fork download
  1. package view.bean;
  2.  
  3. import hrm.model.ldap.MFGroup;
  4. import hrm.model.ldap.MFGroupContext;
  5. import hrm.model.ldap.MFUser;
  6. import hrm.model.ldap.MFUserContext;
  7.  
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. import java.util.Map;
  11. import java.util.SortedSet;
  12. import java.util.TreeSet;
  13.  
  14. import javax.faces.event.ActionEvent;
  15.  
  16. import oracle.adf.share.ADFContext;
  17. import oracle.adf.view.rich.component.rich.data.RichTree;
  18. import oracle.adf.view.rich.component.rich.layout.RichPanelStretchLayout;
  19. import oracle.adf.view.rich.context.AdfFacesContext;
  20. import oracle.adf.view.rich.event.DialogEvent;
  21.  
  22. import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
  23.  
  24. import view.util.JSFUtils;
  25.  
  26.  
  27. public class ProfileTreeBean {
  28. List<Profiles> profileList = new ArrayList<Profiles>();
  29. private Object focusRowKeyValue;
  30. private String profileName;
  31. private Boolean isNewProfile;
  32.  
  33. ChildPropertyTreeModel groups;
  34. private RichTree profileTreeBind;
  35. private RichPanelStretchLayout treePanelStretchBind;
  36. private List<String> pfList = new ArrayList<String>();
  37.  
  38. public ProfileTreeBean() {
  39. super();
  40. createTree();
  41. }
  42.  
  43. public ChildPropertyTreeModel getGroups() {
  44. return groups;
  45. }
  46.  
  47. public void setFocusRowKeyValue(Object focusRowKeyValue) {
  48. this.focusRowKeyValue = focusRowKeyValue;
  49. }
  50.  
  51. public Object getFocusRowKeyValue() {
  52. return focusRowKeyValue;
  53. }
  54.  
  55. public void setProfileTreeBind(RichTree profileTreeBind) {
  56. this.profileTreeBind = profileTreeBind;
  57. }
  58.  
  59. public RichTree getProfileTreeBind() {
  60. return profileTreeBind;
  61. }
  62.  
  63. private void createTree() {
  64. MFGroup mfGroup = new MFGroup();
  65. MFUser mfUser = new MFUser();
  66. List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
  67. List<MFUserContext> uLst = new ArrayList<MFUserContext>();
  68. SortedSet<String> domainSet = new TreeSet<String>();
  69. try {
  70. gLst = mfGroup.searchGroup("");
  71. for (int i = 0; i < gLst.size(); i++) {
  72. if (null != gLst.get(i).getdescription() &&
  73. "Profile".equalsIgnoreCase(gLst.get(i).getdescription())) {
  74. pfList.add(convertCase(gLst.get(i).getcn()));
  75. Profiles profile =
  76. new Profiles(convertCase(gLst.get(i).getcn()),
  77. "profile");
  78. uLst = mfUser.getMembersOfGroup(gLst.get(i).getcn());
  79. for (int j = 0; j < uLst.size(); j++) {
  80.  
  81. }
  82. for (int j = 0; j < uLst.size(); j++) {
  83. Profiles group =
  84. new Profiles(convertCase(uLst.get(j).getcn()),
  85. "role");
  86. profile.addGroups(group);
  87. }
  88. profileList.add(profile);
  89. }
  90. }
  91. groups = new ChildPropertyTreeModel(profileList, "groups");
  92. } catch (Exception e) {
  93. System.out.println(e.getMessage());
  94. }
  95. }
  96.  
  97. private static String convertCase(String s) {
  98. s = s.replaceAll("_", " ");
  99. // StringBuffer stringbf = new StringBuffer();
  100. // String p = "";
  101. // if (null != s) {
  102. // s = s.replaceAll("[^a-zA-Z0-9]", " ");
  103. // Matcher m =
  104. // Pattern.compile("([a-z0-9])([a-z0-9]*)", Pattern.CASE_INSENSITIVE).matcher(s);
  105. // while (m.find()) {
  106. // m.appendReplacement(stringbf,
  107. // m.group(1).toUpperCase() + m.group(2).toLowerCase());
  108. // }
  109. // p = stringbf.toString();
  110. // }
  111. return s;
  112. }
  113.  
  114. public void setProfileName(ActionEvent actionEvent) {
  115. AdfFacesContext.getCurrentInstance().getPageFlowScope().put("isNewProfile",
  116. true);
  117. AdfFacesContext.getCurrentInstance().getPageFlowScope().put("profileName",
  118. null);
  119. }
  120.  
  121. public void profileViewAction(ActionEvent actionEvent) {
  122. AdfFacesContext.getCurrentInstance().getPageFlowScope().put("isNewProfile",
  123. false);
  124. }
  125.  
  126. public void setProfileName(String profileName) {
  127. this.profileName = profileName;
  128. }
  129.  
  130. public String getProfileName() {
  131. return profileName;
  132. }
  133.  
  134. public void setIsNewProfile(Boolean isNewProfile) {
  135. this.isNewProfile = isNewProfile;
  136. }
  137.  
  138. public Boolean getIsNewProfile() {
  139. return isNewProfile;
  140. }
  141.  
  142. public void setTreePanelStretchBind(RichPanelStretchLayout treePanelStretchBind) {
  143. this.treePanelStretchBind = treePanelStretchBind;
  144. ADFContext adfCtx = ADFContext.getCurrent();
  145. Map viewScope = adfCtx.getViewScope();
  146. viewScope.put("treetable", treePanelStretchBind);
  147. }
  148.  
  149. public RichPanelStretchLayout getTreePanelStretchBind() {
  150. return treePanelStretchBind;
  151. }
  152.  
  153. public void deletePopUpdialogListener(DialogEvent dialogEvent) {
  154. System.out.println("deletePopUpdialogListener - " +
  155. dialogEvent.getOutcome());
  156. if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok) {
  157.  
  158. System.out.println("You confirmed to Remove - " +
  159. JSFUtils.resolveExpression("#{node.name}"));
  160.  
  161. } else {
  162. System.out.println("You clicked on Cancel");
  163. }
  164.  
  165. }
  166.  
  167. public void getProfileName(ActionEvent actionEvent) {
  168. // Add event code here...
  169. }
  170.  
  171. public void setPfList(List<String> pfList) {
  172. this.pfList = pfList;
  173. }
  174.  
  175. public List<String> getPfList() {
  176. getProfiles();
  177. return pfList;
  178. }
  179.  
  180. private void getProfiles() {
  181. MFGroup mfGroup = new MFGroup();
  182. List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
  183. try {
  184. gLst = mfGroup.searchGroup("");
  185. for (int i = 0; i < gLst.size(); i++) {
  186. if (null != gLst.get(i).getdescription() &&
  187. "Profile".equalsIgnoreCase(gLst.get(i).getdescription())) {
  188. pfList.add(convertCase(gLst.get(i).getcn()));
  189. }
  190. }
  191.  
  192. } catch (Exception e) {
  193. System.out.println(e.getMessage());
  194. }
  195. }
  196. }
  197.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:27: error: class ProfileTreeBean is public, should be declared in a file named ProfileTreeBean.java
