[gatein-commits] gatein SVN: r4282 - in portal/branches/navcontroller: web/portal/src/main/webapp/groovy/portal/webui/workspace and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 21 06:11:37 EDT 2010


Author: trong.tran
Date: 2010-09-21 06:11:36 -0400 (Tue, 21 Sep 2010)
New Revision: 4282

Modified:
   portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
   portal/branches/navcontroller/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
   portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
   portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
Clear URL parameters before newly rendering a Portlet URL
Use resource locator for the menu toolbars

Modified: portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
===================================================================
--- portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl	2010-09-21 09:57:32 UTC (rev 4281)
+++ portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl	2010-09-21 10:11:36 UTC (rev 4282)
@@ -1,102 +1,108 @@
-<%	
-	import org.exoplatform.portal.config.model.PageNavigation;
-	import org.exoplatform.portal.config.model.PageNode;
-	import org.exoplatform.web.application.JavascriptManager;
-	import org.exoplatform.portal.webui.util.Util ;
-	import org.exoplatform.webui.organization.OrganizationUtils;
-	import org.gatein.common.text.EntityEncoder;
-	
-	def rcontext = _ctx.getRequestContext() ;
-	JavascriptManager jsmanager = rcontext.getJavascriptManager();
-	jsmanager.importJavascript('eXo.portal.UIPortalNavigation');
-	jsmanager.importJavascript('eXo.portal.UIAdminToolbar');
-	jsmanager.addCustomizedOnLoadScript('eXo.portal.UIAdminToolbar.onLoad("' + uicomponent.id + '");');
-		
-	def groupNavigations = uicomponent.getGroupNavigations();
-	def portalURI = Util.getPortalRequestContext().getPortalURI();
-	void renderGroupPageNavigation(PageNavigation navigation) {
-			nodes = navigation.getNodes() ;
-			if(nodes.size() < 1) return ;
-			String navTitle = _ctx.appRes("UIPageNavigation.label.titleBar") ;
-			navTitle = navTitle.replace("{0}", OrganizationUtils.getGroupLabel(navigation.ownerId));
-			print """
-						<div class="TitleBar"><div style="width: 99%" title="$navigation.ownerId">$navTitle</div></div>
-						<div class="SubBlock">
-							""" ;
-							for(int i = 0; i < nodes.size(); i++) {
-								renderPageNode(nodes.get(i), i%2 == 0 ) ;
-							}
-							print """
-						</div>
-			""" ;		
-	}
-	
-	void renderPageNode(PageNode node, boolean flag) {
-		PageNode selectedNode = uicomponent.getSelectedPageNode();
-		String tabStyleNavigation = "";
-		if(selectedNode != null && node.getUri() == selectedNode.getUri()) {			 
-				tabStyleNavigation = "SelectedItem";
-		}
-		
-		boolean hasChild = (node.getChildren() != null && node.getChildren().size() > 0);
-		String clazz = "";
-		if(hasChild) clazz = "ArrowIcon";
-		String	href = Util.getPortalRequestContext().getPortalURI() + node.getUri();
-		String icon = node.getIcon();
-		if(icon == null) icon = "DefaultPageIcon";
-		boolean toolong = (node.resolvedLabel.length() > 60);
-		String label = ( toolong ? node.resolvedLabel.substring(0, 57) + "..." : node.resolvedLabel);
-		String title = "";
-		if(toolong) title = "title='$node.resolvedLabel'";
-		else title = "";
-        EntityEncoder entityEncoder = EntityEncoder.FULL;
-		label = entityEncoder.encode(label);
-		print """
-			<div class="MenuItem $tabStyleNavigation">
-				<div class="$clazz">
-		""";
-						if(node.pageReference != null) {
-								print """<a class="ItemIcon $icon" href="$href" $title>$label</a>""";
-						} else {
-								print """<a class="ItemIcon $icon" href="#" $title>$label</a>""";
-						}
-		print """
-				</div>
-		""" ;
-		if(hasChild) {
-			print """
-				<div class="MenuItemContainer" style="position: absolute; display:none">			
-					<div class="SubBlock">
-			""" ;
-				for(int j = 0; j < node.getChildren().size(); j++) {
-					renderPageNode(node.getChildren().get(j), j%2 == 0);
-				}
-			print """
-					</div>
-				</div>
-			""" ;
-			
-		}
-		print """
-			</div>
-		""" ;			
-	}	
-%> 	
-<div class="UIUserToolBarGroupPortlet" id="$uicomponent.id" >
-	<div class="UIHorizontalTabs">
-		<div class="TabsContainer">	
-			<div class="UITab NormalToolbarTab">
-				<div class="">
-							<a class="GroupIcon TBIcon" href="<%= portalURI + "groupnavigation" %>">Group</a>
-				</div>
-				<% if (!groupNavigations.isEmpty()) { %>
-				<div style="display:none" class="MenuItemContainer">
-				<% for(navigation in groupNavigations) {
-						renderGroupPageNavigation(navigation);
-				} %>
-				</div>
-				<% } %>
-			</div>
-		</div>
-	</div>	
+<%  
+  import org.exoplatform.portal.config.model.PageNavigation;
+  import org.exoplatform.portal.config.model.PageNode;
+  import org.exoplatform.web.application.JavascriptManager;
+  import org.exoplatform.portal.webui.util.Util ;
+  import org.exoplatform.webui.organization.OrganizationUtils;
+  import org.gatein.common.text.EntityEncoder;
+  import org.exoplatform.portal.application.PortalRequestContext;
+  import org.exoplatform.web.url.ControllerURL;
+  
+  def rcontext = _ctx.getRequestContext() ;
+  JavascriptManager jsmanager = rcontext.getJavascriptManager();
+  jsmanager.importJavascript('eXo.portal.UIPortalNavigation');
+  jsmanager.importJavascript('eXo.portal.UIAdminToolbar');
+  jsmanager.addCustomizedOnLoadScript('eXo.portal.UIAdminToolbar.onLoad("' + uicomponent.id + '");');
+    
+  def groupNavigations = uicomponent.getGroupNavigations();
+  def portalURI = Util.getPortalRequestContext().getPortalURI();
+
+  PortalRequestContext pcontext = Util.getPortalRequestContext(); 
+  ControllerURL nodeURL = pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
+  
+  void renderGroupPageNavigation(PageNavigation navigation, ControllerURL nodeURL) {
+      nodes = navigation.getNodes() ;
+      if(nodes.size() < 1) return ;
+      String navTitle = _ctx.appRes("UIPageNavigation.label.titleBar") ;
+      navTitle = navTitle.replace("{0}", OrganizationUtils.getGroupLabel(navigation.ownerId));
+      print """
+            <div class="TitleBar"><div style="width: 99%" title="$navigation.ownerId">$navTitle</div></div>
+            <div class="SubBlock">
+              """ ;
+              for(int i = 0; i < nodes.size(); i++) {
+                renderPageNode(nodes.get(i), nodeURL) ;
+              }
+              print """
+            </div>
+      """ ;   
+  }
+  
+  void renderPageNode(PageNode node, ControllerURL nodeURL) {
+    PageNode selectedNode = uicomponent.getSelectedPageNode();
+    String tabStyleNavigation = "";
+    if(selectedNode != null && node.getUri() == selectedNode.getUri()) {       
+        tabStyleNavigation = "SelectedItem";
+    }
+    
+    boolean hasChild = (node.getChildren() != null && node.getChildren().size() > 0);
+    String clazz = "";
+    if(hasChild) clazz = "ArrowIcon";
+    String actionLink = nodeURL.setResource(node).toString();
+    String icon = node.getIcon();
+    if(icon == null) icon = "DefaultPageIcon";
+    boolean toolong = (node.resolvedLabel.length() > 60);
+    String label = ( toolong ? node.resolvedLabel.substring(0, 57) + "..." : node.resolvedLabel);
+    String title = "";
+    if(toolong) title = "title='$node.resolvedLabel'";
+    else title = "";
+        EntityEncoder entityEncoder = EntityEncoder.FULL;
+    label = entityEncoder.encode(label);
+    print """
+      <div class="MenuItem $tabStyleNavigation">
+        <div class="$clazz">
+    """;
+            if(node.pageReference != null) {
+                print """<a class="ItemIcon $icon" href="$actionLink" $title>$label</a>""";
+            } else {
+                print """<a class="ItemIcon $icon" href="#" $title>$label</a>""";
+            }
+    print """
+        </div>
+    """ ;
+    if(hasChild) {
+      print """
+        <div class="MenuItemContainer" style="position: absolute; display:none">      
+          <div class="SubBlock">
+      """ ;
+        for(int j = 0; j < node.getChildren().size(); j++) {
+          renderPageNode(node.getChildren().get(j), nodeURL);
+        }
+      print """
+          </div>
+        </div>
+      """ ;
+      
+    }
+    print """
+      </div>
+    """ ;     
+  } 
+%>  
+<div class="UIUserToolBarGroupPortlet" id="$uicomponent.id" >
+  <div class="UIHorizontalTabs">
+    <div class="TabsContainer"> 
+      <div class="UITab NormalToolbarTab">
+        <div class="">
+              <a class="GroupIcon TBIcon" href="<%= portalURI + "groupnavigation" %>">Group</a>
+        </div>
+        <% if (!groupNavigations.isEmpty()) { %>
+        <div style="display:none" class="MenuItemContainer">
+        <% for(navigation in groupNavigations) {
+            renderGroupPageNavigation(navigation, nodeURL);
+        } %>
+        </div>
+        <% } %>
+      </div>
+    </div>
+  </div>  
 </div>
