Aaron Evans wrote:
David Sean Taylor <david <at> bluesunrise.com> writes:


Have you looked at the file server pipeline?
There is a simple example of the demo page (pdf.link) of the default install.

Example:

/jetspeed/fileserver/_content/sample_pdf.pdf



David,
I was unaware of this capability. So I took a look at serveral resources in the jetspeed source including pdf.link, /assembly/pipelines.xml, the FilePortlet and the FileServerValve.

What is unclear to me is the link between the path in pdf.link and the FileServerValve itself. I assume that the fact that the path contains
fileserver/_content triggers the use of the whole mechanism. But I cannot
find where this is configured.

I am not that familiar with the pipeline (although I have checked out the
online documentation), but I assume that every Valve in the pipeline is always
invoked (ie. there is no forking/logic that produces different paths through
the pipeline).

So if that is the case, what causes the URI above to be directed to the
portlet configured for the FileServerValve (demo::ContentViewer in
pipelines.xml)?

Thats where we could use a better configuration
Right now, the mapping is done here:

http://svn.apache.org/viewcvs.cgi/portals/jetspeed-2/trunk/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/PathSessionResolver.java?rev=333096&view=log

See the mapPath method


Also, the documentation for the pipeline is a good start, but what is missing
is a guide to adding your own valve to the pipeline describing where in the
pipeline a custom valve should be placed (eg. there are probably some key valves that should go before it and perhaps some that must go after it
depending on what you are doing), how to configure it, etc.

Agreed. I have some slides on pipelines.
Need to get those back into the docs

I think in my case, I would want to leave the existing file server mechanism
in place (although it uses a demo portlet, so I'm not sure how that will
be impacted if I build/deploy without the demo application).

So I'd want to set up a similar mechanism so that I can create a link with
a URI with some parameters, eg /jetspeed/mybinaries/binary?resourceID=XYZ
that will get directed to a portlet in my portlet application that will
be similar to the FilePortlet.
In the FilePortlet I will have to use the request parameters to identify
the correct resource on the filesystem (it will not be deployed as part of
any servlet/portlet application), do a number of security checks and finally
change the response type and render the binary content.

So, I assume I'd need to insert another valve component similar to the
FileServerValve and configure it in a similar way.  But how do you tie
the rest together?

See the File Portlet, it has several ways of looking for the resource

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to