Package org.gatein.api.site

Examples of org.gatein.api.site.SiteId


        Iterator<PageContext> iterator;
        if (pagination == null) {
            if (query.getSiteType() == null || query.getSiteName() == null)
                throw new IllegalArgumentException("Pagination is required when site type or site name is null.");

            SiteKey siteKey = Util.from(new SiteId(query.getSiteType(), query.getSiteName()));
            if (pageService instanceof PageServiceImpl) {
                iterator = ((PageServiceImpl) pageService).loadPages(siteKey).iterator();
            } else if (pageService instanceof PageServiceWrapper) {
                iterator = ((PageServiceWrapper) pageService).loadPages(siteKey).iterator();
            } else {
View Full Code Here


        if (siteKey == null)
            return null;

        switch (siteKey.getType()) {
            case PORTAL:
                return new SiteId(siteKey.getName());
            case GROUP:
                return new SiteId(new Group(siteKey.getName()));
            case USER:
                return new SiteId(new User(siteKey.getName()));
            default:
                throw new AssertionError();
        }
    }
View Full Code Here

        }
    }

    public boolean checkSiteExists(String name) {
        if (name != null) {
            Navigation nav = PortalRequest.getInstance().getPortal().getNavigation(new SiteId(name));
            return nav != null;
        }

        return false;
    }
View Full Code Here

    // TODO: move this to a different bean
    public List<String> loadOriginNodes(String siteName) {
        try {
            ArrayList<String> nodes = new ArrayList<String>();
            if (siteName != null) {
                Node n = PortalRequest.getInstance().getPortal().getNavigation(new SiteId(siteName))
                        .getRootNode(Nodes.visitAll());
                for (Node node : Nodes.asList(n)) {
                    nodes.add(node.getNodePath().toString());
                }
            }
View Full Code Here

    public List<String> loadRedirectNodes() {
        try {
            ArrayList<String> nodes = new ArrayList<String>();
            if (this.pr.getRedirectSite() != null) {
                Navigation nav = PortalRequest.getInstance().getPortal().getNavigation(new SiteId(this.pr.getRedirectSite()));
                if (nav != null) {
                    Node n = nav.getRootNode(Nodes.visitAll());
                    for (Node node : Nodes.asList(n)) {
                        nodes.add(node.getNodePath().toString());
                    }
View Full Code Here

        return _getSites(SITE_QUERY, address, emptySites, offset, limit);
    }

    @Managed("/sites/{site-name}")
    public ModelObject getSite(@MappedPath("site-name") String siteName, @ManagedContext OperationContext context) {
        SiteId id = new SiteId(siteName);
        return _getSite(id, context);
    }
View Full Code Here

    @Managed("/sites/{site-name}")
    @ManagedRole("administrators")
    @ManagedOperation(name = OperationNames.ADD_RESOURCE, description = "Adds a given site")
    public ModelObject addSite(@MappedPath("site-name") String siteName, @MappedAttribute("template") String template, @ManagedContext PathAddress address) {
        SiteId siteId = new SiteId(siteName);
        return _addSite(address, siteId, template);
    }
View Full Code Here

    @Managed("/sites/{site-name}")
    @ManagedRole("administrators")
    @ManagedOperation(name = OperationNames.REMOVE_RESOURCE, description = "Removes the given site")
    public void removeSite(@MappedPath("site-name") String siteName, @ManagedContext OperationContext context) {
        SiteId id = new SiteId(siteName);
        _removeSite(id, context);
    }
View Full Code Here

    @Managed("/sites/{site-name}")
    @ManagedRole("administrators")
    @ManagedOperation(name = OperationNames.UPDATE_RESOURCE, description = "Updates a given site")
    public ModelObject updateSite(@MappedPath("site-name") String siteName, @ManagedContext ModelObject siteModel, @ManagedContext OperationContext context) {
        SiteId id = new SiteId(siteName);
        return _updateSite(id, siteModel, context);
    }
View Full Code Here

        return _updateSite(id, siteModel, context);
    }

    @Managed("/sites/{site-name}/pages")
    public PageManagementResource getPages(@MappedPath("site-name") String siteName, @ManagedContext OperationContext context) {
        SiteId id = new SiteId(siteName);
        return pagesResource(id, context);
    }
View Full Code Here

TOP

Related Classes of org.gatein.api.site.SiteId

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.