Package org.exoplatform.portal.mop.user

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


            uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);

            PortalRequestContext pcontext = Util.getPortalRequestContext();

            try {
                UserNode newNode = uiWizard.saveData();
                NodeURL nodeURL = pcontext.createURL(NodeURL.TYPE).setNode(newNode);
                UIPortalToolPanel toolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
                toolPanel.setUIComponent(null);
                uiWizard.updateUIPortal(event);
                pcontext.sendRedirect(nodeURL.toString());
View Full Code Here


            UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);

            UIPortal uiPortal = uiWorkingWS.getBackupUIPortal();
            siteBody.setUIComponent(uiPortal);

            UserNode currentNode = uiPortal.getSelectedUserNode();
            SiteKey siteKey = currentNode.getNavigation().getKey();
            PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                    PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
            uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);

            prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
            JavascriptManager jsManager = prContext.getJavascriptManager();
            jsManager.require("SHARED/portal", "portal").addScripts(
View Full Code Here

        // 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);

        node.setRestrictOutsidePublicationWindow(getUICheckBoxInput(RESTRICT_OUTSIDE_PUBLICATION_WINDOW).isChecked());
    }
View Full Code Here

    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

            builder.withReadCheck();

            PageNodeEvent<UIPortalApplication> pageNodeEvent = (PageNodeEvent<UIPortalApplication>) event;
            String nodePath = pageNodeEvent.getTargetNodeUri();

            UserNode targetNode = null;
            SiteKey siteKey = pageNodeEvent.getSiteKey();
            if (siteKey != null) {
                if (pcontext.getRemoteUser() == null
                        && (siteKey.getType().equals(SiteType.GROUP) || siteKey.getType().equals(SiteType.USER))) {
                    NavigationService service = uiPortalApp.getApplicationComponent(NavigationService.class);
                    NavigationContext navContext = service.loadNavigation(siteKey);
                    if (navContext != null) {
                        uiPortalApp.setLastRequestNavData(null);
                        pcontext.requestAuthenticationLogin();
                        return;
                    }
                }

                UserNavigation navigation = userPortal.getNavigation(siteKey);
                if (navigation != null) {
                    targetNode = userPortal.resolvePath(navigation, builder.build(), nodePath);
                    if (targetNode == null) {
                        // If unauthenticated users have no permission on PORTAL node and URL is valid, they will be required to
                        // login
                        if (pcontext.getRemoteUser() == null && siteKey.getType().equals(SiteType.PORTAL)) {
                            targetNode = userPortal.resolvePath(navigation, null, nodePath);
                            if (targetNode != null) {
                                uiPortalApp.setLastRequestNavData(null);
                                pcontext.requestAuthenticationLogin();
                                return;
                            }
                        } else {
                            // If path to node is invalid, get the default node instead of.
                            targetNode = userPortal.getDefaultPath(navigation, builder.build());
                        }
                    }
                }

                if (targetNode != null) {
                    // let's check if this node can be shown at this time
                    long now = System.currentTimeMillis();
                    long startPublicationTime = targetNode.getStartPublicationTime();
                    long endPublicationTime = targetNode.getEndPublicationTime();
                    boolean restrictOutsidePublicationWindow = targetNode.isRestrictOutsidePublicationWindow();

                    if (shouldRestrictAccess(restrictOutsidePublicationWindow, now, startPublicationTime, endPublicationTime)) {
                        if (log.isInfoEnabled()) {
                            log.info("User "
                                    +pcontext.getRemoteUser()
                                    +" has tried to access a node ("
                                    +targetNode.getURI()
                                    +") which is outside of the publishing window and is restricted.");
                        }
                        targetNode = userPortal.getDefaultPath(navigation, builder.build());
                    }
                }
            }

            if (targetNode == null) {
                targetNode = userPortal.getDefaultPath(builder.build());
                if (targetNode == null) {
                    if (showedUIPortal != null) {
                        UIPageBody uiPageBody = showedUIPortal.findFirstComponentOfType(UIPageBody.class);
                        uiPageBody.setUIComponent(null);
                    }
                    return;
                }
            }

            UserNavigation targetNav = targetNode.getNavigation();
            UserNode currentNavPath = null;
            if (showedUIPortal != null) {
                currentNavPath = showedUIPortal.getNavPath();
            }

            if (currentNavPath != null && currentNavPath.getNavigation().getKey().equals(targetNav.getKey())) {
                // Case 1: Both navigation type and id are not changed, but current page node is changed and it is not a first
                // request.
                if (!currentNavPath.getURI().equals(targetNode.getURI())) {
                    showedUIPortal.setNavPath(targetNode);
                }
            } else {
                // Case 2: Either navigation type or id has been changed
                // First, we try to find a cached UIPortal
View Full Code Here

                    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

                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[] { id }, 1));
                return;
            }

            UIPortal uiPortal = Util.getUIPortal();
            UserNode userNode = uiPortal.getSelectedUserNode();
            boolean isDeleteCurrentPage = page.getKey().equals(userNode.getPageRef());

            service.getPageService().destroyPage(page.getKey());
            // Minh Hoang TO: The cached UIPage objects corresponding to removed Page should be removed here.
            // As we have multiple UIPortal, which means multiple caches of UIPage. It 's unwise to garbage
            // all UIPage caches at once. Better solution is to clear UIPage on browsing to PageNode having Page
            // removed

            if (isDeleteCurrentPage) {
                SiteKey siteKey = userNode.getNavigation().getKey();
                PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(
                        Util.getUIPortalApplication(), PageNodeEvent.CHANGE_NODE, siteKey, userNode.getURI());
                uiPortal.broadcast(pnevent, Phase.PROCESS);
            } else {
                boolean dataAvailable = uiPageBrowser.feedDataWithQuery(uiPageBrowser.getLastQuery());
                if (!dataAvailable) {
                    showNoResultMessagePopup();
View Full Code Here

        private void removePageNode(PageContext page, Event<UIPageBrowser> event) throws Exception {
            PortalRequestContext prc = Util.getPortalRequestContext();
            UserPortal userPortal = prc.getUserPortalConfig().getUserPortal();

            UserNavigation userNav = userPortal.getNavigation(SiteKey.user(event.getRequestContext().getRemoteUser()));
            UserNode rootNode = userPortal.getNode(userNav, Scope.CHILDREN, null, null);
            if (rootNode == null) {
                return;
            }

            for (UserNode userNode : rootNode.getChildren()) {
                if (page.getKey().equals(userNode.getPageRef())) {
                    // Remove pageNode
                    rootNode.removeChild(userNode.getName());
                    userPortal.saveNode(rootNode, null);

                    // Update navigation and UserToolbarGroupPortlet

                    String pageRef = page.getKey().format();
View Full Code Here

            uiPortal = (UIPortal) siteBody.getUIComponent();

            // Update the cache of UIPortal from UIPortalApplication
            uiPortalApp.refreshCachedUI();

            UserNode currentNode = uiPortal.getSelectedUserNode();
            SiteKey siteKey = currentNode.getNavigation().getKey();
            PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                    PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
            uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);

            if (!acl.hasPermission(portalConfig) && editPortal.getName().equals(prContext.getPortalOwner())) {
                logout(prContext);
            } else {
View Full Code Here

        }
        uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
        uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
        Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);

        UserNode currentNode = uiPortal.getSelectedUserNode();
        PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                PageNodeEvent.CHANGE_NODE, currentNode.getNavigation().getKey(), currentNode.getURI());
        uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);

        Util.updatePortalMode();
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.user.UserNode

Copyright © 2018 www.massapicom. 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.