Examples of UIPortalApplication


Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

            return;
         }
         uicomp.navigations.remove(navigation);

         // remove navigation from UIPortalApplication
         UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
         removeNavigationByID(uiPortalApp.getUserPortalConfig().getNavigations(), navigation);
         removeNavigationByID(uiPortalApp.getNavigations(), navigation);
        
        
         service.remove(navigation);
         event.getRequestContext().addUIComponentToUpdateByAjax(uicomp);

         //Update UserToolbarGroupPortlet
         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChild(UIWorkingWorkspace.class);
         uiWorkingWS.updatePortletsByName("UserToolbarGroupPortlet");
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

   {
      public void execute(Event<UIGroupNavigationManagement> event) throws Exception
      {
         PortalRequestContext prContext = Util.getPortalRequestContext();
         //UIGroupNavigationManagement uicomp = event.getSource();
         UIPortalApplication uiApp = (UIPortalApplication)prContext.getUIApplication();
         //UIGroupNavigationPortlet uiPortlet = (UIGroupNavigationPortlet) uicomp.getParent();
         UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);

         UIAddGroupNavigation uiNewPortal = uiMaskWS.createUIComponent(UIAddGroupNavigation.class, null, null);
         uiMaskWS.setUIComponent(uiNewPortal);
         uiMaskWS.setShow(true);
         prContext.addUIComponentToUpdateByAjax(uiMaskWS);
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

      {
         UISiteManagement uicomp = event.getSource();
         String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
         UserPortalConfigService service = uicomp.getApplicationComponent(UserPortalConfigService.class);
         PortalRequestContext prContext = Util.getPortalRequestContext();
         UIPortalApplication portalApp = (UIPortalApplication)prContext.getUIApplication();

         UserPortalConfig userConfig = service.getUserPortalConfig(portalName, prContext.getRemoteUser());

         if (userConfig == null)
         {
            portalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
               new String[]{portalName}));
            return;
         }
         PortalConfig portalConfig = userConfig.getPortalConfig();

         UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
         if (!userACL.hasEditPermission(portalConfig))
         {
            portalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission",
               new String[]{portalConfig.getName()}));
            return;
         }

         UIWorkingWorkspace uiWorkingWS = portalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         //UIEditInlineWorkspace uiEditWS = uiWorkingWS.addChild(UIEditInlineWorkspace.class, null, UIPortalApplication.UI_EDITTING_WS_ID);
         UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChildById(UIPortalApplication.UI_EDITTING_WS_ID);
         UIPortalComposer uiComposer = uiEditWS.getComposer().setRendered(true);
         uiComposer.setEditted(false);
         uiComposer.setCollapse(false);
         uiComposer.setShowControl(true);
         uiComposer.setComponentConfig(UIPortalComposer.class, null);
         uiComposer.setId("UIPortalComposer");
        
         UIPortal uiPortal = Util.getUIPortal();
         uiWorkingWS.setBackupUIPortal(uiPortal);

         UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
         PortalDataMapper.toUIPortal(editPortal, userConfig);
         uiEditWS.setUIComponent(editPortal);

         // Check if edit current portal
         if (uiPortal.getName().equals(editPortal.getName()))
         {
            editPortal.setSelectedNode(uiPortal.getSelectedNode());
            editPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
            editPortal.setSelectedPath(uiPortal.getSelectedPath());
            UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
            siteBody.setUIComponent(null);
         }

         editPortal.refreshUIPage();
         portalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
         uiWorkingWS.setRenderedChild(UIPortalApplication.UI_EDITTING_WS_ID);

         prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
         prContext.setFullRender(true);
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

                 
         UserPortalConfigService service = event.getSource().getApplicationComponent(UserPortalConfigService.class);
         String defaultPortalName = service.getDefaultPortal();

         PortalRequestContext prContext = Util.getPortalRequestContext();
         UIPortalApplication uiPortalApp = Util.getUIPortalApplication();

         if (defaultPortalName.equals(portalName))
         {
            uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.delete-default-portal",
               new String[]{defaultPortalName}, ApplicationMessage.WARNING));
            return;
         }

         UserPortalConfig config = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
         if (config != null && config.getPortalConfig().isModifiable())
         {
            service.removeUserPortalConfig(portalName);
         }
         else if (config != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
               new String[]{config.getPortalConfig().getName()}));;
            return;
         }
         else
         {
            if (uicomp.stillKeptInPageList(portalName))
            {
               uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
                  new String[]{portalName}));
            }
            return;
         }

         if (config == null && !Util.getUIPortal().getName().equals(portalName))
         {
            uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
               new String[]{portalName}));
            return;
         }

         if (config == null || Util.getUIPortal().getName().equals(portalName))
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

   static public class ChangeApplicationListActionListener extends EventListener<UIPortal>
   {
      public void execute(Event<UIPortal> event) throws Exception
      {
         UIPortal uiPortal = event.getSource();
         UIPortalApplication application = uiPortal.getAncestorOfType(UIPortalApplication.class);
         UIPortalComposer composer = application.findFirstComponentOfType(UIPortalComposer.class);
         UITabPane uiTabPane = composer.getChild(UITabPane.class);
         String appListId = uiTabPane.getChild(UIApplicationList.class).getId();
         uiTabPane.replaceChild(appListId, composer.createUIComponent(UIApplicationList.class, null, null));
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

   {
      public void execute(Event<UIPortal> event) throws Exception
      {
         String portalName = event.getRequestContext().getRequestParameter("portalName");
         UIPortal uiPortal = Util.getUIPortal();
         UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
         UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
         if (portalName != null
            && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null)
         {
            uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist", new String[]{portalName}));
            return;
         }

         UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
         UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
         portalForm.setPortalOwner(portalName);
         portalForm.setBindingBean();
         uiMaskWS.setWindowSize(700, -1);
         event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

      {
         UIPageNodeForm uiForm = event.getSource();
         UIPageSelector2 pageSelector = uiForm.findFirstComponentOfType(UIPageSelector2.class);

         PortalRequestContext pcontext = Util.getPortalRequestContext();
         UIPortalApplication uiPortalApp = Util.getUIPortalApplication();

         UIFormInputSet uiInputSet = pageSelector.getChild(UIFormInputSet.class);
         List<UIComponent> children = uiInputSet.getChildren();
         /*********************************************************************/
         for (UIComponent uiChild : children)
         {
            if (uiChild instanceof UIFormInputBase)
            {
               UIFormInputBase uiInput = (UIFormInputBase)uiChild;
               if (!uiInput.isValid())
                  continue;
               List<Validator> validators = uiInput.getValidators();
               if (validators == null)
                  continue;
               try
               {
                  for (Validator validator : validators)
                     validator.validate(uiInput);
               }
               catch (MessageException ex)
               {
                  uiPortalApp.addMessage(ex.getDetailMessage());
                  return;
               }
               catch (Exception ex)
               {
                  //TODO:  This is a  critical exception and should be handle  in the UIApplication
                  uiPortalApp.addMessage(new ApplicationMessage(ex.getMessage(), null));
                  return;
               }
            }
         }

         UserACL userACL = uiForm.getApplicationComponent(UserACL.class);

         String ownerId = uiForm.getOwner();
         String[] accessPermission = new String[1];
         accessPermission[0] = "*:" + ownerId;
         String editPermission = userACL.getMakableMT() + ":" + ownerId;
        
         if (PortalConfig.PORTAL_TYPE.equals(uiForm.getOwnerType()))
         {
            UIPortal uiPortal = Util.getUIPortal();
            accessPermission = uiPortal.getAccessPermissions();
            editPermission = uiPortal.getEditPermission();
         }
        
        
         UIFormStringInput uiPageName = uiInputSet.getChildById("pageName");
         UIFormStringInput uiPageTitle = uiInputSet.getChildById("pageTitle");

         Page page = new Page();
         page.setOwnerType(uiForm.getOwnerType());
         page.setOwnerId(ownerId);
         page.setName(uiPageName.getValue());
         String title = uiPageTitle.getValue();;
         if (title == null || title.trim().length() < 1)
            title = page.getName();
         page.setTitle(title);

         page.setShowMaxWindow(false);

         page.setAccessPermissions(accessPermission);
         page.setEditPermission(editPermission);

         userACL.hasPermission(page);

         page.setModifiable(true);
         if (page.getChildren() == null)
            page.setChildren(new ArrayList<ModelObject>());

         // check page is exist
         DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
         Page existPage = dataService.getPage(page.getPageId());
         if (existPage != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
         }

         // save page to database
         dataService.create(page);
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

               registerInputSet.removeChildById(UIRegisterInputSet.CAPTCHA);
               registerInputSet.setCaptchaInputAvailability(false);
            }
         }
        
         UIPortalApplication portalApp = Util.getUIPortalApplication();
         if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
            pcontext.setApplicationMode(PortletMode.VIEW);
        
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

    */
   public boolean canEdit()
   {
      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortalRequestContext prc = (PortalRequestContext)context.getParentAppRequestContext();
      UIPortalApplication portalApp = (UIPortalApplication)prc.getUIApplication();
      UIPortal portal = portalApp.getShowedUIPortal();

      //
      try
      {
         PageNode node = portal.getSelectedNode();
View Full Code Here

Examples of org.exoplatform.portal.webui.workspace.UIPortalApplication

   }

   private boolean hasEditPermissionOnNavigation() throws Exception
   {
      PageNavigation selectedNavigation = getSelectedNavigation();
      UIPortalApplication portalApp = Util.getUIPortalApplication();
      UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
      if (selectedNavigation == null || userACL == null)
      {
         return false;
      }
      else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.