You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by wo...@apache.org on 2009/04/22 18:19:51 UTC

svn commit: r767582 - in /portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout: initLayoutDecorators.jsp jetspeed/header.jsp tigris/header.jsp

Author: woonsan
Date: Wed Apr 22 16:19:50 2009
New Revision: 767582

URL: http://svn.apache.org/viewvc?rev=767582&view=rev
Log:
JS2-974: This problem is mainly fixed by the commit for PLUTO-554.
In this commit, I added head contribution stuffs in JSP decorators. (See JS2-961)

Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/initLayoutDecorators.jsp
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.jsp
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/tigris/header.jsp

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/initLayoutDecorators.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/initLayoutDecorators.jsp?rev=767582&r1=767581&r2=767582&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/initLayoutDecorators.jsp (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/initLayoutDecorators.jsp Wed Apr 22 16:19:50 2009
@@ -28,16 +28,21 @@
 <%@page import="org.apache.jetspeed.layout.JetspeedPowerTool"%>
 <%@page import="org.apache.jetspeed.om.page.ContentFragment"%>
 <%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@page import="org.apache.jetspeed.headerresource.HeaderResource"%>
+<%@page import="org.apache.jetspeed.util.KeyValue"%>
+
+<%@page import="org.w3c.dom.Element"%>
 
 <%@page import="java.util.Locale"%>
+<%@page import="java.util.List"%>
 
 
 <portlet:defineObjects/>
 
   <%!
-	  /**
-	   * @author <a href="mailto:kmoh.raj@gmail.com">Mohan Kannapareddy</a>
-	   */
+      /**
+       * @author <a href="mailto:kmoh.raj@gmail.com">Mohan Kannapareddy</a>
+       */
       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)
@@ -77,7 +82,28 @@
   //PageTitle
   String _PageTitle = _jpt.getPage().getTitle(_preferedLocale);
   pageContext.setAttribute("PageTitle", _PageTitle, DEFAULT_SCOPE);
-  
+
+  List<KeyValue<String, Element>> _headElements = _jpt.getHeadElements();
+  pageContext.setAttribute("headElements", _headElements, DEFAULT_SCOPE);
+  boolean _dojoEnabled = false;
+  if (_jpt.isDojoEnabled(_headElements))
+  {
+    HeaderResource hr = (HeaderResource) request.getAttribute("headerResource");
+    if (hr != null)
+    {
+      hr.dojoEnable();
+      _dojoEnabled = true;
+    }
+  }
+  StringBuilder _contributedHeadTags = new StringBuilder(256);
+  for (KeyValue<String, Element> kvPair : _headElements)
+  {
+    if (!"header.dojo.library.include".equals(kvPair.getKey()) || !_dojoEnabled)
+    {
+      _contributedHeadTags.append(_jpt.getElementHtmlString(kvPair.getValue())).append("\r\n");
+    }
+  }
+  pageContext.setAttribute("contributedHeadTags", _contributedHeadTags.toString(), DEFAULT_SCOPE);
 %>
   <%-- BEGIN GLOBAL PAGE SCOPE variables for decorators --%>
 
@@ -101,4 +127,4 @@
   
   </c:set>
 
-  <%-- END GLOBAL PAGE SCOPE variables for decorators --%>  
+  <%-- END GLOBAL PAGE SCOPE variables for decorators --%>  
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.jsp?rev=767582&r1=767581&r2=767582&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.jsp (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/jetspeed/header.jsp Wed Apr 22 16:19:50 2009
@@ -77,6 +77,9 @@
     <c:if test="${not empty requestScope.headerResource}">
       <c:out escapeXml="false" value="${requestScope.headerResource.content}"/><br />
     </c:if>
+    <c:if test="${not empty pageScope.contributedHeadTags}">
+      <c:out escapeXml="false" value="${pageScope.contributedHeadTags}"/><br />
+    </c:if>
     
     <meta http-equiv="Content-type" content="<c:out value='${ContentType}'/>"/>
     <meta http-equiv="Content-style-type" content="text/css"/>   
@@ -94,7 +97,7 @@
   <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>
@@ -138,4 +141,4 @@
                 </td>
             </c:if>
             <!--  START ALL PORTLETS CONTENT -->
-            <td nowrap="nowrap" valign="top"> <!-- S: all portlet content -->
+            <td nowrap="nowrap" valign="top"> <!-- S: all portlet content -->
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/tigris/header.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/tigris/header.jsp?rev=767582&r1=767581&r2=767582&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/tigris/header.jsp (original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/decorations/layout/tigris/header.jsp Wed Apr 22 16:19:50 2009
@@ -77,6 +77,9 @@
     <c:if test="${not empty requestScope.headerResource}">
       <c:out escapeXml="false" value="${requestScope.headerResource.content}"/><br />
     </c:if>
+    <c:if test="${not empty pageScope.contributedHeadTags}">
+      <c:out escapeXml="false" value="${pageScope.contributedHeadTags}"/><br />
+    </c:if>
     
     <meta http-equiv="Content-type" content="<c:out value='${ContentType}'/>"/>
     <meta http-equiv="Content-style-type" content="text/css"/>   



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