Package org.gatein.api

Examples of org.gatein.api.Portal


        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 {
            throw new IOException("Could not retrieve portal API during deserialization.");
        }
View Full Code Here


            this.access = access;
        }

        @Override
        public boolean accept(Node element) {
            Portal portal = PortalRequest.getInstance().getPortal();

            if (element.getPageId() == null) {
                return true;
            }

            Page page = portal.getPage(element.getPageId());
            Permission permission = access ? page.getAccessPermission() : page.getEditPermission();
            return portal.hasPermission(user, permission);
        }
View Full Code Here

        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 {
            throw new IOException("Could not retrieve portal API during deserialization.");
        }
View Full Code Here

    @Override
    protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
        PrintWriter writer = response.getWriter();

        writer.println("<h1>Sites</h1>");
        Portal portal = PortalRequest.getInstance().getPortal();

        List<Site> sites = portal.findSites(new SiteQuery.Builder().withSiteTypes(SiteType.SITE).build());
        for (Site site : sites) {
            outputSite(site, writer);
        }

        writer.println("<h1>Spaces</h1>");
        List<Site> spaces = portal.findSites(new SiteQuery.Builder().withSiteTypes(SiteType.SPACE).build());
        for (Site space : spaces) {
            outputSite(space, writer);
        }

        writer.println("<h1>Dashboard</h1>");
        List<Site> dashboards = portal.findSites(new SiteQuery.Builder().withSiteTypes(SiteType.DASHBOARD).build());
        for (Site dashboard : dashboards) {
            outputSite(dashboard, writer);
        }
    }
View Full Code Here

        }
    }

    public static boolean hasPermission(Permission permission) {
        PortalRequest request = PortalRequest.getInstance();
        Portal portal = request.getPortal();
        User user = request.getUser();

        return portal.hasPermission(user, permission);
    }
View Full Code Here

TOP

Related Classes of org.gatein.api.Portal

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.