Author: hoang_to
Date: 2010-09-24 04:36:07 -0400 (Fri, 24 Sep 2010)
New Revision: 4374
Removed:
portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
Log:
Move the UIComponent used only in WebOS project out of GateIn
Deleted:
portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl 2010-09-24
08:23:23 UTC (rev 4373)
+++
portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl 2010-09-24
08:36:07 UTC (rev 4374)
@@ -1,307 +0,0 @@
-<%
- import org.exoplatform.portal.webui.application.UIPortlet;
- import org.exoplatform.web.application.JavascriptManager;
- import org.exoplatform.portal.config.model.PageNavigation;
- import org.exoplatform.portal.config.model.PageNode;
- def rcontext = _ctx.getRequestContext();
- JavascriptManager jsmanager = rcontext.getJavascriptManager();
-
- jsmanager.importJavascript('eXo.desktop.UIDesktop');
- jsmanager.importJavascript('eXo.webui.UIPopupSelectCategory');
- jsmanager.importJavascript('eXo.desktop.UIWindow');
- jsmanager.importJavascript('eXo.webui.UIRightClickPopupMenu');
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.SaveTitle='" +
_ctx.appRes("UIDashboardContainer.label.SaveTitle") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.CancelTitle='" +
_ctx.appRes("UIDashboardContainer.label.CancelTitle") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.Cache='" +
_ctx.appRes("UIDashboardContainer.label.Cache") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.Debug='" +
_ctx.appRes("UIDashboardContainer.label.Debug") + "';");
- jsmanager.addCustomizedOnLoadScript('eXo.desktop.UIDockbar.initNav();');
-
- String docBase = rcontext.getRequestContextPath();
- String comId = uicomponent.getId();
- boolean modifiable = uicomponent.isModifiable();
-
- void renderSinglePageNode(PageNavigation nav, PageNode node) {
- String href = uicomponent.event("ChangePage", nav.getId() + "::" +
node.getUri());
- String icon = node.getIcon();
- if(icon == null) icon = "DefaultPageIcon";
- print """
- <div class="MenuItem">
- <div class="LabelItem">
- <div class="Icon $icon" style="padding-left: 18px">
- <div class="LabelText"><a href="#"
onclick="$href">$node.resolvedLabel</a></div>
- </div>
- </div>
- </div>
- """;
- }
-
- void renderPageNode(PageNavigation nav, PageNode node) {
- String href = uicomponent.event("ChangePage", nav.getId() + "::"
+ node.getUri());
- String icon = node.getIcon();
- String scrollUpTitle = _ctx.appRes("UIExoStart.tooltip.scrollUp");
- String scrollDownTitle = _ctx.appRes("UIExoStart.tooltip.scrollDown");
- if(icon == null) icon = "DefaultPageIcon";
- print """
- <div class="MenuItem">
- <div class="LabelItem">
- <div class="Icon $icon" style="padding-left: 18px">
- <div class="BlackArrowIcon">
- <div class="LabelText "><a href="#"
onclick="$href">$node.resolvedLabel</a></div>
- </div>
- </div>
- </div>
- <div class="MenuItemContainer">
- <div class="StartMenuDecorator">
- <div class="StartMenuTL">
- <div class="StartMenuTR">
- <div class="StartMenuTC"><span></span></div>
- </div>
- </div>
- <div class="StartMenuML">
- <div class="StartMenuMR">
- <div class="StartMenuBG" style="padding-bottom: 6px">
- <div class="TopNavigator" style="display: none;"
title="$scrollUpTitle">
- <div
class="UpNavigatorIcon"><span></span></div>
- </div>
- <div class="BlockMenu">
- <div class="MenuContainer">
- """;
- for(child in node.getChildren()) {
- if(child.getChildren() != null && child.getChildren().size() > 0)
renderPageNode(nav, child);
- else renderSinglePageNode(nav, child);
- }
- print """
- </div>
- </div>
- <div class="BottomNavigator" style="display: none;"
title="$scrollDownTitle">
- <div
class="DownNavigatorIcon"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="StartMenuBL">
- <div class="StartMenuBR">
- <div class="StartMenuBC"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- """;
- }
-
- void renderPageNavigation(PageNavigation navigation) {
- nodes = navigation.getNodes();
- if(nodes.size() < 1) return;
- String navTitle = _ctx.appRes("UIPageNavigation.label.titleBar");
- navTitle = navTitle.replace("{0}", navigation.ownerId);
- print """
- <div class="PageNavigationBlock">
- <div class="DecoratorBlock">
- <div class="PageOwnerContainer">
- <div class="TitleBar">$navTitle </div>
- """;
- for(node in nodes) {
- if(node.getChildren() != null && node.getChildren().size() > 0) {
- renderPageNode(navigation, node);
- }
- else renderSinglePageNode(navigation, node);
- }
- print """
- </div>
- </div>
- </div>
- """;
- }
-
- void renderNavigations() {
- String label = _ctx.appRes(uicomponent.getId() + ".item.PageNavigation");
- String scrollUpTitle = _ctx.appRes("UIExoStart.tooltip.scrollUp");
- String scrollDownTitle = _ctx.appRes("UIExoStart.tooltip.scrollDown");
- navigations = uicomponent.getNavigations();
- //if (navigations != null && navigations.size() > 0 &&
navigations.get(0).getNodes().size() > 0) {
- if (navigations != null && navigations.size() > 0) {
- print """
- <div class="MenuItemContainer NavigationContainer" style="position:
absolute; top: -450px;">
- <div class="StartMenuDecorator">
- <div class="StartMenuTL">
- <div class="StartMenuTR">
- <div class="StartMenuTC"><span></span></div>
- </div>
- </div>
- <div class="StartMenuML">
- <div class="StartMenuMR">
- <div class="StartMenuBG" style="padding: 5px 0px;">
- <div class="TopNavigator" style="display: none;"
title="$scrollUpTitle">
- <div
class="UpNavigatorIcon"><span></span></div>
- </div>
- <div class="BlockMenu">
- <div class="MenuContainer">
- """;
- for(navigation in navigations) {
- renderPageNavigation(navigation);
- }
- print """
- </div>
- </div>
- <div class="BottomNavigator" style="display: none;"
title="$scrollDownTitle">
- <div
class="DownNavigatorIcon"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- <div class="StartMenuBL">
- <div class="StartMenuBR">
- <div class="StartMenuBC"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- """;
- }
- }
-
-%>
-
-
-<div class="UIPage" id="UIPage-${uicomponent.id}">
- <div class="META-DATA-BLOCK" style="display: none">
- <div class="id">$uicomponent.id</div>
- <div
class="title"><%=_ctx.appRes("UIPage.label.title")%></div>
- <div
class="description"><%=_ctx.appRes("UIPage.label.description")%></div>
- </div>
- <div class="VIEW-PAGE">
- <div id="UIPage">
- <div class="UIPageDesktop" id="UIPageDesktop">
- <%int x = 15; y = 15 %>
- <%for(uiChild in uicomponent.getChildren()) {
- if(!(uiChild instanceof UIPortlet)) {
- uicomponent.renderUIComponent(uiChild);
- continue;
- }
-
- String popupId = uiChild.getId();
- String title = uiChild.getTitle();
- if(title == null || title.trim().length() < 1) {
- title = popupId;
- uiChild.setTitle(title);
- }
- uiChild.setShowInfoBar(true);
- uiChild.setPortletStyle("Window");
- uicomponent.renderUIComponent(uiChild);
-
- String posX = uiChild.getProperties().get("locationX");
- String posY = uiChild.getProperties().get("locationY");
-
- if(posX == null) posX = (String)x;
- if(posY == null) posY = (String)y;
-
- jsmanager.addJavascript("eXo.desktop.UIWindow.init('UIWindow-${popupId}',
true, ${posX}, ${posY});");
- %>
- <% x += 10; y += 20;%>
- <%}%>
-
- <%//String containerMouseOver =
"eXo.desktop.UIDockbar.containerMouseOver();";%>
- <div class="UIDockBar" id="UIDockBar"
onmouseover="eXo.desktop.UIDockbar.startDockBarEvt(event);">
- <div id="DockNavigation" class="UIExoStart"
style="position: absolute; display: none; width: 0px;">
- <div class="StartMenuContainer">
- <% renderNavigations(); %>
- </div>
- </div>
- <div class="UIRightClickPopupMenu" id="DockbarContextMenu"
onmousedown="event.cancelBubble = true;">
- <div class="UIContextMenuContainer" >
- <div class="TopLeftRightClickPopupMenu">
- <div class="TopRightRightClickPopupMenu">
- <div
class="TopCenterRightClickPopupMenu"><span></span></div>
- </div>
- </div>
- <div class="MiddleLeftRightClickPopupMenu">
- <div class="MiddleRightRightClickPopupMenu">
- <div class="UIRightPopupMenuContainer">
- <div class="MenuItem">
- <a href="javascript:eXo.desktop.UIDesktop.removeApp('<%=uicomponent.url("RemoveChild",
"_objectid_")%>')" onclick="return
eXo.webui.UIRightClickPopupMenu.prepareObjectId(event, this);"
- class="ItemIcon
CloseDockBarIcon"><%=_ctx.appRes("UIPageDesktop.action.Close")%></a>
- </div>
- <div class="MenuItem">
- <a class="ItemIcon QuitDockBarIcon"
href="javascript:eXo.desktop.UIDesktop.removeWindowContent('_objectid_')"
onclick="return eXo.webui.UIRightClickPopupMenu.prepareObjectId(event, this);"
><%=_ctx.appRes("UIPageDesktop.action.Quit")%></a>
- </div>
- <div
class="RightClickCustomItem"><%=_ctx.appRes("UIPageDesktop.action.action.Open")%></div>
- </div>
- </div>
- </div>
- <div class="BottomLeftRightClickPopupMenu">
- <div class="BottomRightRightClickPopupMenu">
- <div class="BottomCenterRightClickPopupMenu">
- <div
class="ClickCenterBottom"><span></span></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="DockbarLeft">
- <div class="DockbarRight">
- <div class="DockbarCenter" id="DockbarCenter">
-
- <div class="IconContainer" id="IconContainer"
style="text-align: center;">
- <img id="FixBug" alt=""
src="/eXoResources/skin/sharedImages/Debug1x32.gif" />
-
- <%if(rcontext.getRemoteUser() == null) {%>
- <img id="SignInIcon" class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/Signin.png" alt=""
title=""
- onclick="<%=uicomponent.event("ShowLoginForm",
null);%>" /><span class="Tooltip" style="display:
none;"><%=_ctx.appRes("UIPageDesktop.title.SignIn")%></span>
- <%} else {%>
- <img id="SignOutIcon" class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/Signout.png" alt=""
title=""
- onclick="eXo.portal.logout()" /><span
class="Tooltip" style="display:
none;"><%=_ctx.appRes("UIPageDesktop.title.SignOut")%></span>
- <%} %>
- <img class="Separator" alt=""
src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png"/>
-
- <% String changeLanguageAction =
"if(document.getElementById('UIMaskWorkspace'))
ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'ChangeLanguage',
true));"; %>
- <img id="ChangeLanguageIcon" class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/ChangeLanguage.png"
alt="" title=""
- onclick="$changeLanguageAction" /><span
class="Tooltip" style="display:
none;"><%=_ctx.appRes("UIExoStart.item.ChangeLanguage")%></span>
-
- <img class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/NavigationIcon.png"
alt="" title=""
- id="NavigationIcon"
- onclick="eXo.desktop.UIDockbar.showNavigation(event)"/><span
class="Tooltip" style="display:
none"><%=_ctx.appRes("UIPageDesktop.title.pageNavigation")%></span>
-
- <%if(modifiable) {%>
- <img class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/AddPortlet.png" alt=""
title=""
- id="UIAddApplicationIcon"
-
onclick="<%=uicomponent.event("ShowAddNewApplication")%>"/><span
class="Tooltip" style="display:
none"><%=_ctx.appRes("UIPageDesktop.title.AddApplication")%></span>
- <%}%>
- <img class="Separator" alt=""
src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png"/>
- <%
- def res = rcontext.getApplicationResourceBundle();
- String skin = rcontext.getUIApplication().getSkin();
-
- for(uiChild in uicomponent.getChildren()) {
- if(!(uiChild instanceof UIPortlet)) continue;
- String imgLocation = uiChild.getExoWindowID().getPortletApplicationName() +
"/skin/DefaultSkin/portletIcons/" + uiChild.getExoWindowID().getPortletName();
- String appStatus = uiChild.getProperties().get("appStatus");
- boolean isVisible = "SHOW".equals(appStatus) ||
"HIDE".equals(appStatus);
-
- if(rcontext.getRemoteUser() != null) {
- %>
- <img id="DockItem${uiChild.id}" class="Icon <%=isVisible
? "ShowIcon": ""%>"
onmousedown="eXo.webui.UIRightClickPopupMenu.clickRightMouse(event, this,
'DockbarContextMenu', '${uiChild.id}', null, 1)"
src="/${imgLocation}.png" alt=""
-
onerror="this.src='/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png'"
onclick="eXo.desktop.UIDesktop.showHideWindow('UIWindow-${uiChild.id}',
this);" /><span class="Tooltip" style="display:
none"><%=uiChild.getTitle();%></span>
- <%}else{%>
- <img id="DockItem${uiChild.id}" class="Icon <%=isVisible
? "ShowIcon": ""%>" src="/${imgLocation}.png"
alt=""
-
onerror="this.src='/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png'"
onclick="eXo.desktop.UIDesktop.showHideWindow('UIWindow-${uiChild.id}',
this);" /><span class="Tooltip" style="display:
none"><%=uiChild.getTitle();%></span>
- <%}}%>
-
- <img class="Separator" alt=""
src="/webosResources/skin/Defaultskin/portal/webui/component/view/UIPageDesktop/background/Separator2x1.png"
/>
- <img id="PortletsViewer" class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/ShowPortletsViewer.png"
alt="" title=""/><span class="Tooltip"
style="display:
none;"><%=_ctx.appRes("UIPageDesktop.title.ShowPortletDesktop")%></span>
- <img id="GadgetsViewer" class="Icon"
src="/eXoResources/skin/sharedImages/Icon80x80/HideWidgetsViewer.png"
alt="" title=""/><span class="Tooltip"
style="display:
none;"><%=_ctx.appRes("UIPageDesktop.title.ShowWidgetDesktop")%></span>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- </div>
- </div>
-</div>
-
-<%
- jsmanager.addOnLoadJavascript('eXo.desktop.UIDesktop.init');
- jsmanager.addOnResizeJavascript('eXo.desktop.UIDesktop.fixDesktop');
-%>
\ No newline at end of file
Deleted:
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2010-09-24
08:23:23 UTC (rev 4373)
+++
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2010-09-24
08:36:07 UTC (rev 4374)
@@ -1,235 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.portal.webui.page;
-
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.model.ModelObject;
-import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PageNavigation;
-import org.exoplatform.portal.webui.application.UIAddNewApplication;
-import org.exoplatform.portal.webui.application.UIApplication;
-import org.exoplatform.portal.webui.application.UIGadget;
-import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.navigation.PageNavigationUtils;
-import
org.exoplatform.portal.webui.page.UIPageActionListener.DeleteGadgetActionListener;
-import org.exoplatform.portal.webui.page.UIPageActionListener.RemoveChildActionListener;
-import org.exoplatform.portal.webui.portal.PageNodeEvent;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import
org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.ShowLoginFormActionListener;
-import org.exoplatform.portal.webui.util.PortalDataMapper;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.portlet.WindowState;
-
-/**
- * May 19, 2006
- */
-
-@ComponentConfig(lifecycle = UIPageLifecycle.class, template =
"system:/groovy/portal/webui/page/UIDesktopPage.gtmpl", events = {
- @EventConfig(listeners = ShowLoginFormActionListener.class),
- @EventConfig(listeners = DeleteGadgetActionListener.class),
- @EventConfig(listeners = RemoveChildActionListener.class),
- @EventConfig(listeners = UIDesktopPage.SaveGadgetPropertiesActionListener.class),
- @EventConfig(listeners = UIDesktopPage.SaveWindowPropertiesActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ShowAddNewApplicationActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ChangePageActionListener.class),
- @EventConfig(listeners = UIDesktopPage.ShowPortletActionListener.class)})
-public class UIDesktopPage extends UIPage
-{
-
- public UIDesktopPage()
- {
- setChildren((List<UIComponent>)new
CopyOnWriteArrayList<UIComponent>());
- }
-
- public boolean isShowMaxWindow()
- {
- return true;
- }
-
- public List<PageNavigation> getNavigations() throws Exception
- {
- List<PageNavigation> allNav = Util.getUIPortal().getNavigations();
- String removeUser = Util.getPortalRequestContext().getRemoteUser();
- List<PageNavigation> result = new ArrayList<PageNavigation>();
- for (PageNavigation nav : allNav)
- {
- result.add(PageNavigationUtils.filter(nav, removeUser));
- }
- return result;
- }
-
- static public class SaveGadgetPropertiesActionListener extends
EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String objectId =
event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
- List<UIGadget> uiGadgets = new ArrayList<UIGadget>();
- uiPage.findComponentOfType(uiGadgets, UIGadget.class);
- UIGadget uiGadget = null;
- for (UIGadget ele : uiGadgets)
- {
- if (ele.getId().equals(objectId))
- {
- uiGadget = ele;
- break;
- }
- }
- if (uiGadget == null)
- return;
- String posX = event.getRequestContext().getRequestParameter("posX");
- String posY = event.getRequestContext().getRequestParameter("posY");
- String zIndex =
event.getRequestContext().getRequestParameter(UIApplication.zIndex);
-
- uiGadget.getProperties().put(UIApplication.locationX, posX);
- uiGadget.getProperties().put(UIApplication.locationY, posY);
- uiGadget.getProperties().put(UIApplication.zIndex, zIndex);
-
- if (!uiPage.isModifiable())
- return;
- Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- if (page.getChildren() == null)
- page.setChildren(new ArrayList<ModelObject>());
- DataStorage dataService = uiPage.getApplicationComponent(DataStorage.class);
- dataService.save(page);
- }
- }
-
- static public class SaveWindowPropertiesActionListener extends
EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String objectId =
event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
-
- UIApplication uiApp = uiPage.getChildById(objectId);
- if (uiApp == null)
- return;
-
- /*########################## Save Position ##########################*/
- String posX = event.getRequestContext().getRequestParameter("posX");
- String posY = event.getRequestContext().getRequestParameter("posY");
-
- if (posX != null)
- uiApp.getProperties().put(UIApplication.locationX, posX);
- if (posY != null)
- uiApp.getProperties().put(UIApplication.locationY, posY);
-
- //System.out.println("\n\n\n\n\n\n\n\n\n\n\n SAVE POSX:
"+posX+"\n SAVE POSY: "+posY+"\n\n\n\n\n\n\n\n\n");
- /*########################## Save ZIndex ##########################*/
- String zIndex =
event.getRequestContext().getRequestParameter(UIApplication.zIndex);
-
- if (zIndex != null)
- uiApp.getProperties().put(UIApplication.zIndex, zIndex);
-
- /*########################## Save Dimension ##########################*/
- String windowWidth =
event.getRequestContext().getRequestParameter("windowWidth");
- String windowHeight =
event.getRequestContext().getRequestParameter("windowHeight");
-
- if (windowWidth != null)
- uiApp.getProperties().put("windowWidth", windowWidth);
- if (windowHeight != null)
- uiApp.getProperties().put("windowHeight", windowHeight);
-
- // if(appWidth != null)
uiComponent.getProperties().put(UIApplication.appWidth, appWidth);
- // if(appHeight != null)
uiComponent.getProperties().put(UIApplication.appHeight, appHeight);
-
- // String applicationHeight =
event.getRequestContext().getRequestParameter("applicationHeight");
- // if(applicationHeight != null)
uiComponent.getProperties().put("applicationHeight", applicationHeight);
-
- /*########################## Save Window status (SHOW / HIDE)
##########################*/
- String appStatus =
event.getRequestContext().getRequestParameter(UIApplication.appStatus);
- if (appStatus != null)
- uiApp.getProperties().put(UIApplication.appStatus, appStatus);
-
- // if(!uiPage.isModifiable()) return;
- // Page page = PortalDataMapper.toPageModel(uiPage);
- // UserPortalConfigService configService =
uiPage.getApplicationComponent(UserPortalConfigService.class);
- // if(page.getChildren() == null) page.setChildren(new
ArrayList<Object>());
- // configService.update(page);
- }
- }
-
- static public class ShowAddNewApplicationActionListener extends
EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- UIPortalApplication uiPortalApp =
uiPage.getAncestorOfType(UIPortalApplication.class);
- UIMaskWorkspace uiMaskWorkspace =
uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
-
- UIAddNewApplication uiAddApplication =
uiPage.createUIComponent(UIAddNewApplication.class, null, null);
- uiAddApplication.setInPage(true);
- uiAddApplication.setUiComponentParent(uiPage);
-
uiAddApplication.getApplicationCategories(event.getRequestContext().getRemoteUser(),
null);
-
- uiMaskWorkspace.setWindowSize(700, 375);
- uiMaskWorkspace.setUIComponent(uiAddApplication);
- uiMaskWorkspace.setShow(true);
- event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWorkspace);
- }
- }
-
- static public class ChangePageActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- String uri = event.getRequestContext().getRequestParameter(OBJECTID);
- UIPortal uiPortal = Util.getUIPortal();
- UIPageBody uiPageBody = uiPortal.findFirstComponentOfType(UIPageBody.class);
- if (uiPageBody != null)
- {
- if (uiPageBody.getMaximizedUIComponent() != null)
- {
- UIPortlet currentPortlet =
(UIPortlet)uiPageBody.getMaximizedUIComponent();
- currentPortlet.setCurrentWindowState(WindowState.NORMAL);
- uiPageBody.setMaximizedUIComponent(null);
- }
- }
- PageNodeEvent<UIPortal> pnevent = new
PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
- uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
- }
- }
-
- static public class ShowPortletActionListener extends EventListener<UIPage>
- {
- public void execute(Event<UIPage> event) throws Exception
- {
- UIPage uiPage = event.getSource();
- String portletId =
event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
- UIPortlet uiPortlet = uiPage.getChildById(portletId);
- uiPortlet.getProperties().setProperty("appStatus", "SHOW");
- event.getRequestContext().addUIComponentToUpdateByAjax(uiPortlet);
- }
- }
-
-}
\ No newline at end of file