Package org.exoplatform.portal.webui.page

Examples of org.exoplatform.portal.webui.page.UIPage


    */
   public static void setNextState(UIPortlet uiPortlet, WindowState state)
   {
      if (state != null)
      {
         UIPage uiPage = uiPortlet.getAncestorOfType(UIPage.class);
         if (state == WindowState.MAXIMIZED)
         {
            uiPortlet.setCurrentWindowState(WindowState.MAXIMIZED);
            if (uiPage != null)
            {
               uiPage.setMaximizedUIPortlet(uiPortlet);
            }
         }
         else if (state == WindowState.MINIMIZED)
         {
            uiPortlet.setCurrentWindowState(WindowState.MINIMIZED);
            if (uiPage != null)
            {
               uiPage.setMaximizedUIPortlet(null);
            }
         }
         else
         {
            uiPortlet.setCurrentWindowState(WindowState.NORMAL);
            if (uiPage != null)
            {
               uiPage.setMaximizedUIPortlet(null);
            }
         }
      }
   }
View Full Code Here


         UIPortal uiPortal = uiPortalApp.getShowedUIPortal();
         UIEditInlineWorkspace editInlineWS = event.getSource().getParent();
         UIWorkingWorkspace uiWorkingWS = editInlineWS.getParent();
         UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);

         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);
            PageNodeEvent<UIPortal> pnevent =
               new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE,
                  (uiPortal.getSelectedNode() != null ? uiPortal.getSelectedNode().getUri() : null));
            uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
            JavascriptManager jsManager = event.getRequestContext().getJavascriptManager();
            jsManager.addJavascript("eXo.portal.portalMode=" + UIPortalApplication.NORMAL_MODE + ";");
            return;
         }
         UIPortalComposer composer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
         composer.setEditted(false);
        
         // If it is a page creation wizard
         if (composer.isUsedInWizard())
         {
            UIWizard wizard = (UIWizard)uiToolPanel.getUIComponent();
            int step = wizard.getCurrentStep();
            step++;
            Event<UIComponent> uiEvent =
               wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
            uiEvent.broadcast();
            return;
         }

         // Perform model update
         DataStorage dataService = uiWorkingWS.getApplicationComponent(DataStorage.class);
         dataService.save(page);
         uiToolPanel.setUIComponent(null);

         // Synchronize model object with UIPage object, that seems  redundant but in fact
         // mandatory to have consequent edit actions (on the same page) work properly
         page = dataService.getPage(page.getPageId());
         uiPage.getChildren().clear();
         PortalDataMapper.toUIPage(uiPage, page);
        
         // Update UIPage cache on UIPortal
         uiPortal.setUIPage(pageId, uiPage);
         uiPortal.refreshUIPage();
