@SuppressWarnings("unchecked") public List<String> getListGroup() throws Exception { OrganizationService service = getApplicationComponent(OrganizationService.class); List<String> listGroup = new ArrayList<String>(); if (getCurrentGroup() == null) return null; Collection<Object> groups = service.getGroupHandler().findGroups(getCurrentGroup()); if (groups.size() > 0) { for (Object child : groups) { Group childGroup = (Group)child; listGroup.add(childGroup.getId()); } } return listGroup; }
/** * @see org.exoplatform.webui.core.UIComponent#processRender(org.exoplatform.webui.application.WebuiRequestContext) */ @Override public void processRender(WebuiRequestContext context) throws Exception { OrganizationService service = getApplicationComponent(OrganizationService.class); UITree tree = getChild(UITree.class); if (tree != null && tree.getSibbling() == null) { Collection<?> sibblingsGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingsGroup); } Collection<?> collection = service.getMembershipTypeHandler().findMembershipTypes(); listMemberhip = new ArrayList<String>(5); for (Object obj : collection) { listMemberhip.add(((MembershipType)obj).getName()); } if(!listMemberhip.contains("*")) { listMemberhip.add("*"); } super.processRender(context); }
@SuppressWarnings("unchecked") public void onEvent(Event<GroupDAOImpl, Group> event) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug("Remove all Child of Group: " + event.getData().getId()); } GroupHandler membershipHanler = service_.getGroupHandler(); List<Group> children = (List<Group>)membershipHanler.findGroups(event.getData()); for (Group child : children) { membershipHanler.removeGroup(child, true); } } }
public void changeGroup(String groupId) throws Exception { OrganizationService service = getApplicationComponent(OrganizationService.class); UIBreadcumbs uiBreadcumb = getChild(UIBreadcumbs.class); uiBreadcumb.setPath(getPath(null, groupId)); UITree tree = getChild(UITree.class); Collection sibblingGroup; if (groupId == null) { sibblingGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingGroup); tree.setChildren(null); tree.setSelected(null); selectedGroup = null; return; } selectedGroup = service.getGroupHandler().findGroupById(groupId); String parentGroupId = null; if (selectedGroup != null) parentGroupId = selectedGroup.getParentId(); Group parentGroup = null; if (parentGroupId != null) parentGroup = service.getGroupHandler().findGroupById(parentGroupId); Collection childrenGroup = service.getGroupHandler().findGroups(selectedGroup); sibblingGroup = service.getGroupHandler().findGroups(parentGroup); tree.setSibbling((List)sibblingGroup); tree.setChildren((List)childrenGroup); tree.setSelected(selectedGroup); tree.setParentSelected(parentGroup); }
sibblingGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingGroup); tree.setChildren(null); parentGroup = service.getGroupHandler().findGroupById(parentGroupId); Collection childrenGroup = service.getGroupHandler().findGroups(selectGroup_); sibblingGroup = service.getGroupHandler().findGroups(parentGroup);
sibblingGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingGroup); tree.setChildren(null); Collection childrenGroup = service.getGroupHandler().findGroups(selectGroup_); sibblingGroup = service.getGroupHandler().findGroups(parentGroup);
@SuppressWarnings("unchecked") public UIGroupSelector() throws Exception { UIBreadcumbs uiBreadcumbs = addChild(UIBreadcumbs.class, "BreadcumbGroupSelector", "BreadcumbGroupSelector"); UITree tree = addChild(UITree.class, "UITreeGroupSelector", "TreeGroupSelector"); OrganizationService service = getApplicationComponent(OrganizationService.class); Collection<?> sibblingsGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingsGroup); tree.setIcon("GroupAdminIcon"); tree.setSelectedIcon("PortalIcon"); tree.setBeanIdField("id"); //tree.setBeanLabelField("groupName"); tree.setBeanLabelField("label"); tree.setEscapeHTML(true); uiBreadcumbs.setBreadcumbsStyle("UIExplorerHistoryPath"); }
public UIGroupSelector() throws Exception { UIBreadcumbs uiBreadcumbs = addChild(UIBreadcumbs.class, "BreadcumbGroupSelector", "BreadcumbGroupSelector"); UITree tree = addChild(UITree.class, "UITreeGroupSelector", "TreeGroupSelector"); OrganizationService service = getApplicationComponent(OrganizationService.class); Collection sibblingsGroup = service.getGroupHandler().findGroups(null); tree.setSibbling((List)sibblingsGroup); tree.setIcon("GroupAdminIcon"); tree.setSelectedIcon("PortalIcon"); tree.setBeanIdField("id"); //tree.setBeanLabelField("groupName"); tree.setBeanLabelField("label"); tree.setEscapeHTML(true); uiBreadcumbs.setBreadcumbsStyle("UIExplorerHistoryPath"); }
@Override public void processUpgrade(String oldVersion, String newVersion) { RequestLifeCycle.begin(PortalContainer.getInstance()); try { GroupHandler groupHandler = service.getGroupHandler(); Group spacesParentGroup = service.getGroupHandler().findGroupById("/spaces"); @SuppressWarnings("unchecked") Collection<Group> spacesGroupsList = groupHandler.findGroups(spacesParentGroup); SessionProvider sessionProvider = SessionProvider.createSystemProvider(); if (spacesGroupsList == null || spacesGroupsList.isEmpty()) { LOG.info("No space was found, no upgrade operation will be done."); return; } for (Group group : spacesGroupsList) { LOG.info("Proceed Upgrade '" + group.getId() + "' Space."); Space space = spaceStorage.getSpaceByGroupId(group.getId()); if (space == null) { LOG.warn("Cannot find space for group: " + group.getId()); continue; } LOG.info("Proceed space migration: " + group.getId()); editSpaceHomePage(space.getPrettyName(), group.getId()); } } catch (Exception e) { LOG.error("Error during spaces migration : " + e.getMessage(), e); } finally { RequestLifeCycle.end(); } }