Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.DataStorage


        setColumns(3);
    }

    @Override
    public void processRender(WebuiRequestContext context) throws Exception {
        DataStorage service = getApplicationComponent(DataStorage.class);

        // Get current ui portlet containing this dashboard
        UIPortlet currentUIPortlet = UIPortlet.getCurrentUIPortlet();

        // Get dashboard for merging
        Container dashboard = null;
        if (currentUIPortlet.getStorageId() != null) {
            dashboard = service.loadDashboard(currentUIPortlet.getStorageId());
        }

        //
        if (dashboard != null) {
            UIContainer uiRoot = getChild(UIContainer.class);
View Full Code Here


            // Assemble the dashboard
            PortalDataMapper.toContainer(dashboard, uiRoot);

            // Get data storage
            DataStorage service = getApplicationComponent(DataStorage.class);

            // Save
            try {
                service.saveDashboard(dashboard);
            } catch (StaleModelException e) {
                WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
                context.getUIApplication().addMessage(
                        new ApplicationMessage("UIDashboard.msg.StaleData", null, ApplicationMessage.ERROR));
                context.setAttribute(SAVE_FAIL, true);
View Full Code Here

        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

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

    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

        setSelectedTab("PortalSetting");
    }

    public void setBindingBean() throws Exception {

        DataStorage dataStorage = this.getApplicationComponent(DataStorage.class);

        UIPortal editPortal = null;
        UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
        UIEditInlineWorkspace uiEditWS = uiPortalApp.<UIWorkingWorkspace> getChildById(UIPortalApplication.UI_WORKING_WS_ID)
                .getChild(UIEditInlineWorkspace.class);
        if (uiPortalApp.getModeState() != UIPortalApplication.NORMAL_MODE && uiEditWS != null
                && uiEditWS.getUIComponent() != null && (uiEditWS.getUIComponent() instanceof UIPortal)) {
            editPortal = (UIPortal) uiEditWS.getUIComponent();
        } else {
            PortalConfig pConfig = dataStorage.getPortalConfig(getPortalOwner());
            editPortal = this.createUIComponent(UIPortal.class, null, null);
            PortalDataMapper.toUIPortal(editPortal, pConfig);
        }

        invokeGetBindingBean(editPortal);
View Full Code Here

    public static class SaveActionListener extends EventListener<UIPortalForm> {
        public void execute(Event<UIPortalForm> event) throws Exception {
            UIPortalForm uiForm = event.getSource();

            DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
            UserACL acl = uiForm.getApplicationComponent(UserACL.class);
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiPortalApp = (UIPortalApplication) prContext.getUIApplication();

            PortalConfig pConfig = dataService.getPortalConfig(uiForm.getPortalOwner());
            if (pConfig != null && acl.hasPermission(pConfig)) {
                UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
                PortalDataMapper.toUIPortal(uiPortal, pConfig);

                uiForm.invokeSetBindingBean(uiPortal);
                // uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
                if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE) {
                    PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(uiPortal);
                    dataService.save(portalConfig);
                    UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
                    if (prContext.getPortalOwner().equals(uiForm.getPortalOwner())) {
                        prContext.setUserPortalConfig(service.getUserPortalConfig(uiForm.getPortalOwner(),
                                prContext.getRemoteUser(), PortalRequestContext.USER_PORTAL_CONTEXT));
                        uiPortalApp.reloadPortalProperties();
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

                    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

            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);
                }
                uiPortal.getChildren().clear();
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.