View Full Code Here

         uiParent.removeChildById(id);
         UIPortalComposer portalComposer = uiApp.findFirstComponentOfType(UIPortalComposer.class);
         portalComposer.setEditted(true);

         UIPage uiPage = uiParent.getAncestorOfType(UIPage.class);
         if (uiPage != null && uiPage.getMaximizedUIPortlet() != null)
         {
            if (id.equals(uiPage.getMaximizedUIPortlet().getId()))
            {
               uiPage.setMaximizedUIPortlet(null);
            }
         }
         else
         {
            UIPortal uiPortal = Util.getUIPortal();
View Full Code Here

         if (windowState == null)
         {
            windowState = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID).trim();
         }
         UIPageBody uiPageBody = uiPortlet.getAncestorOfType(UIPageBody.class);
         UIPage uiPage = uiPortlet.getAncestorOfType(UIPage.class);
         if (windowState.equals(WindowState.MAXIMIZED.toString()))
         {
            if (uiPageBody != null)
            {
               uiPortlet.setCurrentWindowState(WindowState.MAXIMIZED);
               //TODO dang.tung: we have to set maximized portlet for page because in ShowMaxWindow case the PageBody isn't rendered
               //                reference: UIPortalLifecycle, UIPageLifecycle, renderChildren() in UIPageBody
               //---------------------------------------------------------
               if (uiPage != null && uiPage.isShowMaxWindow())
               {
                  uiPage.setMaximizedUIPortlet(uiPortlet);
               }
               //---------------------------------------------------------
               uiPageBody.setMaximizedUIComponent(uiPortlet);
            }
            else
            {
               uiPortlet.setCurrentWindowState(WindowState.NORMAL);
            }
            return;
         }
         if (uiPageBody != null)
         {
            UIPortlet maxPortlet = (UIPortlet)uiPageBody.getMaximizedUIComponent();
            if (maxPortlet == uiPortlet)
            {
               uiPageBody.setMaximizedUIComponent(null);
            }
         }
         //TODO dang.tung: for ShowMaxWindow situation
         //----------------------------------------------------------------
         if (uiPage != null)
         {
            UIPortlet maxPortlet = (UIPortlet)uiPage.getMaximizedUIPortlet();
            if (maxPortlet == uiPortlet)
            {
               uiPage.setMaximizedUIPortlet(null);
            }
         }
         //-----------------------------------------------------------------
         if (windowState.equals(WindowState.MINIMIZED.toString()))
         {
View Full Code Here

   private static void addApplicationToPage(Event<UIAddNewApplication> event, boolean atStartup) throws Exception
   {
      UIPortal uiPortal = Util.getUIPortal();

      UIPortalApplication uiPortalApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
      UIPage uiPage;
      if (uiPortal.isRendered())
      {
         uiPage = uiPortal.findFirstComponentOfType(UIPage.class);
      }
      else
      {
         UIPortalToolPanel uiPortalToolPanel = uiPortalApp.findFirstComponentOfType(UIPortalToolPanel.class);
         uiPage = uiPortalToolPanel.findFirstComponentOfType(UIPage.class);
      }

      String applicationId = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);

      Application application = event.getSource().getApplication(applicationId);
      ApplicationType appType = application.getType();
      String portletName = application.getApplicationName();
//      String appGroup = application.getApplicationGroup();

      // TODO review windowId for eXoWidget and eXoApplication
      UIComponent component = null;
      if (ApplicationType.GADGET.equals(appType))
      {
         UIGadget uiGadget = uiPage.createUIComponent(event.getRequestContext(), UIGadget.class, null, null);

         uiGadget.setState(new TransientApplicationState<Gadget>(portletName));

         // Set Properties For gadget
         int posX = (int)(Math.random() * 400);
         int posY = (int)(Math.random() * 200);

         uiGadget.getProperties().put(UIApplication.locationX, String.valueOf(posX));
         uiGadget.getProperties().put(UIApplication.locationY, String.valueOf(posY));

         component = uiGadget;
      }
      else
      {
         boolean remote = ApplicationType.WSRP_PORTLET.equals(appType);

         UIPortlet uiPortlet = uiPage.createUIComponent(UIPortlet.class, null, null);

         CloneApplicationState appState;
         Object appId;
         if (!remote)
         {
            appState = new CloneApplicationState<Portlet>(application.getId());
         }
         else
         {
            appState = new CloneApplicationState<WSRPState>(application.getId());
         }

         ApplicationType applicationType = remote ? ApplicationType.WSRP_PORTLET : ApplicationType.PORTLET;
         PortletState portletState = new PortletState(appState, applicationType);

         uiPortlet.setState(portletState);
         uiPortlet.setPortletInPortal(false);

         if (atStartup)
         {
            uiPortlet.getProperties().setProperty("appStatus", "HIDE");
         }

         if (application != null)
         {
            String displayName = application.getDisplayName();
            if (displayName != null)
            {
               uiPortlet.setTitle(displayName);
            }
            else if (portletName != null)
            {
               uiPortlet.setTitle(portletName);
            }
            uiPortlet.setDescription(application.getDescription());
            List<String> accessPers = application.getAccessPermissions();
            String[] accessPermissions = accessPers.toArray(new String[accessPers.size()]);
            uiPortlet.setAccessPermissions(accessPermissions);

            component = uiPortlet;
         }
      }

      // Add component to page
      uiPage.addChild(component);

      // Save all changes
      if (uiPage.isModifiable())
      {
         Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
         if (page.getChildren() == null)
         {
            page.setChildren(new ArrayList<ModelObject>());
View Full Code Here

         {
            uiToolPanel.setUIComponent(null);
            return;
         }

         UIPage uiPage = Util.toUIPage(node, uiToolPanel);
         UIPageBody uiPageBody = uiPortalApp.findFirstComponentOfType(UIPageBody.class);
         if (uiPageBody.getUIComponent() != null)
         {
            uiPageBody.setUIComponent(null);
         }
View Full Code Here

   {
      JavascriptManager jsmanager = context.getJavascriptManager();
      UIComponent uiComponent = getUIComponent();
      if (uiComponent instanceof UIPage)
      {
         UIPage uiPage = (UIPage)uiComponent;
         //if(uiPage.isShowMaxWindow()){
         if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()))
         {
            uiComponent.processRender(context);
            if (showMaskLayer)
            {
               jsmanager.importJavascript("eXo.core.UIMaskLayer");
View Full Code Here

      UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
      uiWorkingWS.setRenderedChild(UIPortal.class);
      UIPortal uiPortal = uiWorkingWS.findFirstComponentOfType(UIPortal.class);

      UIContainer uiContainer = Util.findUIComponent(uiPortal, UIContainer.class, UIPage.class);
      UIPage uiPage = uiPortal.findFirstComponentOfType(UIPage.class);
      UIPortlet uiPortlet = Util.findUIComponent(uiPortal, UIPortlet.class, UIPage.class);

      String name = "";
      if (uiContainer != null && uiContainer.isShowEditControl())
         name = "'UIContainer'";
      else if (uiPage != null && uiPage.isShowEditControl())
         name = "'UIPage'";
      else if (uiPortlet != null && uiPortlet.isShowEditControl())
         name = "'UIPortlet'";

      getPortalRequestContext().getJavascriptManager().addCustomizedOnLoadScript(
View Full Code Here

   {
      UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
      uiWorkingWS.setRenderedChild(UIPortalToolPanel.class);
      UIPortalToolPanel uiPortalToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);

      UIPage uiPage = uiPortalToolPanel.findFirstComponentOfType(UIPage.class);
      UIContainer uiContainer = uiPage.findFirstComponentOfType(UIContainer.class);
      UIPortlet uiPortlet = uiPage.findFirstComponentOfType(UIPortlet.class);

      String name = "";
      if (uiContainer != null && uiContainer.isShowEditControl())
         name = "UIContainer";
      else if (uiPortlet != null && uiPortlet.isShowEditControl())
View Full Code Here

      return toUIPage(page, uiParent);
   }

   static public UIPage toUIPage(Page page, UIComponent uiParent) throws Exception
   {
      UIPage uiPage = Util.getUIPortal().findFirstComponentOfType(UIPage.class);
      if (uiPage != null && uiPage.getId().equals(page.getId()))
         return uiPage;
      WebuiRequestContext context = Util.getPortalRequestContext();
      if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
      {
         uiPage = uiParent.createUIComponent(context, UIDesktopPage.class, null, null);
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.webui.page.UIPage

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.