gatein SVN: r4472 - epp/docs/branches/EPP_5_0_Branch.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-10-04 00:40:23 -0400 (Mon, 04 Oct 2010)
New Revision: 4472
Removed:
epp/docs/branches/EPP_5_0_Branch/5.0.1_Release_Notes/
Log:
No longer required. Moved to EPP_5_0_1_Branch tag
14 years, 2 months
gatein SVN: r4471 - epp/docs/tags.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-10-04 00:36:40 -0400 (Mon, 04 Oct 2010)
New Revision: 4471
Added:
epp/docs/tags/EPP_5_0_1_Branch/
Log:
JBEPP-372: Tagging post release
Copied: epp/docs/tags/EPP_5_0_1_Branch (from rev 4470, epp/docs/branches/EPP_5_0_Branch)
14 years, 2 months
gatein SVN: r4470 - in portal/branches/branch-GTNPORTAL-1493: web/portal/src/main/webapp/groovy/portal/webui/application and 4 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-10-04 00:21:02 -0400 (Mon, 04 Oct 2010)
New Revision: 4470
Added:
portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl
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/application/UIAddNewApplication.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
Modified:
portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
Log:
Revert commit for code refactoring of the Page object type
Modified: portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2010-10-02 16:14:42 UTC (rev 4469)
+++ portal/branches/branch-GTNPORTAL-1493/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -197,18 +197,4 @@
{
return "Page[ownerType=" + ownerType + ",ownerId=" + ownerId + ",name=" + name + "]";
}
-
- @Override
- public final String getFactoryId()
- {
- String factoryId = super.getFactoryId();
- if (factoryId != null)
- {
- return factoryId;
- }
- else
- {
- return "org.exoplatform.portal.webui.page.UIPage";
- }
- }
}
\ No newline at end of file
Copied: portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl (from rev 4374, portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl)
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl (rev 0)
+++ portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/application/UIAddNewApplication.gtmpl 2010-10-04 04:21:02 UTC (rev 4470)
@@ -0,0 +1,152 @@
+<%
+ import org.exoplatform.web.application.Parameter;
+ List appCategories = uicomponent.getApplicationCategories();
+%>
+<div class="UIAddApplication" id="UIAddNewApplication">
+ <div class="UIBarStyle">
+ <div class="TitleBar">
+ <div class="LeftBar">
+ <div class="RightBar">
+ <div class="MiddleBar"><%=_ctx.appRes("UIAddNewApplication.label.AddApplication")%></div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="ContentContainerDetail">
+ <div class="CategoryContainer">
+
+ <div class="UITabContentContainer">
+ <div class="UITabContent" style="display: block">
+ <div class="UIAddPortlet">
+ <div class="UIItemSelector">
+ <div class="LeftColumnStyle">
+ <div class="ItemListContainer">
+
+ <div class="ItemListTitle">
+ <div class="TitleIcon ItemListIcon"><span></span></div>
+ <div class="Title"><%=_ctx.appRes("UIAddNewApplication.label.Categories")%></div>
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ <div class="ItemList">
+ <%
+ boolean selected = true;
+ for(category in appCategories){
+ %>
+ <div onmouseout="eXo.webui.UIItemSelector.onOver(this, false);" onmouseover="eXo.webui.UIItemSelector.onOver(this, true);" onclick="eXo.webui.UIItemSelector.onClick(this);" class="<%= selected ? "SelectedItem" : "" %> Item" title="<%=category.getDisplayName()%>">
+ <div class="LeftItem">
+ <div class="RightItem"><div id="<%=category.getName()%>" class="ItemTitle"><div class="CenterItemTitle"><%=category.getDisplayName()%></div></div></div>
+ </div>
+ </div>
+ <%
+ selected = false;
+ }
+ %>
+ </div>
+
+ </div>
+
+ <div class="ItemDetailList">
+ <div class="ItemDetailTitle">
+ <div class="TitleIcon ViewListIcon"><span></span></div>
+ <div class="Title"><%=_ctx.appRes("UIAddNewApplication.label.Select")%></div>
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ <div class="ApplicationListContainer">
+ <% if(appCategories==null || appCategories.isEmpty()){ %>
+ <div class="ItemDetail" style="display:block">
+ <div class="NoneAppsMessage" style="display:block">
+ <%=_ctx.appRes("UIAddNewApplication.label.NoneApp")%>
+ </div>
+ </div>
+ <% } %>
+ <%
+ selected = true;
+ for(category in appCategories) {
+ List listApplication = category.getApplications();
+ %>
+ <div class="ItemDetail" style="display: <%= selected ? "block" : "none" %>">
+
+ <%
+ for(application in listApplication) {
+ String srcBG = application.getApplicationGroup() + "/skin/DefaultSkin/portletIcons/" + application.getApplicationName()+ ".png";
+ String srcNormalBG = "/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png";
+
+ //Create add Application Ajax request URL
+ String callingAction = "AddApplication";
+ String addApplicationURL = uicomponent.event(callingAction, application.getId());
+ String addToStartup = uicomponent.event("AddToStartup", application.getId());
+ %>
+ <div class="Application">
+ <div class="ApplicationDescription">
+ <div onclick="$addApplicationURL" title="<%= application.getDisplayName() %>" class="PortletIcon">
+ <span><img src="/$srcBG" alt="" onError="src='$srcNormalBG'" /></span>
+ </div>
+ <div class="ApplicationContent">
+ <div class="TitleBarApplication">
+ <div class="Title"><%= application.getDisplayName() %></div>
+ <div class="ApplicationButton">
+ <% if (org.exoplatform.web.application.Application.EXO_PORTLET_TYPE.equals(application.getApplicationType())) { %>
+ <div title="<%=_ctx.appRes("UIAddNewApplication.label.AddToStartup")%>" class="AddToStartUp" onclick="$addToStartup" ><span></span></div>
+ <%}%>
+ <div title="<%=_ctx.appRes("UIAddNewApplication.label.Add")%>" class="AddButton" onclick="$addApplicationURL" ><span></span></div>
+ </div>
+ </div>
+ <div class="ApplicationContentLabel">
+ <div class="ContentLabel">
+ <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Type")%></span>
+ <span class="RightLabel"><%=application.getApplicationType()%></span>
+ </div>
+ <div class="ContentLabel">
+ <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Created")%></span>
+ <span class="RightLabel">eXo Platform SAS.</span>
+ </div>
+ <div class="ContentLabel">
+ <span class="LeftLabel"><%=_ctx.appRes("UIAddNewApplication.label.Description")%></span>
+ <span class="RightLabel"><%= application.getDescription() %></span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="ClearRight"><span ></span></div>
+ </div>
+ <%
+ }
+ %>
+
+ </div>
+ <%
+ selected = false;
+ }
+ %>
+ </div>
+ </div>
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div class="ActionButton LightBlueStyle" onclick="<%= uicomponent.event("Close") %>" >
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes("UIAddNewApplication.label.Close")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+</div>
\ No newline at end of file
Copied: portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl (from rev 4373, 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 (rev 0)
+++ portal/branches/branch-GTNPORTAL-1493/web/portal/src/main/webapp/groovy/portal/webui/page/UIDesktopPage.gtmpl 2010-10-04 04:21:02 UTC (rev 4470)
@@ -0,0 +1,307 @@
+<%
+ 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
Copied: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java (from rev 4374, portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java)
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java (rev 0)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -0,0 +1,289 @@
+/**
+ * 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.application;
+
+import org.exoplatform.application.registry.Application;
+import org.exoplatform.application.registry.ApplicationCategory;
+import org.exoplatform.application.registry.ApplicationRegistryService;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.config.model.CloneApplicationState;
+import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
+import org.exoplatform.portal.webui.page.UIPage;
+import org.exoplatform.portal.webui.portal.UIPortal;
+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.portal.webui.workspace.UIPortalToolPanel;
+import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/** Created by The eXo Platform SARL Author : Anh Nguyen ntuananh.vn(a)gmail.com Oct 18, 2007 */
+@ComponentConfig(template = "system:/groovy/portal/webui/application/UIAddNewApplication.gtmpl", events = {
+ @EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class),
+ @EventConfig(listeners = UIAddNewApplication.AddApplicationActionListener.class),
+ @EventConfig(listeners = UIAddNewApplication.AddToStartupActionListener.class)})
+public class UIAddNewApplication extends UIContainer
+{
+
+ private List<ApplicationCategory> listAppCategories;
+
+ private UIComponent uiComponentParent;
+
+ private boolean isInPage;
+
+ public List<ApplicationCategory> getApplicationCategories() throws Exception
+ {
+ return listAppCategories;
+ }
+
+ public List<ApplicationCategory> getApplicationCategories(String remoteUser,
+ ApplicationType[] applicationType) throws Exception
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ ApplicationRegistryService prService = (ApplicationRegistryService)container.getComponentInstanceOfType(ApplicationRegistryService.class);
+
+ if (applicationType == null)
+ {
+ applicationType = new ApplicationType[0];
+ }
+
+ List<ApplicationCategory> appCategories = prService.getApplicationCategories(remoteUser,
+ applicationType);
+
+ if (appCategories == null)
+ {
+ appCategories = new ArrayList();
+ }
+ else
+ {
+ Iterator<ApplicationCategory> cateItr = appCategories.iterator();
+ while (cateItr.hasNext())
+ {
+ ApplicationCategory cate = cateItr.next();
+ List<Application> applications = cate.getApplications();
+ if (applications.size() < 1)
+ {
+ cateItr.remove();
+ }
+ }
+ }
+ listAppCategories = appCategories;
+
+ return listAppCategories;
+
+ }
+
+ public UIComponent getUiComponentParent()
+ {
+ return uiComponentParent;
+ }
+
+ public void setUiComponentParent(UIComponent uiComponentParent)
+ {
+ this.uiComponentParent = uiComponentParent;
+ }
+
+ public boolean isInPage()
+ {
+ return isInPage;
+ }
+
+ public void setInPage(boolean isInPage)
+ {
+ this.isInPage = isInPage;
+ }
+
+ private Application getApplication(String id) throws Exception
+ {
+
+ List<ApplicationCategory> pCategories = getApplicationCategories();
+
+ for (ApplicationCategory pCategory : pCategories)
+ {
+ List<Application> applications = pCategory.getApplications();
+ for (Application application : applications)
+ {
+ if (application.getId().equals(id))
+ {
+ return application;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Add Application to UiPage
+ *
+ * @param event
+ * @throws Exception
+ */
+ 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>());
+ }
+ DataStorage dataService = uiPortalApp.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
+ }
+
+ PortalRequestContext pcontext = Util.getPortalRequestContext();
+ UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+ pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ pcontext.setFullRender(true);
+ }
+
+ static public class AddApplicationActionListener extends EventListener<UIAddNewApplication>
+ {
+ public void execute(Event<UIAddNewApplication> event) throws Exception
+ {
+ if (event.getSource().isInPage())
+ {
+ addApplicationToPage(event, false);
+ }
+ }
+ }
+
+ static public class AddToStartupActionListener extends EventListener<UIAddNewApplication>
+ {
+ public void execute(Event<UIAddNewApplication> event) throws Exception
+ {
+ if (event.getSource().isInPage())
+ {
+ addApplicationToPage(event, true);
+ }
+ }
+ }
+}
Copied: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java (from rev 4373, 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 (rev 0)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -0,0 +1,235 @@
+/**
+ * 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
Modified: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2010-10-02 16:14:42 UTC (rev 4469)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -146,9 +146,14 @@
return uiPage;
}
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
- uiPage = createUIComponent(context, clazz, null, null);
-
+ if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
+ {
+ uiPage = createUIComponent(context, UIDesktopPage.class, null, null);
+ }
+ else
+ {
+ uiPage = createUIComponent(context, UIPage.class, null, null);
+ }
PortalDataMapper.toUIPage(uiPage, page);
uiPortal.setUIPage(page.getId(), uiPage);
Modified: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-10-02 16:14:42 UTC (rev 4469)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -350,10 +350,16 @@
}
UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);
-
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
- UIPage uiPage = uiWizard.createUIComponent(context, clazz, null, null);
-
+ UIPage uiPage;
+ if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
+ {
+ uiPage = uiWizard.createUIComponent(context, UIDesktopPage.class, null, null);
+ }
+ else
+ {
+ uiPage = uiWizard.createUIComponent(context, UIPage.class, null, null);
+ }
+
PortalDataMapper.toUIPage(uiPage, page);
uiPagePreview.setUIComponent(uiPage);
Modified: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2010-10-02 16:14:42 UTC (rev 4469)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/util/Util.java 2010-10-04 04:21:02 UTC (rev 4470)
@@ -19,14 +19,13 @@
package org.exoplatform.portal.webui.util;
-import java.util.List;
-
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
+import org.exoplatform.portal.webui.page.UIDesktopPage;
import org.exoplatform.portal.webui.page.UIPage;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.portal.UIPortalComponent;
@@ -39,6 +38,8 @@
import org.exoplatform.webui.core.UIComponentDecorator;
import org.exoplatform.webui.event.Event;
+import java.util.List;
+
/**
* Jun 5, 2006
*/
@@ -225,10 +226,14 @@
if (uiPage != null && uiPage.getId().equals(page.getId()))
return uiPage;
WebuiRequestContext context = Util.getPortalRequestContext();
-
- Class<? extends UIPage> clazz = Class.forName(page.getFactoryId()).asSubclass(UIPage.class);
- uiPage = uiParent.createUIComponent(context, clazz, null, null);
-
+ if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
+ {
+ uiPage = uiParent.createUIComponent(context, UIDesktopPage.class, null, null);
+ }
+ else
+ {
+ uiPage = uiParent.createUIComponent(context, UIPage.class, null, null);
+ }
PortalDataMapper.toUIPage(uiPage, page);
return uiPage;
}
14 years, 2 months
gatein SVN: r4469 - in components/wsrp/trunk/admin-gui/src: test/java/org/gatein/wsrp/other and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 12:14:42 -0400 (Sat, 02 Oct 2010)
New Revision: 4469
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
Log:
- Improved error message creation, hopefully.
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java 2010-10-02 16:03:25 UTC (rev 4468)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/BeanContext.java 2010-10-02 16:14:42 UTC (rev 4469)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -71,8 +71,9 @@
* @param target
* @param message
* @param severity
+ * @param additionalParams
*/
- protected abstract void createMessage(String target, String message, Object severity);
+ protected abstract void createMessage(String target, String message, Object severity, Object... additionalParams);
protected abstract Object getErrorSeverity();
@@ -152,10 +153,10 @@
*/
public void createErrorMessageFrom(String target, Exception e)
{
- Throwable cause = e.getCause();
+// Throwable cause = e.getCause();
String localizedMessage = getLocalizedMessageOrExceptionName(e);
- String message = localizedMessage + (cause != null ? "\n" + getMessageFromBundle(CAUSE) + getLocalizedMessageOrExceptionName(cause) : "");
- createMessage(target, message, getErrorSeverity());
+// String message = localizedMessage + (cause != null ? "\n" + getMessageFromBundle(CAUSE) + getLocalizedMessageOrExceptionName(cause) : "");
+ createMessage(target, localizedMessage, getErrorSeverity(), e.getCause());
}
/**
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-10-02 16:03:25 UTC (rev 4468)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/JSFBeanContext.java 2010-10-02 16:14:42 UTC (rev 4469)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -60,12 +60,12 @@
return facesContext.getExternalContext().getSessionMap();
}
- protected void createMessage(String target, String message, Object severity)
+ protected void createMessage(String target, String message, Object severity, Object... additionalParams)
{
outputMessage(target, message, severity);
}
- public static void outputMessage(String target, String message, Object severity)
+ public static void outputMessage(String target, String message, Object severity, Object... additionalParams)
{
if (ParameterValidation.isNullOrEmpty(target))
{
@@ -96,7 +96,12 @@
log.info("Couldn't resolve component target: " + target);
}
- FacesMessage msg = new FacesMessage(jsfSeverity, message, message);
+ String details = message;
+ if (additionalParams != null && additionalParams.length > 0)
+ {
+ details = ((Exception)additionalParams[0]).getLocalizedMessage();
+ }
+ FacesMessage msg = new FacesMessage(jsfSeverity, message, details);
facesContext.addMessage(target, msg);
}
Modified: components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-10-02 16:03:25 UTC (rev 4468)
+++ components/wsrp/trunk/admin-gui/src/test/java/org/gatein/wsrp/other/ConsumerBeanTestCase.java 2010-10-02 16:14:42 UTC (rev 4469)
@@ -131,7 +131,7 @@
throw new NotYetImplemented();
}
- protected void createMessage(String target, String message, Object severity)
+ protected void createMessage(String target, String message, Object severity, Object... addtionalParams)
{
// ignore for tests
}
14 years, 2 months
gatein SVN: r4468 - in components/wsrp/trunk/wsrp-producer-war/src/main: java/org/gatein/wsrp/endpoints/v2 and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 12:03:25 -0400 (Sat, 02 Oct 2010)
New Revision: 4468
Removed:
components/wsrp/trunk/wsrp-producer-war/src/main/webapp/WEB-INF/classes/
Modified:
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/PortletManagementEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/RegistrationEndpoint.java
components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/ServiceDescriptionEndpoint.java
Log:
- GTNWSRP-53: Completely deactivate handler. Extensions had already been deactivated in the handler proper.
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/MarkupEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -79,7 +79,6 @@
import org.oasis.wsrp.v2.UnsupportedMode;
import org.oasis.wsrp.v2.UnsupportedWindowState;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -97,7 +96,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp_services.wsdl",
endpointInterface = "org.oasis.wsrp.v1.WSRPV1MarkupPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class MarkupEndpoint extends WSRPBaseEndpoint implements WSRPV1MarkupPortType
{
public void performBlockingInteraction(
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/PortletManagementEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -71,7 +71,6 @@
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.SetPortletProperties;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -89,7 +88,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp_services.wsdl",
endpointInterface = "org.oasis.wsrp.v1.WSRPV1PortletManagementPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class PortletManagementEndpoint extends WSRPBaseEndpoint implements WSRPV1PortletManagementPortType
{
public void getPortletPropertyDescription(
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/RegistrationEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -48,7 +48,6 @@
import org.oasis.wsrp.v2.RegistrationState;
import org.oasis.wsrp.v2.ResourceSuspended;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -66,7 +65,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp_services.wsdl",
endpointInterface = "org.oasis.wsrp.v1.WSRPV1RegistrationPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class RegistrationEndpoint extends WSRPBaseEndpoint implements WSRPV1RegistrationPortType
{
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v1/ServiceDescriptionEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -46,7 +46,6 @@
import org.oasis.wsrp.v2.ResourceSuspended;
import org.oasis.wsrp.v2.ServiceDescription;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -63,7 +62,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp_services.wsdl",
endpointInterface = "org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class ServiceDescriptionEndpoint extends WSRPBaseEndpoint implements WSRPV1ServiceDescriptionPortType
{
public void getServiceDescription(
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/MarkupEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -68,7 +68,6 @@
import org.oasis.wsrp.v2.UserContext;
import org.oasis.wsrp.v2.WSRPV2MarkupPortType;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -87,7 +86,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp-2.0-services.wsdl",
endpointInterface = "org.oasis.wsrp.v2.WSRPV2MarkupPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class MarkupEndpoint extends WSRPBaseEndpoint implements WSRPV2MarkupPortType
{
public void handleEvents(
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/PortletManagementEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/PortletManagementEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/PortletManagementEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -72,10 +72,8 @@
import org.oasis.wsrp.v2.UserContext;
import org.oasis.wsrp.v2.WSRPV2PortletManagementPortType;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
-
import java.util.ArrayList;
import java.util.List;
@@ -92,7 +90,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp-2.0-services.wsdl",
endpointInterface = "org.oasis.wsrp.v2.WSRPV2PortletManagementPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class PortletManagementEndpoint extends WSRPBaseEndpoint implements WSRPV2PortletManagementPortType
{
public void getPortletPropertyDescription(
@@ -230,9 +227,9 @@
throws AccessDenied, ExportByValueNotSupported, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
ExportPortlets exportPortlets = WSRPTypeFactory.createExportPortlets(registrationContext, portletContext, userContext, lifetime.value, exportByValueRequired);
-
+
ExportPortletsResponse exportPortletsResponse = producer.exportPortlets(exportPortlets);
-
+
lifetime.value = exportPortletsResponse.getLifetime();
exportContext.value = exportPortletsResponse.getExportContext();
exportedPortlet.value = exportPortletsResponse.getExportedPortlet();
@@ -254,9 +251,9 @@
throws AccessDenied, ExportNoLongerValid, InconsistentParameters, InvalidRegistration, InvalidUserCategory, MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
{
ImportPortlets importPortlets = WSRPTypeFactory.createImportPortlets(registrationContext, importContext, importPortlet, userContext, lifetime);
-
+
ImportPortletsResponse importPortletsResponse = producer.importPortlets(importPortlets);
-
+
importedPortlets.value = importPortletsResponse.getImportedPortlets();
importFailed.value = importPortletsResponse.getImportFailed();
resourceList.value = importPortletsResponse.getResourceList();
@@ -269,9 +266,9 @@
@WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v2:types") UserContext userContext)
{
ReleaseExport releaseExport = WSRPTypeFactory.createReleaseExport(registrationContext, exportContext, userContext);
-
+
producer.releaseExport(releaseExport);
-
+
//release export isn't suppose to return anything
return new ArrayList<Extension>();
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/RegistrationEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/RegistrationEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/RegistrationEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -44,7 +44,6 @@
import org.oasis.wsrp.v2.UserContext;
import org.oasis.wsrp.v2.WSRPV2RegistrationPortType;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -62,7 +61,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp-2.0-services.wsdl",
endpointInterface = "org.oasis.wsrp.v2.WSRPV2RegistrationPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class RegistrationEndpoint extends WSRPBaseEndpoint implements WSRPV2RegistrationPortType
{
public void register(
Modified: components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/ServiceDescriptionEndpoint.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/ServiceDescriptionEndpoint.java 2010-10-02 14:59:33 UTC (rev 4467)
+++ components/wsrp/trunk/wsrp-producer-war/src/main/java/org/gatein/wsrp/endpoints/v2/ServiceDescriptionEndpoint.java 2010-10-02 16:03:25 UTC (rev 4468)
@@ -45,7 +45,6 @@
import org.oasis.wsrp.v2.UserContext;
import org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType;
-import javax.jws.HandlerChain;
import javax.jws.WebParam;
import javax.xml.ws.Holder;
import java.util.List;
@@ -62,7 +61,6 @@
wsdlLocation = "/WEB-INF/wsdl/wsrp-2.0-services.wsdl",
endpointInterface = "org.oasis.wsrp.v2.WSRPV2ServiceDescriptionPortType"
)
-@HandlerChain(file = "wshandlers.xml")
public class ServiceDescriptionEndpoint extends WSRPBaseEndpoint implements WSRPV2ServiceDescriptionPortType
{
public void getServiceDescription(
14 years, 2 months
gatein SVN: r4467 - in portal/branches/wsrp2-integration: component/wsrp and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 10:59:33 -0400 (Sat, 02 Oct 2010)
New Revision: 4467
Modified:
portal/branches/wsrp2-integration/component/wsrp/pom.xml
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
portal/branches/wsrp2-integration/pom.xml
Log:
- Updated to WSRP Beta01-SNAPSHOT.
- Adapted for API changes.
Modified: portal/branches/wsrp2-integration/component/wsrp/pom.xml
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/pom.xml 2010-10-02 14:48:30 UTC (rev 4466)
+++ portal/branches/wsrp2-integration/component/wsrp/pom.xml 2010-10-02 14:59:33 UTC (rev 4467)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component</artifactId>
@@ -125,6 +126,17 @@
<build>
<plugins>
+ <!--<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java</exclude>
+ <exclude>org/gatein/portal/wsrp/MOPPortalStructureProvider.java</exclude>
+ <exclude>org/gatein/portal/wsrp/state/migration/**/*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java 2010-10-02 14:48:30 UTC (rev 4466)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java 2010-10-02 14:59:33 UTC (rev 4467)
@@ -41,7 +41,7 @@
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.StatefulPortletContext;
-import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
import java.util.Collection;
import java.util.Collections;
@@ -54,7 +54,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class MOPPortalStructureProvider implements PortalStructureProvider
+public class MOPPortalStructureProvider implements ConsumerStructureProvider
{
private final POMSessionManager pomManager;
private Map<String, PageInfo> pageInfos;
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java 2010-10-02 14:48:30 UTC (rev 4466)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java 2010-10-02 14:59:33 UTC (rev 4467)
@@ -26,9 +26,9 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
-import org.gatein.wsrp.api.SessionEvent;
-import org.gatein.wsrp.api.SessionEventBroadcaster;
-import org.gatein.wsrp.api.SessionEventListener;
+import org.gatein.wsrp.api.session.SessionEvent;
+import org.gatein.wsrp.api.session.SessionEventBroadcaster;
+import org.gatein.wsrp.api.session.SessionEventListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-10-02 14:48:30 UTC (rev 4466)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-10-02 14:59:33 UTC (rev 4467)
@@ -32,7 +32,7 @@
import org.gatein.portal.wsrp.state.migration.mapping.ExportInfoMapping;
import org.gatein.portal.wsrp.state.migration.mapping.ExportInfosMapping;
import org.gatein.portal.wsrp.state.migration.mapping.ExportedStateMapping;
-import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
import org.gatein.wsrp.consumer.migration.ExportInfo;
import org.gatein.wsrp.consumer.migration.MigrationService;
@@ -46,7 +46,7 @@
*/
public class JCRMigrationService implements MigrationService, StoresByPathManager<ExportInfo>
{
- private PortalStructureProvider structureProvider;
+ private ConsumerStructureProvider structureProvider;
private JCRPersister persister;
private static final String EXPORT_INFOS_PATH = ExportInfosMapping.NODE_NAME;
private int exportInfosCount = -1;
@@ -61,12 +61,12 @@
persister.initializeBuilderFor(mappingClasses);
}
- public PortalStructureProvider getStructureProvider()
+ public ConsumerStructureProvider getStructureProvider()
{
return structureProvider;
}
- public void setStructureProvider(PortalStructureProvider structureProvider)
+ public void setStructureProvider(ConsumerStructureProvider structureProvider)
{
ParameterValidation.throwIllegalArgExceptionIfNull(structureProvider, "PortalStructureProvider");
this.structureProvider = structureProvider;
Modified: portal/branches/wsrp2-integration/pom.xml
===================================================================
--- portal/branches/wsrp2-integration/pom.xml 2010-10-02 14:48:30 UTC (rev 4466)
+++ portal/branches/wsrp2-integration/pom.xml 2010-10-02 14:59:33 UTC (rev 4467)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-Beta04</org.gatein.pc.version>
<org.picketlink.idm>1.1.5.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-Alpha03</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.0-Beta01-SNAPSHOT</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
14 years, 2 months
gatein SVN: r4466 - in portal/branches/wsrp2-integration/webui/portal/src/main/java: org/exoplatform/portal/application/state and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 10:48:30 -0400 (Sat, 02 Oct 2010)
New Revision: 4466
Added:
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/NavigationalStateProviderPlugin.java
Removed:
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/InternalPropertiesPlugin.java
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/PublicPropertiesPlugin.java
Modified:
portal/branches/wsrp2-integration/webui/portal/src/main/java/conf/portal/configuration.xml
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/AbstractContextualPropertyProviderPlugin.java
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManager.java
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManagerImpl.java
portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
Log:
- Reversed merged of webui -r4244:4240 to remove issue with commits 4242 and related 4243.
Modified: portal/branches/wsrp2-integration/webui/portal/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/conf/portal/configuration.xml 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/conf/portal/configuration.xml 2010-10-02 14:48:30 UTC (rev 4466)
@@ -43,29 +43,22 @@
<type>org.exoplatform.portal.application.state.ContextualPropertyManagerImpl</type>
<component-plugins>
<component-plugin>
- <name>PublicPropertiesPlugin</name>
+ <name>NavigationalStateProviderPlugin</name>
<set-method>addPlugin</set-method>
- <type>org.exoplatform.portal.application.state.PublicPropertiesPlugin</type>
+ <type>org.exoplatform.portal.application.state.NavigationalStateProviderPlugin</type>
<init-params>
<value-param>
<name>namespaceURI</name>
<description>Namespace URI</description>
- <value>http://www.gatein.org/xml/ns/prp_1_0</value>
+ <value>http://www.gatein.org</value>
</value-param>
+ <value-param>
+ <name>prefix</name>
+ <description>Prefix of QName</description>
+ <value>gtn</value>
+ </value-param>
</init-params>
</component-plugin>
- <component-plugin>
- <name>InternalPropertiesPlugin</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.portal.application.state.InternalPropertiesPlugin</type>
- <init-params>
- <value-param>
- <name>namespaceURI</name>
- <description>Namespace URI</description>
- <value>http://www.gatein.org/xml/ns/internal_prp_1_0</value>
- </value-param>
- </init-params>
- </component-plugin>
</component-plugins>
</component>
</configuration>
Modified: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/AbstractContextualPropertyProviderPlugin.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/AbstractContextualPropertyProviderPlugin.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/AbstractContextualPropertyProviderPlugin.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -23,35 +23,16 @@
import javax.xml.namespace.QName;
import org.exoplatform.container.component.BaseComponentPlugin;
-import org.exoplatform.container.xml.InitParams;
import org.exoplatform.portal.webui.application.UIPortlet;
-import org.gatein.common.logging.Logger;
-import org.gatein.common.logging.LoggerFactory;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * @date
*/
+
public abstract class AbstractContextualPropertyProviderPlugin extends BaseComponentPlugin
{
- /** . */
- protected final Logger log = LoggerFactory.getLogger(getClass());
+ public abstract Map<QName, String[]> getProperties(UIPortlet portletWindow);
- /** . */
- protected final String namespaceURI;
-
- protected AbstractContextualPropertyProviderPlugin(InitParams params)
- {
- this.namespaceURI = params.getValueParam("namespaceURI").getValue();
- }
-
- public abstract void getProperties(UIPortlet portletWindow, Map<QName, String[]> properties);
-
- protected final void addProperty(Map<QName, String[]> map, QName qname, String value)
- {
- if (value != null)
- {
- map.put(qname, new String[]{value});
- }
- }
}
Modified: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManager.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManager.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManager.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -23,19 +23,16 @@
import javax.xml.namespace.QName;
import org.exoplatform.portal.webui.application.UIPortlet;
+import org.picocontainer.Startable;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * @date
*/
-public interface ContextualPropertyManager
+
+public interface ContextualPropertyManager extends Startable
{
- /**
- * Returns a map of qualified names and string values for contextual properties of the portlet.
- *
- * @param portletWindow the portlet
- * @return the contextual properties
- */
public Map<QName, String[]> getProperties(UIPortlet portletWindow);
}
Modified: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManagerImpl.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManagerImpl.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/ContextualPropertyManagerImpl.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -27,42 +27,41 @@
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.portal.webui.application.UIPortlet;
-import org.picocontainer.Startable;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
* @date
*/
-public class ContextualPropertyManagerImpl implements ContextualPropertyManager, Startable
+public class ContextualPropertyManagerImpl implements ContextualPropertyManager
{
- private ArrayList<AbstractContextualPropertyProviderPlugin> propertyProviderPlugins;
+ private List<AbstractContextualPropertyProviderPlugin> propertyProviderPlugins;
public ContextualPropertyManagerImpl() throws Exception
{
propertyProviderPlugins = new ArrayList<AbstractContextualPropertyProviderPlugin>();
}
+ @Override
public Map<QName, String[]> getProperties(UIPortlet portletWindow)
{
Map<QName, String[]> whatPortletWindowSee = new HashMap<QName, String[]>();
-
- // No need to use an iterator here
- for (int i = 0;i < propertyProviderPlugins.size();i++)
+
+ for(AbstractContextualPropertyProviderPlugin plugin : propertyProviderPlugins)
{
- AbstractContextualPropertyProviderPlugin plugin = propertyProviderPlugins.get(i);
- plugin.getProperties(portletWindow, whatPortletWindowSee);
+ whatPortletWindowSee.putAll(plugin.getProperties(portletWindow));
}
-
- //
+
return whatPortletWindowSee;
}
+ @Override
public void start()
{
}
+ @Override
public void stop()
{
}
@@ -74,4 +73,5 @@
propertyProviderPlugins.add((AbstractContextualPropertyProviderPlugin)plugin);
}
}
+
}
Deleted: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/InternalPropertiesPlugin.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/InternalPropertiesPlugin.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/InternalPropertiesPlugin.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 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.application.state;
-
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.portal.webui.application.UIPortlet;
-
-import javax.xml.namespace.QName;
-import java.util.Map;
-
-/**
- * This plugins setup properties that are NOT publicly supported, however it is recommanded to not change anything
- * but there are no guarantees that it won't change.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class InternalPropertiesPlugin extends AbstractContextualPropertyProviderPlugin
-{
-
- /** . */
- private final QName storageIdQName;
-
- /** . */
- private final QName storageNameQName;
-
- public InternalPropertiesPlugin(InitParams params)
- {
- super(params);
-
- //
- this.storageIdQName = new QName(namespaceURI, "storage_id");
- this.storageNameQName = new QName(namespaceURI, "storage_name");
- }
-
- @Override
- public void getProperties(UIPortlet portletWindow, Map<QName, String[]> properties)
- {
- addProperty(properties, storageIdQName, portletWindow.getStorageId());
- addProperty(properties, storageNameQName, portletWindow.getStorageName());
- }
-}
Copied: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/NavigationalStateProviderPlugin.java (from rev 4240, portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/state/NavigationalStateProviderPlugin.java)
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/NavigationalStateProviderPlugin.java (rev 0)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/NavigationalStateProviderPlugin.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -0,0 +1,86 @@
+/*
+ * 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.application.state;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.webui.application.UIPortlet;
+import org.exoplatform.portal.webui.page.UIPage;
+import org.exoplatform.portal.webui.portal.UIPortal;
+import org.exoplatform.portal.webui.util.Util;
+
+/**
+ * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
+ * @date
+ */
+
+public class NavigationalStateProviderPlugin extends AbstractContextualPropertyProviderPlugin
+{
+
+ private final String NAMESPACE_URI;
+
+ private final String PREFIX;
+
+ public NavigationalStateProviderPlugin(InitParams params) throws Exception
+ {
+ NAMESPACE_URI = params.getValueParam("namespaceURI").getValue();
+ PREFIX = params.getValueParam("prefix").getValue();
+ }
+
+ @Override
+ public Map<QName, String[]> getProperties(UIPortlet portletWindow)
+ {
+ Map<QName, String[]> whatThisPluginProvides = new HashMap<QName, String[]>();
+
+ try
+ {
+ UIPortal currentSite = Util.getUIPortalApplication().getShowedUIPortal();
+ PageNode currentNode = currentSite.getSelectedNode();
+
+ //Provides current node URI
+ whatThisPluginProvides.put(new QName(NAMESPACE_URI, "navigation_uri", PREFIX), new String[]{currentNode.getUri()});
+
+ //Provides current page name
+ UIPage currentPage = currentSite.getUIPage(currentNode.getPageReference());
+ if(currentPage != null)
+ {
+ whatThisPluginProvides.put(new QName(NAMESPACE_URI, "page_name", PREFIX), new String[]{currentPage.getTitle()});
+ }
+
+ //Provides current site type
+ whatThisPluginProvides.put(new QName(NAMESPACE_URI, "site_type", PREFIX), new String[]{currentSite.getOwnerType()});
+
+ //Provides current site name
+ whatThisPluginProvides.put(new QName(NAMESPACE_URI, "site_name", PREFIX), new String[]{currentSite.getOwner()});
+
+ return whatThisPluginProvides;
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ return null;
+ }
+ }
+
+}
Deleted: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/PublicPropertiesPlugin.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/PublicPropertiesPlugin.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/application/state/PublicPropertiesPlugin.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -1,108 +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.application.state;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.portal.config.model.PageNode;
-import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.page.UIPage;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.util.Util;
-
-/**
- * This plugin setup properties that are publicly supported, hence this is part of a public API
- * and once published its contract must not change whatsoever.
- *
- * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
- */
-public class PublicPropertiesPlugin extends AbstractContextualPropertyProviderPlugin
-{
-
- /** . */
- private final QName navigationURIQName;
-
- /** . */
- private final QName pageNameQName;
-
- /** . */
- private final QName siteTypeQName;
-
- /** . */
- private final QName siteNameQName;
-
- /** . */
- private final QName windowShowInfoBarQName;
-
- /** . */
- private final QName windowHeight;
-
- /** . */
- private final QName windowWidth;
-
- public PublicPropertiesPlugin(InitParams params) throws Exception
- {
- super(params);
-
- //
- this.navigationURIQName = new QName(namespaceURI, "navigation_uri");
- this.pageNameQName = new QName(namespaceURI, "page_name");
- this.siteTypeQName = new QName(namespaceURI, "site_type");
- this.siteNameQName = new QName(namespaceURI, "site_name");
- this.windowWidth = new QName(namespaceURI, "window_width");
- this.windowHeight = new QName(namespaceURI, "window_height");
- this.windowShowInfoBarQName = new QName(namespaceURI, "window_show_info_bar");
- }
-
- @Override
- public void getProperties(UIPortlet portletWindow, Map<QName, String[]> properties)
- {
- try
- {
- UIPortal currentSite = Util.getUIPortalApplication().getShowedUIPortal();
- PageNode currentNode = currentSite.getSelectedNode();
-
- // Navigation related properties
- addProperty(properties, navigationURIQName, currentNode.getUri());
-
- // Page related properties
- UIPage currentPage = currentSite.getUIPage(currentNode.getPageReference());
- if(currentPage != null)
- {
- addProperty(properties, pageNameQName, currentPage.getTitle());
- }
-
- // Site related properties
- addProperty(properties, siteTypeQName, currentSite.getOwnerType());
- addProperty(properties, siteNameQName, currentSite.getOwner());
-
- // Window related properties
- addProperty(properties, windowShowInfoBarQName, Boolean.toString(portletWindow.getShowInfoBar()));
- addProperty(properties, windowWidth, portletWindow.getWidth());
- addProperty(properties, windowHeight, portletWindow.getHeight());
- }
- catch (Exception ex)
- {
- log.error("Could not obtain contextual properties for portlet " + portletWindow, ex);
- }
- }
-}
Modified: portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
--- portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-10-02 12:29:53 UTC (rev 4465)
+++ portal/branches/wsrp2-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-10-02 14:48:30 UTC (rev 4466)
@@ -154,7 +154,7 @@
private List<QName> supportedPublishingEvents_;
- private Map<QName, String> supportedPublicParams_;
+ private List<String> supportedPublicParams_;
private boolean portletInPortal_ = true;
@@ -354,37 +354,12 @@
supportedProcessingEvents_ = supportedProcessingEvents;
}
- public Map<QName, String> getSupportedPublicRenderParameters()
+ public List<String> getSupportedPublicRenderParameters()
{
- if (supportedPublicParams_ == null)
- {
- if (producedOfferedPortlet == null)
- {
- log.info("Could not find portlet with ID : " + producerOfferedPortletContext.getId());
- return Collections.emptyMap();
- }
-
- //
- Collection<ParameterInfo> parameters = (Collection<ParameterInfo>)producedOfferedPortlet.getInfo().getNavigation().getPublicParameters();
- Map<QName, String> supportedPublicParams = Collections.emptyMap();
- for (ParameterInfo parameter : parameters)
- {
- if (supportedPublicParams.isEmpty())
- {
- supportedPublicParams = new HashMap<QName, String>();
- }
- supportedPublicParams.put(parameter.getName(), parameter.getId());
- }
-
- //
- this.supportedPublicParams_ = supportedPublicParams;
- }
-
- //
return supportedPublicParams_;
}
- public void setSupportedPublicRenderParameters(Map<QName, String> supportedPublicRenderParameters)
+ public void setSupportedPublicRenderParameters(List<String> supportedPublicRenderParameters)
{
supportedPublicParams_ = supportedPublicRenderParameters;
}
@@ -560,35 +535,46 @@
/**
* Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter
- * qname given as method argument. If the qname is supported, the public render parameter id is returned otherwise
- * false is returned.
- *
- * @param supportedPublicParam the supported public parameter qname
- * @return the supported public parameter id
+ * given as a method argument
*/
- public String supportsPublicParam(QName supportedPublicParam)
+ public boolean supportsPublicParam(String supportedPublicParam)
{
- Map<QName, String> supportedPublicParams = getSupportedPublicRenderParameters();
- return supportedPublicParams.get(supportedPublicParam);
- }
+ if (supportedPublicParams_ == null)
+ {
- /**
- * Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter
- * id given as a method argument.
- *
- * @param supportedPublicParamId the supported public parameter id
- * @return true if the supported public parameter id is supported
- */
- public boolean supportsPublicParam(String supportedPublicParamId)
- {
- Map<QName, String> supportedPublicParams = getSupportedPublicRenderParameters();
- boolean supported = supportedPublicParams.containsValue(supportedPublicParamId);
- if (supported && log.isDebugEnabled())
+ //
+ if (producedOfferedPortlet == null)
+ {
+ log.info("Could not find portlet with ID : " + producerOfferedPortletContext.getId());
+ return false;
+ }
+
+ //
+ Collection<ParameterInfo> parameters =
+ (Collection<ParameterInfo>)producedOfferedPortlet.getInfo().getNavigation().getPublicParameters();
+ supportedPublicParams_ = new ArrayList<String>();
+ for (ParameterInfo parameter : parameters)
+ {
+ supportedPublicParams_.add(parameter.getId());
+ }
+ }
+
+ //
+ for (String publicParam : supportedPublicParams_)
{
- log.debug("The Portlet " + producerOfferedPortletContext.getId()
- + " supports the public render parameter : " + supportedPublicParamId);
+ if (publicParam.equals(supportedPublicParam))
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("The Portlet " + producerOfferedPortletContext.getId()
+ + " supports the public render parameter : " + supportedPublicParam);
+ }
+ return true;
+ }
}
- return true;
+
+ //
+ return false;
}
/**
@@ -632,19 +618,16 @@
}
}
- // Handle exposed portal contextual properties
+ //Handle exposed portal contextual properties
ContextualPropertyManager propertyManager = this.getApplicationComponent(ContextualPropertyManager.class);
Map<QName, String[]> exposedPortalState = propertyManager.getProperties(this);
- for(QName prpQName : exposedPortalState.keySet())
+ for(QName qName : exposedPortalState.keySet())
{
- String prpId = supportsPublicParam(prpQName);
- if(prpId != null)
+ if(supportsPublicParam(qName.getLocalPart()))
{
- publicParamsMap.put(prpId, exposedPortalState.get(prpQName));
+ publicParamsMap.put(qName.toString(), exposedPortalState.get(qName));
}
}
-
- //
return publicParamsMap;
}
14 years, 2 months
gatein SVN: r4465 - portal/branches.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 08:29:53 -0400 (Sat, 02 Oct 2010)
New Revision: 4465
Added:
portal/branches/wsrp2-integration/
Log:
Recreating WSRP 2 integration branch from revision 4464.
Copied: portal/branches/wsrp2-integration (from rev 4464, portal/trunk)
14 years, 2 months
gatein SVN: r4464 - portal/branches.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-02 08:25:24 -0400 (Sat, 02 Oct 2010)
New Revision: 4464
Removed:
portal/branches/wsrp2-integration/
Log:
Removing branch so that it can be recreated with a more appropriate state.
14 years, 2 months
gatein SVN: r4463 - components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-01 19:53:13 -0400 (Fri, 01 Oct 2010)
New Revision: 4463
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
Log:
- GTNWSRP-86: fixed target for consumer creation error messages
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2010-10-01 23:51:55 UTC (rev 4462)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ConsumerManagerBean.java 2010-10-01 23:53:13 UTC (rev 4463)
@@ -62,7 +62,7 @@
static final String REFRESH_MODIFY = "bean_consumermanager_refresh_modify";
static final String REQUESTED_CONSUMER_ID = "id";
static final String SESSION_CONSUMER_ID = "consumerId";
- private static final String MESSAGE_TARGET = "createConsumer:consumerName";
+ private static final String MESSAGE_TARGET = "add-consumer:createConsumer:consumerName";
public ConsumerRegistry getRegistry()
{
@@ -181,7 +181,7 @@
{
try
{
- WSRPConsumer consumer = getRegistry().createConsumer(selectedId, null, null);
+ getRegistry().createConsumer(selectedId, null, null);
setConsumerIdInSession(false);
return CONFIGURE_CONSUMER;
}
14 years, 2 months