You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Uwe Reimann <uw...@saxess.com> on 2001/07/25 16:24:06 UTC

Cocoon2 and logicsheets

Hi there,

did anybody figure out how to use a logicsheet with cocoon 2? I tried to
get greeting3.xml from the xsp-guide to work, but I got a
IllegalAccessException.

CU, Uwe

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2 and logicsheets

Posted by Cassandra Bonner <cb...@yahoo.com>.
> The resource:// protocol will look into your classpath to locate
> the logicsheet.  
> This means you have to put your logicsheet into a jar and deploy it
> into 
> WEB-INF/lib.
> 
> Another way is to use the context:// protocol which starts looking
> at the 
> servlet app context path for it.
> 
> Giacomo
> 


thanks for that.  I actually had the logicsheet in my classpath, but
I didn't have it jar'd up and in the WEB-INF/lib, but rather with
other java code I've written, which was in my classpath env variable
upon starting tomcat.  Note that the example i provided wasn't the
best as I had the full path to the logicsheet vs. the CLASSPATH, but
i had tried that as well.

So - I jar'd up the java classes and logicsheet (print.xsl in my test
example) and put in WEB-INF/lib, and did get a different result, but
not all that much different. :-)  

As I mentioned, this is just a test logicsheet.  Here's a quick
summary of what I'm planning to do, in case anyone has any comments
about this (e.g. performance issues, not good design, won't work :-),
etc.) I plan to have logic sheet(s) for any of our common "external"
java code.  By external, I mean "backend" processing that needs to
occur such as our login, which is rather complex.  

Therefore, each xsp page will call a simple library such as
<usermgr:getuser/>, (implementation defined in a logicsheet) and
return a full instantiated, polulated user object.  The logic sheet
will simply call managers that we've written in java to do all the
"backend logic" of testing whether or not they're a valid user,
populating the user accordingly with access level, etc. and
redirecting the request to an error page if necessary. I feel using
managers and "external" java code is cleaner, allows for better
design, and allows us to generate javadocs (a key since we refuse to
document otherwise) :-)

Anyways - here's the examples:

My test Logicsheet 
====================
(print stmt will actually be calls to managers, passing on a handle
to a connection pull via the mananger class variable for db conn
pooling):

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet
  version="1.0"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:print="http://cwo.com.au/mid/print"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

<xsl:template match="print:junk">
  <xsp:logic>
    System.out.println("CASS:: within print juink");
  </xsp:logic>

</xsl:template>

</xsl:stylesheet>

My test XSP page using this logicsheet:
========================================

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:print="http://cwo.com.au/mid/print"
>

  <page>

    <mytag>Content of my tag</mytag>

    <xsp:logic>
      System.out.println("INDEX.XML:: my name is george");
    </xsp:logic>

    <print:junk/>

  </page>
</xsp:page>

