Strange xsp:attribute behaviour

2002-12-19 Thread Vermeulen, Francis
Hi,

can anyone tell me why the following xsp statements:

xsp:element
xsp:param name=name
xsp:exprCategory/xsp:expr
/xsp:param
xsp:attribute name=name

xsp:exprCarboxypeptidases/xsp:expr
/xsp:attribute
(Generating free amino acids)
/xsp:element

Generate this sort of Java code:



xspAttr.addAttribute(
  ,
  name,
  name,
  CDATA,
  \n\t\t\t\t\t + String.valueOf(Carboxypeptidases) + \n\t\t\t\t
);
  

this.contentHandler.startElement(
  ,
  

(Category)
  ,
  

(Category)
  ,
  xspAttr
);

xspAttr.clear();


this.characters(\n\t\t\t\t);
  
this.characters(\n\t\t\t\t);
  
this.characters(\n\t\t\t\t(Generating free amino acids));
  
this.characters(\n\t\t\t);
  

this.contentHandler.endElement(
  ,
  

(Category)
  ,
  

(Category)
  );



The problem here is in the xspAttr.addAttribute() call that these strings
\n\t\t\t\t\t are being appended to String.valueOf(Carboxypeptidases),
which is obviously not what I intended. To bypass this problem, I'm forced
to add the correct Java code directly into the xsp file, eg:

 xspAttr.addAttribute(
  ,
  name,
  name,
  CDATA,
  String.valueOf(Carboxypeptidases)
);

This behaviour is however not consistent, in some other xsp files the
correct code is generated. I've been looking at the xsp: stylesheet, but
cannot find an explanation for this behaviour.

Regards,
Francis


Ing. FRA Vermeulen
Senior J2EE Architect
ECM Solutions - Eindhoven
mobiel: +31 (0) 6 222 03 856
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]




Using input modules

2002-12-18 Thread Vermeulen, Francis
Hi,

can anyone tell me how to make a sitemap recognize the use of an input
module? I followed the documentation about using modules literally, but the
sitemap generator does not seem to recognize the syntax. Here is the
fragment of my sitemap:

map:resources
map:resource name=controller

map:generate type=serverpages
src=docs/templates/controller.xsp
map:parameter name=event value=action /
/map:generate
map:transform type=cinclude/
map:transform src=stylesheets/{attribute:style}.xsl /
map:serialize type=html /

/map:resource 
 /map:resources

The idea is to use a request attribute (style) - set before the pipeline
is processed - to define the stylesheet to be used. However, the generated
sitemap Java code still handles the {attribute:style} as a regular
substitution by calling substitute(list, {attribute:style}) while I
would have expected a call to the corresponding input module.

It's also not clear from the doc when the sitemap expects an input module,
e.g. when is attribute recognized as an input module and when as an output
module?

Thanks,
Francis


Ing. FRA Vermeulen
Senior J2EE Architect
ECM Solutions - Eindhoven
mobiel: +31 (0) 6 222 03 856
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: Using input modules

2002-12-18 Thread Vermeulen, Francis
Hi Christian,

thanks for your response. I'm currently using the 2.0.3 version, which
probably explains why it doesn't work. the version of
AbstractSitemap.substitute in 2.0.3 does not take care of the : operator.
I'll retry this with a later version as you suggest.

Regards,
Francis

-Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED]]
Sent: woensdag 18 december 2002 10:18
To: [EMAIL PROTECTED]
Subject: Re: Using input modules


On 18.Dec.2002 -- 10:00 AM, Vermeulen, Francis wrote:
 can anyone tell me how to make a sitemap recognize the use of an input
 module? I followed the documentation about using modules literally, but
the
 sitemap generator does not seem to recognize the syntax. Here is the
 fragment of my sitemap:

Unfortunately, you don't tell us which version you are
using. InputModules are available only in 2.0.4 and 2.1.

 map:resources
   map:resource name=controller
 
   map:generate type=serverpages
 src=docs/templates/controller.xsp
   map:parameter name=event value=action /
   /map:generate
   map:transform type=cinclude/
   map:transform src=stylesheets/{attribute:style}.xsl /

Please check that your cocoon.xconf provides a module names
attribute. Some have been renamed, request attributes are now
available through request-attr. If the docs say different, could you
send a patch, please?

   map:serialize type=html /
   
   /map:resource 
  /map:resources
 
 The idea is to use a request attribute (style) - set before the pipeline
 is processed - to define the stylesheet to be used. However, the generated
 sitemap Java code still handles the {attribute:style} as a regular
 substitution by calling substitute(list, {attribute:style}) while I
 would have expected a call to the corresponding input module.

This is handled inside the substitute method.

 It's also not clear from the doc when the sitemap expects an input module,
 e.g. when is attribute recognized as an input module and when as an
output
 module?

The sitemap only handles InputModules. OutputModules are used
currently in some actions and transformers.

Chris.
-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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




RE: how to connect two pipelines in cocoon?

2002-12-17 Thread Vermeulen, Francis
Hi,

you can use the map:call resource. sitemap element to invoke a
pipeline fragment from another pipeline. I use this too, here is en extract
from my sitemap:

map:pipeline  
map:match pattern=do-*.html
map:act set=process
map:parameter name=descriptor
   value=context://resources/{1}-form.xml/
