cedric 01/10/08 06:51:39
Added: contrib/tiles/web/doc/tutorial/dynPortal Channels.jsp
index.jsp myPortalPrefs.jsp myPortalPrefTile.jsp
testChannels.jsp
Log:
start dynamic portal example : jsp files
Revision Changes Path
1.1
jakarta-struts/contrib/tiles/web/doc/tutorial/dynPortal/Channels.jsp
Index: Channels.jsp
===================================================================
<%--
/**
* Summarize channels as unadorned HTML.
*
* @parameters ListArray CHANNELS
* @author Ted Husted
* @author Cedric Dumoulin
* @version $Revision: 1.1 $ $Date: 2001/10/08 13:51:39 $
*/
--%>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<tiles:importAttribute name="CHANNELS" scope="page"/>
<logic:iterate name="CHANNELS" id="CHANNEL" >
<TABLE border="0" cellspacing="2" cellpadding="4" width="300" align="center" >
<TR>
<TD><logic:present name="CHANNEL" property="image"><img src="<bean:write
name="CHANNEL" property="image.URL"/>"></logic:present></TD>
<TD class="spanhd" width="100%"><a href="<bean:write name="CHANNEL"
property="link"/>">
<bean:write name="CHANNEL" property="title"/></a></TD>
</TR>
<TD class="yellow" colspan="2"><bean:write name="CHANNEL"
property="description"/></TD>
</TR>
<TR>
<TD class="datagrey" colspan="2">
<logic:iterate name="CHANNEL" property="items" id="ITEM">
<br><b><bean:write name="ITEM" property="title"/></b>
<br><bean:write name="ITEM" property="description"/>
<br> [ <a href="<bean:write name="ITEM" property="link"/>">more</a> ]
<br>
</logic:iterate>
</TD>
</TR>
</TABLE>
<br>
</logic:iterate>
1.1
jakarta-struts/contrib/tiles/web/doc/tutorial/dynPortal/index.jsp
Index: index.jsp
===================================================================
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<tiles:insert definition="myDynamicPortal" flush="true" />
1.1
jakarta-struts/contrib/tiles/web/doc/tutorial/dynPortal/myPortalPrefs.jsp
Index: myPortalPrefs.jsp
===================================================================
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<tiles:insert definition="myDynamicPortalPreferences" flush="true" />
1.1
jakarta-struts/contrib/tiles/web/doc/tutorial/dynPortal/myPortalPrefTile.jsp
Index: myPortalPrefTile.jsp
===================================================================
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<script language="javaScript1.2">
function selectAll( )
{
for( j=0; j<selectAll.arguments.length; j++ )
{
col1 = selectAll.arguments[j];
for(i=0; i<col1.options.length; i++ )
{
col1.options[ i ].selected = true;
}
} // end loop
return true;
}
function move( col1, col2)
{
toMove = col1.options[ col1.selectedIndex ];
opt = new Option( toMove.text, toMove.value, false, false );
col1.options[col1.selectedIndex ] = null;
col2.options[col2.length] = opt;
return true;
}
function remove( col1)
{
col1.options[ col1.selectedIndex ] = null;
return true;
}
function up( col1 )
{
index = col1.selectedIndex;
if( index <= 0 )
return true;
toMove = col1.options[ index ];
opt = new Option( toMove.text, toMove.value, false, false );
col1.options[index] = col1.options[index-1];
col1.options[index-1] = opt;
return true;
}
function down( col1 )
{
index = col1.selectedIndex;
if( index+1 >= col1.options.length )
return true;
toMove = col1.options[ index ];
opt = new Option( toMove.text, toMove.value, false, false );
col1.options[index] = col1.options[index+1];
col1.options[index+1] = opt;
return true;
}
</script>
<html:form action="/actions/myPortalPrefs.do" >
<html:select property="remaining" multiple="true" >
<html:options property="choices" />
</html:select>
<html:button property="v" value="v" onclick="move(remaining,l0);return true;"/>
<br>
<table>
<tr>
<td>
<html:select property="l0" multiple="true" size="10">
<html:options property="col[0]" labelProperty="colLabels[0]"/>
</html:select>
</td>
<td>
<html:select property="l1" multiple="true" size="10">
<html:options property="col[1]" labelProperty="colLabels[1]"/>
</html:select>
</td>
</tr>
<tr>
<td align="center">
<html:button property="right" value="^" onclick="up(l0);return true;"/>
<html:button property="right" value="del" onclick="remove(l0);return true;"/>
<html:button property="right" value="v" onclick="down(l0);return true;"/>
<html:button property="left" value=">" onclick="move(l0,l1);return false;" />
</td>
<td align="center">
<html:button property="right" value="<" onclick="move(l1,l0);return true;"/>
<html:button property="right" value="^" onclick="up(l1);return true;"/>
<html:button property="right" value="del" onclick="remove(l1);return true;"/>
<html:button property="right" value="v" onclick="down(l1);return true;"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<html:submit property="validate" value="validate" onclick="selectAll(l0,
l1);return true;"/>
</td>
</tr>
</table>
</html:form>
1.1
jakarta-struts/contrib/tiles/web/doc/tutorial/dynPortal/testChannels.jsp
Index: testChannels.jsp
===================================================================
<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<tiles:insert definition="test.rssChannel.page" flush="true" />