(I have a stylesheet for presentation but not providing it here as
it's not relevant).

=========================
My setup in cocoon.xconf
==========================
        <builtin-logicsheet>
          <parameter name="prefix" value="print"/>
          <parameter name="uri" value="http://cwo.com.au/mid/print"/>
          <parameter name="href"
value="resource://au/com/optus/core/util/print.xsl"/>
        </builtin-logicsheet>


As I mentioned, I've jarred up the print.xsl along with my other java
code and placed this in my WEB-INF/lib.  I no longer get the original
error message about "ComponentSelector could not access the Component
for hint: xsp", but now I get the following error message as soon as
I include the print namespace in my xsp file:

New Error Message
==================
"Could not load class for program
'org/apache/cocoon/www/nextgen/cass/index_xml' due to a
java.lang.ClassNotFoundException:
org.apache.cocoon.www.nextgen.cass.index_xml"


***Which - as you can guess :-), my index_xml.java is no longer being
generated (actually it's just an empty file now).  

So - perhaps there's something wrong with my test logicsheet or
setup.  If anyone has any ideas about what is wrong, or our design
plan, it will be greatly appreciated.

thanks in advance,

cass

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2 and logicsheets

Posted by Giacomo Pati <gi...@apache.org>.
Quoting Cassandra Bonner <cb...@yahoo.com>:

> Has anyone found a detailed answer to these questions?  There was a
> similar question a while back...
> 
> 
> http://mailman.real-time.com/pipermail/cocoon-users/2001-June/016332.html
> 
> 
> If anyone can detail how to setup a logicsheet within cocoon2, that'd
> be great.  I can't even get the built-in logicsheets to work.  If i
> add the following into my cocoon.xconf (print.xsl is a simple test
> that prints to stdout), I get the error below.  I've tried it both as
> a resource and file.  I've also tried combinations of the posting
> above, but to no avail.  
> 
> <builtin-logicsheet>
>           <parameter name="prefix" value="print"/>
>           <parameter name="uri" value="http://cwo.com.au/mid/print"/>
>           <parameter name="href"
> 
value="resource://content/cocoon/tomcat/java/au/com/optus/core/util/print.xsl"/>
>           <!--
>           <parameter name="href"
> value="file:///content/cocoon/tomcat/java/au/com/optus/core/util/print.xsl"/>
>           -->
>         </builtin-logicsheet>

The resource:// protocol will look into your classpath to locate the logicsheet.  
This means you have to put your logicsheet into a jar and deploy it into 
WEB-INF/lib.

Another way is to use the context:// protocol which starts looking at the 
servlet app context path for it.

Giacomo

> 
> 
> ERROR MESSAGE:
> ===============
> 
> 2001-09-03 09:42:28 - path="/cocoon" :ERROR   99947   [cocoon  ]
> (Thread-28): processing of resource failed
> org.apache.cocoon.ResourceNotFoundException: markup-languages:
> ComponentSelector could not access the Component for hint: xsp:
> org.apache.avalon.framework.component.ComponentException:
> markup-languages: ComponentSelector could not access the Component f
> or hint: xsp
> 
> 
> thanks in advance,
> cass
> 
> 
> --- Uwe Reimann <uw...@saxess.com> wrote:
> > Hi there.
> > I found out that writing a logicsheet and defining it as
> > builtin-logicsheet in cocoon.xconf works fine. Is that the only way
> > logicsheets work?
> > 
> > CU, Uwe
> > 
> > Philip Doyle wrote:
> > > 
> > > Hi
> > > 
> > > I've been struggling with logisheets in C2 also and would be
> > grateful for
> > > any help or pointers to making them work.
> > > 
> > > I want to add a new tag library and am presuming that the ref to
> > this goes
> > > into cocoon.xconf but don't know how to make my xsp page use my
> > new custom
> > > tags.
> > > 
> > > many thanks
> > > Phil
> > > 
> > > -----Original Message-----
> > > From: Uwe Reimann [mailto:uwe.reimann@saxess.com]
> > > Sent: 25 July 2001 16:24
> > > To: cocoon-users@xml.apache.org
> > > Subject: Cocoon2 and logicsheets
> > > 
> > > Hi there,
> > > 
> > > did anybody figure out how to use a logicsheet with cocoon 2? I
> > tried to
> > > get greeting3.xml from the xsp-guide to work, but I got a
> > > IllegalAccessException.
> > > 
> > > CU, Uwe
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > Please check that your question has not already been answered in
> > the
> > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > > 
> > > To unsubscribe, e-mail: <co...@xml.apache.org>
> > > For additional commands, e-mail:
> > <co...@xml.apache.org>
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > Please check that your question has not already been answered in
> > the
> > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > > 
> > > To unsubscribe, e-mail: <co...@xml.apache.org>
> > > For additional commands, e-mail:
> > <co...@xml.apache.org>
> > 
> >
> ---------------------------------------------------------------------
> > Please check that your question has not already been answered in
> > the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > 
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
> Messenger
> http://im.yahoo.com
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 
> 

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2 and logicsheets

Posted by Cassandra Bonner <cb...@yahoo.com>.
Has anyone found a detailed answer to these questions?  There was a
similar question a while back...


http://mailman.real-time.com/pipermail/cocoon-users/2001-June/016332.html


If anyone can detail how to setup a logicsheet within cocoon2, that'd
be great.  I can't even get the built-in logicsheets to work.  If i
add the following into my cocoon.xconf (print.xsl is a simple test
that prints to stdout), I get the error below.  I've tried it both as
a resource and file.  I've also tried combinations of the posting
above, but to no avail.  

<builtin-logicsheet>
          <parameter name="prefix" value="print"/>
          <parameter name="uri" value="http://cwo.com.au/mid/print"/>
          <parameter name="href"
value="resource://content/cocoon/tomcat/java/au/com/optus/core/util/print.xsl"/>
          <!--
          <parameter name="href"
value="file:///content/cocoon/tomcat/java/au/com/optus/core/util/print.xsl"/>
          -->
        </builtin-logicsheet>


ERROR MESSAGE:
===============

2001-09-03 09:42:28 - path="/cocoon" :ERROR   99947   [cocoon  ]
(Thread-28): processing of resource failed
org.apache.cocoon.ResourceNotFoundException: markup-languages:
ComponentSelector could not access the Component for hint: xsp:
org.apache.avalon.framework.component.ComponentException:
markup-languages: ComponentSelector could not access the Component f
or hint: xsp


thanks in advance,
cass


--- Uwe Reimann <uw...@saxess.com> wrote:
> Hi there.
> I found out that writing a logicsheet and defining it as
> builtin-logicsheet in cocoon.xconf works fine. Is that the only way
> logicsheets work?
> 
> CU, Uwe
> 
> Philip Doyle wrote:
> > 
> > Hi
> > 
> > I've been struggling with logisheets in C2 also and would be
> grateful for
> > any help or pointers to making them work.
> > 
> > I want to add a new tag library and am presuming that the ref to
> this goes
> > into cocoon.xconf but don't know how to make my xsp page use my
> new custom
> > tags.
> > 
> > many thanks
> > Phil
> > 
> > -----Original Message-----
> > From: Uwe Reimann [mailto:uwe.reimann@saxess.com]
> > Sent: 25 July 2001 16:24
> > To: cocoon-users@xml.apache.org
> > Subject: Cocoon2 and logicsheets
> > 
> > Hi there,
> > 
> > did anybody figure out how to use a logicsheet with cocoon 2? I
> tried to
> > get greeting3.xml from the xsp-guide to work, but I got a
> > IllegalAccessException.
> > 
> > CU, Uwe
> > 
> >
>
---------------------------------------------------------------------
> > Please check that your question has not already been answered in
> the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > 
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail:
> <co...@xml.apache.org>
> > 
> >
>
---------------------------------------------------------------------
> > Please check that your question has not already been answered in
> the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > 
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail:
> <co...@xml.apache.org>
> 
>
---------------------------------------------------------------------
> Please check that your question has not already been answered in
> the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon2 and logicsheets

Posted by Uwe Reimann <uw...@saxess.com>.
Hi there.
I found out that writing a logicsheet and defining it as
builtin-logicsheet in cocoon.xconf works fine. Is that the only way
logicsheets work?

CU, Uwe

Philip Doyle wrote:
> 
> Hi
> 
> I've been struggling with logisheets in C2 also and would be grateful for
> any help or pointers to making them work.
> 
> I want to add a new tag library and am presuming that the ref to this goes
> into cocoon.xconf but don't know how to make my xsp page use my new custom
> tags.
> 
> many thanks
> Phil
> 
> -----Original Message-----
> From: Uwe Reimann [mailto:uwe.reimann@saxess.com]
> Sent: 25 July 2001 16:24
> To: cocoon-users@xml.apache.org
> Subject: Cocoon2 and logicsheets
> 
> Hi there,
> 
> did anybody figure out how to use a logicsheet with cocoon 2? I tried to
> get greeting3.xml from the xsp-guide to work, but I got a
> IllegalAccessException.
> 
> CU, Uwe
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Cocoon2 and logicsheets

Posted by Philip Doyle <ph...@codefactory.ie>.
Hi

I've been struggling with logisheets in C2 also and would be grateful for
any help or pointers to making them work.

I want to add a new tag library and am presuming that the ref to this goes
into cocoon.xconf but don't know how to make my xsp page use my new custom
tags.

many thanks
Phil


-----Original Message-----
From: Uwe Reimann [mailto:uwe.reimann@saxess.com]
Sent: 25 July 2001 16:24
To: cocoon-users@xml.apache.org
Subject: Cocoon2 and logicsheets


Hi there,

did anybody figure out how to use a logicsheet with cocoon 2? I tried to
get greeting3.xml from the xsp-guide to work, but I got a
IllegalAccessException.

CU, Uwe

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>



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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>