public void execute(Event<UIMembersPortlet> event) throws Exception { UIMembersPortlet uiAllPeople = event.getSource(); String userId = event.getRequestContext().getRequestParameter(OBJECTID); Identity inviIdentityIdentity = Utils.getIdentityManager().getIdentity(userId, true); Identity invitingIdentity = Utils.getViewerIdentity(); Relationship relationship = Utils.getRelationshipManager().get(invitingIdentity, inviIdentityIdentity); uiAllPeople.setLoadAtEnd(false); if (relationship != null && relationship.getStatus() == Relationship.Type.CONFIRMED) { Utils.getRelationshipManager().delete(relationship); return; } if (relationship == null) { UIApplication uiApplication = event.getRequestContext().getUIApplication(); uiApplication.addMessage( new ApplicationMessage(INVITATION_REVOKED_INFO, null, ApplicationMessage.INFO)); return; } Utils.clearCacheOnUserPopup(); Utils.getRelationshipManager().deny(inviIdentityIdentity, invitingIdentity); }
public void execute(Event<UIMembersPortlet> event) throws Exception { UIMembersPortlet uiMembersPortlet = event.getSource(); if (uiMembersPortlet.currentLoadIndex < uiMembersPortlet.memberNum) { uiMembersPortlet.increaseOffset(); } else { uiMembersPortlet.setEnableLoadNext(false); } }
@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); }
public void execute(Event<UIMembersPortlet> event) throws Exception { UIMembersPortlet uiAllPeople = event.getSource(); String userId = event.getRequestContext().getRequestParameter(OBJECTID); Identity invitedIdentity = Utils.getIdentityManager().getIdentity(userId, true); Identity invitingIdentity = Utils.getViewerIdentity(); Relationship relationship = Utils.getRelationshipManager().get(invitingIdentity, invitedIdentity); uiAllPeople.setLoadAtEnd(false); if (relationship != null) { UIApplication uiApplication = event.getRequestContext().getUIApplication(); uiApplication.addMessage( new ApplicationMessage(INVITATION_ESTABLISHED_INFO, null, ApplicationMessage.INFO)); return; } Utils.getRelationshipManager().inviteToConnect(invitingIdentity, invitedIdentity); Utils.clearCacheOnUserPopup(); event.getRequestContext().addUIComponentToUpdateByAjax(uiAllPeople); }