Cocoon and Servlets

2002-10-27 Thread CLAIS, Rene
Title: Cocoon and Servlets







I have seen this subject (Cocoon with Servlets) in a huge number of archive

Anyway no one can explain me how my problem can be solved (I do not find the right one !!)


The problem is : how can I retrieve java object in a cocoon session ?


My example:


I have a cocoon XLM / XSL showing a HTML page (That works !)

This HTML contains a form which call my Servlet1 (That works !)


form action="Servlet1" method=post

Your name: input type=text name=thename/

/form


This Servlet1 make a senRedirect to ../Cocoon/servlet2 (Good that works)

 the site map contains:

 map:pipeline 

  map:match pattern=servlet2

   map:generate src="http://localhost:8080/Cocoontest/servlet/cocontest.Servlet2/

   map:transform src="appl/servlet2.xsl/

   map:serialize/

  /map:match

 /map:pipeline 


The cocoontest.Servlet2 write a xml layout in the generator

this one is transformed by the appl/servlet2.xsl

and serialized in a HTML page.


All this stuff works well.  


In my Servlet1 I put some attributes in the session:


HttpSession session = request.getSession();

session.setAttribute=(test,cocoon is great !!);


In my Servlet2 I get this attribute:


String value = (String) session.getAttribute(test);


This instruction return a null in the String value.


Does that means that the session of the first called servlet and the session of the second calling servlet are not the same ?

If no:  what is wrong ?

if yes: how can I put objects in session that can be retrieved by servlets writing in the Cocoon generator ?


Thanks a lot for advice and help


René Clais





cocoon icon

2002-10-27 Thread james
Hi,
Anyone knows where can I download a cool looking cocoon icon for a website?
Cheers



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




error or incomplete docs for serializers ???

2002-10-27 Thread SAXESS - Hussayn Dabbous
Hy; 

maybe this message belongs to the developers list, but since it
is about documentation, i am unshure:

During evaluation of cocoon-2.0.3 i found a discrepancy
in the serializers docs:

the document shows an example, how to configure a serializer.
(see documents/userdocs/concepts/sitemap.html)

Look at the usage of the indent tag (the following lines
are a verbatim copy from the docs)

 map:serializer name=html mime-type=text/html 
src=org.apache.cocoon.serialization.HTMLSerializer

. . . 

   encodingUTF-8/encoding
   indent1/indent
 /map:serializer

I tried to use the indent1/indent tag on the XML
serializer. That did not work as expected. Then i tried 
to use indentyes/indent which is conform to the

xsl:output indent=yes/ known within the XSLT

and, guess what? It worked.

I tried to use the XSL:output directly in the stylesheet, but
that was completely ignored, hmm...

I just wonder, if the docs are wrong, or i use an xslt-processor,
which is not officially supported by cocoon. Although i simply
installed the cocoon-2.0.3 on top of tomcat-4.1.12

Just another minor subtility:

when i specify an invalid encoding within the encoding tag,
the serializer silently turns this into UTF-8. I personally would
like to see an error message instead. This would help a lot.


Any hints are welcome.

regards, hussayn
--
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax: +49-221-56011-20
E-Mail:  [EMAIL PROTECTED]


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



Re: internalisation with schematron (XML-Form)

2002-10-27 Thread Mohamed El-Refaey
Hi Michael ,

I faced the same problem and here is what I did when I read the mailing 
list regarding the i18n with Schematron validation error :

1- the XMLForm file is :
xf:password ref=/password
   xf:captioni18n:textPassword/i18n:text/xf:caption
   xf:violations class=error/
   /xf:password
2- the Schematron file :
rule context=/password
   assert test=string-length(.) gt; 7
   The Password Should be @ least 8 character.
   /assert
   /rule
   /pattern

3-the sitemap :
 map:transform type=xmlform label=xml/
   map:transform src=xforms/stylesheets/translate.xsl/
   map:act type=locale
   map:transform type=i18n
   map:parameter name=locale value={locale}/
   /map:transform
 /map:act

