Author: wesleyhales
Date: 2008-02-10 23:05:50 -0500 (Sun, 10 Feb 2008)
New Revision: 9932
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp
Log:
some script enhancements
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java 2008-02-11
04:05:50 UTC (rev 9932)
@@ -54,7 +54,7 @@
//
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
- writer.print("<a href='javascript:" + resp.getNamespace() +
"_handle()'>Click me to trigger script</a>");
+ writer.print("<div
style=\"height:100px;width:100%;text-align:center;padding-top:50px;\"><a
href='javascript:" + resp.getNamespace() + "_handle()'>Click me to
trigger script</a></div>");
}
public void serveResource(ResourceRequest req, ResourceResponse resp) throws
PortletException, IOException
@@ -62,7 +62,8 @@
String namespace =resp.getNamespace();
resp.setContentType("text/javascript");
PrintWriter writer = resp.getWriter();
- writer.print("function " + namespace + "_handle() { alert('Some
alert'); }");
+ writer.print("function " + namespace + "_handle() { " +
+ "new Effect.Grow(document.getElementById('header-portlet'))
}");
writer.close();
}
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CartPortlet.java 2008-02-11
04:05:50 UTC (rev 9932)
@@ -52,7 +52,7 @@
if (!items.isEmpty())
{
- writer.append("<table width='95%'><thead><tr
align='left'><th width='66%'>Description</th><th
align='right'>Price</th></tr></thead><tbody>");
+ writer.append("<table width='95%'
id=\"cart-table\"><thead><tr align='left'><th
width='66%'>Description</th><th
align='right'>Price</th></tr></thead><tbody>");
int total = 0;
for (CatalogItem item : items)
{
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/event/CatalogPortlet.java 2008-02-11
04:05:50 UTC (rev 9932)
@@ -56,7 +56,7 @@
{
addURL.setParameter("id", item.getId());
writer.append("<tr><td>").append(item.getDescription()).append("</td><td>$").append(""
+ item.getPrice())
- .append("</td><td><a
href='").append(addURL.toString()).append("'>Add to
cart</a></td></tr>");
+ .append("</td><td><a
href='").append(addURL.toString()).append("' onclick=\"new
Effect.Highlight(document.getElementById('cart-table'))\">Add to
cart</a></td></tr>");
}
writer.append("</tbody></table>");
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-02-11
04:05:50 UTC (rev 9932)
@@ -1,11 +1,13 @@
<%@ tag body-content="scriptless" %>
<%@ attribute name="name" rtexprvalue="true"
required="true" %>
<%@ attribute name="applicationName" rtexprvalue="true"
required="true" %>
+<%@ attribute name="id" rtexprvalue="true"
required="false" %>
<%@ attribute name="content" fragment="true"
required="false" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
+<%@ taglib prefix="fn"
uri="http://java.sun.com/jsp/jstl/functions" %>
<portal:portlet name="${name}"
applicationName="${applicationName}"
errorPage="/WEB-INF/jsp/error.jsp">
- <div class="portlet">
+ <div class="portlet" id="${!empty id ? id : name}">
<div class="portlet-frame">
<div class="header full-width">
<div class="header-layer full-width">
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo1.jsp 2008-02-11
04:05:50 UTC (rev 9932)
@@ -10,10 +10,10 @@
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google"
localName="zipcode" value="80201"/>
<jbp:layout1>
<jsp:attribute name="leftcol">
- <jbp:portlet name="Cart"
applicationName="samples-cart-event-portlet"/>
+ <jbp:portlet name="Cart"
applicationName="samples-cart-event-portlet" id="cart-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="Catalog"
applicationName="samples-cart-event-portlet"/>
+ <jbp:portlet name="Catalog"
applicationName="samples-cart-event-portlet" />
</jsp:attribute>
</jbp:layout1>
</portal:page>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp 2008-02-11
02:57:55 UTC (rev 9931)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp 2008-02-11
04:05:50 UTC (rev 9932)
@@ -10,14 +10,11 @@
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google"
localName="zipcode" value="80201"/>
<jbp:layout1>
<jsp:attribute name="leftcol">
-
<jbp:portlet name="Foo" applicationName="bar"/>
-
-
</jsp:attribute>
<jsp:attribute name="rightcol">
<jbp:portlet name="ExceptionPortlet"
applicationName="samples-basic"/>
- <jbp:portlet name="HeaderPortlet"
applicationName="samples-basic"/>
+ <jbp:portlet name="HeaderPortlet"
applicationName="samples-basic" id="header-portlet"/>
</jsp:attribute>
</jbp:layout1>
</portal:page>