Package org.exoplatform.portal.config.model

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


        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

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

                UIPage uiPage = (UIPage) uiToolPanel.getUIComponent();

                if (pageContext.getState().getDisplayName() == null)
                    pageContext.getState().builder().displayName(node.getLabel());

                Page page = userService.getDataStorage().getPage(pageId);
                pageContext.update(page);

                // convert Page to UIPage
                PortalDataMapper.toUIPage(uiPage, page);
                Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
View Full Code Here

                PageService pageService = uiPageNodeForm.getApplicationComponent(PageService.class);
                if (pageService.loadPage(pageContext.getKey()) == null) {
                    pageService.savePage(pageContext);

                    //
                    Page page = new Page();
                    page.setOwnerType(pageContext.getKey().getSite().getTypeName());
                    page.setOwnerId(pageContext.getKey().getSite().getName());
                    page.setName(pageContext.getKey().getName());
                    String title = pageContext.getState().getDisplayName();
                    String[] accessPermission = pageContext.getState().getAccessPermissions() == null ? null : pageContext
                            .getState().getAccessPermissions()
                            .toArray(new String[pageContext.getState().getAccessPermissions().size()]);
                    if (title == null || title.trim().length() < 1) {
                        title = page.getName();
                    }
                    page.setTitle(title);
                    page.setShowMaxWindow(false);
                    page.setAccessPermissions(accessPermission);
                    page.setEditPermission(pageContext.getState().getEditPermission());
                    page.setModifiable(true);
                    if (page.getChildren() == null) {
                        page.setChildren(new ArrayList<ModelObject>());
                    }

                    storage.save(page);
                    pageSelector.setValue(page.getPageId());
                }
            }

            if (pageNode.getLabel() == null)
                pageNode.setLabel(pageNode.getName());
View Full Code Here

         if (uiPage == null)
         {
            uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", null));
            return;
         }
         Page page = PortalDataMapper.toPageModel(uiPage);

         UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
         if (!userACL.hasEditPermission(page))
         {
            uiApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditPage-Permission", null));
View Full Code Here

   {
      WebuiRequestContext context = Util.getPortalRequestContext();
      ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userPortalConfigService =
         (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
      Page page = null;
      PageNode pageNode = Util.getUIPortal().getSelectedNode();
      if (pageNode != null)
      {
         try
         {
View Full Code Here

         throws Exception
      {
         String pageId = node.getPageReference();
         if (pageId != null)
         {
            Page page = service.getPage(pageId);
            if (page != null)
            {
               String newName = "page" + node.hashCode();
               page = service.renewPage(pageId, newName, ownerType, ownerId);
               node.setPageReference(page.getPageId());
            }
         }
         List<PageNode> children = node.getChildren();
         if (children == null || children.size() < 1)
            return;
View Full Code Here

               ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
               UserPortalConfigService userPortalConfigService = (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
              
               for (PageNode pageNode : nav.getNodes())
               {
                  Page page = userPortalConfigService.getPage(pageNode.getPageReference(), context.getRemoteUser());
                  if (page != null)
                  {
                     defaultNode = pageNode;
                     break;
                  }
View Full Code Here

TOP

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

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.