You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andre Thenot <at...@thenot.net> on 2002/02/08 19:33:15 UTC

(?) xsp-request:get-attribute documentation

Hi,

I've been playing around with setAttribute() in a java Action 
class in the container, to set attributes accessible with <xsp-
request:get-attribute.../> in an XSP. It works perfectly for 
String objects.
   But what I'm looking for is documentation that explains how to 
pass more exotic stuff using attributes; all I have found is the 
"Request Logicsheet" docs and the javadocs for XSPRequestHelper 
(quite terse).
   I'm trying to pass some array-like data (ie. a 2-dimensional 
String[][]) or, ideally, some tree-like data (an XML fragment?). 
So I tried putting XML markup in the Action class like this:

request.setAttribute("blocofstuff", 
"<table><tr><td>a</td><td>b</td></tr><tr><td>1</td><td>2</td></tr></table>
");

...only to see it escaped, which I guess makes sense for most 
cases. I noticed that there is an 'as="xml|node"' attribute to 
the get-attribute tag, but the docs don't say much about it and 
nothing came out when I used it; is this what I need to use? (if 
so, how?)
   I also tried passing a array of Strings like this:

String aTable[][] = {{"a","b"},{"c","d"}};
request.setAttribute("mytable", aTable);

and called it in a <logic> block:

String table[][] = (String[][]) <xsp-request:get-attribute 
name="mytable"/>;

but Cocoon complains that I'm trying to cast a String to a 
String[][] (indeed in the generated code I can see something 
like String table[][] = (String[][]) 
(String.valueOf(XSPRequestHelper.getAttribute(...))); ).
   This probably a common newbie problem, but I haven't found any 
useful solutions in the archives.

Any suggestions? (Feel free to hit me on the head with a URL :-))

Andre.


---------------------------------------------------------------------
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: Documentation (was: (?) xsp-request:get-attribute documentation)

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Andre Thenot [mailto:at01@thenot.net]
> 
> On Friday, February 8, 2002, at 07:38 , Vadim Gritsenko wrote:
> 
> >> From: Andre Thenot [mailto:at01@thenot.net]
> >>
> >> I'd like to consider helping out some.
> >
> > This would be terrific! Just grab the CVS, or, if you don't have CVS
> > client, just go to
> >
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/documentation/xdocs/,
> > modify any doc where you feel you can contribute, and send in the
> > patches to the developer list!
> >
> > Preferred patches are generated by "diff -u" command between
original
> > file and modified one.
> 
> Thanks. I think the patches to the existing docs are the most
> important now, so I'll work on those now as it can be misleading
> for the unfamiliar. However, I currently have the 2.0 (rc1 I
> think, not 2.0.1) version so maybe some of my stuff might be
> off; do I need to be using the cvs version (I'm suspecting I do,
> but I want to be sure, as that means I'll be using different
> versions for production and development).


Yes, the best it to use CVS version as I already made some changes to
the request and response logicsheets, this includes additions and
bug-fixes.

 
>    I'm also thinking about a reference manual, where all the docs
> can be linked in a single structure like a book (that may be
> output as anything, since it's XML at the base), kinda like the
> MySQL reference manual (www.mysql.com/documentation/). I noticed
> (re)structuring the documentation is marked [high] on the ToDo
> list. I'm very interested in helping out here but if someone is
> already working on it, I'd like to know what's already been
> decided and done.

What is done is in CVS.


>    Do I need to be on the cocoon-dev list for that?

Yes, to coordinate with others and propose whatever changes/additions
you want to do, especially if it is more then patches :)
But patches also send in to the developers list (or bugzilla) with
prefix [PATCH], because here they might be overlooked.

> 
> Andre.
> 
> 

Regards,
Vadim



---------------------------------------------------------------------
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>


Documentation (was: (?) xsp-request:get-attribute documentation)

Posted by Andre Thenot <at...@thenot.net>.
On Friday, February 8, 2002, at 07:38 , Vadim Gritsenko wrote:

>> From: Andre Thenot [mailto:at01@thenot.net]
>>
>>    Is there any documentation project going on?
>
> It's kind of going on continuously in the CVS :)

OK, I check it out (and into it).

