cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [C2]Getting absolute path of component parameter [was: Proposal: URL Protocols]
Date Tue, 30 Jan 2001 17:17:08 GMT
Conny Krappatsch wrote:
> 
> Would the proposed solve the problem I'm currently having?
> 
> I wrote a Component which provides access to a CMS. The CMS needs to be
> initalized with a  file name. Configuration in cocoon.xconf currently
> looks like this:
> 
> <component role="org.infozone.prowler.Prowler"
>            class="org.infozone.ui.cocoon2.ProwlerComponent">
>     <parameter name="properties"
>                value="/absolute/path/to/prowler.xproperties"/>
> </component>
> 
> This works as long as the location of the properties file isn't changed. A
> possibility to use a path relative to the web application would be great.

Basically, yes it would.

> Is there a solution for my problem (can I access the context object from
> the components configure method)?

No.

> If not, would the proposal below be the solution? (sounds like that) Then
> I vote +1000 for it ;-).

I will count that as a +1000 then.

> 
> thanks for any help,
> Conny Krappatsch
> 
> On Tue, 30 Jan 2001 10:53:59 -0500
> Berin Loritsch <bloritsch@apache.org> wrote:
> > I want to run something by the list regarding the way
> > Cocoon uses URLs to get references to files and such.
> >
> > This _does_ affect both versions, and it refers to the
> > naming of the protocols.  The way Servlet 2.2+ specifies
> > to get files from the WAR file is the context.getResource()
> > method.  All resources are relative to the context root.
> > This is separate and distinct from Classloader Resources.
> >
> > My proposal is to specify the following Resource protocols:
> >
> > "resource:" This gets a ClassLoader resource, loaded by
> >             the Cocoon ClassLoader.  This is what it already
> >             does.
> >
> > "context:"  This gets a Context resource, pulled by the
> >             Context.getResource() method.
> >
> > The reason for this proposal is because it will make a Cocoon
> > based WAR file more portable.  If someone wants to package
> > their Logicsheets inside their WAR file, they can always
> > reference them by "context:/Relative/path/to/resource.xsl"
> > and won't have to rewrite the cocoon.properties and cocoon.xconf
> > files for each installation.
> >
> > In fact, the Producers/Generators should use the "context:"
> > methodology to find the files for input into the system.
> > That will ensure that they follow the security and architecture
> > mechanisms of the Servlet specification.
> >
> > The only section that would require any file:// urls is the
> > XSP architecture.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> --
> ______________________________________________________________________
> Conny Krappatsch                              mailto:conny@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message