public class ProfileTreeBean {
       ^
Main.java:3: error: package hrm.model.ldap does not exist
import hrm.model.ldap.MFGroup;
                     ^
Main.java:4: error: package hrm.model.ldap does not exist
import hrm.model.ldap.MFGroupContext;
                     ^
Main.java:5: error: package hrm.model.ldap does not exist
import hrm.model.ldap.MFUser;
                     ^
Main.java:6: error: package hrm.model.ldap does not exist
import hrm.model.ldap.MFUserContext;
                     ^
Main.java:14: error: package javax.faces.event does not exist
import javax.faces.event.ActionEvent;
                        ^
Main.java:16: error: package oracle.adf.share does not exist
import oracle.adf.share.ADFContext;
                       ^
Main.java:17: error: package oracle.adf.view.rich.component.rich.data does not exist
import oracle.adf.view.rich.component.rich.data.RichTree;
                                               ^
Main.java:18: error: package oracle.adf.view.rich.component.rich.layout does not exist
import oracle.adf.view.rich.component.rich.layout.RichPanelStretchLayout;
                                                 ^
Main.java:19: error: package oracle.adf.view.rich.context does not exist
import oracle.adf.view.rich.context.AdfFacesContext;
                                   ^
Main.java:20: error: package oracle.adf.view.rich.event does not exist
import oracle.adf.view.rich.event.DialogEvent;
                                 ^
Main.java:22: error: package org.apache.myfaces.trinidad.model does not exist
import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
                                        ^
Main.java:24: error: package view.util does not exist
import view.util.JSFUtils;
                ^
Main.java:28: error: cannot find symbol
    List<Profiles> profileList = new ArrayList<Profiles>();
         ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:33: error: cannot find symbol
    ChildPropertyTreeModel groups;
    ^
  symbol:   class ChildPropertyTreeModel
  location: class ProfileTreeBean
Main.java:34: error: cannot find symbol
    private RichTree profileTreeBind;
            ^
  symbol:   class RichTree
  location: class ProfileTreeBean
Main.java:35: error: cannot find symbol
    private RichPanelStretchLayout treePanelStretchBind;
            ^
  symbol:   class RichPanelStretchLayout
  location: class ProfileTreeBean
Main.java:43: error: cannot find symbol
    public ChildPropertyTreeModel getGroups() {
           ^
  symbol:   class ChildPropertyTreeModel
  location: class ProfileTreeBean
Main.java:55: error: cannot find symbol
    public void setProfileTreeBind(RichTree profileTreeBind) {
                                   ^
  symbol:   class RichTree
  location: class ProfileTreeBean
Main.java:59: error: cannot find symbol
    public RichTree getProfileTreeBind() {
           ^
  symbol:   class RichTree
  location: class ProfileTreeBean
Main.java:114: error: cannot find symbol
    public void setProfileName(ActionEvent actionEvent) {
                               ^
  symbol:   class ActionEvent
  location: class ProfileTreeBean
Main.java:121: error: cannot find symbol
    public void profileViewAction(ActionEvent actionEvent) {
                                  ^
  symbol:   class ActionEvent
  location: class ProfileTreeBean
Main.java:142: error: cannot find symbol
    public void setTreePanelStretchBind(RichPanelStretchLayout treePanelStretchBind) {
                                        ^
  symbol:   class RichPanelStretchLayout
  location: class ProfileTreeBean
Main.java:149: error: cannot find symbol
    public RichPanelStretchLayout getTreePanelStretchBind() {
           ^
  symbol:   class RichPanelStretchLayout
  location: class ProfileTreeBean
Main.java:153: error: cannot find symbol
    public void deletePopUpdialogListener(DialogEvent dialogEvent) {
                                          ^
  symbol:   class DialogEvent
  location: class ProfileTreeBean
Main.java:167: error: cannot find symbol
    public void getProfileName(ActionEvent actionEvent) {
                               ^
  symbol:   class ActionEvent
  location: class ProfileTreeBean
Main.java:28: error: cannot find symbol
    List<Profiles> profileList = new ArrayList<Profiles>();
                                               ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:64: error: cannot find symbol
        MFGroup mfGroup = new MFGroup();
        ^
  symbol:   class MFGroup
  location: class ProfileTreeBean
Main.java:64: error: cannot find symbol
        MFGroup mfGroup = new MFGroup();
                              ^
  symbol:   class MFGroup
  location: class ProfileTreeBean
Main.java:65: error: cannot find symbol
        MFUser mfUser = new MFUser();
        ^
  symbol:   class MFUser
  location: class ProfileTreeBean
Main.java:65: error: cannot find symbol
        MFUser mfUser = new MFUser();
                            ^
  symbol:   class MFUser
  location: class ProfileTreeBean
Main.java:66: error: cannot find symbol
        List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
             ^
  symbol:   class MFGroupContext
  location: class ProfileTreeBean
Main.java:66: error: cannot find symbol
        List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
                                                  ^
  symbol:   class MFGroupContext
  location: class ProfileTreeBean
Main.java:67: error: cannot find symbol
        List<MFUserContext> uLst = new ArrayList<MFUserContext>();
             ^
  symbol:   class MFUserContext
  location: class ProfileTreeBean
Main.java:67: error: cannot find symbol
        List<MFUserContext> uLst = new ArrayList<MFUserContext>();
                                                 ^
  symbol:   class MFUserContext
  location: class ProfileTreeBean
Main.java:75: error: cannot find symbol
                    Profiles profile =
                    ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:76: error: cannot find symbol
                        new Profiles(convertCase(gLst.get(i).getcn()),
                            ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:83: error: cannot find symbol
                        Profiles group =
                        ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:84: error: cannot find symbol
                            new Profiles(convertCase(uLst.get(j).getcn()),
                                ^
  symbol:   class Profiles
  location: class ProfileTreeBean
Main.java:91: error: cannot find symbol
            groups = new ChildPropertyTreeModel(profileList, "groups");
                         ^
  symbol:   class ChildPropertyTreeModel
  location: class ProfileTreeBean
Main.java:115: error: cannot find symbol
        AdfFacesContext.getCurrentInstance().getPageFlowScope().put("isNewProfile",
        ^
  symbol:   variable AdfFacesContext
  location: class ProfileTreeBean
Main.java:117: error: cannot find symbol
        AdfFacesContext.getCurrentInstance().getPageFlowScope().put("profileName",
        ^
  symbol:   variable AdfFacesContext
  location: class ProfileTreeBean
Main.java:122: error: cannot find symbol
        AdfFacesContext.getCurrentInstance().getPageFlowScope().put("isNewProfile",
        ^
  symbol:   variable AdfFacesContext
  location: class ProfileTreeBean
Main.java:144: error: cannot find symbol
        ADFContext adfCtx = ADFContext.getCurrent();
        ^
  symbol:   class ADFContext
  location: class ProfileTreeBean
Main.java:144: error: cannot find symbol
        ADFContext adfCtx = ADFContext.getCurrent();
                            ^
  symbol:   variable ADFContext
  location: class ProfileTreeBean
Main.java:156: error: package DialogEvent does not exist
        if (dialogEvent.getOutcome() == DialogEvent.Outcome.ok) {
                                                   ^
Main.java:159: error: cannot find symbol
                               JSFUtils.resolveExpression("#{node.name}"));
                               ^
  symbol:   variable JSFUtils
  location: class ProfileTreeBean
Main.java:181: error: cannot find symbol
        MFGroup mfGroup = new MFGroup();
        ^
  symbol:   class MFGroup
  location: class ProfileTreeBean
Main.java:181: error: cannot find symbol
        MFGroup mfGroup = new MFGroup();
                              ^
  symbol:   class MFGroup
  location: class ProfileTreeBean
Main.java:182: error: cannot find symbol
        List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
             ^
  symbol:   class MFGroupContext
  location: class ProfileTreeBean
Main.java:182: error: cannot find symbol
        List<MFGroupContext> gLst = new ArrayList<MFGroupContext>();
                                                  ^
  symbol:   class MFGroupContext
  location: class ProfileTreeBean
51 errors
stdout
Standard output is empty