weaver 2004/01/12 10:22:48
Added: portal/src/webapp/WEB-INF/templates/vm portletstd-bottom.vm
clear-bottom.vm clear-top.vm columns.vm
portletstd-top.vm
portal/src/webapp/WEB-INF/templates/jsp
portletstd-bottom.jsp portletstd-top.jsp
columns.jsp clear-bottom.jsp clear-top.jsp
Log:
created a standardized templates directory
Revision Changes Path
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/vm/portletstd-bottom.vm
Index: portletstd-bottom.vm
===================================================================
</td>
</tr>
</table>
<!-- Portlet Std Decorator bottom -->
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/vm/clear-bottom.vm
<<Binary file>>
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/vm/clear-top.vm
<<Binary file>>
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/vm/columns.vm
Index: columns.vm
===================================================================
#set($table = $jetspeed.columns)
#set($myPage = $jetspeed.page)
#set($myFragment = $jetspeed.currentFragment)
#set($portletEntity = $jetspeed.currentPortletEntity)
#set($decorator = $myPage.getDefaultDecorator($myFragment.getType()))
#if($myFragment.getDecorator())
#set($decorator = $myFragment.getDecorator())
#end
#if ($decorator)
#set($decoTop = "${decorator}-top.vm")
#set($decoBottom = "${decorator}-bottom.vm")
#end
<!-- Decorator $decorator ${decoTop}.vm-${decoBottom}.vm-->
#if (($decoTop) && ($myFragment == $myPage.getRootFragment()))
## $jetspeed.include($jetspeed.getTemplate($decoTop).appRelativePath)
#parse($jetspeed.getTemplate($decoTop).appRelativePath)
#end
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
#foreach($entry in $table)
<td valign="top">
<table width="100%">
#foreach($f in $entry)
#set($fDeco = $myPage.getDefaultDecorator($f.type) )
#if ($f.getDecorator())
#set($fDeco = $f.getDecorator())
#end
#if ($fDeco)
#set($fDecoTop = "${fDeco}-top.vm" )
#set($fDecoBottom = "${fDeco}-bottom.vm" )
#end
## Set the JetspeedPowerTools current fragment
## to this one prior to parse of window decorations
$jetspeed.setCurrentFragment($f)
<tr>
<td width="100%">
## Parse out the top half of the decorator
#if ($fDecoTop)
## $jetspeed.include($jetspeed.getTemplate($fDecoTop).appRelativePath)
#parse($jetspeed.getTemplate($fDecoTop).appRelativePath)
#end
## out.flush(); do we need this in velocity???
$jetspeed.flush()
#if (!$jetspeed.isHidden($f))
## get the actual Portlet content
$jetspeed.include($f)
#end
## parse out the bottom half of the decorator
#if ($fDecoBottom)
#parse($jetspeed.getTemplate($fDecoBottom).appRelativePath)
#end
</td></tr>
#end
</table></td>
#end
</tr>
</table>
## Reset the JetspeedPowerTool to the orignal, root fragment
$jetspeed.setCurrentFragment($myFragment)
#if (($decoBottom ) && ($myFragment == $myPage.getRootFragment()))
## $jetspeed.include($jetspeed.getTemplate($decoBottom).appRelativePath)
#parse($jetspeed.getTemplate($decoBottom).appRelativePath)
#end
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/vm/portletstd-top.vm
Index: portletstd-top.vm
===================================================================
#set($myPage = $jetspeed.page)
#set($myF = $jetspeed.currentFragment)
#set($myPE = $jetspeed.currentPortletEntity)
<!-- Portlet Std Decorator top -->
<table width="100%" cellspacing"0" cellpadding="0">
<tr>
<td bgcolor="${myPage.defaultSkin}">
<table width="100%">
<tr>
<td>
${myPE.portletDefinition.name}
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" valign="top">
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/jsp/portletstd-bottom.jsp
Index: portletstd-bottom.jsp
===================================================================
<%@ page language="java" session="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
</td>
</tr>
</table>
<!-- Portlet Std Decorator bottom -->
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/jsp/portletstd-top.jsp
Index: portletstd-top.jsp
===================================================================
<%@ page language="java"
import="org.apache.jetspeed.om.page.*,org.apache.pluto.om.entity.*" session="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
<portlet:defineObjects/>
<%
Page myPage = (Page)renderRequest.getAttribute("page");
Fragment myF = (Fragment)renderRequest.getAttribute("fragment");
PortletEntity myPE = (PortletEntity)renderRequest.getAttribute("entity");
%>
<!-- Portlet Std Decorator top -->
<table width="100%" cellspacing"0" cellpadding="0">
<tr>
<td bgcolor="<%=myPage.getDefaultSkin()%>">
<table width="100%">
<tr>
<td><% if (myPE!=null) out.write(myPE.getPortletDefinition().getName());%></td>
<td>
</td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%" valign="top">
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/jsp/columns.jsp
Index: columns.jsp
===================================================================
<%@ page language="java"
import="javax.portlet.*, java.util.*, org.apache.jetspeed.aggregator.*,
org.apache.jetspeed.om.page.*"
session="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
<portlet:defineObjects/>
<%
List[] table = (List[])renderRequest.getAttribute("columns");
Page myPage = (Page)renderRequest.getAttribute("page");
Fragment myFragment = (Fragment)renderRequest.getAttribute("fragment");
ContentDispatcher dispatcher =
(ContentDispatcher)renderRequest.getAttribute("dispatcher");
org.apache.pluto.om.entity.PortletEntity portletEntity =
org.apache.jetspeed.services.entity.PortletEntityAccess.getEntity(
org.apache.jetspeed.util.JetspeedObjectID.createFromString(myFragment.getId()));
renderRequest.setAttribute("entity",portletEntity);
%>
<%
String decorator = myPage.getDefaultDecorator(myFragment.getType());
String decoTop = null;
String decoBottom = null;
if (myFragment.getDecorator()!=null)
{
decorator = myFragment.getDecorator();
}
if (decorator != null)
{
decoTop = decorator+"-top.jsp";
decoBottom = decorator+"-bottom.jsp";
}
%>
<!-- Decorator <%= decorator %> <%=decoTop%>-<%=decoBottom%>-->
<%
if ((decoTop != null) && (myFragment == myPage.getRootFragment()))
{
%>
<jsp:include page="<%=decoTop%>" />
<%
}
%>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<%
for(int i=0; i < table.length; i++)
{
%>
<td valign="top"><table width="100%">
<%
for(Iterator it=table[i].iterator(); it.hasNext();)
{
Fragment f = (Fragment)it.next();
org.apache.pluto.om.entity.PortletEntity fPE =
org.apache.jetspeed.services.entity.PortletEntityAccess.getEntity(
org.apache.jetspeed.util.JetspeedObjectID.createFromString(f.getId()));
String fDeco = myPage.getDefaultDecorator(f.getType());
String fDecoTop = null;
String fDecoBottom = null;
if (f.getDecorator()!=null)
{
fDeco = f.getDecorator();
}
if (fDeco != null)
{
fDecoTop = fDeco+"-top.jsp";
fDecoBottom = fDeco+"-bottom.jsp";
}
renderRequest.setAttribute("fragment",f);
renderRequest.setAttribute("entity",fPE);
%>
<tr><td width="100%">
<%
if (fDecoTop != null)
{
%>
<jsp:include page="<%=fDecoTop%>" />
<%
}
%>
<%
out.flush();
if (!"hidden".equals(f.getState()))
{
dispatcher.include(f,(javax.portlet.RenderRequest)renderRequest,
(javax.portlet.RenderResponse)renderResponse);
}
%>
<%
if (fDecoBottom != null)
{
%>
<jsp:include page="<%=fDecoBottom%>" />
<%
}
%>
</td></tr>
<%
}
%>
</table></td>
<%
}
%>
</tr>
</table>
<%
renderRequest.setAttribute("fragment",myFragment);
renderRequest.setAttribute("entity",portletEntity);
if ((decoBottom != null) && (myFragment == myPage.getRootFragment()))
{
%>
<jsp:include page="<%=decoBottom%>" />
<%
}
%>
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/jsp/clear-bottom.jsp
Index: clear-bottom.jsp
===================================================================
<%@ page language="java" session="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
<portlet:defineObjects/>
<!-- Clear decorator bottom -->
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/templates/jsp/clear-top.jsp
Index: clear-top.jsp
===================================================================
<%@ page language="java" session="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
<portlet:defineObjects/>
<!-- Clear decorator top -->
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]