portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r547801 [1/2] - in /portals/jetspeed-2/trunk/src/webapp: WEB-INF/conf/ WEB-INF/templates/ WEB-INF/templates/layout/ WEB-INF/templates/layout/html/columns/ decorations/layout/ decorations/layout/tigris/ decorations/portlet/
Date Fri, 15 Jun 2007 21:45:55 GMT
Author: taylor
Date: Fri Jun 15 14:45:53 2007
New Revision: 547801

URL: http://svn.apache.org/viewvc?view=rev&rev=547801
Log:
https://issues.apache.org/jira/browse/JS2-711
overall implementation from Mohan KR
basic implementation of 
* view mode
* multi columns
* tigris only page and portlet decorations
* edit mode

needs more testing, but looking good

To enable JSP mode:

1. edit WEB-INF/templates/layout/html/columns/layout.properties

template.type=JSP
template.extension=.jsp

2. edit decorations/layout/tigris/decorator.properties:

template.type=JSP
template.extension=.jsp
header=header.jsp
footer=footer.jsp

3. edit decorations/layout/tigris/header.jsp, and add the string JSP to the title, just to know that you are indeed using JSP templates and decorators
   (the <title> is the browser title bar)

  <title>JSP <c:out value="${PageTitle}" /></title>

4. cp jetspeed-layout-portlets-2.1.1-dev.jar WEB-INF/lib
This step is still an issue. I am looking into moving the layout jars into the jetspeed portal proper as an 'internal' type PA instead of 'local' PA

A few gotchas:

1. it only works with the tigris decorators (page and portlet)
2. it seems to break the desktop for the tigris decorator
3.  step 4 needs to be refined 

Added:
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutCustomizerNormal.jsp
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutNormal.jsp
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.jsp
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/positionPortletCustomizer.jsp
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/templateLayoutCustomizer.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/initLayoutDecorators.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/footer.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/header.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/tigrisNavigations.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorations_portlet_init.jsp
    portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorator.jsp
