Examples of OrganizationService


Examples of org.exoplatform.services.organization.OrganizationService

    private static String cachedGroupLabel;

    public static String getGroupLabel(String groupId) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService orgService = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
        Group group = orgService.getGroupHandler().findGroupById(groupId);
        if (group == null) {
            return cachedGroupLabel;
        }
        String label = group.getLabel();
        cachedGroupLabel = (label != null && label.trim().length() > 0) ? label : group.getGroupName();
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    }

    public static String getGroupDescription(String groupId) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        ExoContainer container = context.getApplication().getApplicationServiceContainer();
        OrganizationService orgService = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
        String description = "";
        Group group = orgService.getGroupHandler().findGroupById(groupId);
        if (group != null) {
            description = group.getDescription();
        }
        return description;
    }
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    private Group selectedGroup;

    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");
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    public void setSelectedGroup(Group group) {
        selectedGroup = group;
    }

    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);
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    private List<LocalPath> getPath(List<LocalPath> list, String id) throws Exception {
        if (list == null)
            list = new ArrayList<LocalPath>(5);
        if (id == null)
            return list;
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        Group group = service.getGroupHandler().findGroupById(id);
        if (group == null)
            return list;
        list.add(0, new LocalPath(group.getId(), group.getGroupName()));
        getPath(list, group.getParentId());
        return list;
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    @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");
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

        return selectGroup_;
    }

    @SuppressWarnings("unchecked")
    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);
            selectGroup_ = null;
            return;
        }

        selectGroup_ = service.getGroupHandler().findGroupById(groupId);
        String parentGroupId = null;
        if (selectGroup_ != null)
            parentGroupId = selectGroup_.getParentId();
        Group parentGroup = null;
        if (parentGroupId != null)
            parentGroup = service.getGroupHandler().findGroupById(parentGroupId);

        Collection childrenGroup = service.getGroupHandler().findGroups(selectGroup_);
        sibblingGroup = service.getGroupHandler().findGroups(parentGroup);

        tree.setSibbling((List) sibblingGroup);
        tree.setChildren((List) childrenGroup);
        tree.setSelected(selectGroup_);
        tree.setParentSelected(parentGroup);
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    private List<LocalPath> getPath(List<LocalPath> list, String id) throws Exception {
        if (list == null)
            list = new ArrayList<LocalPath>(5);
        if (id == null)
            return list;
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        Group group = service.getGroupHandler().findGroupById(id);
        if (group == null)
            return list;
        list.add(0, new LocalPath(group.getId(), group.getGroupName()));
        getPath(list, group.getParentId());
        return list;
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

        return list;
    }

    @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());
            }
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

    public UIUserSelector() throws Exception {
        addUIFormInput(new UIFormStringInput(FIELD_KEYWORD, FIELD_KEYWORD, null));
        addUIFormInput(new UIFormSelectBox(FIELD_FILTER, FIELD_FILTER, getFilters()));
        addUIFormInput(new UIFormStringInput(FIELD_GROUP, FIELD_GROUP, null));
        isShowSearch_ = true;
        OrganizationService service = getApplicationComponent(OrganizationService.class);
        ObjectPageList objPageList = new ObjectPageList(service.getUserHandler().findUsers(new Query()).getAll(), 10);
        uiIterator_ = new UIPageIterator();
        uiIterator_.setPageList(objPageList);
        uiIterator_.setId("UISelectUserPage");

        // create group selector
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.