portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r830406 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/ applications/jetspeed/src/main/webapp/WEB-INF/jetui/ applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/ applications/jetspeed/src/main/webap...
Date Tue, 27 Oct 2009 23:51:28 GMT
Author: taylor
Date: Tue Oct 27 23:51:27 2009
New Revision: 830406

URL: http://svn.apache.org/viewvc?rev=830406&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-1057

new ui interface pipeline (/jetspeed/ui) -- will check in required javascript libraries later
to get login to work in ui pipeline modify the index.jsp from /portal to /ui 

Added:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp   (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp   (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/layout_sprite.png   (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css   (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/sprite.png   (with props)
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/greenearth/css/portal.css
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/jetspeed/css/portal.css
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/purpleplanet/css/portal.css
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/turbo/css/portal.css
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PageAggregator.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp Tue Oct 27 23:51:27 2009
@@ -0,0 +1,56 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--%>
+<%@ page contentType="text/html" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.Map" %>
+<%@ page import="org.apache.jetspeed.ui.Jetui" %>
+<%@ page import="org.apache.jetspeed.request.RequestContext" %>
+<%@ page import="org.apache.jetspeed.om.page.Page" %>
+<%@ page import="org.apache.jetspeed.om.page.ContentFragment" %>
+<%@ page import="org.apache.jetspeed.portlets.layout.ColumnLayout" %>
+<%@ page import="org.apache.jetspeed.om.page.ContentFragment" %>
+<%@ page import="org.apache.jetspeed.decoration.DecoratorAction" %>
+<%@ page import="org.apache.jetspeed.PortalReservedParameters" %>
+<%
+	String content = (String)request.getAttribute("content");
+	String pageDec = (String)request.getAttribute("pageDec");
+	ContentFragment fragment = (ContentFragment)request.getAttribute("fragment");	
+%>
+	<div class="portal-layout-cell portal-layout-cell-OneColumn-1-0" id="<%=fragment.getId()%>" name="<%=fragment.getName()%>">
+		<div class="portlet <%=pageDec%>">
+		    <div class="PTitle" >
+	          <div class="PTitleContent"><%=fragment.getPortletContent().getTitle()%></div>
+		  	    <div class="PActionBar">
+<%
+				    for(DecoratorAction action : (List<DecoratorAction>)fragment.getDecoration().getActions())
+				    {			        
+				        String target = "target='"+ action.getTarget() + "'";
+				        if (action.getTarget() == null)
+				            target = "";
+ %>			    
+			     <a href="<%=action.getAction()%>" title="<%=action.getName()%>" class="action portlet-action" <%=target%>><img src="<%=request.getContextPath()%>/<%=action.getLink()%>" alt="<%=action.getAlt()%>" border="0" /></a>
+<% } %>
+			    </div>
+		      </div>
+		       <div class="PContentBorder">
+		         <div class="PContent"><span style="line-height:0.005px;">&nbsp;</span><%=content%></div>
+		       </div>
+		    </div>
+          </div>
+     
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp Tue Oct 27 23:51:27 2009
@@ -0,0 +1,176 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--%>
+<%@ page contentType="text/html" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.Map" %>
+<%@ page import="org.apache.jetspeed.ui.Jetui" %>
+<%@ page import="org.apache.jetspeed.request.RequestContext" %>
+<%@ page import="org.apache.jetspeed.om.page.Page" %>
+<%@ page import="org.apache.jetspeed.om.page.ContentFragment" %>
+<%@ page import="org.apache.jetspeed.portlets.layout.ColumnLayout" %>
+<%@ page import="org.apache.jetspeed.om.page.ContentFragment" %>
+<%@ page import="org.apache.jetspeed.decoration.DecoratorAction" %>
+<%@ page import="org.apache.jetspeed.PortalReservedParameters" %>
+
+<%
+  Jetui jetui = (Jetui)request.getAttribute("jetui");
+  RequestContext rc = (RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV);
+  Page portalPage = rc.getPage();
+  ColumnLayout columnLayout = (ColumnLayout)request.getAttribute("columnLayout");
+  String navContent = jetui.renderPortletWindow("_JetspeedNavigator", "j2-admin::JetspeedNavigator", rc);
+  String tbContent = jetui.renderPortletWindow("_JetspeedToolbox", "j2-admin::JetspeedToolbox", rc);
+  String encoding = "text/html"; 
+  if (response.getCharacterEncoding() != null)
+  {
+      encoding += "; charset=" + response.getCharacterEncoding();
+  }
+  String baseUrl = jetui.getBaseURL(rc);
+  String pageDec = jetui.getTheme(rc).getPageLayoutDecoration().getName();
+%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="content-type" content="<%=encoding%>"/>
+<title><%=jetui.getTitle(rc)%></title>
+<link rel="shortcut icon" href="<%=baseUrl%>images/jetspeed.jpg" type="image/x-icon" />
+<script type="text/javascript" src="/jetspeed/javascript/yui/build/yui/yui-min.js"></script>
+<link rel="stylesheet" type="text/css" href="/jetspeed/jetui/css/portal.css"/>
+
+<%=jetui.includeHeaderResources(rc)%>
+
+<%
+// define layout objects (preferedLocale, rootFragment, site, theme, layoutDecorator)
+// decorator macros
+// defineNavigationConstants()
+
+for (String style : jetui.getStyleSheets(rc))
+{%>
+<link rel="stylesheet" type="text/css" media="screen, projection" href="<%=request.getContextPath()%>/<%=style%>"/>
+<%}
+%>
+
+<body>
+<div id='jetspeedZone'>
+<div id="layout-<%=pageDec%>" class="layout-<%=pageDec%>" >
+<div class="header">
+<h1 class="logo">Jetspeed 2</h1>
+<div class="menu">
+&nbsp;<span style='position: absolute; left: 0px' id='jstbLeftToggle' class='jstbToggle1'></span><span id='jstbRightToggle' class='jstbToggle2' style='position: absolute; right: 0px'></span>
+</div>
+</div> <!-- end header -->
+
+<!-- main area -->
+<table cellpadding="0" cellspacing="0" border="0" width="100%" id="main">
+<tr>         
+<td>
+<div id='jstbLeft' class='jsLeftToolbar'> 
+<div id="jsNavigator" class="portlet <%=pageDec%>">
+    <div class="PTitle" >
+      <div class="PTitleContent">Navigator</div>
+    </div>
+    <div class="PContentBorder">
+      <div class="PContent"><span style="line-height:0.005px;">&nbsp;</span><%=navContent %></div>
+    </div>
+</div>
+</div>
+</td>
+<td id='jsMainarea' class='jsMainarea'>
+<div id="jsFragments" class="portal-nested-layout portal-nested-layout-TwoColumns">
+<%
+	ContentFragment maximized = (ContentFragment)request.getAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE);
+	if (maximized != null)
+	{
+		String content = jetui.getRenderedContent(maximized, rc);
+		request.setAttribute("content", content);
+		request.setAttribute("pageDec", pageDec);
+		request.setAttribute("fragment", maximized);
+%>
+<div id="column_id_0>" 
+     class="portal-layout-column" 
+     style="float:left; width:100%; background-color: #ffffff;">
+<jsp:include page="jetui-portlet.jsp"/>
+</div>	
+<%	
+	}
+	else
+	{
+		int index = 0;
+		for (Object collections : columnLayout.getColumns())
+		{
+		    String columnFloat = columnLayout.getColumnFloat(index);
+		    String columnWidth = columnLayout.getColumnWidth(index);
+		// class="portal-layout-column portal-layout-column-${layoutType}-${columnIndex}"	        
+%>
+<div id="column_id_<%=index%>" 
+     class="portal-layout-column" 
+     style="float:<%=columnFloat%>; min-height: 100px; width:<%=columnWidth%>; background-color: #ffffff;">
+
+<%	    
+			int subindex = 0;
+		    Collection<ContentFragment> columns = (Collection<ContentFragment>)collections;
+		    for (ContentFragment fragment : columns)
+		    {
+		        if (!(fragment.getName().equals("j2-admin::JetspeedToolbox") || fragment.getName().equals("j2-admin::JetspeedNavigator")))
+		        {
+		    		//String content = jetui.renderPortletWindow(fragment.getId(), fragment.getName(), rc);
+		    		String content = jetui.getRenderedContent(fragment, rc);
+		    		request.setAttribute("content", content);
+		    		request.setAttribute("pageDec", pageDec);
+		    		request.setAttribute("fragment", fragment);		    		
+%>
+<jsp:include page="jetui-portlet.jsp"/>
+<%	    	
+					subindex++;
+		        }
+		    }
+		    index++;
+%>
+</div>
+<%
+		}
+	}
+%>
+</div>
+</td>
+<td>
+<div id='jstbRight' class='jsRightToolbar'>
+<div id="jsToolbox" class="portlet <%=pageDec%>">
+    <div class="PTitle" >
+      <div class="PTitleContent">Toolbox</div>
+    </div>
+    <div class="PContentBorder">
+      <div class="PContent"><span style="line-height:0.005px;">&nbsp;</span><%=tbContent %></div>
+    </div>
+</div>
+</div> 
+</td>
+</tr>
+</table>
+
+</div> <!-- end layout -->
+</div>
+</body>
+<script language="javascript">
+var assetsDir = "assets/";
+var buildDir = "/jetspeed/javascript/yui/build/" ;
+var yuiConfig = {base:"/jetspeed/javascript/yui/build/", timeout: 10000, debug: true, useBrowserConsole: true}; // ({classNamePrefix: 'jet'})
+</script>
+<script src="/jetspeed/jetui/engine/portal.js"></script>
+ 
+</html>

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/web.xml Tue Oct 27 23:51:27 2009
@@ -202,6 +202,10 @@
     <servlet-name>jetspeed</servlet-name>
     <url-pattern>/healthcheck/*</url-pattern>
   </servlet-mapping>
+  <servlet-mapping>
+     <servlet-name>jetspeed</servlet-name>
+     <url-pattern>/ui/*</url-pattern>
+  </servlet-mapping>              
 
   <!-- Map *.vm files to Velocity  -->
   <servlet-mapping>

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/greenearth/css/portal.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/greenearth/css/portal.css?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/greenearth/css/portal.css (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/greenearth/css/portal.css Tue Oct 27 23:51:27 2009
@@ -30,6 +30,7 @@
     padding-right:2px;
     white-space:normal;
     font-size:1em;
+    background-color: white;
 }
 
 .greenearth .PTitleContent

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/jetspeed/css/portal.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/jetspeed/css/portal.css?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/jetspeed/css/portal.css (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/jetspeed/css/portal.css Tue Oct 27 23:51:27 2009
@@ -30,6 +30,7 @@
     padding-right:2px;
     white-space:normal;
     font-size:1em;
+    background-color: white;
 }
 
 .jetspeed .PTitleContent

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/purpleplanet/css/portal.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/purpleplanet/css/portal.css?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/purpleplanet/css/portal.css (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/purpleplanet/css/portal.css Tue Oct 27 23:51:27 2009
@@ -30,6 +30,7 @@
     padding-right:2px;
     white-space:normal;
     font-size:1em;
+    background-color: white;
 }
 
 .purpleplanet .PTitleContent

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/turbo/css/portal.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/turbo/css/portal.css?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/turbo/css/portal.css (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/portlet/turbo/css/portal.css Tue Oct 27 23:51:27 2009
@@ -30,6 +30,7 @@
     padding-right:2px;
     white-space:normal;
     font-size:1em;
+    background-color: white;   
 }
 
 .turbo .PTitleContent

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/layout_sprite.png
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/layout_sprite.png?rev=830406&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/layout_sprite.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css Tue Oct 27 23:51:27 2009
@@ -0,0 +1,44 @@
+.jsLeftToolbar {
+	width: 200px;
+	height: 600px;
+}
+.jsMainarea {
+	background:#ffffff;
+	width: 100%;
+}
+.jsRightToolbar {
+	width: 200px;
+	height: 600px;
+	float: right;
+}
+.moving {
+    background-color: #ffffff;
+    border: 1px dotted black;
+}
+
+.jstbMoveMode {
+    background: url("/jetspeed/images/portlets/small/x-office-document.png");
+}
+
+.jstbToggle1 {
+    background:transparent url("/jetspeed/jetui/css/layout_sprite.png") no-repeat -20px -120px;
+	height: 14px;
+    width: 18px;
+}
+.jstbToggle2 {
+    background:transparent url("/jetspeed/jetui/css/layout_sprite.png") no-repeat -20px -140px;
+	height: 14px;
+    width: 18px;    
+}
+#jsNavigator 	{
+	z-index: 100;
+	width: 192px;
+}
+#jsToolbox 	{
+	z-index: 100;
+	width: 192px;
+}
+.PTitle
+{
+   cursor: move;
+}

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/sprite.png
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/sprite.png?rev=830406&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/sprite.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js (added)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js Tue Oct 27 23:51:27 2009
@@ -0,0 +1,440 @@
+//Use loader to grab the modules needed
+YUI(yuiConfig).use('console', 'dd', 'anim', 'io', 'cookie', 'json', 'widget', function(Y) {
+	//new Y.Console().render(); 
+    //Make this an Event Target so we can bubble to it
+    var Portal = function() {
+        Portal.superclass.constructor.apply(this, arguments);
+    };
+    Portal.NAME = 'portal';
+    Portal.prototype.desktopMode = false;
+    Portal.prototype.jstbLeft;
+    Portal.prototype.jstbRight;
+    Portal.prototype.isMoving;
+    Y.extend(Portal, Y.Base);
+    var portal = new Portal();
+    portal.isMoving = false;
+    var goingUp = false, goingRight = false, lastY = 0, lastX = 0;   
+    
+    ////////////////////////////////////////////////////
+    // the Portlet Class
+    function Portlet(config) {
+        Portlet.superclass.constructor.call(this, config);
+    };
+    Y.extend(Portlet, Y.Base, {
+    	initializer : function(cfg) { 
+   	 	},
+        destructor : function(cfg) { 
+   	 	}     	    	
+    });    
+    Portlet.NAME = "portlet";
+    Portlet.ATTRS = {
+    	"name" : { value: "undefined" }, 
+        "id" : { value: "0" },
+        "toolbar" : { value : false },
+        "detached" : { value : false }
+    };
+	Portlet.prototype.info = function() {
+		Y.log("name: " + this.get("name"));
+		Y.log("id  : " + this.get("id"));		
+		Y.log("toolbar  : " + this.get("toolbar"));		
+		Y.log("---------");
+    };
+    
+    ////////////////////////////////////////////////////    
+    // Create Navigator Portlet
+    var navigator = new Portlet();
+    navigator.set("name", "j2-admin::JetspeedNavigator");
+    navigator.set("id", "_JetspeedNavigator");
+    navigator.set("toolbar", true);
+    navigator.set("detached", false);
+    var toolbox = new Portlet();
+    toolbox.set("name", "j2-admin::JetspeedToolbox");
+    toolbox.set("id", "_JetspeedToolbox");
+    toolbox.set("toolbar", true);
+    toolbox.set("detached", false);
+
+//    var toggleMoveMode = function(e) { 
+//	    window.location = window.location + "?toggle=move";
+//    }       
+//    Y.on("click", toggleMoveMode, "#jstbMoveMode");
+    
+    ////////////////////////////////////////////////////    
+    // setup toolbar docking area and togglers    
+    var lhsToggler = Y.get('#jstbLeftToggle');
+    var rhsToggler = Y.get('#jstbRightToggle');    
+    // add fx plugin to docking area
+    portal.jstbLeft = Y.get('#jstbLeft').plug(Y.Plugin.NodeFX, {
+        from: { width: 1 },
+        to: {
+            width: function(node) { // dynamic in case of change
+                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight may be zero)
+            }
+        },
+        easing: Y.Easing.easeOut,
+        duration: 0.3
+    });    
+    portal.jstbRight = Y.get('#jstbRight').plug(Y.Plugin.NodeFX, {
+        from: { width: 1 },
+        to: {
+            width: function(node) { // dynamic in case of change
+                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight may be zero)
+            }
+        },
+        easing: Y.Easing.easeOut,
+        duration: 0.3
+    });        
+    var onClickToolbar = function(e) {
+//    	nav.setStyle('z-index', '500');
+    }
+
+    var onClickToggler = function(e) {
+    	var id = e.target.getAttribute('id');
+    	var toggler = lhsToggler;
+    	var toolbar = portal.jstbLeft;
+    	var compareStyle = 'jstbToggle1';
+    	if (id.indexOf('Left') == -1)
+    	{
+    		toggler = rhsToggler;
+    		toolbar = portal.jstbRight;
+        	var compareStyle = 'jstbToggle2';    		
+    	}
+    	portal.toggleToolbar(toolbar, toggler, compareStyle);    	    	
+    };
+    lhsToggler.on('click', onClickToggler);
+    rhsToggler.on('click', onClickToggler);
+
+    ////////////////////////////////////////////////////       
+    // drag and drop
+    var nav = Y.get('#jsNavigator');
+    nav.data = navigator;
+    var ddNav = new Y.DD.Drag({
+        node: nav,
+        groups: ['toolbars'],
+        dragMode: 'point'                
+    }).plug(Y.Plugin.DDProxy, { 
+      	 moveOnEnd: false         	    	
+    });    
+    ddNav.addHandle('.PTitle');
+    nav.on('click', onClickToolbar);
+
+    var jetspeedZone = Y.get('#jetspeedZone');
+    var jzDrop = new Y.DD.Drop({
+        node: jetspeedZone,
+        groups: ['toolbars']        
+    });
+    
+    var tb = Y.get('#jsToolbox');
+    tb.data = toolbox;
+    var ddToolbox = new Y.DD.Drag({
+        node: tb,
+        groups: ['toolbars'],                 
+        dragMode: 'point'        
+    }).plug(Y.Plugin.DDProxy, { 
+      	 moveOnEnd: false         	    	
+    });    
+    ddToolbox.addHandle('.PTitle');
+    tb.on('click', onClickToolbar);
+    
+    var drop = new Y.DD.Drop({
+        node: Y.get('#jstbLeft'),
+        groups: ['toolbars']
+    });
+    var drop = new Y.DD.Drop({
+        node: Y.get('#jstbRight'),
+        groups: ['toolbars']        
+    });
+    
+    var draggablePortlets = Y.Node.all('.portal-layout-cell');    
+    draggablePortlets.each(function(v, k) {
+        var p = new Portlet();
+        p.set("name", v.getAttribute("name"));
+        p.set("id", v.getAttribute("id"));
+        p.set("toolbar", false);
+        p.set("detached", false);
+        v.data = p;
+        var ddNav = new Y.DD.Drag({
+            node: v,
+            groups: ['portlets'],
+            dragMode: 'intersect'                    
+        }).plug(Y.Plugin.DDProxy, { 
+          	 moveOnEnd: false         	    	
+        });    
+        ddNav.addHandle('.PTitle');
+    	var drop = new Y.DD.Drop({
+            node: v,
+            groups: ['portlets', 'toolbars']            
+        });        
+    });
+    
+    var dropLayoutColumns = Y.Node.all('.portal-layout-column');
+    dropLayoutColumns.each(function(v, k) {
+    	var drop = new Y.DD.Drop({
+            node: v,
+            groups: ['portlets']            
+        });            	
+    });
+    
+    Portal.prototype.toggleToolbar = function(toolbar, toggler, compareStyle) {
+        toggler.toggleClass('jstbToggle1');
+        toggler.toggleClass('jstbToggle2');
+        var currentStyle = toggler.getAttribute('class');
+        var nodelist = toolbar.get('children');
+        if (currentStyle == compareStyle)
+        {
+            nodelist.setStyle('display', 'block');        	
+        }
+        else
+        {
+            nodelist.setStyle('display', 'none');        	
+        }	        
+        toolbar.fx.set('reverse', !toolbar.fx.get('reverse')); // toggle reverse 
+        toolbar.fx.run();
+	};
+	    
+    
+	Y.DD.DDM.on('drag:drophit', function(e) {
+        var drop = e.drop.get('node'),
+            drag = e.drag.get('node');
+        if (drag.data.get("toolbar"))
+        {        	
+        	Y.log("drop hit of toolbar: " + drop.getAttribute('id'));
+            if (drop == portal.jstbLeft || drop == portal.jstbRight)
+            {
+	        	drag.setStyle('position', '');
+				drag.setStyle('top', '');
+				drag.setStyle('left', '');        		
+				drop.appendChild(drag);
+            }
+            else
+            {            		
+				var dragParent = drag.get('parentNode');
+            	drag.setStyle('position', 'absolute');
+				drag.setStyle('top', e.drag.region.top + "px");
+				drag.setStyle('left', e.drag.region.left + "px");        		
+				jetspeedZone.appendChild(drag);
+				if (dragParent.get("children").size() == 0)
+				{        	        
+				    if (dragParent == portal.jstbLeft) {
+						portal.toggleToolbar(dragParent, lhsToggler, "jstbToggle1");
+				    }
+				    else  if (dragParent == portal.jstbRight) {
+				    	portal.toggleToolbar(dragParent, rhsToggler, "jstbToggle2");        	
+				    }
+				}              				
+            }
+        }
+    });
+	
+	  Portal.prototype.movePortlet = function(e)
+	  {
+        var drop = e.drop.get('node'),
+            drag = e.drag.get('node');
+        var dragParent = drag.get('parentNode');
+        var dropParent = drop.get('parentNode');
+
+		Y.log("HIT: " + drop.data.get('id'));
+        
+        if (dropParent == portal.jstbLeft || dropParent == portal.jstbRight)
+        {
+          if (!dropParent.contains(drag)) {
+        	  dropParent.appendChild(drag);
+          }
+        }
+        else
+        {
+        	if (goingUp)
+        	{
+    			Y.log("going UP");
+        		// var next = drop.get('previousSibling');
+    			var prev = drop.previous();
+                if (prev == null)
+                {
+                	//drag.remove();                	
+                	dropParent.prepend(drag);                	
+                }
+                else
+                {
+        			//drag.remove();
+                	dropParent.insertBefore(drag, drop);
+                }        		
+        	}
+        	else
+        	{
+        		var next = drop.next();
+                if (next == null) 
+                {
+        			Y.log("going down APPEND");
+        			//drag.remove();
+        			dropParent.appendChild(drag);
+                }
+                else
+                {
+        			Y.log("going down: " + next); //next.data.get('name'));
+        			//drag.remove();
+        			dropParent.insertBefore(drag, next);
+                }
+        	}
+        }
+    };    
+
+    Y.DD.DDM.on('drag:end', function(e) {
+        var drag = e.target;
+        if (drag.target) {
+            drag.target.set('locked', false);
+        }
+        if (drag.get('node').data.get("toolbar"))
+        {
+            drag.get('node').setStyle('visibility', '');
+        }
+        else
+        {
+            var x = drag.get('node').all('div');
+            if (x != null)
+            {
+            	x.setStyle('visibility', '');
+            }
+        }        
+        //drag.get('node').setStyle('border', '');                
+        drag.get('node').removeClass('moving');
+        drag.get('dragNode').set('innerHTML', '');
+    });
+    
+    Y.DD.DDM.on('drag:start', function(e) {
+        var drag = e.target;
+//        if (drag.target) {
+//            drag.target.set('locked', true);
+//        }
+        var dragNode = drag.get('dragNode');
+        dragNode.set('innerHTML', drag.get('node').get('innerHTML'));
+        dragNode.setStyle('opacity','.5');
+        dragNode.setAttribute('class', 'portlet purpleplanet');
+
+        if (drag.get('node').data.get("toolbar"))
+        {
+        	drag.get('node').setStyle('visibility', 'hidden');        	
+        }
+        else
+        {
+        	var x = drag.get('node').all('div');
+        	if (x != null)
+        	{
+        		x.setStyle('visibility', 'hidden');
+        	}
+        }
+        drag.get('node').setStyle('border', '1px dotted #black');        
+        drag.get('node').addClass('moving');
+        
+        lastX = drag.mouseXY[0];
+        lastY = drag.mouseXY[1];
+        //Y.log("starting drag " + lastX +  " , " + lastY);
+    });
+
+    Y.DD.DDM.on('drag:over', function(e) {
+    	if (portal.isMoving)
+    		return;
+    	
+    	var x = e.drag.mouseXY[0],
+    		y = e.drag.mouseXY[1];
+    	
+    	if (y == lastY)
+    	{    		
+    	}
+    	else if (y < lastY) {
+            goingUp = true;
+            
+        } else {
+            goingUp = false;
+        }
+        lastY = y;
+        if (x < lastX) {
+            goingRight = false;
+        } else {
+            goingRight = true;
+        }        
+        lastX = x;
+        
+        if (e.drag.get('node').data.get("toolbar"))
+        {        
+            var drop = e.drop.get('node'),
+            drag = e.drag.get('node');            
+            var dragParent = drag.get('parentNode');
+            var dropParent = drop.get('parentNode');        	
+            if (drop == portal.jstbLeft || drop == portal.jstbRight)
+            {
+				if (!drop.contains(drag)) {
+					  drop.appendChild(drag);
+				}
+				// close up the toolbar leaving from
+				if (dragParent.get("children").size() == 0)
+				{        	        
+				    if (dragParent == portal.jstbLeft) {
+						portal.toggleToolbar(dragParent, lhsToggler, "jstbToggle1");
+				    }
+				    else  if (dragParent == portal.jstbRight) {
+				    	portal.toggleToolbar(dragParent, rhsToggler, "jstbToggle2");        	
+				    }
+				}              
+            }        	
+            else // jetspeed drop zone
+            {
+            	//Y.log("hovering over the zone");
+            }
+        }
+        else
+        {
+	    	var region = e.drop.get('node').get('region');
+	    	var srcRegion = e.drag.get('node').get('region');
+	    	if (y >= srcRegion.top && y <= srcRegion.bottom && x >= srcRegion.left && x <= srcRegion.right)
+	    	{
+//	    		Y.log("dragging over src");
+	    	}	    	
+	    	else if (y >= region.top && y <= region.bottom && x >= region.left && x <= region.right)
+	    	{
+	    		Y.log("**** HIT");
+	    		portal.isMoving = true;
+	    		portal.movePortlet(e); 
+	    		portal.isMoving = false;
+	    	}
+        }
+		//Y.log("x,y = " + x + "," + y);
+    	
+    });
+    
+//    Y.DD.DDM.on('drag:drag', function(e) {
+//        var x = e.target.mouseXY[0];
+//    	var y = e.target.mouseXY[1];
+//        if (y < lastY) {
+//            goingUp = true;
+//        } else {
+//            goingUp = false;
+//        }
+//        if (x < lastX) {
+//            goingRight = false;
+//        } else {
+//            goingRight = true;
+//        }        
+//        lastX = x;
+//        Y.log("DRAG: x = " + x + " y " + y );
+//    });
+    
+//    Y.DD.DDM.on('drop:enter', function(e) {
+//    
+//    	//var region = e.drop.region;
+//    	var region = e.drop.get('node').get('region');     	
+//    	Y.log("region = " + region.top + "," + region.bottom + " : " + region.left + ","  +region.right);
+    
+//        if (!e.drag || !e.drop || (e.drop !== e.target)) {
+//            return false;
+//        }
+        //var id = e.drop.get('node').data.get('id');
+        //Y.log("entering: " + p);
+        
+//        if (e.drop.get('node').get('tagName').toLowerCase() === 'li') {
+//            if (e.drop.get('node').hasClass('item')) {
+//                _moveMod(e.drag, e.drop);
+//            }
+//        }
+//    });    
+    
+    
+});

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java Tue Oct 27 23:51:27 2009
@@ -85,8 +85,7 @@
             aggregateAndRender(root, context, page, true, null, null, null);
         }
         
-        // write all rendered content
-        context.getResponse().getWriter().write(root.getRenderedContent());
+        renderContent(context, root);
         
         if (null != window)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java Tue Oct 27 23:51:27 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.aggregator.impl;
 
+import java.io.IOException;
 import java.util.List;
 
 import org.slf4j.Logger;
@@ -24,6 +25,7 @@
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.aggregator.PortletRenderer;
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.request.RequestContext;
@@ -110,5 +112,10 @@
             window.getFragment().overrideRenderedContent("Sorry, but we were unable access the requested portlet. Send the following message to your portal admin:  "+  e.getMessage());
         }
     }
+
+    public void renderContent(RequestContext context, ContentFragment root) throws JetspeedException, IOException
+    {
+        context.getResponse().getWriter().write(root.getRenderedContent());        
+    }
     
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java Tue Oct 27 23:51:27 2009
@@ -1075,4 +1075,7 @@
     {
         return this.baseUrlAccess;
     }
+    public void renderContent(RequestContext context, ContentFragment root) throws JetspeedException, IOException
+    {
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java Tue Oct 27 23:51:27 2009
@@ -78,7 +78,7 @@
         }
         
         // write all rendered content
-        context.getResponse().getWriter().write(root.getRenderedContent());
+        renderContent(context, root);
         
         if (null != window)
         {
@@ -88,7 +88,7 @@
         
         releaseBuffers(root, context);        
     }
-
+    
     @SuppressWarnings("unchecked")
     protected void aggregateAndRender( ContentFragment f, RequestContext context, ContentPage page )
     {

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java Tue Oct 27 23:51:27 2009
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.ui;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.RequestDispatcher;
+
+import org.apache.jetspeed.aggregator.PortletRenderer;
+import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.decoration.Theme;
+import org.apache.jetspeed.headerresource.HeaderResource;
+import org.apache.jetspeed.headerresource.HeaderResourceFactory;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.pipeline.PipelineException;
+import org.apache.jetspeed.portlets.layout.ColumnLayout;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.util.DOMUtils;
+import org.apache.jetspeed.util.KeyValue;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class Jetui
+{
+    private PortletRenderer renderer;
+    private HeaderResourceFactory headerFactory;
+    private String layoutTemplate;
+    
+    public Jetui(PortletRenderer renderer, HeaderResourceFactory headerFactory, String layoutTemplate)
+    {
+        this.renderer = renderer;
+        this.headerFactory = headerFactory;
+        this.layoutTemplate = layoutTemplate;
+    }
+    
+    public void process( RequestContext request, ContentFragment maximized)
+        throws PipelineException
+    {
+        try
+        {
+            RequestDispatcher dispatcher = request.getRequest().getRequestDispatcher(layoutTemplate);
+            request.setAttribute("jetui", this);
+            if (maximized == null)
+            {
+                Fragment rootFragment = request.getPage().getRootFragment();
+                String jetspeedLayout = rootFragment.getName();
+                /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+                // BOGUS: I would prefer to put all layout information directly in PSML, not in portlet.xml, right now its mixed
+                // need to have a better algorithm to determine number of columns and fragment column sizes
+                int numberOfColumns = 1;
+                String layoutType = "OneColumn";
+                String fragmentColumnSizes = "100%";
+                if (jetspeedLayout.indexOf("Two") > -1)
+                {
+                    numberOfColumns = 2;
+                    layoutType = "TwoColumn";
+                    fragmentColumnSizes = "50%,50%";
+                }
+                else if (jetspeedLayout.indexOf("Three") > -1)
+                {
+                    numberOfColumns = 3;
+                    layoutType = "ThreeColumn";
+                    fragmentColumnSizes = "33%,34%,33%";                
+                }                
+                else if (jetspeedLayout.indexOf("Four") > -1)
+                {
+                    numberOfColumns = 4;
+                    layoutType = "FourColumn";
+                    fragmentColumnSizes = "25%,25%,25%,25%";                                
+                }                
+                String [] fragmentColumnSizesArray = fragmentColumnSizes.split("\\,");
+                /////////////////////////////////////////////////////////////////////////////////////////////////////////////////            
+                ColumnLayout columnLayout = new ColumnLayout(numberOfColumns, layoutType, rootFragment.getFragments(), fragmentColumnSizesArray);
+                request.setAttribute("columnLayout", columnLayout);
+            }
+            dispatcher.include(request.getRequest(), request.getResponse());            
+        }
+        catch (Exception e)
+        {
+            throw new PipelineException(e.toString(), e);
+        }
+    }
+    
+    public String renderPortlet(ContentFragment fragment, RequestContext context)
+    {
+        return fragment.getRenderedContent();
+    }
+  
+    public String getTitle(RequestContext context)
+    {
+        return context.getPage().getTitle(context.getLocale());
+    }
+    
+    public String getBaseURL(RequestContext context)
+    {
+        StringBuffer url = new StringBuffer();
+        url.append(context.getRequest().getScheme());
+        url.append("://");
+        url.append(context.getRequest().getServerName());
+        url.append(":");
+        url.append(context.getRequest().getServerPort());
+        url.append(context.getRequest().getContextPath());
+        url.append("/");
+        return url.toString();
+    }
+    
+    public Theme getTheme(RequestContext context)
+    {
+        return (Theme)context.getRequest().getAttribute("org.apache.jetspeed.theme");        
+    }
+    
+    public Set<String> getStyleSheets(RequestContext context)
+    {
+        return getTheme(context).getStyleSheets();
+    }
+    
+    public String includeHeaderResources(RequestContext context)
+    {        
+       HeaderResource hr = headerFactory.getHeaderResouce(context);
+       ContentFragment root = context.getPage().getRootContentFragment();
+       StringBuffer result = new StringBuffer(hr.getContent());
+       List<KeyValue<String, Element>> headers = context.getPortletWindow(root).getHeadElements();
+       for (KeyValue<String, Element> pair : headers)
+       {
+           if (!pair.getKey().equals("header.dojo.library.include"))
+           {
+               String element = DOMUtils.stringifyElementToHtml(pair.getValue());
+               result.append(element);
+           }
+       }
+       return result.toString();
+    }
+    
+    public String getRenderedContent(ContentFragment fragment, RequestContext context)
+    {
+        return fragment.getRenderedContent();
+    }
+    
+    public String renderPortletWindow(String windowId, String portletUniqueName, RequestContext context)
+    {
+        try
+        {
+            if (windowId == null || portletUniqueName == null)
+            {
+                throw new IllegalArgumentException("Parameter windowId and portletUniqueName are both required");
+            }
+            PortletWindow window = context.getPortletWindow(windowId);
+            if (window == null)
+            {
+                window = context.getInstantlyCreatedPortletWindow(windowId, portletUniqueName);
+            }
+            if (window.isValid())
+            {
+                PortletWindow currentPortletWindow = context.getCurrentPortletWindow();
+                try
+                {
+                    context.setCurrentPortletWindow(window);                    
+                    renderer.renderNow(window.getFragment(), context);
+                    return window.getFragment().getRenderedContent();
+                }
+                finally
+                {
+                    context.setCurrentPortletWindow(currentPortletWindow);
+                }
+            }
+            else
+            {
+                return "";
+            }
+        }
+        catch (Exception e)
+        {
+            //handleError(e, e.toString(), getCurrentFragment());
+            e.printStackTrace();
+            return "";
+        }
+    }
+  
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java Tue Oct 27 23:51:27 2009
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.ui;
+
+import java.io.IOException;
+
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.aggregator.PageAggregator;
+import org.apache.jetspeed.aggregator.PortletRenderer;
+import org.apache.jetspeed.aggregator.impl.AsyncPageAggregatorImpl;
+import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Jetui builds the content required to render a page of portlets.
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
+ * @version $Id$
+ */
+public class JetuiAggregatorImpl extends AsyncPageAggregatorImpl implements PageAggregator
+{
+
+    private Jetui ui;
+
+    public JetuiAggregatorImpl(PortletRenderer renderer, Jetui ui)
+    {
+        super(renderer);
+        this.ui = ui;
+    }
+
+    public void renderContent(RequestContext context, ContentFragment root) throws JetspeedException, IOException
+    {
+        ContentFragment maximized = (ContentFragment)context.getAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE);
+        ui.process(context, maximized);
+    }
+
+    protected void renderMaximizedWindow(RequestContext context, ContentPage page, ContentFragment layoutContentFragment, PortletWindow window)
+    {
+//        boolean maxedLayout = false;
+//        PortletWindow layoutWindow;
+//        if (window.getFragment().getId().equals(layoutContentFragment.getId()))
+//        {
+//            layoutWindow = window;
+//            maxedLayout = true;
+//        }
+//        else
+//        {
+//            layoutWindow = context.getPortletWindow(layoutContentFragment);
+//        }
+
+          context.setAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE, window.getFragment());
+//        layoutWindow.setAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE, page.getRootContentFragment());
+
+        try
+        {
+            renderer.renderNow(window.getFragment(), context);
+//            if (!maxedLayout)
+//            {
+//                renderer.renderNow(layoutContentFragment, context);
+//            }
+        }
+        catch (Exception e)
+        {
+            log.error(e.getMessage(), e);
+            window.getFragment().overrideRenderedContent(
+                    "Sorry, but we were unable access the requested portlet. Send the following message to your portal admin:  " + e.getMessage());
+        }
+    }
+
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java Tue Oct 27 23:51:27 2009
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.ui;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
+
+/**
+ * Represents a page in a row/column oriented layout 
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class JetuiPage implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+    private Vector<Fragment> columns = null;
+    private int numberOfColumns = 1;
+    
+    public JetuiPage(Page page)
+    {
+        String jetspeedLayout = page.getRootFragment().getName();
+        if (jetspeedLayout.indexOf("Two") > -1)
+        {
+            numberOfColumns = 2;
+        }
+        else if (jetspeedLayout.indexOf("Three") > -1)
+        {
+            numberOfColumns = 3;
+        }    
+        columns = new Vector<Fragment>(numberOfColumns);
+        buildColumns(page.getRootFragment());
+    }
+    
+    private boolean buildColumns(Fragment f)
+    {
+        List<Fragment> fragments = f.getFragments();
+        if (fragments != null && !fragments.isEmpty())
+        {
+            for (Fragment child : fragments)
+            {
+                boolean found = buildColumns(child);
+                if (found)
+                    return true;
+            }
+        }
+        return false;
+    }
+
+    protected final int getColumn(Fragment fragment)
+    {
+        String propertyValue = fragment.getProperty(Fragment.COLUMN_PROPERTY_NAME);
+        if (propertyValue != null)
+        {
+            int columnNumber = Integer.parseInt(propertyValue);
+
+            // Exceeded columns get put into the last column
+            if (columnNumber >= numberOfColumns)
+            {
+                columnNumber = (numberOfColumns - 1);
+            }
+            // Columns less than 1 go in the first column
+            else if (columnNumber < 0)
+            {
+                columnNumber = 0;
+            }
+
+            return columnNumber;
+        }
+        else
+        {
+            return (numberOfColumns - 1);
+        }
+    }
+    
+}
+

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiPage.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java?rev=830406&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java Tue Oct 27 23:51:27 2009
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.ui;
+
+import org.apache.jetspeed.aggregator.PageAggregator;
+import org.apache.jetspeed.pipeline.PipelineException;
+import org.apache.jetspeed.pipeline.valve.AbstractValve;
+import org.apache.jetspeed.pipeline.valve.ValveContext;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Invokes the aggregator service in the request pipeline
+ *
+ * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class JetuiValve
+       extends AbstractValve
+{
+    private Jetui ui;
+    private PageAggregator aggregator;
+    
+    public JetuiValve(Jetui ui, PageAggregator aggregator)
+    {
+        this.ui = ui;
+        this.aggregator = aggregator;
+    }
+
+    public void invoke( RequestContext request, ValveContext context )
+    throws PipelineException
+    {
+        try
+        {
+            aggregator.build(request);
+        }
+        catch (Exception e)
+        {
+            throw new PipelineException(e.toString(), e);
+        }        
+        context.invokeNext( request );        
+    }
+    
+    public String toString()
+    {
+        return "JetuiValve";
+    }
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiValve.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PageAggregator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PageAggregator.java?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PageAggregator.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PageAggregator.java Tue Oct 27 23:51:27 2009
@@ -16,6 +16,12 @@
  */
 package org.apache.jetspeed.aggregator;
 
+import java.io.IOException;
+
+import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.request.RequestContext;
+
 /**
  * Page aggregation handles pipeline requests for pages of portlets.
  *
@@ -24,4 +30,5 @@
  */
 public interface PageAggregator extends Aggregator 
 {
+    void renderContent(RequestContext rc, ContentFragment root) throws JetspeedException, IOException;
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml Tue Oct 27 23:51:27 2009
@@ -204,4 +204,5 @@
     <!-- Uncomment this to HARD CODE your portal URL -->
     <!-- <constructor-arg><ref bean="BasePortalURL"/></constructor-arg>  -->
   </bean>
+
 </beans>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml?rev=830406&r1=830405&r2=830406&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml Tue Oct 27 23:51:27 2009
@@ -819,6 +819,9 @@
         <entry key='/healthcheck'>
           <value>healthcheck-pipeline</value>
         </entry>
+        <entry key='/ui'>
+          <value>jetui-pipeline</value>
+        </entry>
       </map>
     </constructor-arg>
   </bean>
@@ -827,4 +830,63 @@
     <meta key="j2:cat" value="default" />
   </bean>
 
+  <bean id="jetui-pipeline" class="org.apache.jetspeed.pipeline.JetspeedPipeline" init-method="initialize">
+    <meta key="j2:cat" value="default" />
+    <constructor-arg>
+      <value>JetuiPipeline</value>
+    </constructor-arg>
+    <constructor-arg>
+      <list>
+        <ref bean="capabilityValve" />
+        <ref bean="portalURLValve" />
+        <ref bean="securityValve" />
+        <ref bean="localizationValve" />
+        <ref bean="passwordCredentialValve" />
+        <ref bean="loginValidationValve" />
+        <ref bean="profilerValve" />
+        <ref bean="refreshUserHomepageValve" />
+        <!--
+          JS2-806  
+        -->
+        <ref bean="pageHistoryValve" />
+        <ref bean="containerValve" />
+        <ref bean="actionValve" />
+        <ref bean="resourceValve" />
+        <!-- 
+          JS2-834
+          <ref bean="cleanupPortalURLValve"/>
+        -->
+        
+        <ref bean="DecorationValve" />
+        <ref bean="headerAggregatorValvePortal" />
+        <ref bean="jetuiValve" />
+        <ref bean="cleanUpValve" />
+      </list>
+    </constructor-arg>
+  </bean>
+  
+  <bean id="jetuiValve" class="org.apache.jetspeed.ui.JetuiValve" init-method="initialize">
+    <meta key="j2:cat" value="default" />
+    <constructor-arg><ref bean="jetui" /></constructor-arg>
+    <constructor-arg><ref bean="jetuiAggregator" /></constructor-arg> 
+  </bean>
+
+  <bean id="jetui" class="org.apache.jetspeed.ui.Jetui">
+    <meta key="j2:cat" value="default" />
+    <constructor-arg><ref bean="org.apache.jetspeed.aggregator.PortletRenderer"/></constructor-arg>
+    <constructor-arg><ref bean="org.apache.jetspeed.headerresource.HeaderResourceFactory"/></constructor-arg>
+    <constructor-arg><value>/WEB-INF/jetui/yui/jetui.jsp</value></constructor-arg>        
+  </bean>
+  
+   <bean id="jetuiAggregator" class="org.apache.jetspeed.ui.JetuiAggregatorImpl">
+    <meta key="j2:cat" value="default" />
+    <constructor-arg index="0">
+      <ref bean="org.apache.jetspeed.aggregator.PortletRenderer" />
+    </constructor-arg>
+    <constructor-arg>
+      <ref bean="jetui" />
+    </constructor-arg>
+  </bean>
+    
+
 </beans>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message