Modified:
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/conf/jetspeed.properties

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/conf/jetspeed.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/conf/jetspeed.properties?view=diff&rev=547801&r1=547800&r2=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/conf/jetspeed.properties (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/conf/jetspeed.properties Fri Jun 15 14:45:53 2007
@@ -82,8 +82,8 @@
 # -------------------------------------------------------------------
 # standard
 supported.windowstate = normal
-supported.windowstate = maximized
-supported.windowstate = minimized
+#supported.windowstate = maximized
+#supported.windowstate = minimized
 supported.windowstate = solo
     
 # -------------------------------------------------------------------

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutCustomizerNormal.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutCustomizerNormal.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutCustomizerNormal.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutCustomizerNormal.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,123 @@
+<%@ include file="initTemplatesLayoutNormal.jsp" %>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@page import="org.apache.jetspeed.decoration.DecorationFactory"%>
+<%@page import="java.util.ResourceBundle"%>
+<%@page import="java.util.Locale"%>
+<%@page import="javax.servlet.jsp.jstl.core.Config"%>
+<%@page import="javax.servlet.jsp.jstl.fmt.LocalizationContext"%>
+
+  <%-- BEGIN DECLARATIONS --%>
+
+  <%!
+  
+
+  %>
+  
+  <%-- END DECLARATIONS --%>
+
+  <%-- BEGIN customizer page scoped variables and declarations --%>
+    <%
+        //layoutType
+        String _layoutType = portletConfig.getInitParameter("layoutType");
+        pageContext.setAttribute("layoutType", _layoutType, PAGE_SCOPE);
+        
+        
+        Set pageDecorations = _decorationFactory.getPageDecorations(_rc);
+        pageContext.setAttribute("pageDecorations", pageDecorations, PAGE_SCOPE);
+        
+        
+        //messages
+        Locale _tmpLocale = (Locale) renderRequest.getLocale();
+        ResourceBundle _messages = (ResourceBundle) portletConfig.getResourceBundle(renderRequest.getLocale());
+        pageContext.setAttribute("messages", _messages, PAGE_SCOPE);
+        //Now set the JSTL default format bundle ** FORMAT BUNDLE **
+        javax.servlet.jsp.jstl.core.Config.set(request,Config.FMT_LOCALIZATION_CONTEXT,
+                                               new LocalizationContext(_messages, _tmpLocale));
+        
+
+        //capture all the allowed property
+        boolean isRoot = false;
+        if (_myPage.getRootFragment() == _myFragment)
+          isRoot = true;
+        
+        if (isRoot)
+        {
+          pageContext.setAttribute("allowChangePageTheme",
+                getBoolProperty(_rootDecorator,"allow.change.page.theme",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowAddPage",
+                  getBoolProperty(_rootDecorator,"allow.add.page",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowChangePageName",
+                  getBoolProperty(_rootDecorator,"allow.change.page.name",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowNavigatePage",
+                  getBoolProperty(_rootDecorator,"allow.navigate.page",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowDeletePage",
+                  getBoolProperty(_rootDecorator,"allow.delete.page",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowChangeFolderTheme",
+                  getBoolProperty(_rootDecorator,"allow.change.folder.theme",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowAddFolder",
+                  getBoolProperty(_rootDecorator,"allow.add.folder",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowChangeFolderName",
+                  getBoolProperty(_rootDecorator,"allow.change.folder.name",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowNavigateFolder",
+                  getBoolProperty(_rootDecorator,"allow.navigate.folder",true), PAGE_SCOPE);
+          pageContext.setAttribute("allowDeleteFolder",
+                  getBoolProperty(_rootDecorator,"allow.delete.folder",true), PAGE_SCOPE);
+
+        }
+        else
+        {
+            pageContext.setAttribute("allowChangePageTheme",
+                    Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowAddPage",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowChangePageName",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowNavigatePage",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowDeletePage",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowChangeFolderTheme",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowAddFolder",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowChangeFolderName",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowNavigateFolder",
+            		  Boolean.FALSE, PAGE_SCOPE);
+              pageContext.setAttribute("allowDeleteFolder",
+            		  Boolean.FALSE, PAGE_SCOPE);
+        }
+
+        pageContext.setAttribute("allowChangeLayout",
+                getBoolProperty(_rootDecorator,"allow.change.layout",true), PAGE_SCOPE);
+        pageContext.setAttribute("allowAddPortlet",
+                getBoolProperty(_rootDecorator,"allow.add.portlet",true), PAGE_SCOPE);
+        
+        pageContext.setAttribute("allowChangePortletDecorator",
+                getBoolProperty(_rootDecorator,"allow.change.portlet.decorator",true), PAGE_SCOPE);
+
+        //maxLayoutNesting TODO: reminder to ask who sets fragmentNestingLevel
+        Integer _maxLayoutNesting = getIntProperty(_rootDecorator, "max.layout.nesting", 2);
+        Integer fragNestingLevel = (Integer) renderRequest.getAttribute("fragmentNestingLevel");
+        
+        if (fragNestingLevel.intValue() < _maxLayoutNesting.intValue() ) 
+        {
+            pageContext.setAttribute("allowAddLayout", Boolean.TRUE, PAGE_SCOPE);
+        }
+        else
+        {
+            pageContext.setAttribute("allowAddLayout", Boolean.FALSE, PAGE_SCOPE);
+          
+        }
+    %>
+
+<%@page import="java.util.Set"%>
+<c:set var="profiledPage" value="${psrc.page.path}" scope="page"/>
+    
+
+  <%-- END customizer page scoped variables and declarations --%>  
+  
+  <%-- BEGIN customizer content --%>
+
+  
+  <%-- END customizer content --%>

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutNormal.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutNormal.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutNormal.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/initTemplatesLayoutNormal.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,217 @@
+<%@page language="java" pageEncoding="UTF-8"%>
+
+<%@page import="org.apache.commons.logging.Log"%>
+<%@page import="org.apache.commons.logging.LogFactory"%>
+
+<%@page import="org.apache.jetspeed.PortalReservedParameters"%>
+<%@page import="org.apache.jetspeed.decoration.Theme"%>
+<%@page import="org.apache.jetspeed.layout.JetspeedPowerTool"%>
+<%@page import="org.apache.jetspeed.om.page.Page"%>
+<%@page import="org.apache.jetspeed.om.page.ContentFragment"%>
+<%@page import="org.apache.jetspeed.decoration.LayoutDecoration"%>
+<%@page import="org.apache.jetspeed.portlets.layout.ColumnLayout"%>
+<%@page import="org.apache.jetspeed.portalsite.PortalSiteRequestContext"%>
+<%@page import="org.apache.jetspeed.headerresource.HeaderResourceFactory"%>
+<%@page import="org.apache.jetspeed.headerresource.HeaderResource"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@page import="org.apache.jetspeed.portlets.layout.LayoutCoordinate"%>
+<%@page import="org.apache.jetspeed.decoration.LayoutDecoration"%>
+<%@page import="org.apache.jetspeed.decoration.DecorationFactory"%>
+<%@page import="org.apache.jetspeed.om.page.ContentFragment"%>
+<%@page import="org.apache.jetspeed.util.Path"%>
+
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+
+<portlet:defineObjects/>
+
+
+
+  <%!  
+      private static final Log log = LogFactory.getLog("org.apache.jetspeed.portlets.layout.jsp_templates");
+      private static final int REQ_SCOPE = PageContext.REQUEST_SCOPE;
+      private static final int PAGE_SCOPE = PageContext.PAGE_SCOPE;
+      
+      private String getLayoutResource(LayoutDecoration _layoutDecoration,String _path)
+      {
+        String _resourcePath = _layoutDecoration.getResource(_path);
+        return ((null == _resourcePath) ? _path : _resourcePath);
+      }
+      private Boolean getBoolProperty(LayoutDecoration _decorator, String propKey, boolean _default)
+      {
+          Boolean value = new Boolean(_default);
+          String _value = _decorator.getProperty(propKey);
+          if ( (_value != null) && !(_value.equalsIgnoreCase("")) )
+          {
+             value = new Boolean(_value);
+          }
+          return value;
+      }
+
+      private Integer getIntProperty(LayoutDecoration _decorator, String propKey, int _default)
+      {
+          Integer value = new Integer(_default);
+          String _value = _decorator.getProperty(propKey);
+          if ( (_value != null) && !(_value.equalsIgnoreCase("")) )
+          {
+              try 
+              {
+                  value = new Integer(_value);
+              }
+              catch (NumberFormatException e)
+              {
+                log.warn("wrong format for property:<" + propKey + "> " + "value given:<" + _value + ">");
+              }
+             
+          }
+          return value;
+      }
+      
+      
+  %>
+
+  <%
+      // Since we will try to *avoid* using the rt, let's stuff everything in the pageContext
+      //contextPath
+      String _cPath = (String) request.getContextPath();
+  
+      if (_cPath.equalsIgnoreCase(""))
+      {
+          _cPath = "/"; 
+      }
+      else if (_cPath.endsWith("/"))
+      {
+          _cPath = _cPath.substring(0,_cPath.length()-1);
+      }
+      pageContext.setAttribute("cPath",_cPath,REQ_SCOPE);
+    
+      //baseHRef  
+      String _baseHRef = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ _cPath + "/";
+      pageContext.setAttribute("baseHRef", _baseHRef, REQ_SCOPE);
+    
+      //Jetspeed Power Tool
+      JetspeedPowerTool _jpt = (JetspeedPowerTool) renderRequest.getAttribute(PortalReservedParameters.JETSPEED_POWER_TOOL_REQ_ATTRIBUTE);
+      pageContext.setAttribute("jpt", _jpt, REQ_SCOPE);
+    
+      //Jetspeed Request Context
+      RequestContext _rc = (RequestContext) renderRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+
+      //PortalSiteRequestContext
+      PortalSiteRequestContext _psrc = (PortalSiteRequestContext) renderRequest.getAttribute("org.apache.jetspeed.portalsite.PortalSiteRequestContext");
+      pageContext.setAttribute("psrc", _psrc, REQ_SCOPE);
+
+      //Get the resourceHeaderFactory
+      HeaderResourceFactory headerResourceFactory = (HeaderResourceFactory) _jpt.getComponent("org.apache.jetspeed.headerresource.HeaderResourceFactory");
+      HeaderResource headerResource = null;
+      if (null != headerResourceFactory)
+      {
+          headerResource = headerResourceFactory.getHeaderResouce(_rc);
+      }
+      else
+      {
+          log.warn("JSPTemplate: Could not acquire HeaderResourceFactory during template initialization"); 
+      }
+      pageContext.setAttribute("headerResource", headerResource, REQ_SCOPE);
+      
+  %>
+
+  <%
+  
+      //Theme
+      Theme _theme = (Theme) renderRequest.getAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE);
+      pageContext.setAttribute("theme",_theme,REQ_SCOPE);
+    
+      //myPage
+      Page _myPage = _jpt.getPage();
+      pageContext.setAttribute("myPage", _myPage, REQ_SCOPE);
+    
+      
+      //numberOfColumns
+      Integer _numberOfColumns = (Integer)renderRequest.getAttribute("numberOfColumns");
+      pageContext.setAttribute("numberOfColumns", _numberOfColumns, REQ_SCOPE);
+    
+      //editing mode?
+      Boolean _editing = (Boolean) renderRequest.getAttribute("editing");
+      pageContext.setAttribute("editing", _editing, REQ_SCOPE);
+    
+    
+      //columnLayout, no type info here because layout jars not available
+      // TODO got to move ColumnLayout from layout-portlets out! Jetspeed webapp cannot see it!
+      ColumnLayout _columnLayout = (ColumnLayout) renderRequest.getAttribute("columnLayout");
+      pageContext.setAttribute("columnLayout", _columnLayout, REQ_SCOPE);
+    
+      //myFragment
+      ContentFragment _myFragment = _jpt.getCurrentFragment();
+      pageContext.setAttribute("myFragment", _myFragment, PAGE_SCOPE);
+      
+      //defaultDecorator
+      String _defaultDecorator = _myPage.getDefaultDecorator(_myFragment.getType());
+      pageContext.setAttribute("defaultDecorator", _defaultDecorator, PAGE_SCOPE);
+  
+      //decorationFactory
+      DecorationFactory _decorationFactory = (DecorationFactory) renderRequest.getAttribute("decorationFactory");
+      pageContext.setAttribute("decorationFactory", _decorationFactory, PAGE_SCOPE);
+
+      if (_editing)
+      {
+	      //LayoutDecorations list
+	      pageContext.setAttribute("layoutDecorationsList",
+	                                _decorationFactory.getLayouts(_rc),REQ_SCOPE);
+	      //LayoutDecorations list
+	      pageContext.setAttribute("portletDecorationsSet",
+	                                _decorationFactory.getPortletDecorations(_rc),REQ_SCOPE);
+      }
+      
+      //rootDecorator
+      LayoutDecoration _rootDecorator = (LayoutDecoration)((ContentFragment)_myPage.getRootFragment()).getDecoration();
+      pageContext.setAttribute("rootDecorator",_rootDecorator, PAGE_SCOPE);
+  %>
+
+
+  <%-- BEGIN Page and Request Scoped Variables --%>
+
+    <%-- decorator --%>
+    <c:set var="decorator" value="${myFragment.decorator}" scope="page"/>  
+    <c:if test="${empty decorator}">
+      <c:set var="decorator" value="${defaultDecorator}" scope="page"/>
+    </c:if>
+  
+    <%-- root --%>
+    <c:if test="${myFragment eq myPage.rootFragment}" var="isRoot" scope="page"/>
+
+    <%-- ContentType --%>
+    <c:set var="ContentType" value="text/html" scope="request" />
+    <c:if test="${not empty renderResponse.characterEncoding}">
+      <c:set var="ContentType" value="${requestScope.ContentType};${renderResponse.characterEncoding}" scope="request" />
+    </c:if>
+  
+    <%-- SiteVersionTag --%>
+    <c:set var="SiteVersionTag" value="$Id$" scope="request" />
+  
+  
+    <%-- includeJavaScriptforHead --%>
+    <c:set var="includeJavaScriptForHead" scope="request">
+     <script type="text/javascript">
+      <!--//--><![CDATA[//><!--
+        function openWindow(pipeline)
+        {    
+          var vWinUsers = window.open(pipeline, 'PortletSelector', 'status=no,resizable=yes,width=500,height=600,scrollbars=yes');
+          vWinUsers.opener = self;
+          vWinUsers.focus();
+        }
+      //--><!]]>
+     </script>
+    </c:set>
+  
+    <c:set var="includeStyleSheets" scope="request">
+      <c:forEach var="style" items="${theme.styleSheets}">
+        <link rel="stylesheet" type="text/css" media="screen, projection" href="<c:out value='${cPath}/${style}' escapeXml='false'/>" />
+      </c:forEach>
+    </c:set>
+
+
+  <%-- END Request and Scoped Variables --%>
+
+

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,150 @@
+<%@ include file="../../../initTemplatesLayoutNormal.jsp" %>
+
+
+
+
+  <%--  Check if I am root fragment --%>
+  <c:set var="lastColumn" value="${numberOfColumns - 1}" scope="request"/>
+
+  <% 
+      log.debug("------------ SSS ");
+
+      LayoutDecoration layoutDecoration = (LayoutDecoration)_myFragment.getDecoration();
+      // get the layout decoration header file
+      String headerJSP = layoutDecoration.getHeader();
+      if (!(headerJSP.startsWith("/")))
+      {
+    	  headerJSP = "/" + headerJSP;
+      }
+      pageContext.setAttribute("layoutHeaderJSP", headerJSP, PAGE_SCOPE);
+      
+      // get the layout decoration footer file
+      String footerJSP = layoutDecoration.getFooter();
+      if (!(footerJSP.startsWith("/")))
+      {
+        footerJSP = "/" + footerJSP;
+      }
+      pageContext.setAttribute("layoutFooterJSP", footerJSP, PAGE_SCOPE);
+
+
+  %>
+
+  
+  <%-- ***** BEGIN header.jsp ***** --%>
+    <c:choose>
+      <c:when test="${isRoot}">
+        <c:import url="${layoutHeaderJSP}">
+        </c:import>
+        <c:set var="layoutClass" value="portal-nested-layout" scope="page"/>
+      </c:when>
+      <c:otherwise>
+        <c:set var="layoutClass" value="portal-layout" scope="page"/>
+      </c:otherwise>
+    </c:choose>
+  <%-- ***** END header.jsp ***** --%>
+  
+  
+
+      <div id="<portlet:namespace/>"
+           class="<c:out value='${layoutClass} ${layoutClass}-${layoutType }'/>"> <!-- S:div main -->
+        
+        <c:if test="${editing}">
+          <c:set var="customizerUrl" value="/WEB-INF/templates/templateLayoutCustomizer.jsp"/>
+          <c:import url="${customizerUrl}"/>
+        </c:if>
+
+        
+                 <c:set var="dcnt" value="0" scope="request"/>
+        <c:forEach var="column" items="${columnLayout.columns}" varStatus="columnLoop" >  <!--  S:columnLayouts  -->
+
+          <%-- req paramter to positioner  --%>
+          <c:set var="loopIndex" value="${columnLoop.index}" scope="request"/>
+          <%-- BEGIN setup div attributes --%>
+          <%
+              int _loopIndex = ((Integer) pageContext.getAttribute("loopIndex", REQ_SCOPE)).intValue();
+      
+              String _columnFloat = _columnLayout.getColumnFloat(_loopIndex);
+              pageContext.setAttribute("columnFloat",_columnFloat);
+              
+              String _columnWidth = _columnLayout.getColumnWidth(_loopIndex);
+              pageContext.setAttribute("columnWidth",_columnWidth);
+           %>
+           <c:set var="divId" value="column_${myFragment.id}_${loopIndex}" />
+           <c:set var="divClass" value="portal-layout-column portal-layout-column-${layoutType}-${loopIndex}"/>
+           <c:set var="divStyle" value="float:${columnFloat}; width:${columnWidth};" />
+           <%-- END setup div attributes --%>
+      
+      
+             <div id="<c:out value='${divId}'/>"
+                  class="<c:out value='${divClass}'/>"
+                  style="<c:out value='${divStyle}'/>">  <!--  S: content for each column -->
+      
+                 <%-- BEGIN Render Fragments in Column --%>
+                 <c:forEach var="frag" items="${column}">
+                   <c:set var="indexFrag" value="${frag}" scope="request"/>
+                   <c:set var="dcnt" value="${dcnt + 1}" scope="request"/>
+                   
+                   <%
+                      ContentFragment _frag = (ContentFragment) pageContext.getAttribute("frag",PAGE_SCOPE);
+
+                      LayoutCoordinate _coords = _columnLayout.getCoordinate(_frag);
+                      pageContext.setAttribute("coords",_coords);
+                      int _col = _coords.getX();
+                      pageContext.setAttribute("col",_col);
+                      int _row = _coords.getY();
+                      pageContext.setAttribute("row",_row);
+                      
+                      pageContext.setAttribute("lastRow",_columnLayout.getLastRowNumber(_col));
+                      
+                   %>
+                   <c:set var="pClass" value="portal-layout-cell portal-layout-cell-${layoutType}-${row}-${col}" />
+                    <c:if test="${editing}">
+                      <c:set var="portletCustomizerUrl" value="/WEB-INF/templates/layout/positionPortletCustomizer.jsp"/>
+                      <c:import url="../../positionPortletCustomizer.jsp" />
+                    </c:if>
+                    <!-- BEGIN PORTLET CONTENT -->
+                    <div class="<c:out value='${pClass}' />">
+                    
+                      <%-- do the rendering --%>
+                      <%
+                        //inform JPT that we are current.
+                        _jpt.setCurrentFragment(_frag);
+                      
+                      %>
+                      
+                      <c:choose>
+                        <c:when test="${frag.type eq 'portlet'}">
+
+                          <%
+                              // TODO hack alert, we need to do this because PortletDecorationImpl has
+                              // decorator.vm hard coded sigh!     
+                              String _tempPath = _frag.getDecoration().getBasePath();
+                              String _portletJSP = _tempPath.substring(0,_tempPath.lastIndexOf('/')) +
+                                                   "/decorator.jsp";
+                              pageContext.setAttribute("fragTemplateUrl", _portletJSP, PageContext.PAGE_SCOPE);
+                          %>
+                          
+                          <c:import url="${fragTemplateUrl}">
+                          </c:import>
+                        </c:when>
+                        <c:otherwise>
+                          <c:out value="${frag.renderedContent}" />
+                        </c:otherwise>
+                      </c:choose>
+                    </div>
+                    <!-- END PORTLET CONTENT -->
+                 
+                 </c:forEach>
+                 <%-- END Render Fragments in Column --%>
+             
+             </div> <!--  E: content for each column -->
+           
+        </c:forEach> <!--  E:columnLayouts  -->
+      
+      </div> <!-- E:div main -->
+
+  
+  <%-- ***** BEGIN footer.jsp ***** --%>
+  <c:import url="${layoutFooterJSP}"></c:import>
+  <%-- ***** END footer.jsp ***** --%>
+  
\ No newline at end of file

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/positionPortletCustomizer.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/positionPortletCustomizer.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/positionPortletCustomizer.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/positionPortletCustomizer.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,139 @@
+<%@ include file="../initTemplatesLayoutNormal.jsp" %>
+
+  <%
+      // columnLayout already inhertited
+
+      // our current index in the loop
+      int loopIndex = ((Integer) renderRequest.getAttribute("loopIndex")).intValue();
+      
+      // get the fragment in the loop
+      ContentFragment indexFrag = (ContentFragment) renderRequest.getAttribute("indexFrag");
+      LayoutCoordinate _coords = _columnLayout.getCoordinate(indexFrag);
+      pageContext.setAttribute("coords",_coords, PAGE_SCOPE);
+      
+      int _col = _coords.getX();
+      pageContext.setAttribute("col", _col, PAGE_SCOPE);
+      int _row = _coords.getY();
+      pageContext.setAttribute("row", _row, PAGE_SCOPE);
+  
+      pageContext.setAttribute("lastRow",_columnLayout.getLastRowNumber(_col), PAGE_SCOPE);
+
+      String columnFloat = _columnLayout.getColumnFloat(loopIndex);
+      pageContext.setAttribute("columnFloat",columnFloat, PAGE_SCOPE);
+      
+      String columnWidth = _columnLayout.getColumnWidth(loopIndex);
+      pageContext.setAttribute("columnWidth",columnWidth, PAGE_SCOPE);
+
+      //get all the portlet move images
+      pageContext.setAttribute("movePortletLeft", _cPath + "/" +
+                getLayoutResource(_rootDecorator,"images/movePortletLeft.gif"), PAGE_SCOPE);
+      
+      pageContext.setAttribute("movePortletRight", _cPath + "/" +
+              getLayoutResource(_rootDecorator,"images/movePortletRight.gif"), PAGE_SCOPE);
+
+      pageContext.setAttribute("movePortletUp", _cPath + "/" +
+              getLayoutResource(_rootDecorator,"images/movePortletUp.gif"), PAGE_SCOPE);
+
+      pageContext.setAttribute("movePortletDown", _cPath + "/" +
+              getLayoutResource(_rootDecorator,"images/movePortletDown.gif"), PAGE_SCOPE);
+      
+      pageContext.setAttribute("imgClose", _cPath + "/" +
+              getLayoutResource(_rootDecorator,"images/close.gif"), PAGE_SCOPE);
+      
+      
+      pageContext.setAttribute("allowChangePortletDecorator",
+              getBoolProperty(_rootDecorator,"allow.change.portlet.decorator",true), PAGE_SCOPE);
+  %>
+
+  <%-- current loop index passed in request --%>
+  <c:set var="curIndex" value="${requestScope.loopIndex}"/>
+
+  <%-- the current loop fragment passed in request --%>
+  <c:set var="f" value="${requestScope.indexFrag}" scope="request"/>
+
+  <%-- lastColumn passed in request --%>
+  <c:set var="lc" value="${requestScope.lastColumn}" scope="page"/>
+ 
+
+  <c:set var="actionName">
+    <portlet:namespace/><c:out value="${requestScope.dcnt}"/>
+  </c:set>
+
+    
+      <%-- START PORTLET EDITING MODE POSITIONING --%>
+      
+          <div class="portlet-edit-bar">  <!--  B: div  portlet-edit-bar portlet positioning -->
+            <form name="f<c:out value='${actionName}'/>" 
+                  action="<portlet:actionURL/>" method="post">
+                  
+              <input type="hidden" name="fragment" 
+                     value="<c:out value='${f.id}'/>">
+              <input type="hidden" name="move" value="">
+              <input type="hidden" name="remove" value="">
+              <c:choose>
+              
+                <c:when test="${f.type eq 'portlet' }">
+                  <c:set var="fragmentType" value="Portlet" scope="page"/>
+                  <c:if test="${allowChangePortletDecorator}">
+                      <select id="decorator" name="decorator" 
+                              onChange="f<c:out value='${actionName}'/>.submit()">
+                        <option value=""/>
+                        <c:forEach var="pd" items="${portletDecorationsSet}">
+                          <c:set var="_sel" value=""/>
+                          <c:if test="${f.decorator eq pd}">
+                            <c:set var="_sel" value='selected="selected"'/>
+                          </c:if>
+                          <option value="<c:out value='${pd}'/>" 
+                                  <c:out escapeXml="false" value="${_sel}"/>>
+                                  <c:out value="${pd}"/>
+                        </c:forEach>
+                    </select>
+                  </c:if>
+                </c:when>
+                
+                <c:otherwise>
+                  <c:set var="fragmentType" value="Layout" scope="page"/>
+                </c:otherwise>
+                
+              </c:choose>
+              <c:set var="fmtKeyLeft" value="portal.page.editing.move${fragmentType}Left"/>
+              <c:set var="fmtKeyRight" value="portal.page.editing.move${fragmentType}Right"/>
+              <c:set var="fmtKeyUp" value="portal.page.editing.move${fragmentType}Up"/>
+              <c:set var="fmtKeyDown" value="portal.page.editing.move${fragmentType}Down"/>
+              <c:set var="fmtKeyRemove" value="portal.page.editing.remove${fragmentType}"/>
+              
+              <%-- Move Portlet Left --%>
+              <c:if test="${lc gt 0 and col gt 0}">
+                <a href="#" onClick="f<c:out value='${actionName}'/>.move.value='3';f<c:out value='${actionName}'/>.submit();return false;" class="move-portlet-left">
+                  <img src="<c:out value='${movePortletLeft}'/>" border="0" title="<fmt:message key='${fmtKeyLeft}'/>"/>
+                </a>
+              </c:if>
+              
+              <c:if test="${row gt 0}">
+                <a href="#" onClick="f<c:out value='${actionName}'/>.move.value='1';f<c:out value='${actionName}'/>.submit();return false;" class="move-portlet-up">
+                  <img src="<c:out value='${movePortletUp}'/>" border="0" title="<fmt:message key='${fmtKeyUp}'/>"/>
+                </a>
+              </c:if>
+
+              <%-- Remove Portlet BUG: report typo in class --%>
+              <a href="#" onClick="f<c:out value='${actionName}'/>.remove.value='y';f<c:out value='${actionName}'/>.submit();return false;" class="remove-portlet-from-page">
+                <img src="<c:out value='${imgClose}'/>" border="0" title="<fmt:message key='${fmtKeyRemove}'/>"/>
+              </a>       
+              <%-- Move Portlet Down --%>
+              <c:if test="${row lt lastRow}">
+                <a href="#" onClick="f<c:out value='${actionName}'/>.move.value='2';f<c:out value='${actionName}'/>.submit();return false;" class="move-portlet-down">
+                  <img src="<c:out value='${movePortletDown}'/>" border="0" title="<fmt:message key='${fmtKeyDown}'/>"/>
+                </a>
+              </c:if>
+
+              <%-- Move Portlet Left --%>
+              <c:if test="${lc gt 0 and col lt lc}">
+                <a href="#" onClick="f<c:out value='${actionName}'/>.move.value='4';f<c:out value='${actionName}'/>.submit();return false;" class="move-portlet-right">
+                  <img src="<c:out value='${movePortletRight}'/>" border="0" title="<fmt:message key='${fmtKeyRight}'/>"/>
+                </a>
+              </c:if>
+            </form>      
+          </div> <!--  B: div  portlet-edit-bar portlet positioning -->
+  
+  
+  
\ No newline at end of file

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/templateLayoutCustomizer.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/templateLayoutCustomizer.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/templateLayoutCustomizer.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/templateLayoutCustomizer.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,274 @@
+<%@ include file="initTemplatesLayoutCustomizerNormal.jsp" %>
+
+
+
+    <%
+
+      //chooser url
+      String _chooserUrl = _jpt.getBasePath() + 
+                                  "/system/customizer/selector.psml?jspage=" +
+                                  _psrc.getPage().getPath() +
+                                  "&jslayoutid=" +
+                                  _myFragment.getId();
+      pageContext.setAttribute("chooserUrl", renderResponse.encodeURL(_chooserUrl), 
+              PAGE_SCOPE);
+      
+      // all images paths
+      
+      pageContext.setAttribute("imgSelect", _cPath + "/" + getLayoutResource(_rootDecorator,"images/select.gif"), 
+              PAGE_SCOPE);
+    
+    %>
+    <!--  setup the message bundle -->
+    
+    
+    <c:set var="chooser" scope="page" value="${jpt.basePath}/system/customizer/selector.psml?jspage=${profiledPage}&jslayoutid=${myFragment.id}"/>
+
+        <!--  BEGIN: customizer content -->
+
+    <div class="layout-edit-bar">   <!-- B: div layout-edit-bar -->
+
+          <fieldset>    
+            <div class="layout-edit-bar-left"> <!-- B: div layout-edit-bar-left -->
+                <div class="layout-title">
+                  <b><fmt:message key="portal.page.customizer.name"/></b>
+                </div>
+            </div> <!-- E: div layout-edit-bar-left -->
+            <div class="layout-edit-bar-right"> <!-- B: div layout-edit-bar-right -->
+              <c:if test="${allowAddPortlet}">
+                <label><fmt:message key="portal.page.editing.portlet"/></label>
+                <a href="<c:out escapeXml='false' value='${chooserUrl}'/>">
+                  <img src="<c:out value="${imgSelect}"/>"
+                       border="0"
+                       title="<fmt:message key="portal.page.editing.addportlet"/>"/>
+                </a>
+              </c:if>
+            </div> <!-- E: div layout-edit-bar-right -->
+          </fieldset>
+
+        <!--  END: customizer content -->
+        
+        <!-- BEGIN: All editing modes -->
+        <form name="f<portlet:namespace/>" action="<portlet:actionURL/>" method="post"> <!--  B: main form -->
+          <!-- add and change layout -->
+          <fieldset> <!-- B: add change layout -->
+              <div class="layout-edit-bar-left"> <!-- B: customizer layout-edit-bar-left -->
+
+            <%-- B: addLayout or changeLayout block--%>
+            <c:if test="${allowAddLayout or allowChangeLayout}">
+                 <div class="layout-title"><b><fmt:message key="portal.page.editing.layoutConfiguration"/></b></div>   
+
+                 <div class="layout-content"> <!-- B: div class layout-content -->
+            </c:if>
+
+            <%-- allowChangePageTheme --%>
+            <c:if test="${allowChangePageTheme}">
+                  <div> <!-- B: div allowChangePageTheme -->
+                    <label for="theme"><fmt:message key="portal.page.editing.theme"/></label>
+                    <select id='theme' name='theme' onChange="f<portlet:namespace/><portlet:actionURL/>">
+                      <c:forEach var="td" items="${pageDecorations}">
+                        <c:set var="_sel" value=""/>
+                        <c:if test="${rootDecorator.name eq td}">
+                          <c:set var="_sel" value='selected="selected"'/>
+                        </c:if>
+                        <option value="<c:out value='${td}'/>" <c:out escapeXml="false" value="${_sel}"/>/>
+                        <c:out value="${td}"/>
+                      </c:forEach>
+                    </select>   
+                  </div> <!-- E: div allowChangePageTheme -->
+            </c:if>
+            
+            <%-- add/changeLayout --%>
+            <c:if test="${allowAddLayout or allowChangeLayout}">
+                  <div> <!-- B: div add change layout -->
+                    <label for="layout"><fmt:message key="portal.page.editing.layout"/></label>
+                    <select id='layout' name='layout'>
+                      <c:forEach var="ld" items="${layoutDecorationsList}">
+                        <c:set var="_sel" value=""/>
+                        <c:if test="${myFragment.name eq ld.name}">
+                          <c:set var="_sel" value='selected="selected"'/>
+                        </c:if>
+                        <option value="<c:out value='${ld.name}'/>" 
+                                <c:out escapeXml="false" value="${_sel}"/>/>
+                                <c:out value="${ld.name}"/>
+                      </c:forEach>
+                    </select>
+            </c:if>
+            <c:if test="${allowChangeLayout}">
+                    <input type="submit" name="jsChangeLayout" value="<fmt:message key='portal.page.editing.changelayout'/>" />
+            </c:if>
+            <c:if test="${allowAddLayout}">
+                    <input type="submit" name="jsAddLayout" value="<fmt:message key='portal.page.editing.addlayout'/>" />
+            </c:if>
+            <c:if test="${allowAddLayout or allowChangeLayout}">
+                  </div> <!-- E: div add change layout -->
+            </c:if>
+
+            <%-- allow portlet decorations --%>
+            <%-- TODO figure out what myFragment should be ?? --%>
+            <c:if test="${allowChangePortletDecorator}">
+                  <div> <!--  B: allowChangePortletDecorator -->
+                    <input type="hidden" name="fragment" value="<c:out value='${myFragment.id}'/>">
+                    <input type="hidden" name="move" value="">
+                    <input type="hidden" name="remove" value="">
+                    <label for="decorators"><fmt:message key='portal.page.editing.portlet.decorator'/></label>
+                    <select id="decorators" name="decorators">
+                      <option value=""/>
+                        <c:forEach var="pd" items="${portletDecorationsSet}">
+                          <c:set var="_sel" value=""/>
+                          <c:if test="${myFragment.decorator eq pd}">
+                            <c:set var="_sel" value='selected="selected"'/>
+                          </c:if>
+                          <option value="<c:out value='${pd}'/>" 
+                                  <c:out escapeXml="false" value="${_sel}"/>/>
+                                  <c:out value="${pd}"/>
+                        </c:forEach>
+                    </select>
+                    <input type="submit" name="jsSubmitTheme" value="<fmt:message key='portal.page.editing.changethemeall'/>"/>
+                  </div> <!--  E: allowChangePortletDecorator -->
+            </c:if>
+            
+            <c:if test="${allowAddLayout or allowChangeLayout}">
+                 </div> <!-- E: div class layout-content -->
+            </c:if>
+            
+            <%-- E: addLayout or changeLayout block--%>
+              </div> <!-- E: customizer layout-edit-bar-left -->
+          </fieldset><!-- E: add change layout -->
+          
+          <%-- All portal page customizers  --%>
+          <fieldset style="float:left;width:49%;margin:0px;padding:0px;"> <!-- B: portal page customizer fieldset -->
+
+            <div class="layout-edit-bar-left"> <!-- B: page customizer layout-edit-bar-left -->
+
+            <%-- B: AddPage ChangePage PageTheme customizer block--%>
+            <c:if test="${allowAddPage or allowChangePageName or allowDeletePage}">
+                 <div class="page-title"><b><fmt:message key="portal.page.editing.pageConfiguration"/></b></div>   
+                 <div class="page-content"> <!-- B: div class page-content -->
+            </c:if>
+
+            <c:if test="${allowAddPage or allowChangePageName}">
+                    <div>
+                      <label for="pagename"><fmt:message key="portal.page.editing.page"/></label>
+                      <input id="pagename" name="jsPageName"/>
+                    </div>
+                    <div>
+                      <label for="pagetitle"><fmt:message key="portal.page.editing.page.title"/></label>
+                      <input id="pagetitle" name="jsPageTitle"/>
+                    </div>
+                    <div>
+                      <label for="pageshorttitle"><fmt:message key="portal.page.editing.page.shorttitle"/></label>
+                      <input id="pageshorttitle" name="jsPageShortTitle"/>
+                    </div>
+                    <div> <!--  B: test allowAddPage or allowChangePageName -->
+            </c:if>
+            <c:if test="${allowAddPage}">
+                      <input type="submit" name="jsSubmitPage" value="<fmt:message key='portal.page.editing.addpage'/>"/>
+            </c:if>                    
+            <c:if test="${allowChangePageName}">
+                      <input type="submit" name="jsChangePageName" value="<fmt:message key='portal.page.editing.changepagename'/>"/>
+            </c:if>                    
+            <c:if test="${allowAddPage or allowChangePageName}">
+                    </div> <!--  E: test allowAddPage or allowChangePageName -->
+            </c:if>
+                                
+            <c:if test="${allowNavigatePage}">
+                    <div>
+                      <label><fmt:message key="portal.page.editing.pagenavigation"/></label>
+                      <input id="move-page-left" type="submit" name="jsMovePageLeft" value="<fmt:message key='portal.page.editing.movePageLeft'/>" />
+                      <input id="move-page-right" type="submit" name="jsMovePageRight" value="<fmt:message key='portal.page.editing.movePageRight'/>" />
+                    </div>
+            </c:if>                    
+
+            <c:if test="${allowDeletePage}">
+                    <div>
+                      <label for="deletepage"><fmt:message key="portal.page.editing.deleteThisPage"/></label>
+                      <input id="deletepage" type="submit" name="jsDeletePage" value="<fmt:message key='portal.page.editing.deletePage'/>" onclick="if(window.confirm('<fmt:message key="portal.page.editing.confirmDeleteThisPage"/>')){return true;}return false;"/>
+                    </div>
+            </c:if>                    
+
+
+            <c:if test="${allowAddPage or allowChangePageName or allowDeletePage}">
+                 </div>                      <!-- E: div class page-content -->
+            </c:if>
+            <%-- E: AddPage ChangePage PageTheme customizer block--%>
+            </div> <!-- E: page customizer layout-edit-bar-left -->
+          </fieldset> <!-- E: portal page customizer fieldset -->
+
+            <%-- BEGIN FOLDER CUSTOMIZATION --%>
+            
+          <fieldset style="width:49%;margin:0px;padding:0px;">
+            <div class="layout-edit-bar-left"> <!-- B: folder customizer layout-edit-bar-left -->
+            
+            <c:if test="${allowAddFolder or allowChangeFolderName or allowDeleteFolder}">
+                 <div class="folder-title"><b><fmt:message key="portal.folder.editing.folderConfiguration"/></b></div>   
+                 <div class="folder-content"> <!-- B: div class folder-content -->
+            </c:if>
+            
+            <c:if test="${allowAddFolder or allowChangeFolderName}">
+                    <div>
+                      <label for="foldername"><fmt:message key="portal.folder.editing.folder"/></label>
+                      <input id="foldername" name="jsFolderName"/>
+                    </div>
+                    <div>
+                      <label for="foldertitle"><fmt:message key="portal.folder.editing.folder.title"/></label>
+                      <input id="foldertitle" name="jsFolderTitle"/>
+                    </div>
+                    <div>
+                      <label for="foldershorttitle"><fmt:message key="portal.folder.editing.folder.shorttitle"/></label>
+                      <input id="foldershorttitle" name="jsFolderShortTitle"/>
+                    </div>
+                    <div> <!--  B: test allowAddFolder or allowChangeFolderName -->
+            </c:if>
+            <c:if test="${allowAddFolder}">
+                      <input type="submit" name="jsSubmitFolder" value="<fmt:message key='portal.folder.editing.addfolder'/>"/>
+            </c:if>
+            <c:if test="${allowChangeFolderName}">
+                      <input type="submit" name="jsChangeFolderName" value="<fmt:message key='portal.folder.editing.changefoldername'/>"/>
+            </c:if>
+            <c:if test="${allowAddFolder or allowChangeFolderName}">
+                    </div> <!--  E: test allowAddFolder or allowChangeFolderName -->
+            </c:if>
+
+            <c:if test="${allowNavigateFolder}">
+                    <div>
+                      <label><fmt:message key="portal.folder.editing.foldernavigation"/></label>
+                      <input id="move-folder-left" type="submit" name="jsMoveFolderLeft" value="<fmt:message key='portal.folder.editing.moveFolderLeft'/>" />
+                      <input id="move-folder-right" type="submit" name="jsMoveFolderRight" value="<fmt:message key='portal.folder.editing.moveFolderRight'/>" />
+                    </div>
+            </c:if>
+
+            <c:if test="${allowDeleteFolder}">
+                    <div>
+                      <label for="deletefolder"><fmt:message key="portal.folder.editing.deleteThisFolder"/></label>
+                      <input id="deletefolder" type="submit" name="jsDeleteFolder" value="<fmt:message key='portal.folder.editing.deleteFolder'/>" onclick="if(window.confirm('<fmt:message key="portal.folder.editing.confirmDeleteThisFolder"/>')){return true;}return false;"/>
+                    </div>
+            </c:if>
+            
+            <c:if test="${allowAddFolder or allowChangeFolderName or allowDeleteFolder}">
+                 </div>                      <!-- E: div class folder-content -->
+            </c:if>
+            </div> <!-- E: folder customizer layout-edit-bar-left -->
+          </fieldset> <!-- E: folder customizer fieldset -->
+          
+            <%-- END FOLDER CUSTOMIZATION --%>
+          <br style="clear:both;">
+        </form>   <!--  E: main form -->    
+
+    </div>                            <!-- E: div layout-edit-bar -->
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
\ No newline at end of file

Added: portals/jetspeed-2/trunk/src/webapp/decorations/layout/initLayoutDecorators.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/decorations/layout/initLayoutDecorators.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/initLayoutDecorators.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/initLayoutDecorators.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,85 @@
+<%@page language="java" pageEncoding="UTF-8"%>
+
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<%@page import="org.apache.commons.logging.Log"%>
+<%@page import="org.apache.commons.logging.LogFactory"%>
+<%@page import="org.apache.jetspeed.PortalReservedParameters"%>
+<%@page import="org.apache.jetspeed.decoration.LayoutDecoration"%>
+<%@page import="org.apache.jetspeed.decoration.Theme"%>
+<%@page import="org.apache.jetspeed.layout.JetspeedPowerTool"%>
+<%@page import="org.apache.jetspeed.om.page.ContentFragment"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+
+<%@page import="java.util.Locale"%>
+
+
+<portlet:defineObjects/>
+
+  <%!
+      private final static Log log = LogFactory.getLog("org.apache.jetspeed.decoration.layout.tigris_jsp");
+      private int PAGE_SCOPE = PageContext.PAGE_SCOPE;
+      private String getLayoutResource(LayoutDecoration _layoutDecoration,String _path)
+      {
+        String _resourcePath = _layoutDecoration.getResource(_path);
+        return ((null == _resourcePath) ? _path : _resourcePath);
+      }
+  %>
+
+<%
+
+  int DEFAULT_SCOPE = PageContext.PAGE_SCOPE;
+  int REQ_SCOPE = PageContext.REQUEST_SCOPE;
+  
+  //extract the jpt
+  JetspeedPowerTool _jpt = (JetspeedPowerTool) renderRequest.getAttribute("jpt");
+
+  //extract the theme
+  Theme _theme = (Theme) renderRequest.getAttribute("theme");
+
+  //rootFragment
+  ContentFragment _rootFragment = _jpt.getCurrentFragment();
+  pageContext.setAttribute("rootFragment", _rootFragment, DEFAULT_SCOPE);
+
+  //layoutDecoration TODO vmmacros call decoration
+  LayoutDecoration _layoutDecoration = _theme.getPageLayoutDecoration();
+  pageContext.setAttribute("layoutDecoration", _layoutDecoration, DEFAULT_SCOPE);
+
+  //Jetspeed Request Context
+  RequestContext _rc = (RequestContext) renderRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+  pageContext.setAttribute("rc", _rc, DEFAULT_SCOPE);
+
+  //preferedLocale (NOTE: req scope menus need it)
+  Locale _preferedLocale = _rc.getLocale();
+  pageContext.setAttribute("preferedLocale", _preferedLocale, REQ_SCOPE);
+  
+  //PageTitle
+  String _PageTitle = _jpt.getPage().getTitle(_preferedLocale);
+  pageContext.setAttribute("PageTitle", _PageTitle, DEFAULT_SCOPE);
+  
+%>
+  <%-- BEGIN GLOBAL PAGE SCOPE variables for decorators --%>
+
+
+  <c:set var="jetspeed"     value="${requestScope.jpt}" scope="page" />
+  <c:set var="PageBaseCSSClass" value="${layoutDecoration.baseCSSClass}" scope="page" />
+  <c:set var="resourceBaseHref" value="${requestScope.cPath}${layoutDecoration.basePath}"/>
+  
+  
+  <%-- PageActionBar --%>
+  <c:set var="actions" value="${layoutDecoration.actions}" scope="page" />
+  <c:set var="PageActionBar" scope="page">
+  
+                        <div id="portal-page-actions"> <!-- B: div portal-page-actions --> 
+                          <c:forEach var="_action" items="${actions}">
+                            <a href="<c:out value='${_action.action}'/>" title="<c:out value='${_action.name}'/>" class="action pageAction">
+                              <img src="<c:out value='${requestScope.cPath}/${_action.link}'/>" alt="<c:out value='${_action.alt}'/>" border="0" />
+                            </a>
+                          </c:forEach>
+                        </div> <!-- E: div portal-page-actions --> 
+  
+  </c:set>
+
+  <%-- END GLOBAL PAGE SCOPE variables for decorators --%>  

Added: portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/footer.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/footer.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/footer.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/footer.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,21 @@
+<%@ include file="../initLayoutDecorators.jsp" %>
+  <%
+      //contextPath
+      String _cPath = (String) request.getContextPath();
+      pageContext.setAttribute("imgFooter", _cPath + "/" +
+              getLayoutResource(_layoutDecoration,"images/Jetspeed_blue_sm.png"), PAGE_SCOPE);
+  %>
+
+
+
+          </td>   <!--  E: all portlet content -->
+        </tr>    <!--  E: Main row -->
+      </table> <!--  S: ALL CONTENT TABLE -->
+
+    </div> <!-- END: body div wrapper -->
+    <p>
+      <img src="<c:out escapeXml='false' value='${imgFooter}'/>" alt="Jetspeed 2 Powered" border="0" />
+    </p>
+  </body>
+</html>
+

Added: portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/header.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/header.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/header.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/header.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%@ include file="../initLayoutDecorators.jsp" %>
+<%@ include file="tigrisNavigations.jsp" %>
+
+  <%-- img variables --%>
+  <%
+      String _cPath = (String) renderRequest.getAttribute("cPath");
+  
+      pageContext.setAttribute("imgBanner", _cPath + "/" +
+                getLayoutResource(_layoutDecoration,"images/Jetspeed_blue_med.png"), PAGE_SCOPE);
+      //site
+      PortalSiteRequestContext _site = (PortalSiteRequestContext) renderRequest.getAttribute("psrc");
+
+      // pages or tabs navigation
+      Menu pageTabNavigations = (Menu) _site.getMenu("pages");
+      String pageTabNavigationHTML = "";
+      if (null != pageTabNavigations)
+      {
+          pageTabNavigationHTML = getTabsNavigationContent(renderRequest,pageTabNavigations,
+                                          _preferedLocale,LEFT_TO_RIGHT);
+      }
+      pageContext.setAttribute("pageTabNavigationHTML", pageTabNavigationHTML, PAGE_SCOPE);
+      
+      // breadcrumbs menu
+      Menu breadCrumbs = (Menu) _site.getMenu("breadcrumbs");
+      String breadCrumbsHTML = "&nbsp;";
+      if (null != breadCrumbs)
+      {
+          breadCrumbsHTML = getLinksNavigation(renderRequest,breadCrumbs,_preferedLocale,
+                                  LEFT_TO_RIGHT,TITLE_ORDER_NONE,BREADCRUMBS_STYLE,"");
+      }
+      pageContext.setAttribute("breadCrumbs", breadCrumbsHTML, PAGE_SCOPE);
+
+      // navigations menu
+      Menu navigations = (Menu) _site.getMenu("navigations");
+      Boolean haveNavigationLinks = Boolean.FALSE;
+      
+      String navigationsHTML = "&nbsp;";
+      if ((null != navigations) && !(navigations.isEmpty()))
+      {
+          navigationsHTML = getLinksWithIconNavigation(renderRequest,
+                  navigations, _preferedLocale, TOP_TO_BOTTOM);
+          haveNavigationLinks = Boolean.TRUE;
+          pageContext.setAttribute("haveNavigationLinks", haveNavigationLinks, PAGE_SCOPE);
+      }
+      
+      pageContext.setAttribute("navigationsHTML", navigationsHTML, PAGE_SCOPE);
+      
+  %>
+
+<html>
+
+  <head>
+
+    <title><c:out value="${PageTitle}" /></title>
+
+    <!--  include any headerResource -->
+    <c:if test="${not empty requestScope.headerResource}">
+      <c:out escapeXml="false" value="${requestScope.headerResource.content}"/><br />
+    </c:if>
+    
+    <meta http-equiv="Content-type" content="<c:out value='${ContentType}'/>"/>
+    <meta http-equiv="Content-style-type" content="text/css"/>   
+    <meta name="version" content="<c:out value='${SiteVersionTag}'/>"/>
+    <meta name="keywords" content="" />
+    <meta name="description" content="<c:out value="${PageTitle}"/>"/>
+
+    <c:out value="${includeJavaScriptForHead}" escapeXml="false"/>
+    <c:out value="${includeStyleSheets}" escapeXml="false"/>
+
+
+    
+  </head>
+
+  <body class="<c:out value='${PageBaseCSSClass}'/>">
+
+    <div class="<c:out value='${PageBaseCSSClass}'/>"> <!-- BEGIN: body div  wrapper -->
+
+      <div id="banner"> <!-- B: banner div -->
+        <table border="0" cellspacing="0" cellpadding="8" width="100%">
+          <tr>
+            <td>
+              <h1><img src="<c:out escapeXml='false' value='${imgBanner}'/>" alt="Jetspeed 2 Logo" border="0"/></h1>
+            </td>
+            <td>
+              <div align="right" id="login">
+                &nbsp;
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div> <!-- E: banner div -->
+
+      <!-- TABS navidation -->
+      <div class="tabs">
+        <c:out escapeXml="false" value="${pageTabNavigationHTML}"/>
+      </div>
+
+      <!-- BREADCRUMBS Navigation -->
+      <div id="breadcrumbs"> <!-- B: breadcrumbs -->
+        <c:out escapeXml="false" value="${breadCrumbs}"/>
+        <c:if test="${not empty renderRequest.userPrincipal}">
+          <span style="position:absolute;right:5em"><a href="<c:out value='${requestScope.baseHRef}login/logout'/>">Logout</a></span>
+        </c:if>
+        <c:out escapeXml="false" value="${PageActionBar}"/>
+      </div> <!-- E: breadcrumbs -->
+      
+      <!-- CONTENT in a Table -->
+      <table cellpadding="0" cellspacing="0" border="0" width="100%" id="main"> <!--  S: ALL CONTENT TABLE -->
+        <tr> <!--  S: Main row -->
+            <!--  S: Left Navigation -->
+            <c:if test="${haveNavigationLinks}">
+                <td valign="top" id="leftcol" >
+                  <div id="navcolumn">
+                    <table cellpadding="0" cellspacing="4" border="0" width="100%">
+                      <c:out escapeXml="false" value="${navigationsHTML}" />
+                    </table>
+                  </div>
+                </td>
+            </c:if>
+            <!--  START ALL PORTLETS CONTENT -->
+            <td nowrap="nowrap" valign="top"> <!-- S: all portlet content -->
\ No newline at end of file

Added: portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/tigrisNavigations.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/tigrisNavigations.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/tigrisNavigations.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/layout/tigris/tigrisNavigations.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,644 @@
+<%@page language="java" pageEncoding="UTF-8"%>
+
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<%@page import="org.apache.commons.logging.Log"%>
+<%@page import="org.apache.commons.logging.LogFactory"%>
+<%@page import="org.apache.jetspeed.portalsite.PortalSiteRequestContext"%>
+
+<%@page import="org.apache.jetspeed.portalsite.Menu"%>
+
+<%@page import="java.util.Locale"%>
+<%@page import="java.util.Iterator"%>
+<%@page import="org.apache.jetspeed.portalsite.MenuElement"%>
+<%@page import="org.apache.jetspeed.layout.JetspeedPowerTool"%>
+<%@page import="javax.portlet.RenderRequest"%>
+<%@page import="java.util.Map"%>
+<%@page import="java.util.HashMap"%>
+<%@page import="org.apache.jetspeed.portalsite.MenuOption"%>
+<%@page import="org.apache.jetspeed.portalsite.MenuSeparator"%>
+
+<portlet:defineObjects/>
+
+<%-- TODO
+       - Tabs
+--%>
+
+  <%!
+  
+  
+      private final static int INITIAL_BUFFER = 1024;
+      
+      /**
+        * orientation: How the individual menu elements are oriented.
+        *              supported configuration represents the constants below.
+        */
+      private final static int LEFT_TO_RIGHT = 1;
+      private final static int RIGHT_TO_LEFT = 2;
+      private final static int TOP_TO_BOTTOM = 10;
+      private final static int BOTTOM_TO_TOP = 11;
+
+      /**
+       * titleOrder: How the title element text appears
+       *             supported configuration represents the constants below.
+       */
+
+      private final static int TITLE_ORDER_FIRST = 20;
+      private final static int TITLE_ORDER_LAST = 21;
+      private final static int TITLE_ORDER_NONE = 22;
+      
+      /**
+       * menuStyle: currently only BREADCRUMBS_STYLE is understood.
+       */
+      private final static int BREADCRUMBS_STYLE = 0;
+
+      private final static Map MenuOptionTypes = new HashMap();
+      private final static int PAGE_TYPE = 0;
+      private final static int FOLDER_TYPE = 1;
+      private final static int LINK_TYPE = 2;
+      private final static Map MenuElementTypes = new HashMap();
+      private final static int OPTION_TYPE = 0;
+      private final static int SEPARATOR_TYPE = 1;
+      private final static int MENU_TYPE = 2;
+      
+      static {
+        MenuOptionTypes.put("page",  new Integer(PAGE_TYPE));
+        MenuOptionTypes.put("folder", new Integer(FOLDER_TYPE));
+        MenuOptionTypes.put("link",   new Integer(LINK_TYPE));
+        MenuElementTypes.put("option", new Integer(OPTION_TYPE));
+        MenuElementTypes.put("separator", new Integer(SEPARATOR_TYPE));
+        MenuElementTypes.put("menu", new Integer(MENU_TYPE));
+      }
+      
+      /**
+       *
+       */
+      private String getNormalizedString(String s)
+      {
+          return ((s == null) ? "" : s);    
+      }
+      
+      
+      private String getMenuElementOptionHTML(JetspeedPowerTool jpt,
+                          MenuOption menuElmOption, Locale locale,
+                          boolean addTarget)
+      {
+          final String TAB_INDENT_1 = "\t\t\t";
+          final String TAB_INDENT_2 = "\t\t\t\t";
+              
+          StringBuffer sb = new StringBuffer(INITIAL_BUFFER);
+          // get all our text
+          String lnkTitle = getNormalizedString(menuElmOption.getTitle(locale));
+          String lnkName  = getNormalizedString(menuElmOption.getShortTitle(locale));
+          String lnkUrl = getNormalizedString(jpt.getAbsoluteUrl(menuElmOption.getUrl()));
+
+          
+          // now output accoding to menu type
+          int menuType = ((Integer)MenuOptionTypes.get(menuElmOption.getType())).intValue();
+          if (menuType == PAGE_TYPE)
+          {
+              sb.append(TAB_INDENT_1).
+                 append("<div>\n").append(TAB_INDENT_2).
+                 append("<a href=\"").
+                 append(lnkUrl).append("\"").
+                 append("class=\"LinkPage\" ").append("title=\"").
+                 append(lnkTitle).append("\">").
+                 append(lnkName).append("</a>\n").
+                 append(TAB_INDENT_1).append("</div>\n");
+
+          }
+          else if (menuType == LINK_TYPE)
+          {
+              String lnkTarget = getNormalizedString(menuElmOption.getTarget());
+              sb.append(TAB_INDENT_1).
+              append("<div>\n").append(TAB_INDENT_2).
+              append("<a href=\"").
+              append(lnkUrl).append("\" ");
+              if (addTarget)
+              {
+                  sb.append(" target=\"").append(lnkTarget).append("\"");
+              }
+              sb.append(" class=\"Link\" ").append(" title=\"").
+              append(lnkTitle).append("\">").
+              append(lnkName).append("</a>\n").
+              append(TAB_INDENT_1).append("</div>\n");
+          }
+          else if (menuType == FOLDER_TYPE)
+          {
+              sb.append(TAB_INDENT_1).
+              append("<div>\n").append(TAB_INDENT_2).
+              append("<a href=\"").
+              append(lnkUrl).append("\"").
+              append("class=\"LinkFolder\" ").append("title=\"").
+              append(lnkTitle).append("\">").
+              append(lnkName).append("</a>\n").
+              append(TAB_INDENT_1).append("</div>\n");
+          }
+          
+          return sb.toString();
+      } // E: getMenuOptionHTML()
+      
+      /**
+       *  Helper method to create HTML content supporting the layout decoration
+       *  in which it exists. This is mainly used to create the breadcrumbs.
+       */
+      
+      private String getLinksNavigation(RenderRequest req, Menu menu, Locale locale,
+                          int orientation, int titleOrder, 
+                          int style, String delimiter)
+      {
+          final String TAB_INDENT_1 = "\t\t";
+          final String TAB_INDENT_2 = "\t\t  ";
+          final String TAB_INDENT_3 = "\t\t    ";
+
+          JetspeedPowerTool jpt = (JetspeedPowerTool) req.getAttribute("jpt");
+          StringBuffer sb = new StringBuffer(INITIAL_BUFFER);
+        
+          // get the delimiter right
+          if ((null == delimiter) || delimiter.equalsIgnoreCase(""))
+          {
+             if ( style == BREADCRUMBS_STYLE)
+             {
+               delimiter = "&nbsp;&gt;&gt;&nbsp;";
+             }
+             else
+             {
+          	   delimiter = "&nbsp;";
+             }
+          }
+        
+          String menuTitle = getNormalizedString(menu.getTitle(locale));
+          String menuName = getNormalizedString(menu.getShortTitle(locale));
+          
+          sb.append(TAB_INDENT_1).
+             append("<div class=\"FolderList\"><!-- B: div class FolderList -->\n");
+        
+          //check title
+          if (titleOrder == TITLE_ORDER_FIRST)
+          {
+            if (orientation == LEFT_TO_RIGHT)
+            {
+                sb.append(TAB_INDENT_2).
+                   append("<span title=\"").append(menuTitle).append("\">").
+                   append(menuName).append("&nbsp;</span>\n");
+            }
+            else if (orientation == TOP_TO_BOTTOM)
+            {
+                sb.append(TAB_INDENT_2).append("<div class=\"pagetitle\" title=\"").
+                   append(menuTitle).append("\">").
+                   append(menuName).append(TAB_INDENT_2).
+                   append("</div>\n");
+            }
+          }
+
+          //start the menu
+          Iterator menuIterator = menu.getElements().iterator();
+          int i = 0;
+          int size = menu.getElements().size();
+          
+          while(menuIterator.hasNext())
+          {
+             i++;
+             Object menuElmObj = menuIterator.next();
+             int menuElmType = ((Integer)MenuElementTypes.get(
+                                            ((MenuElement)menuElmObj).getElementType())).intValue();
+             
+             if (menuElmType == OPTION_TYPE)
+             {
+                 MenuOption menuElm = (MenuOption) menuElmObj;
+                 int menuType = ((Integer)MenuOptionTypes.get(menuElm.getType())).intValue();
+  
+                 // get all our text
+                 String lnkTitle = getNormalizedString(menuElm.getTitle(locale));
+                 String lnkName  = getNormalizedString(menuElm.getShortTitle(locale));
+                 String lnkUrl = getNormalizedString(jpt.getAbsoluteUrl(menuElm.getUrl()));
+ 
+                 if ( (style != BREADCRUMBS_STYLE) || 
+                       !(menuType == PAGE_TYPE) ||
+                       (i < size) )
+                 {
+                   //start element
+                   if (orientation == LEFT_TO_RIGHT)
+                   {
+                        sb.append(TAB_INDENT_2).append("<span>");
+                   }
+                   else if (orientation == TOP_TO_BOTTOM)
+                   {
+                        sb.append(TAB_INDENT_2).append("<div><!-- S: menu element -->\n");
+                   }
+                   
+                   // add the content
+                   if (menuType == PAGE_TYPE)
+                   {
+                       sb.append("<a href=\"").
+                            append(lnkUrl).append("\"").
+                            append(" class=\"LinkPage\" title=\"").
+                              append(lnkTitle).append("\">").
+                          append(lnkName).
+                          append("</a>");
+                   }
+                   else if (menuType == LINK_TYPE)
+                   {
+                       sb.append("<a href=\"").
+                            append(lnkUrl).append("\"").
+                            append(" class=\"Link\" title=\"").
+                         append(lnkTitle).append("\">").
+                          append(lnkName).
+                         append("</a>");
+                       
+                   }
+                   else if (menuType == FOLDER_TYPE)
+                   {
+                       sb.append("<a href=\"").
+                            append(lnkUrl).append("\"").
+                            append(" class=\"LinkFolder\" title=\"").
+                          append(lnkTitle).append("\">").
+                            append(lnkName).
+                          append("</a>");
+                   }
+                   else
+                   {
+                       sb.append("<a href=\"").
+                            append(lnkUrl).append("\"").
+                            append(" title=\"").
+                          append(lnkTitle).append("\">").
+                            append(lnkName).
+                          append("</a>");
+                   }
+                   
+                   if (orientation == LEFT_TO_RIGHT)
+                   {
+                     sb.append(delimiter).append("</span>\n");
+                   }
+                   else if (orientation == TOP_TO_BOTTOM)
+                   {
+                     sb.append(TAB_INDENT_2).append("</div>\n");
+                   }
+                 }
+                 else
+                 {
+                     if (orientation == LEFT_TO_RIGHT)
+                     {
+                       sb.append(TAB_INDENT_2).append("<span title=\"").
+                          append(lnkTitle).append("\">").
+                          append(lnkName).append("&nbsp;").append("</span>\n");
+                     }
+                     else if (orientation == TOP_TO_BOTTOM)
+                     {
+                         sb.append(TAB_INDENT_2).append("<div title=\"").
+                            append(lnkTitle).append("\">").
+                            append(lnkName).append("</div>\n");
+                     }
+                     
+                 } // Not BREADCRUMB_STYLE etc.
+             } // option type
+             else if(menuElmType == SEPARATOR_TYPE)
+             {
+                 MenuSeparator menuElm = (MenuSeparator) menuElmObj;
+                 String sepTitle = menuElm.getTitle(locale);
+                 if (null == sepTitle)
+                     sepTitle = "";
+                 String sepText  = menuElm.getText(locale);
+                 if (null == sepText)
+                     sepText = "";
+                 if (orientation == LEFT_TO_RIGHT)
+                 {
+                   sb.append(TAB_INDENT_2).append("<span title=\"").append(sepTitle).append("\">").
+                      append(sepText).append(delimiter).append("</span>\n");
+                 }
+                 else if (orientation == TOP_TO_BOTTOM)
+                 {
+                     sb.append(TAB_INDENT_2).append("<div class=\"pagetitle\" title=\"").
+                        append(sepTitle).append("\">").
+                        append(sepText).append("</div>\n");
+                 }
+               
+             }
+          } // while menu items
+          if (titleOrder == TITLE_ORDER_LAST)
+          {
+              if (orientation == LEFT_TO_RIGHT)
+              {
+                sb.append(TAB_INDENT_2).append("<span title=\"").append(menuTitle).append("\">").
+                   append(menuName).append("&nbsp;").append("</span>\n");
+                  
+              }
+              else
+              {
+                sb.append(TAB_INDENT_2).append("<div class=\"pagetitle\" title=\"").
+                   append(menuTitle).append("\">").
+                   append(menuName).append("</div>\n");
+              }
+          }
+  
+          sb.append("\t\t</div><!-- B: div class FolderList -->\n");
+          return sb.toString();
+          
+      } // getLinksNavigation
+      
+      /*
+      *  getLinksWithIconNavigation
+      *     This is for tigris, assumes a table already present.
+      */
+      private String getLinksWithIconNavigation(RenderRequest req, Menu menu, Locale locale,
+                          int orientation)
+      {
+         JetspeedPowerTool _jpt = (JetspeedPowerTool) req.getAttribute("jpt");
+         StringBuffer sb = new StringBuffer(INITIAL_BUFFER);
+
+         String TR_TD_START = "\n\t\t\t <tr>\n \t\t\t\t <td>\n";
+         String TR_TD_END = "\n\t\t\t\t </td>\n \t\t\t </tr>\n";
+         
+         final String DIV_TOOLGROUP = "\t\t\t\t\t<div class=\"toolgroup\"><!-- div class toolgroup -->\n";
+         final String DIV_BODY = "\t\t\t\t\t\t<div class=\"body\"><!-- div class body -->\n";
+         final String DIV_FOLDERLIST = "\t\t\t\t\t\t\t\t<div class=\"FolderList\"><!-- div class FolderList -->\n";
+         
+         boolean rowStarted = false;
+         boolean elmStarted = false;
+
+         //start the menu
+         Iterator menuIteartor = menu.getElements().iterator();
+         int i = 0;
+         
+         while(menuIteartor.hasNext())
+         {
+            i++;
+            Object menuElmObj = menuIteartor.next();
+            int menuElmType = ((Integer)MenuElementTypes.get(
+                                           ((MenuElement) menuElmObj).
+                                              getElementType())).intValue();
+            
+            if (menuElmType == OPTION_TYPE)
+            {
+                MenuOption menuElmOption = (MenuOption) menuElmObj;
+                //start the xhtml/html elements
+                if (!rowStarted)
+                {
+                  sb.append(TR_TD_START).
+                     append(DIV_TOOLGROUP).
+                     append(DIV_BODY).
+                     append(DIV_FOLDERLIST);
+                }
+                else if (!elmStarted)
+                {
+                    sb.append(DIV_BODY).
+                       append(DIV_FOLDERLIST);
+                    
+                }
+                // get all our text
+                String lnkTitle = menuElmOption.getTitle(locale);
+                if (null == lnkTitle)
+                    lnkTitle = "";
+                String lnkName  = menuElmOption.getShortTitle(locale);
+                if (null == lnkName)
+                    lnkName = "";
+                String lnkUrl = _jpt.getAbsoluteUrl(menuElmOption.getUrl());
+                if (null == lnkUrl)
+                    lnkUrl = "";
+                // now output accoding to menu type
+                int menuType = ((Integer)MenuOptionTypes.get(menuElmOption.getType())).intValue();
+                if (menuType == PAGE_TYPE)
+                {
+                    sb.append("\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<a href=\"").
+                       append(lnkUrl).append("\"").
+                       append("class=\"LinkPage\" ").append("title=\"").
+                       append(lnkTitle).append("\">").
+                       append(lnkName).append("</a>\n\t\t\t\t\t\t\t\t</div>\n");
+
+                }
+                else if (menuType == LINK_TYPE)
+                {
+                    String lnkTarget = menuElmOption.getTarget();
+                    if (null == lnkTarget)
+                        lnkTarget = "";
+                    sb.append("\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<a href=\"").
+                    append(lnkUrl).append("\"").
+                    append(" target=\"").append(lnkTarget).append("\" ").
+                    append("class=\"Link\" ").append("title=\"").
+                    append(lnkTitle).append("\">").
+                    append(lnkName).append("</a>\n\t\t\t\t\t\t\t\t</div>\n");
+                }
+                else if (menuType == FOLDER_TYPE)
+                {
+                    sb.append("\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<a href=\"").
+                    append(lnkUrl).append("\"").
+                    append("class=\"LinkFolder\" ").append("title=\"").
+                    append(lnkTitle).append("\">").
+                    append(lnkName).append("</a>\n\t\t\t\t\t\t\t\t</div>\n");
+                    
+                }
+                rowStarted = true;
+                elmStarted = true;
+            }
+            else if (menuElmType == MENU_TYPE)
+            {
+                if (!rowStarted)
+                {
+                    sb.append(TR_TD_START).
+                    append(DIV_TOOLGROUP).
+                    append(DIV_BODY).
+                    append(DIV_FOLDERLIST);
+                    
+                }
+                else if (!elmStarted)
+                {
+                    sb.append(DIV_BODY).
+                    append(DIV_FOLDERLIST);
+                }
+                
+                sb.append(
+                        getNestedLinksIconNavigation(req,(Menu) menuElmObj, locale, orientation)
+                        );
+                //TODO includeNested
+                rowStarted = true;
+                elmStarted = true;
+            }
+            else if (menuElmType == SEPARATOR_TYPE)
+            {
+                MenuSeparator menuElmSeparator = (MenuSeparator) menuElmObj;
+                String sepTitle = menuElmSeparator.getTitle(locale);
+                if (null == sepTitle)
+                    sepTitle = "";
+                String sepText  = menuElmSeparator.getText(locale);
+                if (null == sepText)
+                    sepText = "";
+                if (!rowStarted)
+                {
+                    sb.append(TR_TD_START).
+                    append(DIV_TOOLGROUP);
+                }
+                else if (elmStarted)
+                {
+                    sb.append("\t\t\t\t\t\t\t\t</div>\n").
+                       append("\t\t\t\t\t\t\t</div>\n");
+                }
+                sb.append("\t\t\t\t\t\t\t\t<div class=\"label\">").
+                   append(sepText).append("</div>\n");
+                rowStarted = true;
+                elmStarted = false; //already outputed
+            }
+            
+         } // while loop
+         
+         if (elmStarted)
+         {
+             sb.append("\t\t\t\t\t\t\t\t</div>\n").
+             append("\t\t\t\t\t\t\t</div>\n");
+             
+         }
+         else if (rowStarted)
+         {
+             sb.append("</div>\n").
+                append(TR_TD_END);
+         }
+         return sb.toString();
+      } //E: getLinksWithIconNavigation
+
+      
+      private String getNestedLinksIconNavigation(RenderRequest req, Menu menu, Locale locale,
+              int orientation)
+      {
+         JetspeedPowerTool jpt = (JetspeedPowerTool) req.getAttribute("jpt");
+         String menuTitle = menu.getTitle(locale);
+         String menuName = menu.getShortTitle(locale);
+         StringBuffer sb = new StringBuffer(INITIAL_BUFFER);
+         if ((null != menuTitle) && !(menuTitle.equalsIgnoreCase("")))
+         {
+             sb.append("\t\t\t\t\t\t\t\t\t").
+                append("<div class=\"pagetitle\" ").
+                append("title=\"").append(menuTitle).
+                append("\">").append(menuName).
+                append(menuName).append("</div>\n");
+         }
+
+         sb.append("\t\t\t\t\t\t\t\t\t").append("<div><!-- S: nested menu -->\n");
+
+         //start the menu
+         Iterator menuIteartor = menu.getElements().iterator();
+         int i = 0;
+         
+         while(menuIteartor.hasNext())
+         {
+             i++;
+             Object menuElmObj = menuIteartor.next();
+             int menuElmType = ((Integer)MenuElementTypes.get(
+                                            ((MenuElement) menuElmObj).
+                                               getElementType())).intValue();
+             if (menuElmType == OPTION_TYPE)
+             {
+                 sb.append(
+                     getMenuElementOptionHTML(jpt,(MenuOption)menuElmObj,locale,true));
+             }
+             else if (menuElmType == MENU_TYPE)
+             {
+                 sb.append(
+                         getNestedLinksIconNavigation(req,(Menu)menuElmObj,locale,orientation)
+                         );
+             }
+             else if (menuElmType == SEPARATOR_TYPE)
+             {
+                 MenuSeparator menuElmSeparator = (MenuSeparator) menuElmObj;
+                 String sepTitle = menuElmSeparator.getTitle(locale);
+                 if (null == sepTitle)
+                     sepTitle = "";
+                 String sepText  = menuElmSeparator.getText(locale);
+                 if (null == sepText)
+                     sepText = "";
+                 sb.append("\t\t\t\t\t\t\t\t").
+                    append("<div class=\"pagetitle\" ").
+                    append(" title=\"").append(sepTitle).append("\">").
+                    append(sepText).append("</div>\n");
+                 
+             }
+         } //while
+
+         sb.append("\t\t\t\t\t\t\t\t\t").append("</div><!-- E: nested menu -->\n");
+
+         return sb.toString();
+
+      } //E: getNestedLinksIconNavigation
+      
+      /**
+       *  Helper method to create HTML content supporting page TABS
+       *  
+       */
+      private String getTabsNavigationContent(RenderRequest req, Menu menu, Locale locale,int orientation)
+      {
+
+          final String TAB_INDENT_1 = "\t\t";
+          final String TAB_INDENT_2 = "\t\t  ";
+          final String TAB_INDENT_3 = "\t\t    ";
+
+          JetspeedPowerTool _jpt = (JetspeedPowerTool) req.getAttribute("jpt");
+          PortalSiteRequestContext site = (PortalSiteRequestContext) req.getAttribute("psrc");
+          
+          StringBuffer sb = new StringBuffer(INITIAL_BUFFER);
+          
+          sb.append(TAB_INDENT_1);
+          sb.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n").
+             append(TAB_INDENT_2).append("<tr>\n");
+          
+          Iterator menuIteartor = menu.getElements().iterator();
+          int i = 0;
+          
+          while(menuIteartor.hasNext())
+          {
+              i++;
+              Object menuElmObj = menuIteartor.next();
+              int menuElmType = ((Integer)MenuElementTypes.get(
+                                             ((MenuElement) menuElmObj).
+                                                getElementType())).intValue();
+              
+              if (menuElmType != OPTION_TYPE)
+              {
+                  continue;
+              }
+              MenuOption menuElm = (MenuOption) menuElmObj;
+              String tabTitle = getNormalizedString(menuElm.getTitle(locale));
+              String tabName = getNormalizedString(menuElm.getShortTitle(locale));
+              
+              if (orientation == LEFT_TO_RIGHT)
+              {
+                  if (menuElm.isSelected(site))
+                  {
+                      sb.append(TAB_INDENT_3).
+                         append("<td class=\"LTabLeft\" nowrap=\"nowrap\">&nbsp;</td>\n").
+                         append(TAB_INDENT_3).
+                         append("<td class=\"LTab\" align=\"center\" valign=\"middle\" nowrap=\"nowrap\" title=\"").
+                         append(tabTitle).append("\">").append(tabName).append("</td>\n").
+                         append(TAB_INDENT_3).
+                         append("<td class=\"LTabRight\"  nowrap=\"nowrap\">&nbsp;</td>\n");
+                      
+                  }
+                  else
+                  {
+                      String tabUrl = _jpt.getAbsoluteUrl(menuElm.getUrl());
+                      sb.append(TAB_INDENT_3).
+                      append("<td class=\"LTabLeftLow\" nowrap=\"nowrap\">&nbsp;</td>\n").
+                      append(TAB_INDENT_3).
+                      append("<td class=\"LTabLow\" align=\"center\" ").
+                                append("valign=\"middle\" nowrap=\"nowrap\" title=\"").
+                                append(tabTitle).append("\">").
+                      append("<a href=\"").append(tabUrl).append("\">").
+                        append(tabName).
+                      append("</a>").append("</td>\n").
+                      append(TAB_INDENT_3).
+                      append("<td class=\"LTabRightLow\"  nowrap=\"nowrap\">&nbsp;</td>\n");
+                  }
+              }
+              else
+              {
+                  
+              }
+          }
+          sb.append(TAB_INDENT_2).append("</tr>\n").
+             append(TAB_INDENT_1).
+             append("</table>");
+          
+          return sb.toString();
+      }
+  %>
+
+  

Added: portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorations_portlet_init.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorations_portlet_init.jsp?view=auto&rev=547801
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorations_portlet_init.jsp (added)
+++ portals/jetspeed-2/trunk/src/webapp/decorations/portlet/decorations_portlet_init.jsp Fri Jun 15 14:45:53 2007
@@ -0,0 +1,50 @@
+<%@page language="java" pageEncoding="UTF-8"%>
+
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<%@page import="org.apache.jetspeed.layout.JetspeedPowerTool"%>
+<%@page import="org.apache.jetspeed.om.page.ContentFragment"%>
+
+<portlet:defineObjects/>
+
+<%
+
+  int DEFAULT_SCOPE = PageContext.PAGE_SCOPE;
+
+  //extract the jpt, just in case we need it.
+  JetspeedPowerTool _jpt = (JetspeedPowerTool) renderRequest.getAttribute("jpt");
+  pageContext.setAttribute("jetspeed", _jpt, DEFAULT_SCOPE);
+
+  // set the fragment
+  ContentFragment _frag = _jpt.getCurrentFragment();
+  pageContext.setAttribute("frag", _frag, DEFAULT_SCOPE);
+  
+  //hidden
+  pageContext.setAttribute("isHidden", _jpt.isHidden(_frag), DEFAULT_SCOPE);
+  
+%>
+
+  <%-- BEGIN Request Scoped Variables --%>
+  <c:set var="decoration" value="${frag.decoration}" scope="page"/>
+  <c:set var="actions" value="${decoration.actions}" scope="page" />
+
+  <%-- PortletActionBar --%>
+  <c:set var="PortletActionBar" scope="page">
+  
+                        <div class="PActionBar"> <!-- B: div portal-page-actions --> 
+                          <c:forEach var="_action" items="${actions}">
+                            <a href="<c:out value='${_action.action}'/>" 
+                               title="<c:out value='${_action.name}'/>" 
+                               class="action portlet-action"
+                               <c:if test="${_action.target}"> target="<c:out value='${_action.target}'/>"</c:if>>
+                              <img src="<c:out value='${requestScope.cPath}/${_action.link}'/>" alt="<c:out value='${_action.alt}'/>" border="0" />
+                            </a>
+                          </c:forEach>
+                        </div> <!-- E: div portal-page-actions --> 
+  
+  </c:set>
+
+  <%-- END Request Scoped Variables --%>
+  
\ 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