Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserPortalConfigService


      {
         UIPageBrowser uiPageBrowser = event.getSource();
         PortalRequestContext pcontext = Util.getPortalRequestContext();
         UIPortalApplication uiPortalApp = (UIPortalApplication)pcontext.getUIApplication();
         String id = pcontext.getRequestParameter(OBJECTID);
         UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);

         //Check existence of the page
         Page page = service.getPage(id);
         if (page == null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
View Full Code Here


         UIPage uiPage = uiToolPanel.findFirstComponentOfType(UIPage.class);
         Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
         String pageId = page.getPageId();

         UserPortalConfigService portalConfigService =
            uiWorkingWS.getApplicationComponent(UserPortalConfigService.class);
        
         /*
          * if it is a edition of the current page
          */
         if (page.getStorageId() != null && portalConfigService.getPage(pageId) == null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{pageId}, 1));
            uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
            uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
            Util.getPortalRequestContext().setFullRender(true);
View Full Code Here

         if (pageNode == null)
         {
            uiForm.setShowPublicationDate(false);
            return;
         }
         UserPortalConfigService configService = uiWizard.getApplicationComponent(UserPortalConfigService.class);
         String accessUser = event.getRequestContext().getRemoteUser();
         Page page = null;
         if (pageNode.getPageReference() != null)
            page = configService.getPage(pageNode.getPageReference(), accessUser);
         if (page == null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIWizardPageSetInfo.msg.null", null));
            uiForm.reset();
            uiForm.setShowPublicationDate(false);
View Full Code Here

   @SuppressWarnings("unchecked")
   public UIPageForm(InitParams initParams) throws Exception
   {
      super("UIPageForm");
      PortalRequestContext pcontext = Util.getPortalRequestContext();
      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
      List<SelectItemOption<String>> ownerTypes = new ArrayList<SelectItemOption<String>>();
      ownerTypes.add(new SelectItemOption<String>(PortalConfig.USER_TYPE));

      UserPortalConfig userPortalConfig =
         configService.getUserPortalConfig(pcontext.getPortalOwner(), pcontext.getRemoteUser());
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      UserACL acl = (UserACL)container.getComponentInstanceOfType(UserACL.class);
      if (acl.hasEditPermission(userPortalConfig.getPortalConfig()))
      {
         ownerTypes.add(new SelectItemOption<String>(PortalConfig.PORTAL_TYPE));
      }
      ownerIdInput = new UIFormStringInput(OWNER_ID, OWNER_ID, null);
      ownerIdInput.setEditable(false).setValue(pcontext.getRemoteUser());

      UIFormSelectBox uiSelectBoxOwnerType = new UIFormSelectBox(OWNER_TYPE, OWNER_TYPE, ownerTypes);
      uiSelectBoxOwnerType.setOnChange("ChangeOwnerType");

      UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
      uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setEditable(false)).addUIFormInput(
         uiSelectBoxOwnerType).addUIFormInput(ownerIdInput).addUIFormInput(
         new UIFormStringInput("name", "name", null).addValidator(StringLengthValidator.class, 3, 30).addValidator(
            IdentifierValidator.class).addValidator(MandatoryValidator.class)).addUIFormInput(
         new UIFormStringInput("title", "title", null).addValidator(StringLengthValidator.class, 3, 120))
         .addUIFormInput(new UIFormCheckBoxInput("showMaxWindow", "showMaxWindow", false));
      addUIFormInput(uiSettingSet);
      setSelectedTab(uiSettingSet.getId());

      uiPermissionSetting = createUIComponent(UIFormInputSet.class, "PermissionSetting", null);
      UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
      uiListPermissionSelector.configure("UIListPermissionSelector", "accessPermissions");
      uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
      uiPermissionSetting.addChild(uiListPermissionSelector);
      uiPermissionSetting.setSelectedComponent(uiListPermissionSelector.getId());
      UIPermissionSelector uiEditPermission = createUIComponent(UIPermissionSelector.class, null, null);
      uiEditPermission.setRendered(false);
      uiEditPermission.addValidator(org.exoplatform.webui.organization.UIPermissionSelector.MandatoryValidator.class);
      uiEditPermission.setEditable(false);
      uiEditPermission.configure("UIPermissionSelector", "editPermission");
      uiPermissionSetting.addChild(uiEditPermission);

      //TODO: This following line is fixed for bug PORTAL-2127
      uiListPermissionSelector.getChild(UIFormPopupWindow.class).setId("UIPageFormPopupGroupMembershipSelector");

      List<String> groups = configService.getMakableNavigations(pcontext.getRemoteUser(), true);
      if (groups.size() > 0)
      {
         Collections.sort(groups);
         ownerTypes.add(new SelectItemOption<String>(PortalConfig.GROUP_TYPE));
         List<SelectItemOption<String>> groupsItem = new ArrayList<SelectItemOption<String>>();
View Full Code Here

         }

         UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         UIPortalToolPanel uiToolPanel =
            uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class).setRendered(true);
         UserPortalConfigService userService = uiToolPanel.getApplicationComponent(UserPortalConfigService.class);

         // get selected page
         String pageId = selectedPageNode.getPageReference();
         Page selectPage = (pageId != null) ? userService.getPage(pageId) : null;
         if (selectPage != null)
         {
            UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(selectPage))
            {
View Full Code Here

         PageNavigation edittedNav = uiNodeSelector.getEdittedNavigation();
         Object obj = PageNavigationUtils.searchParentNode(edittedNav, uri);
         PageNode selectedNode = PageNavigationUtils.searchPageNodeByUri(edittedNav, uri);
         String pageId = selectedNode.getPageReference();

         UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
         Page node = (pageId != null) ? service.getPage(pageId) : null;
         if (node != null)
         {
            UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasPermission(node))
            {
View Full Code Here

            uiPageNodeSelector.selectNavigation(uiPageNodeSelector.getSelectedNavigation());
            uiToolPanel.setUIComponent(null);
            return;
         }

         UserPortalConfigService configService = uiParent.getApplicationComponent(UserPortalConfigService.class);
         Page page = null;
         if (node.getPageReference() != null)
         {
            page = configService.getPage(node.getPageReference(), event.getRequestContext().getRemoteUser());
         }

         if (page == null)
         {
            uiToolPanel.setUIComponent(null);
View Full Code Here

   }

   public void setBindingBean() throws Exception
   {

      UserPortalConfigService service = this.getApplicationComponent(UserPortalConfigService.class);
      PortalRequestContext prContext = Util.getPortalRequestContext();

      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
      {
         UserPortalConfig userConfig = service.getUserPortalConfig(getPortalOwner(), prContext.getRemoteUser());
         editPortal = this.createUIComponent(UIPortal.class, null, null);
         PortalDataMapper.toUIPortal(editPortal, userConfig);
      }

      invokeGetBindingBean(editPortal);
View Full Code Here

      public void execute(Event<UIPortalForm> event) throws Exception
      {
         UIPortalForm uiForm = event.getSource();

         DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
         UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
         PortalRequestContext prContext = Util.getPortalRequestContext();

         UserPortalConfig userConfig = service.getUserPortalConfig(uiForm.getPortalOwner(), prContext.getRemoteUser());
         if (userConfig != null)
         {
            UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
            PortalDataMapper.toUIPortal(uiPortal, userConfig);

            UIPortalApplication uiPortalApp = (UIPortalApplication)prContext.getUIApplication();
            uiForm.invokeSetBindingBean(uiPortal);
            //uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
            if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
            {
               PortalConfig portalConfig = (PortalConfig)PortalDataMapper.buildModelObject(uiPortal);
               UserPortalConfigService configService = uiForm.getApplicationComponent(UserPortalConfigService.class);
               dataService.save(portalConfig);
            }
            else
            {
               UIWorkingWorkspace uiWorkingWS = uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
View Full Code Here

      PageNavigation filter = nav.clone();
      filter.setNodes(new ArrayList<PageNode>());
     
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      ExoContainer container = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userService =
         (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
      UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);

      for (PageNode node : nav.getNodes())
      {
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.UserPortalConfigService

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.