Package org.exoplatform.portal.config

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


        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

                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

        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

*/
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

    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler,
            org.gatein.mop.api.workspace.Page rootPage) throws ResourceNotFoundException, OperationException {
        String operationName = operationContext.getOperationName();
        SiteKey siteKey = getSiteKey(rootPage.getSite());
        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        PageService pageService = operationContext.getRuntimeContext().getRuntimeComponent(PageService.class);

        String pageName = operationContext.getAddress().resolvePathTemplate("page-name");

        // retrieve pages
View Full Code Here

                    state.getOwnerId());
        } else {
            // Hate doing this, but it's the only way to deal with persistent application state...
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage ds = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    S s = ds.load(existing, type);
                    String contentId = ds.getId(existing);

                    return new TransientApplicationState<S>(contentId, s);
                } catch (Exception e) {
                    throw new RuntimeException("Exception copying persistent application state.", e);
                }
View Full Code Here

        localeCtx.setCookieLocales(getCookieLocales(request));
        localeCtx.setSessionLocale(getSessionLocale(request));
        localeCtx.setUserProfileLocale(getUserProfileLocale(reqCtx));
        localeCtx.setRemoteUser(reqCtx.getRemoteUser());

        DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
        PortalConfig pConfig = null;
        try {
            pConfig = dataStorage.getPortalConfig(SiteType.PORTAL.getName(), reqCtx.getPortalOwner());
            if (pConfig == null)
                log.warn("No UserPortalConfig available! Portal locale set to 'en'");
        } catch (Exception ignored) {
            if (log.isDebugEnabled())
                log.debug("IGNORED: Failed to load UserPortalConfig: ", ignored);
View Full Code Here

                uiEvent.broadcast();
                return;
            }

            // Perform model update
            DataStorage dataService = uiWorkingWS.getApplicationComponent(DataStorage.class);
            PageService pageService = uiWorkingWS.getApplicationComponent(PageService.class);
            try {
                PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                        page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions())
                                : null, page.getEditPermission());
                pageService.savePage(new PageContext(pageKey, pageState));
                dataService.save(page);
            } catch (StaleModelException ex) {
                // Temporary solution to concurrency-related issue
                // This catch block should be put in an appropriate ApplicationLifecyclec
            }
            uiToolPanel.setUIComponent(null);
View Full Code Here

        }
    }

    public void buildForm(UIPage uiPage) throws Exception {
        PortalRequestContext pcontext = Util.getPortalRequestContext();
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);

        PortalConfig pConfig = dataStorage.getPortalConfig(pcontext.getPortalOwner());
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) container.getComponentInstanceOfType(UserACL.class);

        UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
        uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setReadOnly(true));
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.DataStorage

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.