Package org.exoplatform.portal.config.model

Examples of org.exoplatform.portal.config.model.PortalConfig


     * @param ownerType the owner type
     * @param ownerId the portal name
     * @throws Exception any exception
     */
    public void removeUserPortalConfig(String ownerType, String ownerId) throws Exception {
        PortalConfig config = storage_.getPortalConfig(ownerType, ownerId);
        if (config != null) {
            storage_.remove(config);
        }
    }
View Full Code Here


            default:
                throw new AssertionError();
        }
        for (Iterator<String> i = list.iterator(); i.hasNext();) {
            String name = i.next();
            PortalConfig config = storage_.getPortalConfig(siteType.getName(), name);
            if (config == null || !userACL_.hasPermission(config)) {
                i.remove();
            }
        }
        return list;
View Full Code Here

    public boolean createPortalConfig(NewPortalConfig config, String owner) throws Exception {
        String type = config.getOwnerType();
        UnmarshalledObject<PortalConfig> obj = getConfig(config, owner, type, PortalConfig.class);

        PortalConfig pConfig;
        if (obj == null) {
            String fixedName = fixOwnerName(type, owner);
            if (dataStorage_.getPortalConfig(type, fixedName) != null) {
                return true;
            } else {
                pConfig = new PortalConfig(type, fixedName);
            }
        } else {
            pConfig = obj.getObject();
        }
View Full Code Here

        //
        ImportMode importMode = getRightMode(config.getImportMode());

        //
        Locale locale;
        PortalConfig portalConfig = dataStorage_.getPortalConfig(config.getOwnerType(), owner);
        if (portalConfig != null && portalConfig.getLocale() != null) {
            locale = new Locale(portalConfig.getLocale());
        } else {
            locale = Locale.ENGLISH;
        }

        //
View Full Code Here

            PageNavigation nav = (PageNavigation) o;
            nav.setOwnerType(ownerType);
            nav.setOwnerId(owner);
            fixOwnerName((PageNavigation) o);
        } else if (o instanceof PortalConfig) {
            PortalConfig portalConfig = (PortalConfig) o;
            portalConfig.setType(ownerType);
            portalConfig.setName(owner);
            fixOwnerName(portalConfig);
        } else if (o instanceof PageSet) {
            for (Page page : ((PageSet) o).getPages()) {
                page.setOwnerType(ownerType);
                page.setOwnerId(owner);
View Full Code Here

        } else if (type == PortalConfig.class) {
            Bilto<PortalConfig, PortalData> bilto = new Bilto<PortalConfig, PortalData>((Query<PortalConfig>) q,
                    PortalData.class, (Comparator<PortalConfig>) sortComparator) {
                @Override
                protected PortalConfig create(PortalData portalData) {
                    return new PortalConfig(portalData);
                }
            };
            return (ListAccess<T>) bilto.execute();
        } else {
            throw new UnsupportedOperationException("Cannot query type " + type);
View Full Code Here

    }

    public PortalConfig getPortalConfig(String ownerType, String portalName) throws Exception {
        PortalKey key = new PortalKey(ownerType, portalName);
        PortalData data = delegate.getPortalConfig(key);
        return data != null ? new PortalConfig(data) : null;
    }
View Full Code Here

                if (SiteLayoutExportTask.FILES.contains(file)) {
                    // Unmarshal site layout data
                    Marshaller<PortalConfig> marshaller = operationContext.getBindingProvider().getMarshaller(
                            PortalConfig.class, ContentType.XML);
                    PortalConfig portalConfig = marshaller.unmarshal(zis);
                    portalConfig.setType(siteKey.getTypeName());
                    if (!portalConfig.getName().equals(siteKey.getName())) {
                        throw new OperationException(operationName,
                                "Name of site does not match that of the zip entry site name.");
                    }

                    // Add import task to run later
View Full Code Here

        this.dataStorage = dataStorage;
    }

    @Override
    public void importData(ImportMode importMode) throws Exception {
        PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
        if (portalConfig == null)
            throw new Exception("Cannot import navigation because site does not exist for " + siteKey);

        Locale locale = (portalConfig.getLocale() == null) ? Locale.ENGLISH : new Locale(portalConfig.getLocale());

        final NavigationContext navContext = navigationService.loadNavigation(siteKey);
        if (navContext == null) {
            rollbackTask = new RollbackTask() {
                @Override
View Full Code Here

            throws ResourceNotFoundException, OperationException {
        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        SiteKey siteKey = getSiteKey(site);

        try {
            PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            resultHandler.completed(portalConfig);
        } catch (Exception e) {
            throw new OperationException(operationContext.getOperationName(),
                    "Could not retrieve site layout for site " + site, e);
        }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.model.PortalConfig

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.