map:parameter name=validate-set value=input /
map:call resource=controller
map:parameter  name=style value={style}
/
/map:call
map:serialize /
/map:act
map:generate src=docs/xml/error-login.xml/
map:serialize /
/map:match
map:handle-errors
!-- 
This pipeline specifies a different error handler.
--
map:transform src=stylesheets/error2html.xsl/
map:serialize status-code=500/
/map:handle-errors
/map:pipeline

map:resources
map:resource name=controller

map:generate type=serverpages
src=docs/templates/controller.xsp
map:parameter name=event value=action /
/map:generate
map:transform type=cinclude/
map:transform src=stylesheets/{style}.xsl /
map:serialize type=html /

/map:resource 
 /map:resources

Regards,
Francis

-Original Message-
From: Oskar Casquero [mailto:[EMAIL PROTECTED]]
Sent: dinsdag 17 december 2002 13:15
To: [EMAIL PROTECTED]
Subject: how to connect two pipelines in cocoon?


Hello,

I have the following pipelines in cocoon:

!-- This pipeline generates an XML document from an structured text
file --
map:match pattern=MAST_TXT2MAST_XMLresponse
map:act type=fileUploadAction
map:parameter name=file-name value=mast/
map:generate type=textparser src={src}
map:parameter name=grammar value=cocoon:/mast-out.grm/
map:parameter name=includeignorabletokens value=true/
/map:generate
map:transform src=stylesheets/chaperon2mastXML.xsl/
map:serialize type=text/
/map:act
/map:match

!-- This pipeline stores an XML document in eXist database using the xmldb
logicsheet--
map:match pattern=eXistAdmin
map:generate type=serverpages src=serverpages/xadmin.xsp/
map:transform src=stylesheets/doc2html.xsl/
map:serialize type=xhtml/
/map:match

I want to store the XML file in the database, so I would like to connect the
first pipeline with the second one, creating a chain, where the first
pipeline's output SAX events feed the second pipeline's generator. How can I
do this?

Thank you,
Oskar


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




Using own application components in Cocoon

2002-12-03 Thread Vermeulen, Francis
Hi folks,

cab anyone tell me what the recommended way is to add Avalon/Excalibur
components to the Cocoon configuration? I guessed it is by adding
component entries in cocoon.xconf, but this is nowhere explicitely
mentioned in the developers docs. Related to this: does Cocoon use an
Excalibur role manager so that roles and components can be defined
independently? Can role entries be added to cocoon.xconf? Thanks for your
help.

Regards,


Ing. FRA Vermeulen
Senior J2EE Architect
ECM Solutions - Eindhoven
mobiel: +31 (0) 6 222 03 856
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: Cocoon not compatible with latest Avalon/Excalibur version?

2002-12-03 Thread Vermeulen, Francis
Hi Bruno,

thanks for your answers. In the meantime I did what you suggested and it
seems to work with our own instances of ExcaliburComponentManager and
DefaultRoleManager.

Regards,
Francis

-Original Message-
From: Bruno Dumon [mailto:[EMAIL PROTECTED]]
Sent: dinsdag 3 december 2002 11:38
To: [EMAIL PROTECTED]
Subject: Re: Cocoon not compatible with latest Avalon/Excalibur version?


On Mon, 2002-12-02 at 17:25, Vermeulen, Francis wrote:
 Hi folks,
 
 we are trying to invoke an application framework from within Cocoon by
means
 of a custom transformer. This framework itself uses Avalon/Excalibur
 components through a separate component and role manager, instantiated
from
 within the framework. The framework is developed using the version 4.1.2
of
 Avalon and 4.1 of Excalibur and works fine in stand-alonemode when
invoked
 from our own servlet. However when invoked from the custom transformer in
 Cocoon version 2.0.3, the Avalon/Excalibur part doesn't work because we
are
 then using the version supplied with Cocoon as libraries.

What exactly do you mean with doesn't work? Do you get any exceptions
or just strange behaviour?

  So to me it looks
 as if Cocoon comes bundled with its own version of Avalon/Excalibur that
is
 not compatible with the latest release of these. 

Wouldn't it help to simply recompile your own framework against the
avalon libraries that ship with cocoon?

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[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]


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




Help with Action that puts XML fragment in Session

2002-11-19 Thread Vermeulen, Francis
Hi,

I would be gratefull if anyone could shed some light on the problem I
encounter.

I try to use a self-written Action that produces an XML fragment (as an
XMLizable object) and puts this in the Session. After which I use the
SessionAttributeGenerator to generate this XML from the session and output
it to the browser.

Here is the submap that I'm using:

 sitemap.xmap 
Here is the source code for my Action:

 MyMessage.java  ProduceMessage.java 
The result of this is that the code past the new MyMessage() statement is
NEVER executed 

If I change ProduceMessage.java to directly put the XML fragment as a String
object in the session, the desired result is produced.

I suspect there is a problem when trying to load a class (MyMessage) from
whithin the action, but I can't get the explanation by debugging the stuff.

I'm using JDK 1.3.1, Tomcat 4.0.2 and Cocoon 2.0.3 under Windows 2000.

Thanx for your help.

Regards,
Francis



Ing. FRA Vermeulen
Senior J2EE Architect
ECM Solutions - Eindhoven
mobiel: +31 (0) 6 222 03 856
e-mail: [EMAIL PROTECTED]





sitemap.xmap
Description: Binary data


MyMessage.java
Description: Binary data


ProduceMessage.java
Description: Binary data
-
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]