Package org.gatein.api.site

Examples of org.gatein.api.site.SiteImpl


            throw new EntityAlreadyExistsException("Cannot create site. Site " + siteId + " already exists.");
        }
        Parameters.requireNonNull(templateName, "templateName");

        // Create new site
        return new SiteImpl(siteId, templateName);
    }
View Full Code Here


    private static List<Site> fromList(List<PortalConfig> internalSites) {
        List<Site> sites = new ArrayList<Site>(internalSites.size());
        for (PortalConfig internalSite : internalSites) {
            if (internalSite == null) continue;

            sites.add(new SiteImpl(internalSite));
        }
        return sites;
    }
View Full Code Here

        Parameters.requireNonNull(siteId, "siteId");
        SiteKey siteKey = Util.from(siteId);

        try {
            PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            return (portalConfig == null) ? null : new SiteImpl(portalConfig);
        } catch (Throwable e) {
            throw new ApiException("Failed to get site", e);
        }
    }
View Full Code Here

        Parameters.requireNonNull(siteId, "siteId");
        SiteKey siteKey = Util.from(siteId);

        try {
            PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            return (portalConfig == null) ? null : new SiteImpl(portalConfig);
        } catch (Throwable e) {
            throw new ApiException("Failed to get site", e);
        }
    }
View Full Code Here

            throw new EntityAlreadyExistsException("Cannot create site. Site " + siteId + " already exists.");
        }
        Parameters.requireNonNull(templateName, "templateName");

        // Create new site
        return new SiteImpl(siteId, templateName);
    }
View Full Code Here

                    throw new ApiException("Failed to find sites", t);
                }
            }

            if (includeAllSites || ctx != null) {
                sites.add(new SiteImpl(internalSite));
            }
        }
        return sites;
    }
View Full Code Here

        Parameters.requireNonNull(siteId, "siteId");
        SiteKey siteKey = Util.from(siteId);

        try {
            PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            return (portalConfig == null) ? null : new SiteImpl(portalConfig);
        } catch (Throwable e) {
            throw new ApiException("Failed to get site", e);
        }
    }
View Full Code Here

            throw new EntityAlreadyExistsException("Cannot create site. Site " + siteId + " already exists.");
        }
        Parameters.requireNonNull(templateName, "templateName");

        // Create new site
        return new SiteImpl(siteId, templateName);
    }
View Full Code Here

    private static List<Site> fromList(List<PortalConfig> internalSites) {
        List<Site> sites = new ArrayList<Site>(internalSites.size());
        for (PortalConfig internalSite : internalSites) {
            if (internalSite == null) continue;

            sites.add(new SiteImpl(internalSite));
        }
        return sites;
    }
View Full Code Here

            return null;
        } else if (sorting.getComparator() == null) {
            return new Comparator<PortalConfig>() {
                @Override
                public int compare(PortalConfig o1, PortalConfig o2) {
                    Site site = new SiteImpl(o1);
                    Site other = new SiteImpl(o2);
                    if (sorting.getOrder() == Sorting.Order.descending) {
                        Site tmp = site;
                        site = other;
                        other = tmp;
                    }

                    return site.compareTo(other);
                }
            };
        } else {
            return new ComparatorWrapper<Site, PortalConfig>(sorting.getComparator()) {

                @Override
                protected Site from(PortalConfig entity) {
                    return new SiteImpl(entity);
                }
            };
        }
    }
View Full Code Here

TOP

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

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.