Examples of UserNode


Examples of org.exoplatform.portal.mop.user.UserNode

                    userPortalContext);
            if (cfg != null) {
                UserPortal userPortal = cfg.getUserPortal();
                UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder().withAuthMode(
                        UserNodeFilterConfig.AUTH_READ);
                UserNode userNode = userPortal.resolvePath(builder.build(), requestPath);

                if (userNode != null) {
                    siteKey = userNode.getNavigation().getKey();
                    uri = userNode.getURI();
                }
            }
        }

        //
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

    public List<UserNode> getNavigations() throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        List<UserNode> nodes = new ArrayList<UserNode>();
        if (context.getRemoteUser() != null) {
            UserNode currRootNode = getCurrentNavigation();
            if (currRootNode != null) {
                nodes.add(currRootNode);
            }
        } else {
            UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
            List<UserNavigation> navigations = userPortal.getNavigations();
            for (UserNavigation userNav : navigations) {
                if (!showUserNavigation && userNav.getKey().getType().equals(SiteType.USER)) {
                    continue;
                }

                UserNode rootNode = userPortal.getNode(userNav, navigationScope, NAVIGATION_FILTER_CONFIG, null);
                if (rootNode != null) {
                    nodes.add(rootNode);
                }
            }
        }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

        for (UserNavigation nav : rearrangeNavigations(listNavigations)) {
            if (!showUserNavigation && nav.getKey().getType().equals(SiteType.USER)) {
                continue;
            }
            try {
                UserNode rootNode = userPortal.getNode(nav, navigationScope, NAVIGATION_FILTER_CONFIG, null);
                if (rootNode != null) {
                    childNodes.addAll(rootNode.getChildren());
                }
            } catch (Exception ex) {
                log.error(ex.getMessage(), ex);
            }
        }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

    public UserNode resolvePath(String path) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();

        UserNode node;
        if (context.getRemoteUser() != null) {
            node = userPortal.resolvePath(Util.getUIPortal().getUserNavigation(), NAVIGATION_FILTER_CONFIG, path);
        } else {
            node = userPortal.resolvePath(NAVIGATION_FILTER_CONFIG, path);
        }

        if (node != null && !node.getURI().equals(path)) {
            // Node has been deleted
            return null;
        }
        return updateNode(node);
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        NodeChangeQueue<UserNode> queue = new NodeChangeQueue<UserNode>();
        userPortal.updateNode(node, navigationScope, queue);
        for (NodeChange<UserNode> change : queue) {
            if (change instanceof NodeChange.Removed) {
                UserNode deletedNode = ((NodeChange.Removed<UserNode>) change).getTarget();
                if (hasRelationship(deletedNode, node)) {
                    // Node has been deleted
                    return null;
                }
            }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

    private UserNode getCurrentNavigation() throws Exception {
        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        UserNavigation userNavigation = Util.getUIPortal().getUserNavigation();
        try {
            UserNode rootNode = userPortal.getNode(userNavigation, navigationScope, NAVIGATION_FILTER_CONFIG, null);
            return rootNode;
        } catch (Exception ex) {
            log.error("Navigation has been deleted");
        }
        return null;
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

        // this help to ignore name textbox
        nameTextBox.setReadOnly(true);
        super.invokeSetBindingBean(bean);
        nameTextBox.setReadOnly(false);

        UserNode node = (UserNode) bean;

        if (getUICheckBoxInput(SWITCH_MODE).isChecked()) {
            node.setLabel(null);
        } else if (node.getLabel() == null || node.getLabel().trim().length() == 0) {
            node.setLabel(node.getName());
        }

        Visibility visibility;
        if (getUICheckBoxInput(VISIBLE).isChecked()) {
            UICheckBoxInput showPubDate = getUICheckBoxInput(SHOW_PUBLICATION_DATE);
            visibility = showPubDate.isChecked() ? Visibility.TEMPORAL : Visibility.DISPLAYED;
        } else {
            visibility = Visibility.HIDDEN;
        }
        node.setVisibility(visibility);

        Calendar cal = getUIFormDateTimeInput(START_PUBLICATION_DATE).getCalendar();
        long time = (cal != null) ? cal.getTimeInMillis() : -1;
        node.setStartPublicationTime(time);
        cal = getUIFormDateTimeInput(END_PUBLICATION_DATE).getCalendar();
        time = (cal != null) ? cal.getTimeInMillis() : -1;
        node.setEndPublicationTime(time);
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

    public UserNode createUserNode(UserNode parent) throws Exception {
        UIFormStringInput nameTextBox = getUIStringInput(PAGE_NAME);
        String nodeName = nameTextBox.getValue();

        UserNode child = parent.addChild(nodeName);
        invokeSetBindingBean(child);
        return child;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

        UIPagePreview uiPagePreview = getChild(UIPagePreview.class);
        UIPage uiPage = (UIPage) uiPagePreview.getUIComponent();

        UIWizardPageSetInfo uiPageInfo = getChild(UIWizardPageSetInfo.class);
        UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
        UserNode selectedNode = uiNodeSelector.getSelectedNode();

        Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
        UserNode createdNode = uiPageInfo.createUserNode(selectedNode);

        createdNode.setPageRef(page.getPageKey());

        //
        PageService pageService = getApplicationComponent(PageService.class);
        PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions()) : null,
                page.getEditPermission());
        pageService.savePage(new PageContext(page.getPageKey(), pageState));

        //
        DataStorage dataService = getApplicationComponent(DataStorage.class);
        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
        Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
        Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();

        for (String strLocale : cachedLabels.keySet()) {
            Locale locale;
            if (strLocale.contains("_")) {
                String[] arr = strLocale.split("_");
                if (arr.length > 2) {
                    locale = new Locale(arr[0], arr[1], arr[2]);
                } else {
                    locale = new Locale(arr[0], arr[1]);
                }
            } else {
                locale = new Locale(strLocale);
            }

            descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
        }

        descriptionService.setDescriptions(createdNode.getId(), descriptions);
        return createdNode;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.user.UserNode

     * @throws Exception
     */
    private boolean isSelectedNodeExist() {
        UIWizardPageSetInfo uiPageSetInfo = getChild(UIWizardPageSetInfo.class);
        String pageName = uiPageSetInfo.getUIStringInput(UIWizardPageSetInfo.PAGE_NAME).getValue();
        UserNode selectedPageNode = uiPageSetInfo.getSelectedPageNode();
        if (selectedPageNode.getChild(pageName) != null) {
            return true;
        }
        return false;
    }
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.