Hi David,
It seems that there is a bug with portal-site component, actually the
problem is caused by MenuImpl, when I test your contentViewer portlet.
Reproduce Steps:
1. Login portal as admin.
2. Add "Content Viewer" to page.
3. Click the
Constitution<http://localhost:8080/jetspeed/portal/Constitution.html>
.
4. Done.
You will got a java.lang.StackOverflowError Exception. The following are the
detail messages:
VelocityViewServlet : Error processing the template Invocation of method
'getMenu' in class
org.apache.jetspeed.portalsite.impl.PortalSiteRequestContextImpl threw
exception class java.lang.StackOverflowError : null
java.lang.StackOverflowError
at
java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:54)
at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.jetspeed.om.page.proxy.LinkProxy.invoke(LinkProxy.java:116)
at $Proxy15.getName(Unknown Source)
at
org.apache.jetspeed.page.document.proxy.NodeSetImpl.get(NodeSetImpl.java:64)
at
org.apache.jetspeed.portalsite.view.SiteView.getNodeProxy(SiteView.java:753)
at
org.apache.jetspeed.portalsite.impl.MenuImpl.constructMenuElements(MenuImpl.java:611)
at org.apache.jetspeed.portalsite.impl.MenuImpl.(MenuImpl.java:170)
at
org.apache.jetspeed.portalsite.impl.MenuImpl.constructMenuElements(MenuImpl.java:738)
at org.apache.jetspeed.portalsite.impl.MenuImpl.(MenuImpl.java:170)
at
org.apache.jetspeed.portalsite.impl.MenuImpl.constructMenuElements(MenuImpl.java:738)
at org.apache.jetspeed.portalsite.impl.MenuImpl.(MenuImpl.java:170)
at
org.apache.jetspeed.portalsite.impl.MenuImpl.constructMenuElements(MenuImpl.java:738)
at org.apache.jetspeed.portalsite.impl.MenuImpl.(MenuImpl.java:170)
at
org.apache.jetspeed.portalsite.impl.MenuImpl.constructMenuElements(MenuImpl.java:738)
at org.apache.jetspeed.portalsite.impl.MenuImpl.(MenuImpl.java:170)
....................................... (omit)
I did some debug on it and I found that it is caused by system folder in
path "jetspeed\WEB-INF\pages\". There is no folder.metadata with this
folder, and this will cause infinite loop. Once you add a "folder.metadata"
to it, everything is fine.
I think this bug will affect all the page that use jscookmenu as
layout-decorator.
Correct me if I am wrong.
- James Liao
On 9/21/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Author: taylor
> Date: Tue Sep 20 11:19:00 2005
> New Revision: 290507
>
> URL: http://svn.apache.org/viewcvs?rev=290507&view=rev
> Log:
> demo for:
>
> http://issues.apache.org/jira/browse/JS2-363
> Document Resources: Profiler mapping criteria to associated pages
>
> The FilePortlet can now optionally look at the path i.e.
>
> /content/Constitution.html
>
> and map that to a PSML page, where the PSML page is never referenced in
> the URL
> this feature is useful for Graffito
>
> Modified:
>
> portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/file/FilePortlet.java
>
> Modified:
> portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/file/FilePortlet.java
> URL:
> http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/file/FilePortlet.java?rev=290507&r1=290506&r2=290507&view=diff
>
> ==============================================================================
> ---
> portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/file/FilePortlet.java
> (original)
> +++
> portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/file/FilePortlet.java
> Tue Sep 20 11:19:00 2005
> @@ -15,6 +15,7 @@
> */
> package org.apache.portals.gems.file;
>
> +import java.io.File;
> import java.io.IOException;
> import java.io.InputStream;
> import java.io.OutputStream;
> @@ -24,6 +25,7 @@
> import javax.portlet.RenderResponse;
> import javax.portlet.PortletPreferences;
>
> +import org.apache.jetspeed.PortalReservedParameters;
> import org.apache.portals.bridges.common.GenericServletPortlet;
>
>
> @@ -36,22 +38,42 @@
> public class FilePortlet extends GenericServletPortlet
> {
>
> - public void doView(RenderRequest request, RenderResponse response)
> throws PortletException, IOException
> + public void doView(RenderRequest request, RenderResponse response)
> + throws PortletException, IOException
> {
> response.setContentType("text/html");
> - PortletPreferences prefs = request.getPreferences();
> - String fileName = prefs.getValue("file", null);
> - if (fileName != null)
> +
> + // NOTE: this is Jetspeed specific
> + String path = (String)request.getAttribute(
> PortalReservedParameters.PATH_ATTRIBUTE);
> +
> + if (path != null && path.endsWith(".html"))
> {
> - InputStream is = this.getPortletContext().getResourceAsStream(fileName);
> - drain(is, response.getPortletOutputStream());
> - is.close();
> + File temp = new File(path);
> + renderFile(response, "/WEB-INF/content/" + temp.getPath());
> }
> else
> {
> - response.getWriter().println("Could not find file preference ");
> + PortletPreferences prefs = request.getPreferences();
> + String fileName = prefs.getValue("file", null);
> + if (fileName != null)
> + {
> + renderFile(response, fileName);
> + }
> + else
> + {
> + response.getWriter().println("Could not find file preference ");
> + }
> }
> }
> +
> + protected void renderFile(RenderResponse response, String fileName)
> + throws PortletException, IOException
> + {
> + InputStream is = this.getPortletContext().getResourceAsStream(fileName);
> + drain(is, response.getPortletOutputStream());
> + is.close();
> + }
> +
>
> static final int BLOCK_SIZE=4096;
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>