Beispiel #1
0
    @Override
    public void execute(Event<UIMembersPortlet> event) throws Exception {
      WebuiRequestContext ctx = event.getRequestContext();
      UIMembersPortlet uiMembersPortlet = event.getSource();

      UIProfileUserSearch uiSearch = uiMembersPortlet.uiSearchMemberOfSpace;

      String charSearch = ctx.getRequestParameter(OBJECTID);

      ResourceBundle resApp = ctx.getApplicationResourceBundle();

      String defaultNameVal = resApp.getString(uiSearch.getId() + ".label.name");
      String defaultPosVal = resApp.getString(uiSearch.getId() + ".label.position");
      String defaultSkillsVal = resApp.getString(uiSearch.getId() + ".label.skills");

      ProfileFilter filter = uiSearch.getProfileFilter();

      try {
        uiMembersPortlet.setSelectedChar(charSearch);
        if (charSearch != null) { // search by alphabet
          ((UIFormStringInput) uiSearch.getChildById(SEARCH)).setValue(defaultNameVal);
          ((UIFormStringInput) uiSearch.getChildById(Profile.POSITION)).setValue(defaultPosVal);
          ((UIFormStringInput) uiSearch.getChildById(Profile.EXPERIENCES_SKILLS))
              .setValue(defaultSkillsVal);
          filter.setName(charSearch);
          filter.setPosition("");
          filter.setSkills("");
          filter.setFirstCharacterOfName(charSearch.toCharArray()[0]);
          if (ALL_FILTER.equals(charSearch)) {
            filter.setFirstCharacterOfName(EMPTY_CHARACTER);
            filter.setName("");
          }
          uiSearch.setRawSearchConditional("");
        }

        uiSearch.setProfileFilter(filter);
        uiSearch.setNewSearch(true);
      } catch (Exception e) {
        uiSearch.setIdentityList(new ArrayList<Identity>());
      }

      uiMembersPortlet.loadSearch();
      uiMembersPortlet.setLoadAtEnd(false);
    }
    @Override
    public void execute(Event<UIInvitations> event) throws Exception {
      UIInvitations uiInvitations = event.getSource();

      WebuiRequestContext ctx = event.getRequestContext();
      UIProfileUserSearch uiSearch = uiInvitations.uiProfileUserSearch;

      String charSearch = ctx.getRequestParameter(OBJECTID);
      ProfileFilter filter = uiInvitations.uiProfileUserSearch.getProfileFilter();

      try {
        uiInvitations.setSelectedChar(charSearch);
        if (charSearch != null) { // search by alphabet
          filter.setName(charSearch);
          filter.setPosition("");
          filter.setSkills("");
          filter.setFirstCharacterOfName(charSearch.toCharArray()[0]);
          if (UIProfileUserSearch.ALL_FILTER.equals(charSearch)) {
            filter.setFirstCharacterOfName(UIProfileUserSearch.EMPTY_CHARACTER);
            filter.setName("");
          }
          uiSearch.setRawSearchConditional("");
        } else if (UIProfileUserSearch.ALL_FILTER.equals(uiSearch.getRawSearchConditional())) {
          uiInvitations.setSelectedChar(UIProfileUserSearch.ALL_FILTER);
        }

        uiSearch.setProfileFilter(filter);
        uiSearch.setNewSearch(true);
        uiInvitations.uiProfileUserSearch.setLoadFromSearch(true);
      } catch (Exception e) {
        uiSearch.setIdentityList(new ArrayList<Identity>());
      }

      uiInvitations.loadSearch();
      uiInvitations.setLoadAtEnd(false);
    }