Package org.exoplatform.portal.pom.config

Examples of org.exoplatform.portal.pom.config.POMSession


            throw new NullPointerException("No null id accepted");
        }
        if (locale == null) {
            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 id accepted");
        }
        if (locale == null) {
            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

    public Described.State getDescription(String id) {
        if (id == null) {
            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

    public void setDescription(String id, Described.State description) {
        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        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 {
View Full Code Here

    public Map<Locale, Described.State> getDescriptions(String id) {
        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Map<Locale, Described> mixins = able.getI18NMixin(Described.class);
        Map<Locale, Described.State> names = null;
        if (mixins != null) {
            names = new HashMap<Locale, Described.State>(mixins.size());
View Full Code Here

    public void setDescriptions(String id, Map<Locale, Described.State> descriptions) {
        if (id == null) {
            throw new NullPointerException("No null id accepted");
        }
        POMSession session = manager.getSession();
        WorkspaceObject obj = session.findObjectById(id);
        I18NAdapter able = obj.adapt(I18NAdapter.class);
        Collection<Locale> locales = able.removeI18NMixin(Described.class);
        for (Locale locale : locales) {
            cache.removeState(new CacheKey(locale, id));
        }
View Full Code Here

        InputStream inputStream = attachment.getStream();
        if (inputStream == null)
            throw new OperationException(operationContext.getOperationName(), "No data stream available for import.");

        final POMSessionManager mgr = operationContext.getRuntimeContext().getRuntimeComponent(POMSessionManager.class);
        POMSession session = mgr.getSession();
        if (session == null)
            throw new OperationException(operationName, "MOP session was null");

        Workspace workspace = session.getWorkspace();
        if (workspace == null)
            throw new OperationException(operationName, "MOP workspace was null");

        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        if (dataStorage == null)
View Full Code Here

        if (objectType == null) {
            throw new ResourceNotFoundException("No site type found for " + siteType);
        }

        POMSessionManager mgr = operationContext.getRuntimeContext().getRuntimeComponent(POMSessionManager.class);
        POMSession session = mgr.getSession();
        if (session == null)
            throw new OperationException(operationName, "MOP session was null");

        Workspace workspace = session.getWorkspace();
        if (workspace == null)
            throw new OperationException(operationName, "MOP workspace was null");

        execute(operationContext, resultHandler, workspace, objectType);
    }
View Full Code Here

        if (key == null) {
            throw new NullPointerException();
        }

        //
        POMSession session = manager.getSession();
        NavigationData data = dataCache.getNavigationData(session, key);
        return data != null && data != NavigationData.EMPTY ? new NavigationContext(data) : null;
    }
View Full Code Here

    public List<NavigationContext> loadNavigations(SiteType type) throws NullPointerException, NavigationServiceException {
        if (type == null) {
            throw new NullPointerException();
        }

        POMSession session = manager.getSession();
        ObjectType<Site> objectType = objectType(type);
        Collection<Site> sites = session.getWorkspace().getSites(objectType);

        List<NavigationContext> navigations = new LinkedList<NavigationContext>();
        for (Site site : sites) {
            Navigation defaultNavigation = site.getRootNavigation().getChild("default");
            if (defaultNavigation != null) {
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.pom.config.POMSession

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.