RE: [2.2] StatelessAppleController and problem with users sharing variables across sessions and requests

2008-11-13 Thread Magnus Haraldsen Amundsen
Thanks :)

- Magnus

-Original Message-
From: Reinhard Pötz [mailto:[EMAIL PROTECTED] 
Sent: 13. november 2008 11:57
To: users@cocoon.apache.org
Subject: Re: [2.2] StatelessAppleController and problem with users sharing 
variables across sessions and requests

Magnus Haraldsen Amundsen wrote:
 Our Cocoon webapp shares class variables across sessions and request, so
 that ie. two users access the same URL at the same time, both users gets
 the same privileges even if one of them are logged in as administrator
 and the other as a regular user. What can be the cause of this?
 
 Example sitemap snippet:
 map:match pattern=
 
   map:call
 function=com.computas.sublima.app.controller.admin.TopicController
 map:parameter name=mode value=browse/
   /map:call
 /map:match
 
 Should'nt this create a unique TopicController object per request?

Hi Magnus,

check that the bean definition of your controller *explicitly* sets the
scope to prototype to override the default 'singleton'.

See
http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-prototype


-- 
Reinhard Pötz   Managing Director, {Indoqa} GmbH
 http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member  [EMAIL PROTECTED]


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


Vi har flyttet til nye lokaler på Lysaker Torg 45.  I den forbindelse har vi 
gått over til mobil telefonløsning. For kontakt med ansatte i Computas kan du 
ringe vårt sentralbord på samme telefonnummer som tidligere, 67 83 10 00 eller 
direkte på deres mobiltelefon. Vårt faksnummer er også uendret, 67 83 10 01.


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



Cform Binding problem

2008-11-13 Thread Yet another person
Hello Everybody,
I worked through the form examples on the website, then i wanted to add
binding functionality.
So i looked at the examples from the cocoon trunk, but i don't seem to get
it to work.

I tried isolating the form2simplexml by copying all resources references by
the flow aswell as the sitemap to my own block, but i keep running into
errors. I even tried copying all form example files to my own block but it
still doesn't work.

Then a question about the handleForm:

in the sitemap the examples call handleForm, and give it parameters.
But if i look in the registration function, or the entire flowscript for
that matter, only documentURI is called to load the form. what happens to
the other parameters?

map:call function=handleForm
map:parameter value=function name=registration/
  map:parameter name=definitionURI
value=resource/internal/registration_definition.xml /
  map:parameter name=documentURI
value=resource/internal/editme.xml /
  map:parameter name=bindingURI
value=resource/internal/registration_binding.xml /
/map:call

I was under the impression from the form binding explanation on the cocoon
website that for binding you need the usual definition file and the
template. besides these you would need a binding file that tells the
application what element will be put where in the xml file to be created and
you could load an xml file that complies with the specification from the
binding and definition file in order to edit this

Am i correct so far?

Hopefully anyone can get me some clarity on the cform stuff because i can't
make heads nor tail of it


Kind regards

Yap


Re: [2.2] StatelessAppleController and problem with users sharing variables across sessions and requests

2008-11-13 Thread Reinhard Pötz
Magnus Haraldsen Amundsen wrote:
 Our Cocoon webapp shares class variables across sessions and request, so
 that ie. two users access the same URL at the same time, both users gets
 the same privileges even if one of them are logged in as administrator
 and the other as a regular user. What can be the cause of this?
 
 Example sitemap snippet:
 map:match pattern=
 
   map:call
 function=com.computas.sublima.app.controller.admin.TopicController
 map:parameter name=mode value=browse/
   /map:call
 /map:match
 
 Should’nt this create a unique TopicController object per request?

Hi Magnus,

check that the bean definition of your controller *explicitly* sets the
scope to prototype to override the default 'singleton'.

See
http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-prototype


-- 
Reinhard Pötz   Managing Director, {Indoqa} GmbH
 http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member  [EMAIL PROTECTED]


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



[2.1] Generator src from document content

2008-11-13 Thread Palol Carlos

Hi list,

I'm trying to query a Daisy 2.2 repository from a Lenya 2 website  
(Cocoon 2.1)


So i have XML documents like this:

mydoc
  query
SELECT name WHERE InCollection('xyz')
  /query
/mydoc

And would like to query that repository through HTTP API, like this:

http://user:[EMAIL PROTECTED]/repositoryquery?q=SELECT+name+WHERE  
InCollection%28%27xyz%27%29

which returns an XML result.

What i would like to do (in the pipeline) is:

1. Read de XML query text node.
2. Escape the string, create de full url in an action, XSLT or else.
3. Generate (file generator) using the full url.
4. Transform, etc

I can't find a simple way to take content to de sitemap. Is it  
necessary to use an action and access the document from it?


Thanks in advance for any suggestion,

--
Carlos Palol








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



Re: [2.1] Generator src from document content

2008-11-13 Thread Joerg Heinicke

On 14.11.2008 04:26, Palol Carlos wrote:

I'm trying to query a Daisy 2.2 repository from a Lenya 2 website 
(Cocoon 2.1)


So i have XML documents like this:

mydoc
  query
SELECT name WHERE InCollection('xyz')
  /query
/mydoc

And would like to query that repository through HTTP API, like this:

http://user:[EMAIL PROTECTED]/repositoryquery?q=SELECT+name+WHERE 
InCollection%28%27xyz%27%29

which returns an XML result.

What i would like to do (in the pipeline) is:

1. Read de XML query text node.
2. Escape the string, create de full url in an action, XSLT or else.
3. Generate (file generator) using the full url.
4. Transform, etc

I can't find a simple way to take content to de sitemap. Is it necessary 
to use an action and access the document from it?


Hi Carlos,

There is no direct access to the content in the sitemap as you describe 
it. Also you would need 2 generators in a pipeline what's not possible 
(first one querying the repository, second one reading the file).


You need a 2-pipeline setup. In the main pipeline you query the 
repository, transform the result adding an xinclude directive (an 
element in the xinclude namespace) to it, run the xinclude transformer 
and maybe some post transformations. The included document (even it 
will replace the original XML from the query completely) will be created 
from a sub-request to Cocoon (cocoon:/-protocol), i.e. second pipeline. 
Here you have again the free choice about what to do.


Hope this helps,
Joerg

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