> From: Eric Dalquist [mailto:[EMAIL PROTECTED]]
> 
> I'll look into patching it if you could give me a little more of a
path to
> follow ... like an example that uses the source revolver or API doc to
look
> at.

You may look into XSPFormValidatorHelper.getConfiguration(...) method,
it uses resolver.

Variable resolver is already defined in the scope of XSP, so no
additional steps are required. Patch may look similar to:

---------- Line 140 of util.xsl ---------------
String __name = String.valueOf(<xsl:copy-of select="$href"/>);
org.apache.cocoon.environment.Source __source = null;
try { 
    __source = resolver.resolve(__name);
    __source.toSAX(
        new org.apache.cocoon.xml.IncludeXMLConsumer(
            this.contentHandler));
} catch (Exception e) {
    getLogger().error("Could not include page", e);
} finally {
    if (__source != null) __source.recycle();
}
---------- Line 159 --------------------------


If it works, send to -dev or bugzilla.

PS This is patch for 2.0.3

PPS The good thing, this code will work even faster then old one when
using "cocoon://" protocol.


Vadim



> -Eric Dalquist
> 
> ----- Original Message -----
> From: "Vadim Gritsenko" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 11, 2002 10:03 PM
> Subject: RE: [Q] util:include-uri relative path
> 
> 
> > > From: Eric Dalquist [mailto:[EMAIL PROTECTED]]
> > >
> > > I just tried using cocoon://nav_bar.xsp but it still didn't work.
> > > Looking in the core.log I found the following message:
> > >
> > > DEBUG   (2002-07-11) 13:19.09:225
> > > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL from cocoon://nav_bar.xsp
> > > DEBUG   (2002-07-11) 13:19.09:225
> > > [core.url-factory](/cocoon/index.xsp)
> > > Thread-6/URLFactoryImpl: Making URL - MalformedURLException in
getURL:
> > > java.net.MalformedURLException: unknown protocol: cocoon
> > >  at java.net.URL.<init>(URL.java:586)
> > >  at java.net.URL.<init>(URL.java:476)
> > >  at java.net.URL.<init>(URL.java:425)
> > >  at org.apache.cocoon.components.url.URLFactoryImpl.getURL(
> > > URLFactoryImpl.java:118)
> > >  at org.apache.cocoon.www.logic.site_format_xsp.generate(
> >
> > Hmmm... Looks like util logicsheet's code is quite outdated... Would
you
> > mind patching util logicsheet (util.xsl)? It should use source
resolver
> > to do the work.
> >
> > If you don't know who to patch it, file a bug into bugzilla saying
that
> > util:include-uri uses URLFactory but should use source resolver.
> >
> >
> > Thanks,
> > Vadim
> >
> >
> > ...
> >
> > >  at java.lang.Thread.run(Thread.java:536)
> > >
> > > If anyone can make a suggestion it would be much appreciated.
> > > I'm using cocoon 2.0.2-dev, Tomcat 4.1.3b and JDK1.4.0
> > >
> > > -Eric Dalquist
> > >
> > >
> > > ----- Original Message -----
> > > From: "Vadim Gritsenko" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Thursday, July 11, 2002 12:02 PM
> > > Subject: RE: [Q] util:include-uri relative path
> > >
> > > > > From: Eric Dalquist [mailto:[EMAIL PROTECTED]]
> > > > >
> > > > > I'm wondering if I can use include-uri to include the 
> > > > > output of an XSP in
> > > > > another XSP. I can get it to work if I use the full path 
> > > > > but I don't want to
> > > > > do it this way unless I can use a relative path. The file is
> > > > > being included in
> > > > > site_format.xsp which is used as a style sheet for index.xsp
> > > > >
> > > > > Here is the working include:
> > > > > <util:include-uri
> > > > > href="http://www.incoherentramblings.net:8888
> > > > > /cocoon/nav_bar.xsp"/>
> > > > >
> > > > > I would like to do:
> > > > > <util:include-uri href="nav_bar.xsp"/>
> > > >
> > > > Why not:
> > > >
> > > > <util:include-uri href="cocoon://nav_bar.xsp"/>
> > > >
> > > > ?
> > > >
> > > > Vadim
...


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to