in which the translate.xsl file is the that what they r talking about in 
the mailing list :

?xml version=1.0?
xsl:stylesheet version=1.0
   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   xmlns:xf=http://xml.apache.org/cocoon/xmlform/2002;
   xmlns:i18n=http://apache.org/cocoon/i18n/2.0;

xsl:template match=document
 document
   xsl:apply-templates/
 /document
/xsl:template

xsl:template match=xf:violation
 xf:violation
   i18n:text
 xsl:value-of select=./
   /i18n:text
 /xf:violation
/xsl:template

xsl:template match=node() priority=-1
 xsl:copy
   xsl:copy-of select=@*/
   xsl:apply-templates/
 /xsl:copy
/xsl:template
/xsl:stylesheet

and the Catalog file :

message key=PasswordPassword/message


I wish this will help u


Mohamed


Michael Bald wrote:

Hi!
I have a problem to translate the error-massages of the schematrons. I 
hope someone can give me a hint to solve my problem.

I want to translate the Error Message of my pattern in the Schematron 
file. But I don´t know exactly how. I tried the way I found in the 
Mail archives of cocoon, but it didn´t work in my case.

I hope someone can answer me how to include the internalisation in my 
schematron file.

In the xml file I have following:
xf:form
xf:password ref=/password
xf:caption
i18n:textpassword_field/i18n:text
/xf:caption
xf:violation class=error/  
/xf:form

The schematron file has following pattern:
rule context=/password
assert test=string-lenght...
Error_message that I want to translate!
/assert
/rule

And the translation file has allready:
...
message key=password_fieldPassword/message
message key=The password is to long!/message
...

sitemap:
...
map:generate src=
map:transform type=i18n
map:parameter name=locale value={./locale}/
/map:transform
map:transform type=xmlform label=xml
map:transform src=
...

I tried allready to switch the transformers...but it didn´t work.

Hopefully someone can help me with this problem.

Greetings

Michael





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




Re: Cocoon and Servlets

2002-10-27 Thread SAXESS - Hussayn Dabbous
I may be wrong, but i assume, the problem comes from
the redirection specs in your sitemap:

When you call the source 

   http://localhost:8080/Cocoontest/servlet/cocontest.Servlet2

cocoon probably does this by making a http:client call to that resource. 
This is definitely done in a separate session. What exactly do you
want to achieve? Couldn't this be done cheeper by passing parameters 
in the redirect of your Servlet1 to Servlet2 ?

regards, hussayn


CLAIS, Rene wrote:

I have seen this subject (Cocoon with Servlets)  in a huge number of 
archive
Anyway no one can explain me how my problem can be solved (I do not find 
the right one !!)

The problem is : how can I retrieve java object in a cocoon session ?

My example:

I have a cocoon XLM / XSL showing a HTML page  (That works !)
This HTML contains a form which call my Servlet1  (That works !)

form action=Servlet1 method=post
Your name: input type=text name=thename/
/form

This Servlet1 make a senRedirect to  ../Cocoon/servlet2  (Good that works)
the site map contains:
map:pipeline 
map:match pattern=servlet2
map:generate 
src=http://localhost:8080/Cocoontest/servlet/cocontest.Servlet2/
map:transform src=appl/servlet2.xsl/
map:serialize/
/map:match
/map:pipeline

The cocoontest.Servlet2 write a xml layout in the generator
this one is transformed by the appl/servlet2.xsl
and serialized in a HTML page.

All this stuff works well. 

In my Servlet1 I put  some attributes in the session:

HttpSession session = request.getSession();
session.setAttribute=(test,cocoon is great !!);

In my Servlet2 I get this attribute:

String value = (String) session.getAttribute(test);

This instruction return a null in the String value.

Does that means that the session of the first called servlet and the 
session of the second calling servlet are not the same ?

