Package org.exoplatform.portal.mop

Examples of org.exoplatform.portal.mop.Described$State


    final List<String> accessPermissions;

    public PageState(Page page) {

        Attributes attrs = page.getAttributes();
        Described described = page.adapt(Described.class);

        //
        List<String> accessPermissions = Collections.emptyList();
        String editPermission = null;
        if (page.isAdapted(ProtectedResource.class)) {
            ProtectedResource pr = page.adapt(ProtectedResource.class);
            accessPermissions = pr.getAccessPermissions();
            editPermission = pr.getEditPermission();
        }

        //
        this.factoryId = attrs.getValue(MappedAttributes.FACTORY_ID);
        this.displayName = described.getName();
        this.description = described.getDescription();
        this.accessPermissions = Utils.safeImmutableList(accessPermissions);
        this.editPermission = editPermission;
        this.showMaxWindow = attrs.getValue(MappedAttributes.SHOW_MAX_WINDOW, false);
    }
View Full Code Here


    final List<String> moveContainersPermissions;

    public PageState(Page page) {

        Attributes attrs = page.getAttributes();
        Described described = page.adapt(Described.class);

        //
        List<String> accessPermissions = Collections.emptyList();
        String editPermission = null;
        if (page.isAdapted(ProtectedResource.class)) {
            ProtectedResource pr = page.adapt(ProtectedResource.class);
            accessPermissions = pr.getAccessPermissions();
            editPermission = pr.getEditPermission();
        }

        //
        this.factoryId = attrs.getValue(MappedAttributes.FACTORY_ID);
        this.displayName = described.getName();
        this.description = described.getDescription();
        this.accessPermissions = Utils.safeImmutableList(accessPermissions);
        this.editPermission = editPermission;
        this.showMaxWindow = attrs.getValue(MappedAttributes.SHOW_MAX_WINDOW, false);

        if (page.isAdapted(ProtectedContainer.class)) {
View Full Code Here

            throw new NullPointerException("No null locale accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getI18NMixin(Described.class, locale, false);
        return desc != null ? desc.getState() : null;
    }
View Full Code Here

            throw new NullPointerException("No null locale accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getI18NMixin(Described.class, locale, true);
        cache.removeState(new CacheKey(locale, id));
        desc.setState(description);
    }
View Full Code Here

            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Described desc = able.getMixin(Described.class, false);
        return desc != null ? desc.getState() : null;
    }
View Full Code Here

        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        if (description != null) {
            Described desc = able.getMixin(Described.class, true);
            desc.setState(description);
        } else {
            able.removeMixin(Described.class);
        }
    }
View Full Code Here

        }

        // Interface specifies it allows a null description map
        if (descriptions != null) {
            for (Map.Entry<Locale, Described.State> entry : descriptions.entrySet()) {
                Described described = able.addI18NMixin(Described.class, entry.getKey());
                described.setState(entry.getValue());
            }
        }
    }
View Full Code Here

        if (src.isAdapted(Redirectable.class)) {
            Redirectable redirectAble = src.adapt(Redirectable.class);
            redirects = loadRedirects(src, redirectAble.getRedirects());
        }

        Described described = src.adapt(Described.class);

        //
        return new PortalData(src.getObjectId(), src.getName(), type, attrs.getValue(MappedAttributes.LOCALE),
                described.getName(), described.getDescription(), accessPermissions, editPermission,
                Collections.unmodifiableMap(properties), attrs.getValue(MappedAttributes.SKIN), layout, redirects);
    }
View Full Code Here

            ProtectedResource pr = dst.adapt(ProtectedResource.class);
            pr.setAccessPermissions(src.getAccessPermissions());
            pr.setEditPermission(src.getEditPermission());

            Described described = dst.adapt(Described.class);
            described.setName(src.getLabel());
            described.setDescription(src.getDescription());

            Redirectable redirectable = dst.adapt(Redirectable.class);
            Map<String, Redirect> redirects = redirectable.getRedirects();

            List<RedirectData> redirectsData = src.getRedirects();
View Full Code Here

            moveAppsPermissions = ProtectedContainer.DEFAULT_MOVE_APPLICATIONS_PERMISSIONS;
            moveContainersPermissions = ProtectedContainer.DEFAULT_MOVE_CONTAINERS_PERMISSIONS;
        }

        //
        Described described = src.adapt(Described.class);

        Attributes attrs = src.getAttributes();
        return new ContainerData(src.getObjectId(), attrs.getValue(MappedAttributes.ID), attrs.getValue(MappedAttributes.NAME),
                attrs.getValue(MappedAttributes.ICON), attrs.getValue(MappedAttributes.TEMPLATE),
                attrs.getValue(MappedAttributes.FACTORY_ID), described.getName(), described.getDescription(),
                attrs.getValue(MappedAttributes.WIDTH), attrs.getValue(MappedAttributes.HEIGHT),
                Utils.safeImmutableList(accessPermissions), Utils.safeImmutableList(moveAppsPermissions),
                Utils.safeImmutableList(moveContainersPermissions), children);
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.Described$State

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.