>> I'd like to consider helping out some.
>
> This would be terrific! Just grab the CVS, or, if you don't have CVS
> client, just go to
> http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/documentation/xdocs/,
> modify any doc where you feel you can contribute, and send in the
> patches to the developer list!
>
> Preferred patches are generated by "diff -u" command between original
> file and modified one.

Thanks. I think the patches to the existing docs are the most 
important now, so I'll work on those now as it can be misleading 
for the unfamiliar. However, I currently have the 2.0 (rc1 I 
think, not 2.0.1) version so maybe some of my stuff might be 
off; do I need to be using the cvs version (I'm suspecting I do, 
but I want to be sure, as that means I'll be using different 
versions for production and development).

   I'm also thinking about a reference manual, where all the docs 
can be linked in a single structure like a book (that may be 
output as anything, since it's XML at the base), kinda like the 
MySQL reference manual (www.mysql.com/documentation/). I noticed 
(re)structuring the documentation is marked [high] on the ToDo 
list. I'm very interested in helping out here but if someone is 
already working on it, I'd like to know what's already been 
decided and done.

   Do I need to be on the cocoon-dev list for that?

Andre.


---------------------------------------------------------------------
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: (?) xsp-request:get-attribute documentation

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Andre Thenot [mailto:at01@thenot.net]
> 
> Never mind -- I found where to look: in the request.xsl
> logicsheet in the cocoon.jar file.
> And btw, it works! (I needed to use as="object" for the array case).
> 
>    Is there any documentation project going on?

It's kind of going on continuously in the CVS :)

> I'd like to consider helping out some.

This would be terrific! Just grab the CVS, or, if you don't have CVS
client, just go to 
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/documentation/xdocs/,
modify any doc where you feel you can contribute, and send in the
patches to the developer list!

Preferred patches are generated by "diff -u" command between original
file and modified one.

> Things really aren't too hard to
> understand looking at the XSL but for the newcomer, it takes a
> while to find out where to start.
> 
> A.

Vadim

<snip/>


---------------------------------------------------------------------
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: (?) xsp-request:get-attribute documentation

Posted by Andre Thenot <at...@thenot.net>.
Never mind -- I found where to look: in the request.xsl 
logicsheet in the cocoon.jar file.
And btw, it works! (I needed to use as="object" for the array case).

   Is there any documentation project going on? I'd like to 
consider helping out some. Things really aren't too hard to 
understand looking at the XSL but for the newcomer, it takes a 
while to find out where to start.

A.

On Friday, February 8, 2002, at 01:33 , Andre Thenot wrote:

> Hi,
>
> I've been playing around with setAttribute() in a java Action 
> class in the container, to set attributes accessible with <xsp-
> request:get-attribute.../> in an XSP. It works perfectly for 
> String objects.
>   But what I'm looking for is documentation that explains how 
> to pass more exotic stuff using attributes; all I have found is 
> the "Request Logicsheet" docs and the javadocs for 
> XSPRequestHelper (quite terse).
>   I'm trying to pass some array-like data (ie. a 2-dimensional 
> String[][]) or, ideally, some tree-like data (an XML 
> fragment?). So I tried putting XML markup in the Action class 
> like this:
>
> request.setAttribute("blocofstuff", 
> "<table><tr><td>a</td><td>b</td></tr><tr><td>1</td><td>2</td></tr></table>
> ");
>
> ...only to see it escaped, which I guess makes sense for most 
> cases. I noticed that there is an 'as="xml|node"' attribute to 
> the get-attribute tag, but the docs don't say much about it and 
> nothing came out when I used it; is this what I need to use? 
> (if so, how?)
>   I also tried passing a array of Strings like this:
>
> String aTable[][] = {{"a","b"},{"c","d"}};
> request.setAttribute("mytable", aTable);
>
> and called it in a <logic> block:
>
> String table[][] = (String[][]) <xsp-request:get-attribute 
> name="mytable"/>;
>
> but Cocoon complains that I'm trying to cast a String to a 
> String[][] (indeed in the generated code I can see something 
> like String table[][] = (String[][]) 
> (String.valueOf(XSPRequestHelper.getAttribute(...))); ).
>   This probably a common newbie problem, but I haven't found 
> any useful solutions in the archives.
>
> Any suggestions? (Feel free to hit me on the head with a URL :-))
>
> Andre.


---------------------------------------------------------------------
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>