Package org.gatein.api

Examples of org.gatein.api.PortalRequest


            return defaultAction;
        }
    }

    public String generateRegisterLink() {
        PortalRequest portalRequest = PortalRequest.getInstance();
        String portalURL = portalRequest.getURIResolver().resolveURI(portalRequest.getSiteId());
        return portalURL + "/" + REGISTER_NODE;
    }
View Full Code Here


        String portalURL = portalRequest.getURIResolver().resolveURI(portalRequest.getSiteId());
        return portalURL + "/" + REGISTER_NODE;
    }

    public String generateHomePageLink() throws Exception {
        PortalRequest portalRequest = PortalRequest.getInstance();
        String portalURL = portalRequest.getURIResolver().resolveURI(portalRequest.getSiteId());
        return portalURL;
    }
View Full Code Here

        String portalURL = portalRequest.getURIResolver().resolveURI(portalRequest.getSiteId());
        return portalURL;
    }

    public String generateDashboardLink() throws Exception {
        PortalRequest portalRequest = PortalRequest.getInstance();
        return portalRequest.getURIResolver().resolveURI(new SiteId(portalRequest.getUser()));
    }
View Full Code Here

    public Map<String, NodeBean> getGroupNodes() throws Exception {

        Map<String, NodeBean> navNodes = new HashMap<String, NodeBean>();

        PortalRequest portalRequest = PortalRequest.getInstance();

        SiteQuery.Builder siteQueryBulder = new SiteQuery.Builder();
        SiteQuery siteQuery = siteQueryBulder.withSiteTypes(SiteType.SPACE).includeEmptySites(false).build();
        List<Site> groupSites = PortalRequest.getInstance().getPortal().findSites(siteQuery);

        for (Site site : groupSites) {
            // check permissions and handle the special 'guest' site
            if (portalRequest.getPortal().hasPermission(portalRequest.getUser(), site.getAccessPermission())
                    && !site.getName().equals("/platform/guests")) {
                Navigation siteNavigation = portalRequest.getPortal().getNavigation(site.getId());
                Node node = siteNavigation.getRootNode(Nodes.visitNodes(this.nodeLevel));
                if (node.isVisible()) {
                    String groupLabel = OrganizationUtils.getGroupLabel(siteNavigation.getSiteId().getName().toString());
                    NodeBean nodeBean = new NodeBean(node, site.getId(), true);
                    navNodes.put(groupLabel, nodeBean);
View Full Code Here

    public URIResolver getURIResolver() {
        return uriResolver;
    }

    static void createInstance(PortalRequestContext context) {
        PortalRequest request = new PortalRequestImpl(context);
        PortalRequest.setInstance(request);
    }
View Full Code Here

     * @throws IOException if the streaming causes an I/O problem
     */
    @Override
    protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {

        PortalRequest portalRequest = PortalRequest.getInstance();

        Navigation navigation = PortalRequest.getInstance().getNavigation();

        // Diving two levels so the information about children count of children nodes is available
        Node rootNode = navigation.getRootNode(Nodes.visitNodes(2)).filter().showDefault();

        // The root navigation bean contains the top-menu elements (Home and Sitemap by default) as its direct children nodes.
        NavigationNodeBean  navigationRootNodeBean = new NavigationNodeBean(rootNode);

        boolean showEmptyCategory = getShowEmptyCategory(request);

        if (!showEmptyCategory) {
            navigationRootNodeBean.setEmptyCategory(isEmptyCategory(rootNode));
        }

        /* Setting the 1st node to be active when accesing the root node "/" */
        boolean isRootNode = portalRequest.getNodePath().equals(NodePath.root());

        List<NavigationNodeBean> rootNodeChildrenList = getChildren(rootNode, isRootNode, showEmptyCategory);

        navigationRootNodeBean.setChildren(rootNodeChildrenList);

View Full Code Here

    public URIResolver getURIResolver() {
        return uriResolver;
    }

    static void createInstance(PortalRequestContext context) {
        PortalRequest request = new PortalRequestImpl(context);
        PortalRequest.setInstance(request);
    }
View Full Code Here

        }
    }

    String resolve(NodeContext<ApiNode> ctx) {
        if (i18nResolver == null) {
            PortalRequest request = PortalRequest.getInstance();
            Site site;
            if (request.getSiteId().equals(siteId)) {
                site = request.getSite();
            } else { // look it up
                site = request.getPortal().getSite(siteId);
            }

            if (site == null) {
                throw new ApiException("Could not resolve display name because site " + siteId + " could not be found.");
            }
View Full Code Here

        // deserialize serialization only fields
        NodePath nodePath = (NodePath) in.readObject();
        ApiNode parent = (ApiNode) in.readObject();
        boolean expanded = in.readBoolean();

        PortalRequest request = PortalRequest.getInstance();
        Portal portal = (request == null) ? null : request.getPortal();
        if (portal != null) {
            navigation = (NavigationImpl) portal.getNavigation(siteId);
            if (navigation == null)
                throw new IOException("Could not retrieve navigation for site " + siteId);
        } else {
View Full Code Here

        // deserialize serialization only fields
        NodePath nodePath = (NodePath) in.readObject();
        ApiNode parent = (ApiNode) in.readObject();
        boolean expanded = in.readBoolean();

        PortalRequest request = PortalRequest.getInstance();
        Portal portal = (request == null) ? null : request.getPortal();
        if (portal != null) {
            navigation = (NavigationImpl) portal.getNavigation(siteId);
            if (navigation == null)
                throw new IOException("Could not retrieve navigation for site " + siteId);
        } else {
View Full Code Here

TOP

Related Classes of org.gatein.api.PortalRequest

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.