You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/05/05 18:21:09 UTC
svn commit: r400102 [5/5] - in /tapestry/tapestry4/trunk: .settings/
examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/
examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/
examples/Workbench/src/java/org/apache/tapestry/work...
Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/WMLMarkupFilter.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/WMLMarkupFilter.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/WMLMarkupFilter.java (original)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/WMLMarkupFilter.java Fri May 5 09:20:58 2006
@@ -22,8 +22,9 @@
*/
public class WMLMarkupFilter extends AbstractMarkupFilter
{
+
public WMLMarkupFilter()
{
super(new WMLCharacterTranslatorSource().getDefaultTranslator());
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/pages/WMLException.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/pages/WMLException.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/pages/WMLException.java (original)
+++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/wml/pages/WMLException.java Fri May 5 09:20:58 2006
@@ -46,4 +46,4 @@
_exceptions = analyzer.analyze(value);
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/framework/src/js/build.xml
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/js/build.xml?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/build.xml (original)
+++ tapestry/tapestry4/trunk/framework/src/js/build.xml Fri May 5 09:20:58 2006
@@ -29,20 +29,20 @@
<property name="module.javac.target" value="1.5" />
<property name="module.javac.source" value="1.5" />
<property name="module.install.dir" value="${root.dir}/target/js" />
-
+
<property name="root.dir" value="../../.." />
<property file="${root.dir}/config/build.properties" />
<property name="profile.file" value="tapestry.profile.js" />
-
+
<property name="release.dir" value="${dojo.dir}/../release/" />
-
+
<import file="${hivebuild.dir}/jar-module.xml" />
-
+
<target name="check-dependencies" description="Ensures that dojo.dir is set.">
<fail message="dojo.dir not set" unless="dojo.dir" />
</target>
-
+
<!-- ====================================================== -->
<!-- Building -->
<!-- ====================================================== -->
Added: tapestry/tapestry4/trunk/framework/src/js/tests/widget/test_widgetManager.js
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/js/tests/widget/test_widgetManager.js?rev=400102&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/js/tests/widget/test_widgetManager.js (added)
+++ tapestry/tapestry4/trunk/framework/src/js/tests/widget/test_widgetManager.js Fri May 5 09:20:58 2006
@@ -0,0 +1,10 @@
+dojo.require("dojo.widget.DomWidget");
+
+function test_domwidget_ctor(){
+ var dw = new dojo.widget.DomWidget();
+
+ jum.assertEquals("test1", (typeof dw), "object");
+ jum.assertEquals("test3", null, dw.templateNode);
+ jum.assertEquals("test4", null, dw.templateString);
+ dw.buildFromTemplate();
+}
\ No newline at end of file
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/ExceptionService.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/ExceptionService.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/ExceptionService.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/ExceptionService.java Fri May 5 09:20:58 2006
@@ -34,6 +34,7 @@
*/
public class ExceptionService implements IEngineService
{
+
private WebRequest _request;
private WebResponse _response;
@@ -42,22 +43,27 @@
public ILink getLink(boolean post, Object parameter)
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod("getLink"));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod("getLink"));
}
- public void service(IRequestCycle cycle) throws IOException
+ public void service(IRequestCycle cycle)
+ throws IOException
{
WebSession session = _request.getSession(true);
String markup = (String) session
.getAttribute(PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE);
- PrintWriter writer = _response.getPrintWriter(new ContentType("text/html"));
+ PrintWriter writer = _response.getPrintWriter(new ContentType(
+ "text/html"));
PortletURL url = _globals.getRenderResponse().createActionURL();
- writer.println("<span class=\"portlet-msg-error\">An exception has occured.</span>");
+ writer
+ .println("<span class=\"portlet-msg-error\">An exception has occured.</span>");
writer.println("<br/>");
- writer.println("<a href=\"" + url.toString() + "\">Click here to continue</a>");
+ writer.println("<a href=\"" + url.toString()
+ + "\">Click here to continue</a>");
writer.print("<br/><hr/>");
writer.println();
@@ -83,4 +89,4 @@
{
_globals = globals;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationInitializer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationInitializer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationInitializer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationInitializer.java Fri May 5 09:20:58 2006
@@ -17,13 +17,15 @@
import javax.portlet.PortletConfig;
/**
- * Command interface for the <code>tapestry.portlet.ApplicationInitializer</code> configuration
- * point, which is used by the application portlet to bootstrap the application.
+ * Command interface for the
+ * <code>tapestry.portlet.ApplicationInitializer</code> configuration point,
+ * which is used by the application portlet to bootstrap the application.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public interface PortletApplicationInitializer
{
- public void initialize(PortletConfig portletConfig);
-}
\ No newline at end of file
+
+ void initialize(PortletConfig portletConfig);
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationSpecificationInitializer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationSpecificationInitializer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationSpecificationInitializer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletApplicationSpecificationInitializer.java Fri May 5 09:20:58 2006
@@ -25,20 +25,23 @@
import org.apache.tapestry.web.WebContextResource;
/**
- * Locates and reads the application specification for the portlet and stores it into
- * {@link org.apache.tapestry.services.ApplicationGlobals}.
+ * Locates and reads the application specification for the portlet and stores it
+ * into {@link org.apache.tapestry.services.ApplicationGlobals}.
* <p>
* TODO: Merge this code with
- * {@link org.apache.tapestry.services.impl.ApplicationSpecificationInitializer}, they're very
- * similar. This would probably be an additional service that would do the lookup based on the
- * {@link org.apache.tapestry.web.WebActivator} and the {@link org.apache.tapestry.web.WebContext}.
+ * {@link org.apache.tapestry.services.impl.ApplicationSpecificationInitializer},
+ * they're very similar. This would probably be an additional service that would
+ * do the lookup based on the {@link org.apache.tapestry.web.WebActivator} and
+ * the {@link org.apache.tapestry.web.WebContext}.
*
* @author Howard M. Lewis Ship
* @since 4.0
* @see org.apache.tapestry.services.impl.ApplicationSpecificationInitializer
*/
-public class PortletApplicationSpecificationInitializer implements PortletApplicationInitializer
+public class PortletApplicationSpecificationInitializer implements
+ PortletApplicationInitializer
{
+
private WebContext _context;
private ApplicationGlobals _globals;
@@ -62,11 +65,11 @@
String expectedName = name + ".application";
Resource webInfLocation = new WebContextResource(_context, "/WEB-INF/");
- Resource webInfAppLocation = webInfLocation.getRelativeResource(name + "/");
+ Resource webInfAppLocation = webInfLocation.getRelativeResource(name
+ + "/");
Resource result = check(webInfAppLocation, expectedName);
- if (result != null)
- return result;
+ if (result != null) return result;
return check(webInfLocation, expectedName);
}
@@ -75,8 +78,7 @@
{
Resource result = resource.getRelativeResource(name);
- if (result.getResourceURL() != null)
- return result;
+ if (result.getResourceURL() != null) return result;
return null;
}
@@ -87,8 +89,8 @@
// Pretend the file exists in the most common expected location.
- Resource virtualLocation = new WebContextResource(_context, "/WEB-INF/" + name
- + ".application");
+ Resource virtualLocation = new WebContextResource(_context, "/WEB-INF/"
+ + name + ".application");
result.setSpecificationLocation(virtualLocation);
@@ -111,4 +113,4 @@
{
_parser = parser;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConfigStrategy.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConfigStrategy.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConfigStrategy.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConfigStrategy.java Fri May 5 09:20:58 2006
@@ -41,12 +41,13 @@
receiver.section("Init Parameters");
- Iterator i = WebUtils.toSortedList(pc.getInitParameterNames()).iterator();
+ Iterator i = WebUtils.toSortedList(pc.getInitParameterNames())
+ .iterator();
- while (i.hasNext())
+ while(i.hasNext())
{
String name = (String) i.next();
receiver.property(name, pc.getInitParameter(name));
}
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConstants.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConstants.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConstants.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletConstants.java Fri May 5 09:20:58 2006
@@ -18,7 +18,7 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class PortletConstants
+public final class PortletConstants
{
/**
* Name of the render service, whose job is to render a page. The page to render is identified
@@ -57,4 +57,4 @@
{
// Prevent instantiation
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletExceptionPresenter.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletExceptionPresenter.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletExceptionPresenter.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletExceptionPresenter.java Fri May 5 09:20:58 2006
@@ -37,18 +37,21 @@
import org.apache.tapestry.web.WebResponse;
/**
- * Service used to present a runtime exception to the user. This is very tricky in the Portlet world
- * because of the split between the action and render requests (much more likely to get an error
- * during the action request than during the render request, but both are possible).
+ * Service used to present a runtime exception to the user. This is very tricky
+ * in the Portlet world because of the split between the action and render
+ * requests (much more likely to get an error during the action request than
+ * during the render request, but both are possible).
* <p>
- * During an action request, this code will render the HTML markup for the exception into a buffer
- * that is stored as persistent attribute in the portal session.
+ * During an action request, this code will render the HTML markup for the
+ * exception into a buffer that is stored as persistent attribute in the portal
+ * session.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletExceptionPresenter implements ExceptionPresenter
{
+
private PortletRequestGlobals _globals;
private RenderStrategy _renderStrategy;
@@ -67,8 +70,7 @@
{
if (_globals.isRenderRequest())
reportRenderRequestException(cycle, cause);
- else
- reportActionRequestException(cycle, cause);
+ else reportActionRequestException(cycle, cause);
}
catch (Exception ex)
{
@@ -90,13 +92,14 @@
.unableToProcessClientRequest(cause), cause);
}
- private void reportActionRequestException(IRequestCycle cycle, Throwable cause)
+ private void reportActionRequestException(IRequestCycle cycle,
+ Throwable cause)
{
CharArrayWriter caw = new CharArrayWriter();
PrintWriter pw = new PrintWriter(caw);
- IMarkupWriter writer = _markupWriterSource
- .newMarkupWriter(pw, new ContentType("text/html"));
+ IMarkupWriter writer = _markupWriterSource.newMarkupWriter(pw,
+ new ContentType("text/html"));
writeException(writer, cycle, cause);
@@ -105,21 +108,22 @@
String markup = caw.toString();
_request.getSession(true).setAttribute(
- PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
- markup);
+ PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE, markup);
ActionResponse response = _globals.getActionResponse();
- response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE);
+ response.setRenderParameter(ServiceConstants.SERVICE,
+ PortletConstants.EXCEPTION_SERVICE);
}
- private void reportRenderRequestException(IRequestCycle cycle, Throwable cause)
- throws IOException
+ private void reportRenderRequestException(IRequestCycle cycle,
+ Throwable cause)
+ throws IOException
{
PrintWriter pw = _response.getPrintWriter(new ContentType("text/html"));
- IMarkupWriter writer = _markupWriterSource
- .newMarkupWriter(pw, new ContentType("text/html"));
+ IMarkupWriter writer = _markupWriterSource.newMarkupWriter(pw,
+ new ContentType("text/html"));
writeException(writer, cycle, cause);
}
@@ -139,7 +143,8 @@
_request = request;
}
- public void setRequestExceptionReporter(RequestExceptionReporter requestExceptionReporter)
+ public void setRequestExceptionReporter(
+ RequestExceptionReporter requestExceptionReporter)
{
_requestExceptionReporter = requestExceptionReporter;
}
@@ -177,7 +182,7 @@
writer.begin("table");
writer.attribute("class", "portlet-section-subheader");
- for (int i = 0; i < properties.length; i++)
+ for(int i = 0; i < properties.length; i++)
{
writer.begin("tr");
@@ -191,7 +196,8 @@
writer.begin("td");
- _renderStrategy.renderObject(properties[i].getValue(), writer, cycle);
+ _renderStrategy.renderObject(properties[i].getValue(), writer,
+ cycle);
writer.end("tr");
writer.println();
}
@@ -200,14 +206,13 @@
writer.println();
}
- if (!showStackTrace)
- return;
+ if (!showStackTrace) return;
writer.begin("ul");
String[] trace = exception.getStackTrace();
- for (int i = 0; i < trace.length; i++)
+ for(int i = 0; i < trace.length; i++)
{
writer.begin("li");
writer.print(trace[i]);
@@ -220,12 +225,15 @@
}
- private void writeException(IMarkupWriter writer, IRequestCycle cycle, Throwable cause)
+ private void writeException(IMarkupWriter writer, IRequestCycle cycle,
+ Throwable cause)
{
- ExceptionDescription[] exceptions = new ExceptionAnalyzer().analyze(cause);
+ ExceptionDescription[] exceptions = new ExceptionAnalyzer()
+ .analyze(cause);
- for (int i = 0; i < exceptions.length; i++)
- writeException(writer, cycle, exceptions[i], i + 1 == exceptions.length);
+ for(int i = 0; i < exceptions.length; i++)
+ writeException(writer, cycle, exceptions[i],
+ i + 1 == exceptions.length);
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java Fri May 5 09:20:58 2006
@@ -27,15 +27,17 @@
import org.apache.tapestry.services.ResponseRenderer;
/**
- * Replacement for the standard home service, used by Portlets. This exists to handle the special
- * case where a Portlet render request arrives when there is not a Portlet action request prior ...
- * this can happen when a Portlet is first added to a Portal page.
+ * Replacement for the standard home service, used by Portlets. This exists to
+ * handle the special case where a Portlet render request arrives when there is
+ * not a Portlet action request prior ... this can happen when a Portlet is
+ * first added to a Portal page.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletHomeService implements IEngineService
{
+
private PortletRenderer _portletRenderer;
private PortletRequestGlobals _requestGlobals;
@@ -54,7 +56,8 @@
public ILink getLink(boolean post, Object parameter)
{
if (parameter != null)
- throw new IllegalArgumentException(EngineMessages.serviceNoParameter(this));
+ throw new IllegalArgumentException(EngineMessages
+ .serviceNoParameter(this));
Map parameters = new HashMap();
@@ -71,7 +74,8 @@
_responseRenderer = responseRenderer;
}
- public void service(IRequestCycle cycle) throws IOException
+ public void service(IRequestCycle cycle)
+ throws IOException
{
String pageName = _pageResolver.getPageNameForRequest(cycle);
@@ -100,4 +104,4 @@
{
_pageResolver = pageResolver;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLink.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLink.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLink.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLink.java Fri May 5 09:20:58 2006
@@ -28,6 +28,7 @@
*/
public class PortletLink implements ILink
{
+
private final PortletURL _portletURL;
private final QueryParameterMap _parameters;
@@ -48,24 +49,22 @@
public String getURL(String anchor, boolean includeParameters)
{
- if (includeParameters)
- loadParameters();
+ if (includeParameters) loadParameters();
String url = _portletURL.toString();
url = unencode(url);
- if (anchor != null)
- url = url + "#" + anchor;
+ if (anchor != null) url = url + "#" + anchor;
return url;
}
/**
- * The PortletURL class returns a url that's already XML-escaped, ready for inclusion directly
- * into the response stream. However, the IMarkupWriter expects to do that encoding too ... and
- * double encoding is bad. So we back out the most likely encoding (convert '&amp;' to just
- * '&').
+ * The PortletURL class returns a url that's already XML-escaped, ready for
+ * inclusion directly into the response stream. However, the IMarkupWriter
+ * expects to do that encoding too ... and double encoding is bad. So we
+ * back out the most likely encoding (convert '&amp;' to just '&').
*/
private String unencode(String url)
@@ -73,12 +72,11 @@
StringBuffer buffer = new StringBuffer(url.length());
String text = url;
- while (true)
+ while(true)
{
int ampx = text.indexOf("&");
- if (ampx < 0)
- break;
+ if (ampx < 0) break;
// Take up to and including the '&'
@@ -96,33 +94,35 @@
{
String[] names = _parameters.getParameterNames();
- for (int i = 0; i < names.length; i++)
+ for(int i = 0; i < names.length; i++)
{
String name = names[i];
String[] values = _parameters.getParameterValues(name);
- if (values != null)
- _portletURL.setParameter(name, values);
+ if (values != null) _portletURL.setParameter(name, values);
}
}
public String getURL(String scheme, String server, int port, String anchor,
boolean includeParameters)
{
- // Ignore scheme, server and port ... those are under the control of the portlet container.
+ // Ignore scheme, server and port ... those are under the control of the
+ // portlet container.
return getURL(anchor, includeParameters);
}
public String getAbsoluteURL()
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod("getAbsoluteURL"));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod("getAbsoluteURL"));
}
- public String getAbsoluteURL(String scheme, String server, int port, String anchor,
- boolean includeParameters)
+ public String getAbsoluteURL(String scheme, String server, int port,
+ String anchor, boolean includeParameters)
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod("getAbsoluteURL"));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod("getAbsoluteURL"));
}
public String[] getParameterNames()
@@ -135,4 +135,4 @@
return _parameters.getParameterValues(name);
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLinkFactoryImpl.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLinkFactoryImpl.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLinkFactoryImpl.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletLinkFactoryImpl.java Fri May 5 09:20:58 2006
@@ -19,21 +19,21 @@
import javax.portlet.PortletURL;
import javax.portlet.RenderResponse;
-import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.engine.IEngineService;
import org.apache.tapestry.engine.ILink;
import org.apache.tapestry.services.impl.LinkFactoryImpl;
import org.apache.tapestry.util.QueryParameterMap;
/**
- * Extended version of {@link org.apache.tapestry.services.impl.LinkFactoryImpl} that can
- * create generate Portlet URLs.
+ * Extended version of {@link org.apache.tapestry.services.impl.LinkFactoryImpl} that
+ * can create generate Portlet URLs.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletLinkFactoryImpl extends LinkFactoryImpl
{
+
private RenderResponse _renderResponse;
public void setRenderResponse(RenderResponse renderResponse)
@@ -41,8 +41,8 @@
_renderResponse = renderResponse;
}
- public ILink constructLink(IEngineService service, boolean post, Map parameters,
- boolean stateful)
+ public ILink constructLink(IEngineService service, boolean post,
+ Map parameters, boolean stateful)
{
finalizeParameters(service, parameters);
@@ -50,4 +50,4 @@
return new PortletLink(url, new QueryParameterMap(parameters));
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java Fri May 5 09:20:58 2006
@@ -20,9 +20,16 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-class PortletMessages
+final class PortletMessages
{
- private final static MessageFormatter _formatter = new MessageFormatter(PortletMessages.class);
+
+ private static final MessageFormatter _formatter = new MessageFormatter(
+ PortletMessages.class);
+
+ /* defeat instantiation */
+ private PortletMessages()
+ {
+ }
static String unsupportedMethod(String methodName)
{
@@ -53,4 +60,4 @@
{
return _formatter.getMessage("stale-session");
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRenderer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRenderer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRenderer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRenderer.java Fri May 5 09:20:58 2006
@@ -26,6 +26,7 @@
*/
public interface PortletRenderer
{
- public void renderPage(IRequestCycle cycle, String pageName)
- throws IOException;
-}
\ No newline at end of file
+
+ void renderPage(IRequestCycle cycle, String pageName)
+ throws IOException;
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobals.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobals.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobals.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobals.java Fri May 5 09:20:58 2006
@@ -21,33 +21,35 @@
import javax.portlet.RenderResponse;
/**
- * Stores the current Portlet request and response, for access by other services.
+ * Stores the current Portlet request and response, for access by other
+ * services.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public interface PortletRequestGlobals
{
- public void store(ActionRequest request, ActionResponse response);
- public void store(RenderRequest request, RenderResponse response);
+ void store(ActionRequest request, ActionResponse response);
- public ActionRequest getActionRequest();
+ void store(RenderRequest request, RenderResponse response);
- public ActionResponse getActionResponse();
+ ActionRequest getActionRequest();
- public RenderRequest getRenderRequest();
+ ActionResponse getActionResponse();
- public RenderResponse getRenderResponse();
+ RenderRequest getRenderRequest();
+
+ RenderResponse getRenderResponse();
/**
- * Returns true if {@link #store(RenderRequest, RenderResponse)}has been invoked, false
- * otherwise.
+ * Returns true if {@link #store(RenderRequest, RenderResponse)}has been
+ * invoked, false otherwise.
*/
- public boolean isRenderRequest();
+ boolean isRenderRequest();
/**
* Returns whatever is available; the ActionRequest or the PortletRequest.
*/
- public PortletRequest getPortletRequest();
-}
\ No newline at end of file
+ PortletRequest getPortletRequest();
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobalsImpl.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobalsImpl.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobalsImpl.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletRequestGlobalsImpl.java Fri May 5 09:20:58 2006
@@ -21,14 +21,15 @@
import javax.portlet.RenderResponse;
/**
- * Implementation of the tapestry.portlet.PortletRequestGlobals service, which uses the threaded
- * service lifecycle model.
+ * Implementation of the tapestry.portlet.PortletRequestGlobals service, which
+ * uses the threaded service lifecycle model.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletRequestGlobalsImpl implements PortletRequestGlobals
{
+
private ActionRequest _actionRequest;
private ActionResponse _actionResponse;
@@ -84,4 +85,4 @@
{
return _portletRequest;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletResponseRenderer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletResponseRenderer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletResponseRenderer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletResponseRenderer.java Fri May 5 09:20:58 2006
@@ -22,10 +22,11 @@
import org.apache.tapestry.services.ServiceConstants;
/**
- * Sets render parameters on the current {@link javax.portlet.ActionResponse} that will invoke the
- * {@link org.apache.tapestry.portlet.RenderService} to render the (currently) active page. This
- * reflects the Portlet API's very clear division between processing an action and rendering a
- * response; we need to record into the implicit render URL the render service and the name of the
+ * Sets render parameters on the current {@link javax.portlet.ActionResponse}
+ * that will invoke the {@link org.apache.tapestry.portlet.RenderService} to
+ * render the (currently) active page. This reflects the Portlet API's very
+ * clear division between processing an action and rendering a response; we need
+ * to record into the implicit render URL the render service and the name of the
* active page.
*
* @author Howard M. Lewis Ship
@@ -33,6 +34,7 @@
*/
public class PortletResponseRenderer implements ResponseRenderer
{
+
private PortletRequest _request;
private ActionResponse _response;
@@ -41,12 +43,13 @@
{
String pageName = cycle.getPage().getPageName();
- _response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.RENDER_SERVICE);
+ _response.setRenderParameter(ServiceConstants.SERVICE,
+ PortletConstants.RENDER_SERVICE);
_response.setRenderParameter(ServiceConstants.PAGE, pageName);
- _response.setRenderParameter(PortletConstants.PORTLET_MODE, _request.getPortletMode()
- .toString());
- _response.setRenderParameter(PortletConstants.WINDOW_STATE, _request.getWindowState()
- .toString());
+ _response.setRenderParameter(PortletConstants.PORTLET_MODE, _request
+ .getPortletMode().toString());
+ _response.setRenderParameter(PortletConstants.WINDOW_STATE, _request
+ .getWindowState().toString());
}
public void setResponse(ActionResponse response)
@@ -58,4 +61,4 @@
{
_request = request;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletSessionDescribableStrategy.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletSessionDescribableStrategy.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletSessionDescribableStrategy.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletSessionDescribableStrategy.java Fri May 5 09:20:58 2006
@@ -31,6 +31,7 @@
*/
public class PortletSessionDescribableStrategy implements DescribableStrategy
{
+
public void describeObject(Object object, DescriptionReceiver receiver)
{
PortletSession session = (PortletSession) object;
@@ -39,16 +40,19 @@
receiver.property("creationTime", new Date(session.getCreationTime()));
receiver.property("id", session.getId());
- receiver.property("lastAccessedTime", new Date(session.getLastAccessedTime()));
- receiver.property("maxInactiveInterval", session.getMaxInactiveInterval());
+ receiver.property("lastAccessedTime", new Date(session
+ .getLastAccessedTime()));
+ receiver.property("maxInactiveInterval", session
+ .getMaxInactiveInterval());
receiver.property("new", session.isNew());
receiver.section("Attributes");
- Iterator i = WebUtils.toSortedList(session.getAttributeNames()).iterator();
- while (i.hasNext())
+ Iterator i = WebUtils.toSortedList(session.getAttributeNames())
+ .iterator();
+ while(i.hasNext())
{
String key = (String) i.next();
receiver.property(key, session.getAttribute(key));
}
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebActivator.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebActivator.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebActivator.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebActivator.java Fri May 5 09:20:58 2006
@@ -24,13 +24,15 @@
import org.apache.tapestry.web.WebUtils;
/**
- * Adapts a {@link javax.portlet.PortletConfig} as {@link org.apache.tapestry.web.WebActivator}.
+ * Adapts a {@link javax.portlet.PortletConfig} as
+ * {@link org.apache.tapestry.web.WebActivator}.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletWebActivator implements WebActivator
{
+
private final PortletConfig _config;
public PortletWebActivator(PortletConfig config)
@@ -60,4 +62,4 @@
receiver.describeAlternate(_config);
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContext.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContext.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContext.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContext.java Fri May 5 09:20:58 2006
@@ -30,13 +30,15 @@
import org.apache.tapestry.web.WebUtils;
/**
- * Adapts {@link javax.portlet.PortletContext}as {@link org.apache.tapestry.web.WebContext}.
+ * Adapts {@link javax.portlet.PortletContext}as
+ * {@link org.apache.tapestry.web.WebContext}.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletWebContext implements WebContext
{
+
private static final Log LOG = LogFactory.getLog(PortletWebContext.class);
private final PortletContext _portletContext;
@@ -76,8 +78,7 @@
{
if (attribute == null)
_portletContext.removeAttribute(name);
- else
- _portletContext.setAttribute(name, attribute);
+ else _portletContext.setAttribute(name, attribute);
}
public List getInitParameterNames()
@@ -100,15 +101,18 @@
receiver.describeAlternate(_portletContext);
}
- public String getRealPath(String path) {
- return _portletContext.getRealPath(path);
- }
-
- public InputStream getResourceAsStream(String path) {
- return _portletContext.getResourceAsStream(path);
- }
-
- public Set getResourcePaths(String path) {
- return _portletContext.getResourcePaths(path);
- }
+ public String getRealPath(String path)
+ {
+ return _portletContext.getRealPath(path);
+ }
+
+ public InputStream getResourceAsStream(String path)
+ {
+ return _portletContext.getResourceAsStream(path);
+ }
+
+ public Set getResourcePaths(String path)
+ {
+ return _portletContext.getResourcePaths(path);
+ }
}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContextInitializer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContextInitializer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContextInitializer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebContextInitializer.java Fri May 5 09:20:58 2006
@@ -28,14 +28,17 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class PortletWebContextInitializer implements PortletApplicationInitializer
+public class PortletWebContextInitializer implements
+ PortletApplicationInitializer
{
+
private ApplicationGlobals _applicationGlobals;
public void initialize(PortletConfig portletConfig)
{
WebActivator activator = new PortletWebActivator(portletConfig);
- WebContext context = new PortletWebContext(portletConfig.getPortletContext());
+ WebContext context = new PortletWebContext(portletConfig
+ .getPortletContext());
_applicationGlobals.storeActivator(activator);
_applicationGlobals.storeWebContext(context);
@@ -45,4 +48,4 @@
{
_applicationGlobals = applicationGlobals;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebRequest.java Fri May 5 09:20:58 2006
@@ -36,6 +36,7 @@
*/
public class PortletWebRequest implements WebRequest
{
+
private final PortletRequest _portletRequest;
private WebSession _webSession;
@@ -69,13 +70,11 @@
public WebSession getSession(boolean create)
{
- if (_webSession != null)
- return _webSession;
+ if (_webSession != null) return _webSession;
PortletSession session = _portletRequest.getPortletSession(create);
- if (session != null)
- _webSession = new PortletWebSession(session);
+ if (session != null) _webSession = new PortletWebSession(session);
return _webSession;
}
@@ -96,7 +95,8 @@
}
/**
- * Returns "<PortletRequest>", because portlets don't have a notion of request URI.
+ * Returns "<PortletRequest>", because portlets don't have a notion of
+ * request URI.
*/
public String getRequestURI()
@@ -136,13 +136,13 @@
{
if (attribute == null)
_portletRequest.removeAttribute(name);
- else
- _portletRequest.setAttribute(name, attribute);
+ else _portletRequest.setAttribute(name, attribute);
}
protected final void unsupported(String methodName)
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod(methodName));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod(methodName));
}
public void describeTo(DescriptionReceiver receiver)
@@ -176,4 +176,4 @@
{
return _portletRequest.isUserInRole(role);
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebResponse.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebResponse.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebResponse.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebResponse.java Fri May 5 09:20:58 2006
@@ -25,13 +25,15 @@
import org.apache.tapestry.web.WebResponse;
/**
- * Adapts {@link javax.portlet.PortletResponse} as {@link org.apache.tapestry.web.WebResponse}.
+ * Adapts {@link javax.portlet.PortletResponse} as
+ * {@link org.apache.tapestry.web.WebResponse}.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletWebResponse implements WebResponse
{
+
private final PortletResponse _portletResponse;
public PortletWebResponse(PortletResponse portletResponse)
@@ -41,14 +43,16 @@
_portletResponse = portletResponse;
}
- public OutputStream getOutputStream(ContentType contentType) throws IOException
+ public OutputStream getOutputStream(ContentType contentType)
+ throws IOException
{
unsupported("getOutputStream");
return null;
}
- public PrintWriter getPrintWriter(ContentType contentType) throws IOException
+ public PrintWriter getPrintWriter(ContentType contentType)
+ throws IOException
{
unsupported("getPrintWriter");
@@ -73,8 +77,8 @@
}
/**
- * Returns the empty string. The {@link RenderWebResponse} subclass actually provides a
- * real value here.
+ * Returns the empty string. The {@link RenderWebResponse} subclass
+ * actually provides a real value here.
*/
public String getNamespace()
{
@@ -83,7 +87,8 @@
protected final void unsupported(String methodName)
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod(methodName));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod(methodName));
}
/** Unsupported. */
@@ -111,9 +116,10 @@
}
/** Unsupported. */
- public void sendError(int statusCode, String message) throws IOException
+ public void sendError(int statusCode, String message)
+ throws IOException
{
unsupported("sendError");
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebSession.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebSession.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebSession.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/PortletWebSession.java Fri May 5 09:20:58 2006
@@ -24,13 +24,15 @@
import org.apache.tapestry.web.WebUtils;
/**
- * Adapts a {@link javax.portlet.PortletSession}as a {@link org.apache.tapestry.web.WebSession}.
+ * Adapts a {@link javax.portlet.PortletSession}as a
+ * {@link org.apache.tapestry.web.WebSession}.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public class PortletWebSession implements WebSession
{
+
private final PortletSession _portletSession;
public PortletWebSession(final PortletSession portletSession)
@@ -75,4 +77,4 @@
_portletSession.invalidate();
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicer.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicer.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicer.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicer.java Fri May 5 09:20:58 2006
@@ -21,14 +21,15 @@
import javax.portlet.RenderResponse;
/**
- * Used to define the commands in the <code>tapestry.portlet.RenderRequestServicerPipeline</code>
- * configuration.
+ * Used to define the commands in the
+ * <code>tapestry.portlet.RenderRequestServicerPipeline</code> configuration.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
public interface RenderRequestServicer
{
- public void service(RenderRequest request, RenderResponse response) throws IOException,
- PortletException;
-}
\ No newline at end of file
+
+ void service(RenderRequest request, RenderResponse response)
+ throws IOException, PortletException;
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerFilter.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerFilter.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerFilter.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerFilter.java Fri May 5 09:20:58 2006
@@ -30,6 +30,8 @@
*/
public interface RenderRequestServicerFilter
{
- public void service(RenderRequest request, RenderResponse response,
- RenderRequestServicer servicer) throws IOException, PortletException;
-}
\ No newline at end of file
+
+ void service(RenderRequest request, RenderResponse response,
+ RenderRequestServicer servicer)
+ throws IOException, PortletException;
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerToWebRequestServicerBridge.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerToWebRequestServicerBridge.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerToWebRequestServicerBridge.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderRequestServicerToWebRequestServicerBridge.java Fri May 5 09:20:58 2006
@@ -23,21 +23,22 @@
import org.apache.tapestry.services.WebRequestServicer;
/**
- * Bridges from the <code>tapestry.portlet.RenderRequestServicerPipeline</code> to the standard
- * <code>tapestry.request.WebRequestServicerPipeline</code>.
+ * Bridges from the <code>tapestry.portlet.RenderRequestServicerPipeline</code>
+ * to the standard <code>tapestry.request.WebRequestServicerPipeline</code>.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class RenderRequestServicerToWebRequestServicerBridge implements RenderRequestServicer
+public class RenderRequestServicerToWebRequestServicerBridge implements
+ RenderRequestServicer
{
private PortletRequestGlobals _portletRequestGlobals;
private WebRequestServicer _webRequestServicer;
- public void service(RenderRequest request, RenderResponse response) throws IOException,
- PortletException
+ public void service(RenderRequest request, RenderResponse response)
+ throws IOException, PortletException
{
_portletRequestGlobals.store(request, response);
@@ -54,7 +55,8 @@
}
}
- public void setPortletRequestGlobals(PortletRequestGlobals portletRequestGlobals)
+ public void setPortletRequestGlobals(
+ PortletRequestGlobals portletRequestGlobals)
{
_portletRequestGlobals = portletRequestGlobals;
}
@@ -64,4 +66,4 @@
_webRequestServicer = webRequestServicer;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderService.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderService.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderService.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderService.java Fri May 5 09:20:58 2006
@@ -24,20 +24,23 @@
import org.apache.tapestry.services.ServiceConstants;
/**
- * Responsible for rendering out a page; a Portlet render URL is built during action processing that
- * stores the active page; this is the page that will be rendered. The render service is (typically)
- * the only service that operates during a portlet RenderRequest. All other services will be an
- * ActionRequest that (via {@link org.apache.tapestry.portlet.PortletResponseRenderer}, writes
- * query parameters to activate this service during the render request.
+ * Responsible for rendering out a page; a Portlet render URL is built during
+ * action processing that stores the active page; this is the page that will be
+ * rendered. The render service is (typically) the only service that operates
+ * during a portlet RenderRequest. All other services will be an ActionRequest
+ * that (via {@link org.apache.tapestry.portlet.PortletResponseRenderer},
+ * writes query parameters to activate this service during the render request.
* <p>
- * Problematic is is anything related to the portlet mode or window state. As per the Portlet spec,
- * when the user clicks the "help" or "edit" buttons (or the minimize, maximize, etc.), this causes
- * a new RenderRequest, but explicitly keeps the render parameters set by the most recent
- * ActionRequest. But what Tapestry needs is to detect that the mode or state has changed and select
- * a different page to render the response. So we store the mode and state in effect when the
- * ActionRequest executed as two more query parameters, and detect changes to mode and state that
- * way. If there is a change, then we ignore the page query parameter and use the
- * {@link PortletPageResolver} to figure out the correct page to display instead.
+ * Problematic is is anything related to the portlet mode or window state. As
+ * per the Portlet spec, when the user clicks the "help" or "edit" buttons (or
+ * the minimize, maximize, etc.), this causes a new RenderRequest, but
+ * explicitly keeps the render parameters set by the most recent ActionRequest.
+ * But what Tapestry needs is to detect that the mode or state has changed and
+ * select a different page to render the response. So we store the mode and
+ * state in effect when the ActionRequest executed as two more query parameters,
+ * and detect changes to mode and state that way. If there is a change, then we
+ * ignore the page query parameter and use the {@link PortletPageResolver} to
+ * figure out the correct page to display instead.
*
* @author Howard M. Lewis Ship
* @since 4.0
@@ -45,6 +48,7 @@
*/
public class RenderService implements IEngineService
{
+
private PortletRequest _request;
private PortletRenderer _portletRenderer;
@@ -53,10 +57,12 @@
public ILink getLink(boolean post, Object parameter)
{
- throw new UnsupportedOperationException(PortletMessages.unsupportedMethod("getLink"));
+ throw new UnsupportedOperationException(PortletMessages
+ .unsupportedMethod("getLink"));
}
- public void service(IRequestCycle cycle) throws IOException
+ public void service(IRequestCycle cycle)
+ throws IOException
{
String pageName = getPageNameToRender(cycle);
@@ -72,17 +78,21 @@
}
/**
- * Returns true if the portlet mode or the window state has changed since. The values stored
- * previously (during an action request) are compared to the current values.
+ * Returns true if the portlet mode or the window state has changed since.
+ * The values stored previously (during an action request) are compared to
+ * the current values.
*/
boolean isStateChange(IRequestCycle cycle)
{
- String expectedPortletMode = cycle.getParameter(PortletConstants.PORTLET_MODE);
- String expectedWindowState = cycle.getParameter(PortletConstants.WINDOW_STATE);
-
- return !(_request.getPortletMode().toString().equals(expectedPortletMode) && _request
- .getWindowState().toString().equals(expectedWindowState));
+ String expectedPortletMode = cycle
+ .getParameter(PortletConstants.PORTLET_MODE);
+ String expectedWindowState = cycle
+ .getParameter(PortletConstants.WINDOW_STATE);
+
+ return !(_request.getPortletMode().toString().equals(
+ expectedPortletMode) && _request.getWindowState().toString()
+ .equals(expectedWindowState));
}
@@ -105,4 +115,4 @@
{
_pageResolver = pageResolver;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderWebResponse.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderWebResponse.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderWebResponse.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/RenderWebResponse.java Fri May 5 09:20:58 2006
@@ -31,6 +31,7 @@
*/
public class RenderWebResponse extends PortletWebResponse
{
+
private final RenderResponse _renderResponse;
public RenderWebResponse(RenderResponse renderResponse)
@@ -45,7 +46,8 @@
_renderResponse.reset();
}
- public PrintWriter getPrintWriter(ContentType contentType) throws IOException
+ public PrintWriter getPrintWriter(ContentType contentType)
+ throws IOException
{
Defense.notNull(contentType, "contentType");
@@ -58,4 +60,4 @@
{
return _renderResponse.getNamespace();
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/SetupPortletApplicationGlobals.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/SetupPortletApplicationGlobals.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/SetupPortletApplicationGlobals.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/SetupPortletApplicationGlobals.java Fri May 5 09:20:58 2006
@@ -19,13 +19,16 @@
import org.apache.tapestry.services.impl.AbstractSetupApplicationGlobals;
/**
- * Alternative to {@link org.apache.tapestry.services.impl.SetupServletApplicationGlobals}, but for
- * Portlets and the <code>tapestry.portlet.services.FactoryServices</code> configuration point.
+ * Alternative to
+ * {@link org.apache.tapestry.services.impl.SetupServletApplicationGlobals},
+ * but for Portlets and the
+ * <code>tapestry.portlet.services.FactoryServices</code> configuration point.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class SetupPortletApplicationGlobals extends AbstractSetupApplicationGlobals implements
+public class SetupPortletApplicationGlobals extends
+ AbstractSetupApplicationGlobals implements
PortletApplicationInitializer
{
@@ -34,4 +37,4 @@
initialize("portlet");
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderFilter.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderFilter.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderFilter.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderFilter.java Fri May 5 09:20:58 2006
@@ -24,38 +24,44 @@
/**
* @author Raphael Jean
- *
*/
-public class PortletMultipartDecoderFilter implements ActionRequestServicerFilter
+public class PortletMultipartDecoderFilter implements
+ ActionRequestServicerFilter
{
+
private PortletMultipartDecoder _decoder;
- public void service(ActionRequest request, ActionResponse response,
- ActionRequestServicer servicer) throws IOException, PortletException
- {
+ public void service(ActionRequest request, ActionResponse response,
+ ActionRequestServicer servicer)
+ throws IOException, PortletException
+ {
String contentType = request.getContentType();
- // contentType is occasionally null in testing. The browser tacks on additional
- // information onto the contentType to indicate where the boundaries are in
+ // contentType is occasionally null in testing. The browser tacks on
+ // additional
+ // information onto the contentType to indicate where the boundaries are
+ // in
// the stream.
- boolean encoded = contentType != null && contentType.startsWith("multipart/form-data");
+ boolean encoded = contentType != null
+ && contentType.startsWith("multipart/form-data");
try
{
- ActionRequest newRequest = encoded ? _decoder.decode(request) : request;
+ ActionRequest newRequest = encoded ? _decoder.decode(request)
+ : request;
servicer.service(newRequest, response);
}
finally
{
- if (encoded)
- _decoder.cleanup();
+ if (encoded) _decoder.cleanup();
}
- }
+ }
- public void setDecoder(PortletMultipartDecoder decoder) {
- this._decoder = decoder;
- }
+ public void setDecoder(PortletMultipartDecoder decoder)
+ {
+ this._decoder = decoder;
+ }
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderImpl.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderImpl.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderImpl.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/PortletMultipartDecoderImpl.java Fri May 5 09:20:58 2006
@@ -29,11 +29,13 @@
/**
* @author Raphael Jean
- *
*/
-public class PortletMultipartDecoderImpl extends AbstractMultipartDecoder implements PortletMultipartDecoder {
+public class PortletMultipartDecoderImpl extends AbstractMultipartDecoder
+ implements PortletMultipartDecoder
+{
- public ActionRequest decode(ActionRequest request) {
+ public ActionRequest decode(ActionRequest request)
+ {
_encoding = request.getCharacterEncoding();
PortletFileUpload upload = createFileUpload();
@@ -46,22 +48,24 @@
}
catch (FileUploadException ex)
{
- throw new ApplicationRuntimeException(MultipartMessages.unableToDecode(ex), ex);
+ throw new ApplicationRuntimeException(MultipartMessages
+ .unableToDecode(ex), ex);
}
Map parameterMap = buildParameterMap();
return new UploadFormPortletParametersWrapper(request, parameterMap);
- }
+ }
- private PortletFileUpload createFileUpload() {
- FileItemFactory factory = new DiskFileItemFactory(_thresholdSize, new File(_repositoryPath));
- PortletFileUpload upload = new PortletFileUpload(factory);
+ private PortletFileUpload createFileUpload()
+ {
+ FileItemFactory factory = new DiskFileItemFactory(_thresholdSize,
+ new File(_repositoryPath));
+ PortletFileUpload upload = new PortletFileUpload(factory);
- if (_encoding != null)
- upload.setHeaderEncoding(_encoding);
+ if (_encoding != null) upload.setHeaderEncoding(_encoding);
return upload;
- }
+ }
}
Modified: tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/UploadFormPortletParametersWrapper.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/UploadFormPortletParametersWrapper.java?rev=400102&r1=400101&r2=400102&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/UploadFormPortletParametersWrapper.java (original)
+++ tapestry/tapestry4/trunk/portlet/src/java/org/apache/tapestry/portlet/multipart/UploadFormPortletParametersWrapper.java Fri May 5 09:20:58 2006
@@ -20,27 +20,27 @@
import javax.portlet.ActionRequest;
import org.apache.hivemind.util.Defense;
-import org.apache.tapestry.multipart.ValuePart;
/**
* @author Raphael Jean
- *
*/
-public class UploadFormPortletParametersWrapper extends ActionRequestWrapper {
+public class UploadFormPortletParametersWrapper extends ActionRequestWrapper
+{
/**
* Map of {@link ValuePart} keyed on parameter name.
*/
private Map _parameterMap;
- public UploadFormPortletParametersWrapper(ActionRequest request,
- Map parameterMap) {
- super(request);
-
+ public UploadFormPortletParametersWrapper(ActionRequest request,
+ Map parameterMap)
+ {
+ super(request);
+
Defense.notNull(parameterMap, "parameterMap");
_parameterMap = Collections.unmodifiableMap(parameterMap);
- }
+ }
public String getParameter(String name)
{
@@ -66,7 +66,7 @@
public String toString()
{
- return "<UploadFormPortletParametersWrapper for " + getRequest() + ">";
+ return "<UploadFormPortletParametersWrapper for " + getRequest() + ">";
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org