Package org.exoplatform.portal.webui.navigation

Examples of org.exoplatform.portal.webui.navigation.UIPortalNavigation


      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletRequest prequest = context.getRequest();
      PortletPreferences prefers = prequest.getPreferences();
      String template = prefers.getValue("template", "app:/groovy/portal/webui/component/UIPortalNavigation.gtmpl");

      UIPortalNavigation portalNavigation = addChild(UIPortalNavigation.class, "UIHorizontalNavigation", null);
      portalNavigation.setUseAjax(Boolean.valueOf(prefers.getValue("useAJAX", "true")));
      portalNavigation.setShowUserNavigation(Boolean.valueOf(prefers.getValue("showUserNavigation", "true")));
      portalNavigation.setTemplate(template);

      portalNavigation.setCssClassName(prefers.getValue("CSSClassName", ""));
   }
View Full Code Here


      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletRequest prequest = context.getRequest();
      PortletPreferences prefers = prequest.getPreferences();
      String template = prefers.getValue("template", "system:/groovy/webui/core/UISitemapTree.gtmpl");

      UIPortalNavigation uiPortalNavigation = addChild(UIPortalNavigation.class, "UISiteMap", null);
      uiPortalNavigation.loadTreeNodes();
      uiPortalNavigation.setTemplate(template);
   }
View Full Code Here

        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        String template = prefers.getValue("template", "app:/groovy/portal/webui/component/UIPortalNavigation.gtmpl");

        UIPortalNavigation portalNavigation = addChild(UIPortalNavigation.class, "UIHorizontalNavigation", null);
        portalNavigation.setUseAjax(isUseAjax());
        portalNavigation.setShowUserNavigation(Boolean.valueOf(prefers.getValue("showUserNavigation", "true")));
        portalNavigation.setTemplate(template);

        portalNavigation.setCssClassName(prefers.getValue("CSSClassName", ""));

        int level = DEFAULT_LEVEL;
        try {
            level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
        } catch (Exception ex) {
            log.warn("Preference for navigation level can only be integer");
        }

        if (level <= 0) {
            portalNavigation.setScope(Scope.ALL);
        } else {
            portalNavigation.setScope(GenericScope.treeShape(level));
        }
    }
View Full Code Here

        res.getWriter().write(jsChilds.toString());
    }

    public JSONArray getChildrenAsJSON(String nodeURI) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        UIPortalNavigation uiPortalNavigation = getChild(UIPortalNavigation.class);

        Collection<UserNode> childs = null;
        UserNode userNode = uiPortalNavigation.resolvePath(nodeURI);
        if (userNode != null) {
            childs = userNode.getChildren();
        }

        JSONArray jsChilds = new JSONArray();
View Full Code Here

        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        String template = prefers.getValue("template", "system:/groovy/webui/core/UISitemapTree.gtmpl");

        UIPortalNavigation uiPortalNavigation = addChild(UIPortalNavigation.class, "UISiteMap", null);
        uiPortalNavigation.setTemplate(template);
        uiPortalNavigation.setUseAjax(isUseAjax());

        int level = DEFAULT_LEVEL;
        try {
            level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
        } catch (Exception ex) {
            log.warn("Preference for navigation level can only be integer");
        }

        if (level <= 0) {
            uiPortalNavigation.setScope(Scope.ALL);
        } else {
            uiPortalNavigation.setScope(GenericScope.treeShape(level));
        }
    }
View Full Code Here

    private JSONArray getChildrenAsJSON(String nodeID) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        List<TreeNode> childs = null;

        UIPortalNavigation uiPortalNavigation = getChild(UIPortalNavigation.class);
        TreeNode tnode = uiPortalNavigation.getTreeNodes().findNodes(nodeID);
        if (tnode != null) {
            UserNode userNode = uiPortalNavigation.updateNode(tnode.getNode());
            if (userNode != null) {
                tnode.setExpanded(true);
                tnode.setChildren(userNode.getChildren());
                childs = tnode.getChildren();
            }
View Full Code Here

        }
        return jsChilds;
    }

    private JSONObject toJSON(TreeNode tnode, MimeResponse res) throws Exception {
        UIPortalNavigation uiPortalNavigation = getChild(UIPortalNavigation.class);
        JSONObject json = new JSONObject();
        UserNode node = tnode.getNode();
        String nodeId = node.getId();

        json.put("label", node.getEncodedResolvedLabel());
        json.put("hasChild", tnode.hasChild());
        json.put("isExpanded", tnode.isExpanded());
        json.put("collapseURL", uiPortalNavigation.url("CollapseNode", nodeId));

        ResourceURL rsURL = res.createResourceURL();
        rsURL.setResourceID(nodeId);
        json.put("getNodeURL", rsURL.toString());
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.webui.navigation.UIPortalNavigation

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.