If no:     what is wrong ?
if yes:  how can I put objects in session that can be retrieved  by 
servlets writing in the Cocoon generator ?

Thanks a lot for advice and help

René Clais



--
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax: +49-221-56011-20
E-Mail:  [EMAIL PROTECTED]


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




[Ann] XMLForm automatic check-box handling

2002-10-27 Thread Ivelin Ivanov

The new version of XMLForm checked in CVS HEAD (C2.1),
implements behind the scenes logic to help with
client languages which do not send values for some input fields.

The typical example is HTML's checkbox.

When it is unchecked, the browser won't send anything,
which leaves the app server to handle.
Writing custom code on a case by case basis is certainly tedious and error
prone process.

   -0-


Several solutions have been discussed over time, and I have finally took a
shot at it.

The implementation is relatively simple.
The XMLFormTransformer saves in the session all the input field references
to model properties, which were rendered in the original document. The
entries are saved under the key of the form view.
When the form is submitted, the populator extracts all the expected fields
and matches them with the request.
The ones which are not available, are replaced with default values.
For SelectBoolean, the default value is 'false'.
For SelectMany, the default value is empty collection(or array).
For all the others, the default value is empty string.

   -0-

The FeedbackWizard sample is modified. It no longer includes code which
reset values for check-box fields.

Notice that only session scope forms can benefit from this new feature!
Request scope forms cannot take advantage of it.



Thoughts and ideas are welcome.


Regards,

-=Ivelin=-




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




User-roles (was Re: Installing the mail component)

2002-10-27 Thread Kjetil Kjernsmo
Hello!

I resolved the URIResolver problem by installing Tomcat 4.1.12 (still 
don't understand what the problem was, though). So, I'm back to trying 
to get user-roles for the mail component working. I'm still stuck with 
that.

My current config involves the 1.3.1 SDK from Blackdown, Tomcat 4.1.12 
and Cocoon 2.1-dev from yesterday. I have compiled the mail component 
successfully, typed in the myroles.xconf file according The Book 
(checked many times...), and added the config for the component to 
cocoon.xconf. Then, I add user-roles=WEB-INF/myroles.xconf to the 
cocoon-element of ditto. I think that should be what I need to get 
going, but I get errors.  

   ERROR   (2002-10-18) 11:59.20:465   [access]
   (Unknown-URI)
   Unknown-thread/CocoonServlet: Exception reloading
 
  org.apache.avalon.framework.configuration.ConfigurationException:
   Error
   trying to load user-roles configuration

The basic error is still the same, but seems to bubble up from 
elsewhere:

ERROR   (2002-10-27) 17:01.29:656   [access] (Unknown-URI) 
Unknown-thread/CocoonServlet: Exception reloading
org.apache.avalon.framework.configuration.ConfigurationException: Error 
trying to load user-roles configuration
at org.apache.cocoon.Cocoon.configure(Cocoon.java:400)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:284)
at 
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1269)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:469)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
at
[snip]
java.io.FileNotFoundException
at 
org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:344)
at java.net.URL.openStream(URL.java:798)
at org.apache.cocoon.Cocoon.configure(Cocoon.java:395)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:284)
at 
org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1269)
at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:469)
[snip]

Frustrating, that is what it is... :-) Again, I can't do much other than 
ask for assistance... 

Best,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/


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




Re: internalisation with schematron (XML-Form)

2002-10-27 Thread Ivelin Ivanov

Mohamed,

would you consider submitting your email as a how-to document in bugzilla.
The question about i18n with XMLForm is popping constantly.

Ivelin


- Original Message -
From: Mohamed El-Refaey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, October 27, 2002 4:08 PM
Subject: Re: internalisation with schematron (XML-Form)


Hi Michael ,

I faced the same problem and here is what I did when I read the mailing
list regarding the i18n with Schematron validation error :