\ No newline at end of file

Modified: portal/branches/navcontroller/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl	2010-09-21 09:57:32 UTC (rev 4281)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl	2010-09-21 10:11:36 UTC (rev 4282)
@@ -66,9 +66,9 @@
     <%}%>
     <script type="text/javascript">
       eXo.env.portal.context = "<%=docBase%>" ;
-      <%if(rcontext.getAccessPath() == 0) {%>eXo.env.portal.accessMode = "public" ;<%}
-      else
-      {%>eXo.env.portal.accessMode = "private" ;<%}%>
+      <%
+      if(rcontext.getAccessPath() == 0) {%>eXo.env.portal.accessMode = "public" ;<%}
+      else {%>eXo.env.portal.accessMode = "private" ;<%}%>
       eXo.env.portal.portalName = "<%=rcontext.getPortalOwner()%>" ;
       eXo.env.server.context = "<%=docBase%>" ;
       eXo.env.server.portalBaseURL = "<%=rcontext.getRequest().getRequestURI()%>" ;
@@ -91,47 +91,44 @@
      def headerElements = rcontext.getExtraMarkupHeadersAsStrings();
      if (headerElements != null) 
      {
-       for (element in headerElements)
-       { %>
-        <%=element%>  
-    <% }
+        for (element in headerElements)
+        {
+          print(element);  
+        }
      }     
