Package org.exoplatform.portal.config

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


    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

        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

            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

                    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

            tmp.clearUIPage(pageRef);
        }
    }

    public void refreshCachedUI() throws Exception {
        DataStorage storage = this.getApplicationComponent(DataStorage.class);
        all_UIPortals.clear();

        UIPortal uiPortal = getCurrentSite();
        if (uiPortal != null) {
            SiteKey siteKey = uiPortal.getSiteKey();

            UIPortal tmp = null;
            PortalConfig portalConfig = storage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            if (portalConfig != null) {
                tmp = this.createUIComponent(UIPortal.class, null, null);
                PortalDataMapper.toUIPortal(tmp, portalConfig);
                this.putCachedUIPortal(tmp);
                tmp.setNavPath(uiPortal.getNavPath());
View Full Code Here

@ComponentConfig(template = "system:/groovy/portal/webui/application/UIStandaloneGadget.gtmpl", events = { @EventConfig(listeners = UIStandaloneGadget.SaveUserPrefActionListener.class) })
public class UIStandaloneGadget extends UIGadget {

    @Override
    public boolean isLossData() {
        DataStorage ds = getApplicationComponent(DataStorage.class);
        try {
            ds.getId(getState());
        } catch (Exception e) {
            return true;
        }
        return super.isLossData();
    }
View Full Code Here

     */
    private void initWorkspaces() throws Exception {
        UIWorkingWorkspace uiWorkingWorkspace = addChild(UIWorkingWorkspace.class, UIPortalApplication.UI_WORKING_WS_ID, null);
        UIComponentDecorator uiViewWS = uiWorkingWorkspace.addChild(UIComponentDecorator.class, null, UI_VIEWING_WS_ID);

        DataStorage dataStorage = getApplicationComponent(DataStorage.class);
        Container container = dataStorage.getSharedLayout();

        uiWorkingWorkspace.addChild(UIEditInlineWorkspace.class, null, UI_EDITTING_WS_ID).setRendered(false);
        if (container != null) {
            org.exoplatform.portal.webui.container.UIContainer uiContainer = createUIComponent(
                    org.exoplatform.portal.webui.container.UIContainer.class, null, null);
View Full Code Here

            uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
            uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
            prContext.ignoreAJAXUpdateOnPortlets(true);

            if (uiComposer.isPortalExist(editPortal)) {
                DataStorage storage = uiPortalApp.getApplicationComponent(DataStorage.class);
                PortalConfig pConfig = storage.getPortalConfig(uiPortal.getSiteKey().getTypeName(), uiPortal.getSiteKey()
                        .getName());
                if (pConfig != null) {
                    prContext.getUserPortalConfig().setPortalConfig(pConfig);
                }
View Full Code Here

                page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions()) : null,
                page.getEditPermission());
        pageService.savePage(new PageContext(page.getPageKey(), pageState));

        //
        DataStorage dataService = getApplicationComponent(DataStorage.class);
        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
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.