You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jan Hoskens <jh...@schaubroeck.be> on 2004/01/21 10:34:35 UTC

[xsp-session-fw][authentication] getting role

Hi,

I'm using the Authentication framework and was trying to retreive the 'role' of a user by using the session. (just using the sitemap parameter {role} works fine)
In an XSP I used the following line:

String role = <xsp-session-fw:getxml  context="authentication"  path="/authentication/role" as="string"/>;

I expected to get the full value of 'role', but got only a part of it. Apparently that line does not get every text node from the role element, but just the first one.
(If I retreive it as a documentfragment, all is fine but I do want it as a string and don't want to parse the node itself!)

Is this a bug?? If not, what is the meaning of the 'as="string"'??

Greetings,

Jan

RE: [xsp-session-fw][authentication] getting role

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi Morley:

Thanks for the suggestion, but this thread is not related to the bug. We
are requesting just the firstnode in this case.

Best Regards,

Antonio Gallardo

Morley Howell dijo:
>
> This may be related to something that I found in the
> AbstractDOMTransformer
> where it would only return a portion of the data from a tag:
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26219
>
> Joerg Heinicke seemed to think the problem was not in the ADT but perhaps
> in
> some lower-level class. Maybe these two problems have the same root cause.
>
> Morley
>
>> -----Original Message-----
>> From: Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com]
>> Sent: Wednesday January 21, 2004 6:36 AM
>> To: users@cocoon.apache.org
>> Subject: Re: [xsp-session-fw][authentication] getting role
>>
>>
>> Joerg Heinicke dijo:
>> > On 21.01.2004 12:23, Stephanie Zohner wrote:
>> >
>> >> Hi,
>> >>
>> >> This is a bug, in my opinion. I already posted it in the dev mailing
>> >> list
>> >> (but haven't got an answer yet).
>> >
>> > Does an entry on bugzilla exist? Antonio, I don't want to point on
>> you,
>> > but wasn't that your extension (getxml)??
>>
>> It's not a bug, it is a feature! lol. ;-)
>>
>> Best Regards,
>>
>> Antonio Gallardo.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Joerg Heinicke dijo:
> On 21.01.2004 12:23, Stephanie Zohner wrote:
>
>> Hi,
>>
>> This is a bug, in my opinion. I already posted it in the dev mailing
>> list
>> (but haven't got an answer yet).
>
> Does an entry on bugzilla exist? Antonio, I don't want to point on you,
> but wasn't that your extension (getxml)??

It's not a bug, it is a feature! lol. ;-)

Best Regards,

Antonio Gallardo.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Joerg Heinicke dijo:
> On 21.01.2004 12:23, Stephanie Zohner wrote:
>
>> Hi,
>>
>> This is a bug, in my opinion. I already posted it in the dev mailing
>> list
>> (but haven't got an answer yet).
>
> Does an entry on bugzilla exist? Antonio, I don't want to point on you,
> but wasn't that your extension (getxml)??

lol. :-DDDD

Yes, I already posted a mail requesting some ideas to improve the tag.

Thanks for the remainder. :-DD

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Joerg Heinicke <jo...@gmx.de>.
On 21.01.2004 12:23, Stephanie Zohner wrote:

> Hi,
> 
> This is a bug, in my opinion. I already posted it in the dev mailing list
> (but haven't got an answer yet).

Does an entry on bugzilla exist? Antonio, I don't want to point on you, 
but wasn't that your extension (getxml)??

Joerg

> Here's my work around: Think of "role", instead of "name"
> <xsp:logic>
> org.w3c.dom.DocumentFragment fragment = <xsp-session-fw:getxml as="object"
> context="authentication" path="/authentication/data/name"/>
> StringBuffer name = new StringBuffer();
> for(int i = 0; i&lt; fragment.getChildNodes().getLength(); i++){
> name.append(fragment.getChildNodes().item(i).getNodeValue());			
> }			
> </xsp:logic>
> 
> Now the whole string is saved in the variable "name", you can use now for
> your perpose.
> 
> Hope that helped,
> 
> Good luck,
> 
> Stephanie
> 
> 
> 
>>Hi,
>>
>>I'm using the Authentication framework and was trying to retreive the 
>>'role' of a user by using the session. (just using the sitemap parameter 
>>{role} works fine)
>>In an XSP I used the following line:
>>
>>String role = <xsp-session-fw:getxml  context="authentication"  
>>path="/authentication/role" as="string"/>;
>>
>>I expected to get the full value of 'role', but got only a part of it. 
>>Apparently that line does not get every text node from the role element, 
>>but just the first one.
>>(If I retreive it as a documentfragment, all is fine but I do want it as 
>>a string and don't want to parse the node itself!)
>>
>>Is this a bug?? If not, what is the meaning of the 'as="string"'??
>>
>>Greetings,
>>
>>Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Stephanie Zohner <st...@gmx.at>.
Hi,

I did I new try, this time with:

>cocoon cli -f build/webapp/archive-runner/urls.txt -c build/webapp -d
build/output -C build/webapp/WEB-INF/cocoon.xconf -w build/work -e false

I put the url with the tacked request params in the uri file "urls.txt". No
errors this time, but now I have again the problem, that the url/pipeline is
called more then once (3 !! times in this case) instead of only once. However
as you can see, I used the option -e and set it to "false". So there should
be no extention confiriming.

Can you explain this?

Thanks,

Stephanie

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon2.1.3 forms example needed

Posted by Ugo Cei <u....@cbim.it>.
Lincoln wrote:
> As a novice I spent days getting cocoon setup, is it complex to install
> "2.1.4-dev straight from CVS" does it come packaged with Jetty?

It's exactly the same as with 2.1.3, but probably you'll need JDK 1.4 
since at the moment it doesn't work with 1.3.

	Ugo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon2.1.3 forms example needed

Posted by Lincoln <li...@linc.net.au>.
Thanks for the tip Ugo, the woody sample "XML Binding - A form for just
editing an XML file." in Cocoon2.1.3 works well.
As a novice I spent days getting cocoon setup, is it complex to install
"2.1.4-dev straight from CVS" does it come packaged with Jetty?

Linc



> Lincoln wrote:
> > I am new to Cocoon/Jxforms and am trying to achieve a mini content
> > management
> > system where an admin user via the browser can edit simple web content
> > stored in "content.xml" on the server. I believe I need to use Jxforms
but
> > maybe Forms or Xforms is best.
>
> There are currently three form frameworks in Cocoon:
>
> 1. XMLForms (deprecated)
> 2. JXForms (unlikely to be further extended)
> 3. Cocoon Forms (a.k.a. Woody)
>
> Woody is quite robust and rich with features, even though it is still
> considered "alpha" quality and some specifications may change. If you're
> just exploring and not committed to a particular release date, I would
> suggest going with Woody and the most current version of Cocoon
> 2.1.4-dev straight from CVS.
>
> Ugo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon2.1.3 forms example needed

Posted by Ugo Cei <u....@cbim.it>.
Lincoln wrote:
> I am new to Cocoon/Jxforms and am trying to achieve a mini content
> management
> system where an admin user via the browser can edit simple web content
> stored in "content.xml" on the server. I believe I need to use Jxforms but
> maybe Forms or Xforms is best.

There are currently three form frameworks in Cocoon:

1. XMLForms (deprecated)
2. JXForms (unlikely to be further extended)
3. Cocoon Forms (a.k.a. Woody)

Woody is quite robust and rich with features, even though it is still 
considered "alpha" quality and some specifications may change. If you're 
just exploring and not committed to a particular release date, I would 
suggest going with Woody and the most current version of Cocoon 
2.1.4-dev straight from CVS.

	Ugo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Cocoon2.1.3 forms example needed

Posted by Lincoln <li...@linc.net.au>.
Hi,


I am new to Cocoon/Jxforms and am trying to achieve a mini content
management
system where an admin user via the browser can edit simple web content
stored in "content.xml" on the server. I believe I need to use Jxforms but
maybe Forms or Xforms is best.

At present I have only run an Xform on my local drive to write "content.xml"
to my local drive, and believe cocoon is the answer to making this all work
server side.

I am using the X-smiles browser to view the xform. Do I have to use an
Xforms compliant browser or plug in?
As I am a newbie an idiot proof example of how to do this in Cocoon2.1.3
would be advantageous.


Linc

Lincoln Mitchell
hm: 618 9250 6772
mb: 0414 286 433
email: lincoln@linc.net.au
web: www.linc.net.au



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Stephanie Zohner <st...@gmx.at>.
> >
> How does:
> 
> cocoon cli -c build\webapp -d build/output -C
> build/webapp/WEB-INF/cocoon.xconf -w build/work
>
"archive-runner/insertRun?time=test&date=test&archive-label=test&number-of-run=test&archive-run-version=test"
> 
> work?

Does not work either, it causes an error in the command line, saying
""=test" cant't be used in this context", seemingly it breaks the url with the
tacked request params.

Regards,

Stephanie

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Upayavira <uv...@upaya.co.uk>.
Stephanie Zohner wrote:

>Hi Upayavira
>
>
>Thanks for your help, so far.
>
>My CLI command should call a pipeline which inserts an xml fragment in an
>existing xml file (using the source writing Transformer). So a very simple task
>(from the CLI point of view).
>
>Now to my second problem:
>WHat do you mean by "tack the request parameters onto the end of the URI"? I
>tried with this:
>  
>
How does:

cocoon cli -c build\webapp -d build/output -C build/webapp/WEB-INF/cocoon.xconf -w build/work "archive-runner/insertRun?time=test&date=test&archive-label=test&number-of-run=test&archive-run-version=test"

work?


Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Stephanie Zohner <st...@gmx.at>.
Hi Upayavira


Thanks for your help, so far.

My CLI command should call a pipeline which inserts an xml fragment in an
existing xml file (using the source writing Transformer). So a very simple task
(from the CLI point of view).

Now to my second problem:
WHat do you mean by "tack the request parameters onto the end of the URI"? I
tried with this:

>cocoon cli -c build\webapp -d build/output -C
build/webapp/WEB-INF/cocoon.xconf -w build/work
archive-runner/insertRun?time=test&date=test&archive-label=test&number-of-run=test&archive-run-version=test

However the CLI interprets the request params as input parameter and prompts
to insert a date, and so on.

Did I understand you wrong?

Regards,

Stephanie

> Stephanie Zohner wrote:
> 
> >Hi, 
> >
> >I'm still fighting with request params in CLI xconf.
> >
> >For testing I added the request params to the URI src attribute (see
> below).
> >The called pipeline inserts an xml element in an existing xml file.
> >
> >1. problem:
> >When I run cocoon cli with this xconf file, the generation is completed
> with
> >no errors but instead of one xml element, two element are added to the
> >xml-file. 
> >
> >So it seems that the defined pipeline is called twice instead of only
> once.
> >But what command does produce this behaviour? When I call the pipeline in
> the
> >browser everything works fine.
> >  
> >
> Yup. Once to get the links and once to get the page. If you switch off 
> 'confirm-extensions', I think that should get you down to one.
> 
> >2. problem:
> >Can I configure request-params with the "command line parameter method",
> >too? How is the syntax for the url in the command line then?
> >  
> >
> Yes. Any parameters without switches will be taken as URIs. Just tack 
> the request parameters onto the end of the URI and you'll be done.
> 
> What is it you are trying to achieve with the CLI?
> 
> (I've got an answer planned to your previous post - no time right now).
> 
> Regards, Upayavira
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Upayavira <uv...@upaya.co.uk>.
Stephanie Zohner wrote:

>Hi, 
>
>I'm still fighting with request params in CLI xconf.
>
>For testing I added the request params to the URI src attribute (see below).
>The called pipeline inserts an xml element in an existing xml file.
>
>1. problem:
>When I run cocoon cli with this xconf file, the generation is completed with
>no errors but instead of one xml element, two element are added to the
>xml-file. 
>
>So it seems that the defined pipeline is called twice instead of only once.
>But what command does produce this behaviour? When I call the pipeline in the
>browser everything works fine.
>  
>
Yup. Once to get the links and once to get the page. If you switch off 
'confirm-extensions', I think that should get you down to one.

>2. problem:
>Can I configure request-params with the "command line parameter method",
>too? How is the syntax for the url in the command line then?
>  
>
Yes. Any parameters without switches will be taken as URIs. Just tack 
the request parameters onto the end of the URI and you'll be done.

What is it you are trying to achieve with the CLI?

(I've got an answer planned to your previous post - no time right now).

Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Stephanie Zohner <st...@gmx.at>.
Hi, 

I'm still fighting with request params in CLI xconf.

For testing I added the request params to the URI src attribute (see below).
The called pipeline inserts an xml element in an existing xml file.

1. problem:
When I run cocoon cli with this xconf file, the generation is completed with
no errors but instead of one xml element, two element are added to the
xml-file. 

So it seems that the defined pipeline is called twice instead of only once.
But what command does produce this behaviour? When I call the pipeline in the
browser everything works fine.


2. problem:
Can I configure request-params with the "command line parameter method",
too? How is the syntax for the url in the command line then?

Regards,

Stephanie


> Sorry Upayavira, I must have skipped your reply.
> 
> I'm not sure I understood your explaination right. You say the CLI handles
> request params, in the way that you hardcode it in the URL src-Attribute.
> Is
> that right? But how can I set the request params dynamically?
> 
> In case I use the "command line parameter method" I can generate a text
> file
> with my urls (including the request params) in my command line before I
> call
> cocoon cli, but how can I do it when I want to use the Xconf method?
> 
> Regards,
> 
> Stephanie
> 
> > Stephanie Zohner wrote:
> > 
> > >Hi, 
> > >
> > >Sorry, for contacting you directy. I posted my problem in the cocoon
> > users
> > >mailing list before, but did not get any reply. 
> > >
> > >I'm just trying to get a better understanding of the cocoon command
> line
> > >interface. The configuration is quite tricky but with the help of the
> > >mailing
> > >list I could run a simple example, at least.
> > >
> > >However, my problem now is: How can I configure request parameters for
> > one
> > >of the URLS in the cli.xconf?
> > >Can I hand request params over to a defined uri when I call the cocoon
> > cli?
> > >
> > >Thanks for your help,
> > >
> > >Stephanie
> > >
> > >  
> > >
> > Stephanie,
> > 
> > You did get a reply. I replied on the list. You can see my reply at:
> > 
> > http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107463604109759&w=2
> > 
> > As I say there, if you feel like helping to improve request parameter 
> > handling, I'd happily help you...
> > 
> > Regards, Upayavira
> > 
> > 
> 
> -- 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Upayavira <uv...@upaya.co.uk>.
Stephanie Zohner wrote:

>Sorry Upayavira, I must have skipped your reply.
>
>I'm not sure I understood your explaination right. You say the CLI handles
>request params, in the way that you hardcode it in the URL src-Attribute. Is
>that right? But how can I set the request params dynamically?
>
>In case I use the "command line parameter method" I can generate a text file
>with my urls (including the request params) in my command line before I call
>cocoon cli, but how can I do it when I want to use the Xconf method?
>  
>
There is a <uri-file> option, which allows you to supply a list of URIs 
to generate. I remember testing it, so it should work.

I think there's scope for improving this functionality too, though.

Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon CLI & Request params

Posted by Stephanie Zohner <st...@gmx.at>.
Sorry Upayavira, I must have skipped your reply.

I'm not sure I understood your explaination right. You say the CLI handles
request params, in the way that you hardcode it in the URL src-Attribute. Is
that right? But how can I set the request params dynamically?

In case I use the "command line parameter method" I can generate a text file
with my urls (including the request params) in my command line before I call
cocoon cli, but how can I do it when I want to use the Xconf method?

Regards,

Stephanie

> Stephanie Zohner wrote:
> 
> >Hi, 
> >
> >Sorry, for contacting you directy. I posted my problem in the cocoon
> users
> >mailing list before, but did not get any reply. 
> >
> >I'm just trying to get a better understanding of the cocoon command line
> >interface. The configuration is quite tricky but with the help of the
> >mailing
> >list I could run a simple example, at least.
> >
> >However, my problem now is: How can I configure request parameters for
> one
> >of the URLS in the cli.xconf?
> >Can I hand request params over to a defined uri when I call the cocoon
> cli?
> >
> >Thanks for your help,
> >
> >Stephanie
> >
> >  
> >
> Stephanie,
> 
> You did get a reply. I replied on the list. You can see my reply at:
> 
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107463604109759&w=2
> 
> As I say there, if you feel like helping to improve request parameter 
> handling, I'd happily help you...
> 
> Regards, Upayavira
> 
> 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Stephanie Zohner <st...@gmx.at>.
> 
> How we can separate every node in the returned string? Or we don't need a
> separation char at all?
> 
I don't think we need a separation because we have no influence on which
part of the string is in which node.
I can't think of any usage.
I think it's rather irritating to get only a part of the string. From the
user's point of view this behaviour is rather unintuitive.

Regards,

Stephanie

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi Stephanie:

The code was not designed to retrieve all the nodes, just the first node
while using as="string". But of course this can change.

How we can separate every node in the returned string? Or we don't need a
separation char at all?

Please comments.

Best Regards,

Antonio Gallardo


Stephanie Zohner dijo:
> Hi,
>
> This is a bug, in my opinion. I already posted it in the dev mailing list
> (but haven't got an answer yet).
>
> Here's my work around: Think of "role", instead of "name"
> <xsp:logic>
> org.w3c.dom.DocumentFragment fragment = <xsp-session-fw:getxml as="object"
> context="authentication" path="/authentication/data/name"/>
> StringBuffer name = new StringBuffer();
> for(int i = 0; i&lt; fragment.getChildNodes().getLength(); i++){
> name.append(fragment.getChildNodes().item(i).getNodeValue());
> }
> </xsp:logic>
>
> Now the whole string is saved in the variable "name", you can use now for
> your purpose.
>
> Hope that helped,
>
> Good luck,
>
> Stephanie
>
>
>> Hi,
>>
>> I'm using the Authentication framework and was trying to retrieve the
>> 'role' of a user by using the session. (just using the sitemap parameter
>> {role} works fine)
>> In an XSP I used the following line:
>>
>> String role = <xsp-session-fw:getxml  context="authentication"
>> path="/authentication/role" as="string"/>;
>>
>> I expected to get the full value of 'role', but got only a part of it.
>> Apparently that line does not get every text node from the role element,
>> but just the first one.
>> (If I retreive it as a documentfragment, all is fine but I do want it as
>> a string and don't want to parse the node itself!)
>>
>> Is this a bug?? If not, what is the meaning of the 'as="string"'??
>>
>> Greetings,
>>
>> Jan
>
> --
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [xsp-session-fw][authentication] getting role

Posted by Stephanie Zohner <st...@gmx.at>.
Hi,

This is a bug, in my opinion. I already posted it in the dev mailing list
(but haven't got an answer yet).

Here's my work around: Think of "role", instead of "name"
<xsp:logic>
org.w3c.dom.DocumentFragment fragment = <xsp-session-fw:getxml as="object"
context="authentication" path="/authentication/data/name"/>
StringBuffer name = new StringBuffer();
for(int i = 0; i&lt; fragment.getChildNodes().getLength(); i++){
name.append(fragment.getChildNodes().item(i).getNodeValue());			
}			
</xsp:logic>

Now the whole string is saved in the variable "name", you can use now for
your perpose.

Hope that helped,

Good luck,

Stephanie


> Hi,
> 
> I'm using the Authentication framework and was trying to retreive the 
> 'role' of a user by using the session. (just using the sitemap parameter 
> {role} works fine)
> In an XSP I used the following line:
> 
> String role = <xsp-session-fw:getxml  context="authentication"  
> path="/authentication/role" as="string"/>;
> 
> I expected to get the full value of 'role', but got only a part of it. 
> Apparently that line does not get every text node from the role element, 
> but just the first one.
> (If I retreive it as a documentfragment, all is fine but I do want it as 
> a string and don't want to parse the node itself!)
> 
> Is this a bug?? If not, what is the meaning of the 'as="string"'??
> 
> Greetings,
> 
> Jan

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org