Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.DataStorage


        this.maximizedUIPortlet = maximizedUIPortlet;
    }

    public void switchToEditMode() throws Exception {
        PageService pageService = this.getApplicationComponent(PageService.class);
        DataStorage dataStorage = this.getApplicationComponent(DataStorage.class);

        PageKey pageKey = new PageKey(getSiteKey(), getName());
        PageContext pageContext = pageService.loadPage(pageKey);
        if (pageContext == null) {
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            ApplicationMessage msg = new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageKey.format() }, 1);
            uiApp.addMessage(msg);
        } else {
            Page page = dataStorage.getPage(pageKey.format());
            pageContext.update(page);
            switchToEditMode(page);
        }
    }
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

        currApp = getChildByStorageId(storageId);
        if (currApp != null) {
            return;
        }

        DataStorage ds = getApplicationComponent(DataStorage.class);
        String[] siteInfo;
        try {
            siteInfo = ds.getSiteInfo(storageId);
        } catch (Exception ex) {
            lossData = true;
            return;
        }

        String siteType = null;
        String siteOwner = null;
        if (siteInfo != null) {
            siteType = siteInfo[0];
            siteOwner = siteInfo[1];
        }
        ConversationState currentState = ConversationState.getCurrent();
        if (PortalConfig.USER_TYPE.equals(siteType) && currentState.getIdentity().getUserId().equals(siteOwner)) {
            Application<Gadget> gadgetModel = ds.getApplicationModel(storageId);
            UIStandaloneGadget staGadget = createUIComponent(UIStandaloneGadget.class, null, null);
            staGadget.setStorageId(storageId);
            PortalDataMapper.toUIGadget(staGadget, gadgetModel);
            addChild(staGadget);
            currApp = staGadget;
View Full Code Here

            if (navigation != null && navigation.getState() != null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageNavigationForm.msg.existPageNavigation",
                        new String[] { ownerId }));
            } else {
                // Create portal config of the group when it does not exist
                DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
                if (dataService.getPortalConfig("group", ownerId) == null) {
                    UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
                    configService.createGroupSite(ownerId);
                }

                // create navigation for group
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

        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 SiteLayoutExportResource extends AbstractSiteOperationHandler {
    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site)
            throws ResourceNotFoundException, OperationException {
        BindingProvider bindingProvider = operationContext.getBindingProvider();
        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);

        SiteKey siteKey = getSiteKey(site);

        resultHandler.completed(new ExportResourceModel(new SiteLayoutExportTask(siteKey, dataStorage, bindingProvider
                .getMarshaller(PortalConfig.class, ContentType.XML))));
View Full Code Here

*/
public class SiteLayoutReadConfig 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, Page pages)
            throws ResourceNotFoundException, OperationException {
        SiteKey siteKey = getSiteKey(pages.getSite());

        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        PageService pageService = operationContext.getRuntimeContext().getRuntimeComponent(PageService.class);
        BindingProvider bindingProvider = operationContext.getBindingProvider();

        Collection<Page> pagesList = pages.getChildren();
        List<ExportTask> tasks = new ArrayList<ExportTask>(pagesList.size());
View Full Code Here

            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

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.