Examples of DataStorage


Examples of org.exoplatform.portal.config.DataStorage

    @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

Examples of org.exoplatform.portal.config.DataStorage

                    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

Examples of org.exoplatform.portal.config.DataStorage

        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

Examples of org.exoplatform.portal.config.DataStorage

                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

Examples of org.exoplatform.portal.config.DataStorage

        }
    }

    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

Examples of org.exoplatform.portal.config.DataStorage

        PortalApplication app = controllerContext.getController().getApplication(PortalApplication.PORTAL_APPLICATION_ID);
        PortalRequestContext context = new PortalRequestContext(app, controllerContext, requestSiteType, requestSiteName,
                requestPath, requestLocale);
        if (context.getUserPortalConfig() == null) {
            DataStorage storage = (DataStorage) PortalContainer.getComponent(DataStorage.class);
            PortalConfig persistentPortalConfig = storage.getPortalConfig(requestSiteType, requestSiteName);
            if (persistentPortalConfig == null) {
                return false;
            } else if (req.getRemoteUser() == null) {
                context.requestAuthenticationLogin();
            } else {
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

    public void setState(PortletState<S> state) {
        if (state != null) {
            try {
                PortletInvoker portletInvoker = getApplicationComponent(PortletInvoker.class);
                DataStorage dataStorage = getApplicationComponent(DataStorage.class);
                String applicationId = dataStorage.getId(state.getApplicationState());
                ModelAdapter<S, C> adapter = ModelAdapter.getAdapter(state.getApplicationType());
                PortletContext producerOfferedPortletContext = adapter.getProducerOfferedPortletContext(applicationId);
                org.gatein.pc.api.Portlet producedOfferedPortlet;

                try {
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

        public synchronized void execute(Event<UIPortalForm> event) throws Exception {
            UIPortalForm uiForm = event.getSource();
            PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
            String template = uiForm.getChild(UIFormInputItemSelector.class).getSelectedItemOption().getValue().toString();
            String portalName = uiForm.getUIStringInput(FIELD_NAME).getValue();
            DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
            PortalConfig config = dataService.getPortalConfig(portalName);
            if (config != null) {
                UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.sameName", null));
                return;
            }

            UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
            service.createUserPortalConfig(SiteType.PORTAL.getName(), portalName, template);

            PortalConfig pconfig = dataService.getPortalConfig(portalName);
            uiForm.invokeSetBindingBean(pconfig);
            dataService.save(pconfig);
            UIPortalApplication uiPortalApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();

            UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChild(UIWorkingWorkspace.class);
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

            UIPortalApplication uiPortalApp = uiPageForm.getAncestorOfType(UIPortalApplication.class);
            PortalRequestContext pcontext = Util.getPortalRequestContext();
            UIPage uiPage = uiPageForm.getUIPage();
            Page page = new Page();
            uiPageForm.invokeSetBindingBean(page);
            DataStorage dataService = uiPageForm.getApplicationComponent(DataStorage.class);
            // create new page
            if (uiPage == null) {
                PageService pageService = uiPageForm.getApplicationComponent(PageService.class);
                PageContext existPage = pageService.loadPage(page.getPageKey());
                if (existPage != null) {
                    uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
                    return;
                }
                page.setModifiable(true);
                if (page.getChildren() == null) {
                    page.setChildren(new ArrayList<ModelObject>());
                }

                //
                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(page.getPageKey(), pageState));

                //
                dataService.save(page);
                postSave(uiPortalApp, pcontext);
                return;
            }

            page.setOwnerType(uiPage.getSiteKey().getTypeName());
View Full Code Here

Examples of org.exoplatform.portal.config.DataStorage

                    uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);

                    // TODO Wait to fix issue EXOGTN-213 and then
                    // we should get "showInfobar" from current UI portal instead of Storage service
                    UIPortal currentPortal = Util.getUIPortal();
                    DataStorage storage = uiApp.getApplicationComponent(DataStorage.class);
                    uiPortlet.setShowInfoBar(storage.getPortalConfig(currentPortal.getSiteKey().getTypeName(),
                            currentPortal.getSiteKey().getName()).isShowInfobar());
                    uiSource = uiPortlet;
                }
                List<UIComponent> children = uiTarget.getChildren();
                uiSource.setParent(uiTarget);
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.