+
+     /*Hide All Popup Menu when click on document*/
+     rcontext.getJavascriptManager().addOnLoadJavascript('eXo.core.DOMUtil.hideElements');
+     //rcontext.getJavascriptManager().addOnResizeJavascript('eXo.core.UIMaskLayer.resizeMaskLayer');
     %>
   </head>
 
   <body style="height: 100%;">
-    <% 
-      /*Hide All Popup Menu when click on document*/
-      rcontext.getJavascriptManager().addOnLoadJavascript('eXo.core.DOMUtil.hideElements');
-      //rcontext.getJavascriptManager().addOnResizeJavascript('eXo.core.UIMaskLayer.resizeMaskLayer');
-    %>
- 
-	<div class="$uicomponent.skin" id="UIPortalApplication" style="!height: 100%;">
-    	
-		<div class="AjaxLoadingMask" id="AjaxLoadingMask" style="display: none; margin: auto;">
-      <div class="LoadingContainer">
-        <div class="CenterLoadingContainer">
-          <div class="LoadingText"><%=_ctx.appRes("UIPortalApplication.label.Loading")%></div>
-          <div class="LoadingProgressBar"><span></span></div>
-          
-          <div class="UIAction"> 
-				    <table class="ActionContainer">
-					    <tr>
-					    	<td>
-						      <div onclick="javascript:ajaxAbort();" class="ActionButton LightBlueStyle">
-						        <div class="ButtonLeft">
-						          <div class="ButtonRight">
-						            <div class="ButtonMiddle">
-						              <a href="javascript:void(0);"><%=_ctx.appRes("UIPortalApplication.label.Abort")%></a>
-						            </div>
-						          </div>
-						        </div>
-						      </div>
-						    </td>
-				      </tr>
-				 	  </table>
-					</div>
-          
+  	<div class="$uicomponent.skin" id="UIPortalApplication" style="!height: 100%;">    	
+  		<div class="AjaxLoadingMask" id="AjaxLoadingMask" style="display: none; margin: auto;">
+        <div class="LoadingContainer">
+          <div class="CenterLoadingContainer">
+            <div class="LoadingText"><%=_ctx.appRes("UIPortalApplication.label.Loading")%></div>
+            <div class="LoadingProgressBar"><span></span></div>
+            
+            <div class="UIAction"> 
+  				    <table class="ActionContainer">
+  					    <tr>
+  					    	<td>
+  						      <div onclick="javascript:ajaxAbort();" class="ActionButton LightBlueStyle">
+  						        <div class="ButtonLeft">
+  						          <div class="ButtonRight">
+  						            <div class="ButtonMiddle">
+  						              <a href="javascript:void(0);"><%=_ctx.appRes("UIPortalApplication.label.Abort")%></a>
+  						            </div>
+  						          </div>
+  						        </div>
+  						      </div>
+  						    </td>
+  				      </tr>
+  				 	  </table>
+  					</div>
+            
+          </div>
         </div>
-      </div>
-	  </div>
+  	  </div>

Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java	2010-09-21 09:57:32 UTC (rev 4281)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java	2010-09-21 10:11:36 UTC (rev 4282)
@@ -107,7 +107,10 @@
       StringBuilder baseURL = new StringBuilder(this.portalRequestURI).append("?")
          .append(PortalRequestContext.UI_COMPONENT_ID).append("=").append(this.portletId);
 */
-
+      
+      //Clear URL parameters
+      url.getQueryParameters().clear();
+      
       String type;
       if (containerURL instanceof RenderURL)
       {

Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java	2010-09-21 09:57:32 UTC (rev 4281)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java	2010-09-21 10:11:36 UTC (rev 4282)
@@ -260,7 +260,7 @@
                               if ("title".equals(element.getNodeName().toLowerCase())
                                     && element.getFirstChild() != null)
                               {
-                                 String title = element.getFirstChild().getTextContent();
+                                 String title = element.getFirstChild().getNodeValue();
                                  prcontext.getRequest().setAttribute(PortalRequestContext.REQUEST_TITLE, title);
                               }
                               else



More information about the gatein-commits mailing list