1- the XMLForm file is :
xf:password ref=/password
xf:captioni18n:textPassword/i18n:text/xf:caption
xf:violations class=error/
/xf:password
2- the Schematron file :
 rule context=/password
assert test=string-length(.) gt; 7
The Password Should be @ least 8 character.
/assert
/rule
/pattern

3-the sitemap :
  map:transform type=xmlform label=xml/
map:transform src=xforms/stylesheets/translate.xsl/
map:act type=locale
map:transform type=i18n
map:parameter name=locale value={locale}/
/map:transform
  /map:act

in which the translate.xsl file is the that what they r talking about in
the mailing list :

?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xf=http://xml.apache.org/cocoon/xmlform/2002;
xmlns:i18n=http://apache.org/cocoon/i18n/2.0;

xsl:template match=document
  document
xsl:apply-templates/
  /document
/xsl:template

xsl:template match=xf:violation
  xf:violation
i18n:text
  xsl:value-of select=./
/i18n:text
  /xf:violation
/xsl:template

xsl:template match=node() priority=-1
  xsl:copy
xsl:copy-of select=@*/
xsl:apply-templates/
  /xsl:copy
/xsl:template
/xsl:stylesheet

and the Catalog file :

message key=PasswordPassword/message


I wish this will help u


Mohamed


Michael Bald wrote:

 Hi!
 I have a problem to translate the error-massages of the schematrons. I
 hope someone can give me a hint to solve my problem.

 I want to translate the Error Message of my pattern in the Schematron
 file. But I don´t know exactly how. I tried the way I found in the
 Mail archives of cocoon, but it didn´t work in my case.

 I hope someone can answer me how to include the internalisation in my
 schematron file.

 In the xml file I have following:
 xf:form
 xf:password ref=/password
 xf:caption
 i18n:textpassword_field/i18n:text
 /xf:caption
 xf:violation class=error/
 /xf:form

 The schematron file has following pattern:
 rule context=/password
 assert test=string-lenght...
 Error_message that I want to translate!
 /assert
 /rule

 And the translation file has allready:
 ...
 message key=password_fieldPassword/message
 message key=The password is to long!/message
 ...

 sitemap:
 ...
 map:generate src=
 map:transform type=i18n
 map:parameter name=locale value={./locale}/
 /map:transform
 map:transform type=xmlform label=xml
 map:transform src=
 ...

 I tried allready to switch the transformers...but it didn´t work.

 Hopefully someone can help me with this problem.

 Greetings

 Michael





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



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




DataML

2002-10-27 Thread Derek Hohls



If you deal at all with database reporting and graphing, have a look 
at:
http://dataml.net/

and a somewhat brief referral article at:
http://javaboutique.internet.com/resources/javaatwork/dataML.html

Don't you have the feeling that this has been done somewhere, somehow
in a very familiar web-publishing framework... ;-) Yes, I do 
too, but
I can't escape the nagging feeling that I am *still* building and 
rebuilding
database reporting apps. Cocoon *does* it make it easier, and 
provides
a logical framework to do it in, but do we as a community have an 
equivalent "system" that someone can just adopt (and, of course, 
adapt
as needed) 'out of the box'. 

As I say, I have been working to develop an approach for myself, but 
I
also can't help thinking that others are doing the same too - anyone 
want to get together on this and jointly develop a (reasonably) solid 

platform for this type of activity? - Maybe the Cocoon Wiki would be a 

good place to share thoughts, but I would like to know if there are 
any
other out there with similar thoughts?

Thanks
Derek

[TheCocoon Wiki |http://outerthought.net/wiki/Wiki.jsp]


Re: cocoon icon

2002-10-27 Thread Bert Van Kets
It's in CVS in the xml-cocoon2/src/resources directory.
You will find anything you need.

Bert

At 11:42 27/10/2002 +0100, you wrote:

Hi,
Anyone knows where can I download a cool looking cocoon icon for a website?
Cheers



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



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