Examples of DataStorage


Examples of org.exoplatform.portal.config.DataStorage

            portlet = transientApplicationState.getContentState();
        } else {
            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    portlet = dataStorage.load(state, ApplicationType.PORTLET);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain portlet state.");
                }

                try {
                    contentId = dataStorage.getId(state);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain contentId.", e);
                }
            } else {
                throw new XMLStreamException("Cannot marshal application state " + state
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

            contentId = tas.getContentId();
        } else {
            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    contentId = dataStorage.getId(state);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain contentId.", e);
                }
            } else {
                throw new XMLStreamException("Cannot marshal application state " + state
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

        UIPortal uiPortal = Util.getUIPortal();
        String remoteUser = prContext.getRemoteUser();
        String portalName = prContext.getPortalOwner();

        PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(editPortal);
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);
        UserACL acl = getApplicationComponent(UserACL.class);

        if (!isPortalExist(editPortal)) {
            return;
        }

        SkinService skinService = getApplicationComponent(SkinService.class);
        skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
        try {
            dataStorage.save(portalConfig);
        } catch (StaleModelException ex) {
            // Temporary solution for concurrency-related issue. The StaleModelException should be
            // caught in the ApplicationLifecycle
            rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
        }
        prContext.getUserPortalConfig().setPortalConfig(portalConfig);
        PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
        if (pConfig != null) {
            editPortal.setModifiable(acl.hasEditPermission(pConfig));
        } else {
            editPortal.setModifiable(false);
        }
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

    }

    public void setState(ApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget> state) {
        if (state != null) {
            try {
                DataStorage ds = getApplicationComponent(DataStorage.class);
                String gadgetId = ds.getId(state);

                //
                this.gadgetId = gadgetId;
                this.state = state;
            } catch (Exception e) {
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

        }
    }

    public boolean isLossData() {
        try {
            DataStorage service = getApplicationComponent(DataStorage.class);
            service.load(state, ApplicationType.GADGET);
            if (getApplication() == null) {
                throw new Exception();
            }

            if (metadata_ == null) {
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

     *
     * @return the string represents user preference of gadget application
     * @throws Exception when can't convert object to string
     */
    public String getUserPref() throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);
        org.exoplatform.portal.pom.spi.gadget.Gadget pp = service.load(state, ApplicationType.GADGET);
        return pp != null ? pp.getUserPref() : null;
    }
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

        org.exoplatform.portal.pom.spi.gadget.Gadget pp = service.load(state, ApplicationType.GADGET);
        return pp != null ? pp.getUserPref() : null;
    }

    public void addUserPref(String addedUserPref) throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);
        org.exoplatform.portal.pom.spi.gadget.Gadget gadget = new org.exoplatform.portal.pom.spi.gadget.Gadget();

        //
        gadget.addUserPref(addedUserPref);

        //
        state = service.save(state, gadget);

        // WARNING :
        // This is used to force a state save and it should not be copied else where to make things
        // convenient as this could lead to a severe performance degradation
        ModelDataStorage mds = getApplicationComponent(ModelDataStorage.class);
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

                portalApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
                        new String[] { currentPortal.getName() }));
                return;
            }

            DataStorage dataStorage = portalApp.getApplicationComponent(DataStorage.class);
            PortalConfig portalConfig = dataStorage.getPortalConfig(pcontext.getSiteType().getName(), pcontext.getSiteName());
            UIPortal transientPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
            PortalDataMapper.toUIPortal(transientPortal, portalConfig);
            transientPortal.setNavPath(currentPortal.getNavPath());
            transientPortal.refreshUIPage();
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

        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)
            throw new OperationException(operationName, "DataStorage was null");

        PageService pageService = operationContext.getRuntimeContext().getRuntimeComponent(PageService.class);
        if (pageService == null)
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

*/
public class SiteLayoutReadConfigAsXml extends AbstractSiteOperationHandler {
    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site)
            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
Copyright © 2018 www.massapi.com. 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.