Package org.exoplatform.portal.config.model

Examples of org.exoplatform.portal.config.model.Page


        // As ownerId is now normalized, we have to maker sure that owenerId of 'group' type starts with a '/'
        if (SiteType.GROUP.getName().equals(ownerType) && ownerId.charAt(0) != '/') {
            ownerId = "/" + ownerId;
        }

        Page page = (Page) bean;
        page.setPageId(getUIStringInput("pageId").getValue());
        page.setOwnerType(ownerType);
        page.setOwnerId(ownerId);
        page.setName(getUIStringInput("name").getValue());
        String title = getUIStringInput("title").getValue();
        if (title == null || title.trim().length() < 1)
            title = page.getName();
        page.setTitle(title);

        if (!page.isShowMaxWindow()) {
            page.setShowMaxWindow(getUICheckBoxInput("showMaxWindow").getValue());
        }
        if (!SiteType.USER.getName().equals(page.getOwnerType())) {
            page.setAccessPermissions(uiPermissionSetting.getChild(UIListPermissionSelector.class).getValue());
            page.setEditPermission(uiPermissionSetting.getChild(UIPermissionSelector.class).getValue());
        }
        UserACL userACL = getApplicationComponent(UserACL.class);
        userACL.hasPermission(page);

        UIFormInputItemSelector uiTemplate = getChildById("Template");
        if (uiTemplate != null) {
            SelectItemOption<?> itemOption = uiTemplate.getSelectedItemOption();
            if (itemOption != null) {
                page.setFactoryId(itemOption.getIcon());
                // page.setTemplate((String)itemOption.getValue());
            }
        }
        UIPageTemplateOptions uiConfigOptions = getChild(UIPageTemplateOptions.class);
        if (uiConfigOptions == null)
            return;
        Page selectedPage = uiConfigOptions.createPageFromSelectedOption(page.getOwnerType(), page.getOwnerId());
        if (selectedPage == null)
            return;
        page.setChildren(selectedPage.getChildren());
        page.setFactoryId(selectedPage.getFactoryId());
    }
View Full Code Here


            uiPermissionSetting.getChild(UIPermissionSelector.class).setEditable(true);
        }

        if (uiPage != null) {
            uiPage_ = uiPage;
            Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
            invokeGetBindingBean(page);
            getUIStringInput("name").setReadOnly(true);
            getUIStringInput("pageId").setValue(uiPage.getPageId());
            getUIStringInput("title").setValue(uiPage.getTitle());
            getUICheckBoxInput("showMaxWindow").setValue(uiPage.isShowMaxWindow());
View Full Code Here

            }

            // Need this code to override editpage action in extension project
            UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
            UIPage uipage = clazz.createUIPage(null);
            Page page = service.getDataStorage().getPage(id);
            pageContext.update(page);
            uipage.switchToEditMode(page);
        }
View Full Code Here

        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiPageForm = event.getSource();
            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());

            List<UIPortlet> uiPortlets = new ArrayList<UIPortlet>();
            findAllPortlet(uiPortlets, uiPage);
            ArrayList<ModelObject> applications = new ArrayList<ModelObject>();
            for (UIPortlet uiPortlet : uiPortlets) {
                applications.add(PortalDataMapper.buildModelObject(uiPortlet));
            }

            List<UIComponent> uiChildren = uiPage.getChildren();
            if (uiChildren == null)
                return;
            ArrayList<ModelObject> children = new ArrayList<ModelObject>();
            for (UIComponent child : uiChildren) {
                ModelObject component = PortalDataMapper.buildModelObject(child);
                if (component != null)
                    children.add(component);
            }
            page.setChildren(children);
            uiPage.getChildren().clear();

            PortalDataMapper.toUIPage(uiPage, page);

            // if (page.getTemplate() == null) page.setTemplate(uiPage.getTemplate());
            if (page.getChildren() == null)
                page.setChildren(new ArrayList<ModelObject>());
        }
View Full Code Here

        try {
            UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
            uiPage = clazz.createUIPage(context);

            Page page = userPortalConfigService.getDataStorage().getPage(pageReference);
            pageContext.update(page);
            PortalDataMapper.toUIPage(uiPage, page);
            uiPortal.setUIPage(pageReference, uiPage);
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
View Full Code Here

        UIWizardPageSetInfo uiPageInfo = getChild(UIWizardPageSetInfo.class);
        UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
        UserNode selectedNode = uiNodeSelector.getSelectedNode();

        Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
        UserNode createdNode = uiPageInfo.createUserNode(selectedNode);

        createdNode.setPageRef(page.getPageKey());

        //
        PageService pageService = getApplicationComponent(PageService.class);
        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));

        //
        DataStorage dataService = getApplicationComponent(DataStorage.class);
        dataService.save(page);
View Full Code Here

            UserNavigation pageNavi = uiNodeSelector.getNavigation();
            String ownerType = pageNavi.getKey().getTypeName();
            String ownerId = pageNavi.getKey().getName();

            UIFormStringInput pageName = uiPageInfo.getUIStringInput(UIWizardPageSetInfo.PAGE_NAME);
            Page page = uiPageTemplateOptions.createPageFromSelectedOption(ownerType, ownerId);
            page.setName("page" + page.hashCode());
            String pageId = ownerType + "::" + ownerId + "::" + page.getName();

            // check page is exist
            PageService pageService = uiWizard.getApplicationComponent(PageService.class);
            if (pageService.loadPage(PageKey.parse(pageId)) != null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.NameNotSame", null));
                uiWizard.viewStep(FIRST_STEP);
                uiWizard.updateWizardComponent();
            }
            page.setModifiable(true);

            // Set default permissions on the page
            setDefaultPermission(page, pageNavi.getKey());

            if (page.getTitle() == null || page.getTitle().trim().length() == 0) {
                page.setTitle(pageName.getValue());
            }

            UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);

            UIPageFactory clazz = UIPageFactory.getInstance(page.getFactoryId());
            UIPage uiPage = clazz.createUIPage(context);

            PortalDataMapper.toUIPage(uiPage, page);
            uiPagePreview.setUIComponent(uiPage);
View Full Code Here

            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPage uiPage = uiPageForm.getUIPage();
            if (uiPage == null)
                return;

            Page page = new Page();
            uiPageForm.invokeSetBindingBean(page);
            uiPage.setAccessPermissions(page.getAccessPermissions());
            uiPage.setEditPermission(page.getEditPermission());
            uiPage.setTitle(page.getTitle());
            uiPage.setShowMaxWindow(page.isShowMaxWindow());

            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();
            pcontext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
                    .addScripts("portalComposer.toggleSaveButton();");
        }
View Full Code Here

        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

        this.pageService = pageService;
    }

    public void perform() throws Exception {
        PageContext existingPage = pageService.loadPage(src.getPageKey());
        Page dst;

        //
        switch (mode) {
            case CONSERVE:
                dst = null;
                break;
            case INSERT:
                if (existingPage == null) {
                    dst = src;
                } else {
                    dst = null;
                }
                break;
            case MERGE:
            case OVERWRITE:
                dst = src;
                break;
            default:
                throw new AssertionError();
        }

        if (dst != null) {
            PageState dstState = new PageState(dst.getTitle(), dst.getDescription(), dst.isShowMaxWindow(), dst.getFactoryId(),
                    dst.getAccessPermissions() != null ? Arrays.asList(dst.getAccessPermissions()) : null,
                    dst.getEditPermission());

            pageService.savePage(new PageContext(src.getPageKey(), dstState));
            service.save(dst);
        }
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.model.Page

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.