processPipelineTo and error handling

2011-01-20 Thread Schmitz, Jeffrey A
Hello,
   I have a flowscript which calls processPipelineTo, and I can't figure out 
how to get back into the script if there is an exception in one of the 
components of the pipeline that has been called.  For some reason, any error 
handling in my sitemap sends its results back to the client (i.e. the browser) 
instead of back to the flowscript via  the specified parameter ( transResult in 
the below example)

cocoon.processPipelineTo(importURL, null, transResult);

In the below handler, I was expecting the saxError.xml file contents to be sent 
back to my flowscript, but it ends up being sent to the browser instead, and my 
flowscript never continues on.  What am I missing here?

   map:handle-errors
  map:select type=exception
  map:when test=sax-parser-error
 map:generate src=xml/saxError.xml /
 map:serialize type=xml /
  /map:when




pipeline error handler

2011-01-14 Thread Schmitz, Jeffrey A
Hello,

I'm having a problem with my error handlers in Cocoon 2.1.11.  Specifically, I 
can't get my error handlers to work when attached to an individual pipeline.  
They work when attached to a pipelines element, so I think my map:selectors 
is setup ok, but the handlers attached to a pipeline element never catches any 
exceptions.  Any ideas?  E.g.

  map:pipeline type=noncaching
!--
  Pipeline for importing legacy xml into the Neutral model using
  semantic XML app models
--
map:match pattern=*/*/*In/*/*sxmlIn.flow/*/*
  map:generate src=inputs/{4} /
  map:transform src=xsl/{3}FormatNames.xsl
map:parameter name=instanceName value={2} /
  /map:transform
  map:transform src=xsl/AppInAdapter.xsl
map:parameter name=instanceName value={2} /
map:parameter name=appName value={3} /
map:parameter name=xmlRoot value={7} /
  /map:transform
  map:serialize type=xml /
/map:match
map:handle-errors
  map:select type=exception
map:when test=sax-parser-error
  map:generate src=xml/saxError.xml /
  map:serialize type=xml /
/map:when
map:otherwise
  map:generate src=xml/saxError.xml /
  map:serialize type=xml /
/map:otherwise
  /map:select
/map:handle-errors
  /map:pipeline



RE: Switching to Saxon

2010-12-17 Thread Schmitz, Jeffrey A
Sorry, I meant Tomcat.  As we only have one Cocoon based webapp, the concepts 
of tomcat and cocoon have kind of merged in my mind.

 -Original Message-
 From: Peter Flynn [mailto:pfl...@ucc.ie]
 Sent: Friday, December 17, 2010 9:08 AM
 To: users@cocoon.apache.org
 Subject: Re: Switching to Saxon
 
 On 16/12/10 16:23, Schmitz, Jeffrey A wrote:
  Taking a quick look, that looks like the same as I did, although I'm
  using a saxon9he.jar file. To ask maybe a dumb question, did you
  restart Cocoon after adding the jar?
 
 No, I assumed any change would force Tomcat to reread it all.
 I can restart Tomcat but I'm not aware of how to restart Cocoon itself.
 
 ///Peter
 
 
  -Original Message-
  From: Peter Flynn [mailto:pfl...@ucc.ie]
  Sent: Thursday, December 16, 2010 9:58 AM
  To: users@cocoon.apache.org
  Subject: Switching to Saxon
 
  I just tried this, but there seems to be a lack of up-to-date
 details
  on
  doing this in Cocoon 2.1.11 with saxon9. Following the assorted web
  pages for earlier versions, I got as far as adding saxon9.jar to
  Cocoon's WEB-INF/lib and editing the two files (commenting out the
  Xalan
  entries):
 
  - cocoon.xconf:
 
component logger=core.xslt
 
 role=org.apache.excalibur.xml.xslt.XSLTProcessor/saxon
 
 class=org.apache.cocoon.components.xslt.TraxProcessor
   parameter name=use-store value=true/
   parameter name=transformer-factory
value=net.sf.saxon.TransformerFactoryImpl/
/component
 
  - sitemap.xmap:
 
map:transformer name=xslt pool-grow=2 pool-max=32
pool-min=8 logger=sitemap.transformer.xslt
src=org.apache.cocoon.transformation.TraxTransformer
  use-request-parametersfalse/use-request-parameters
  use-browser-capabilities-dbfalse/use-browser-capabilities-db
  use-session-parametersfalse/use-session-parameters
  use-cookie-parametersfalse/use-cookie-parameters
  xslt-processor-rolesaxon/xslt-processor-role
  check-includestrue/check-includes
/map:transformer
 
  But then Cocoon spits out:
 
  Internal Server Error
  Message: Could not find component (key
  [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon])
  Description: org.apache.cocoon.ProcessingException: Lookup of
  transformer 'xslt' failed at map:transform -
  file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71
  Sender: org.apache.cocoon.servlet.CocoonServlet
  Source: Cocoon Servlet
 
  cause
  org.apache.avalon.framework.component.ComponentException: Could not
  find component (key
  [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon])
  full exception chain stacktrace
  org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt'
  failed
at map:transform -
  file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71
at
 
 org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.
  java:113)
 
  What is it actually looking for when it says
  org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea
 what
  or where org.apache.excalibur.xml.xslt.XSLTProcessor points to
 (I'm
  sure it's possible to find out, but I'm not a Java programmer :-)
 
  ///Peter
 
  
 -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Switching to Saxon

2010-12-16 Thread Schmitz, Jeffrey A
Taking a quick look, that looks like the same as I did, although I'm using a 
saxon9he.jar file.  To ask maybe a dumb question, did you restart Cocoon after 
adding the jar?

 -Original Message-
 From: Peter Flynn [mailto:pfl...@ucc.ie]
 Sent: Thursday, December 16, 2010 9:58 AM
 To: users@cocoon.apache.org
 Subject: Switching to Saxon
 
 I just tried this, but there seems to be a lack of up-to-date details
 on
 doing this in Cocoon 2.1.11 with saxon9. Following the assorted web
 pages for earlier versions, I got as far as adding saxon9.jar to
 Cocoon's WEB-INF/lib and editing the two files (commenting out the
 Xalan
 entries):
 
 - cocoon.xconf:
 
   component logger=core.xslt
  role=org.apache.excalibur.xml.xslt.XSLTProcessor/saxon
  class=org.apache.cocoon.components.xslt.TraxProcessor
  parameter name=use-store value=true/
  parameter name=transformer-factory
   value=net.sf.saxon.TransformerFactoryImpl/
   /component
 
 - sitemap.xmap:
 
   map:transformer name=xslt pool-grow=2 pool-max=32
   pool-min=8 logger=sitemap.transformer.xslt
   src=org.apache.cocoon.transformation.TraxTransformer
 use-request-parametersfalse/use-request-parameters
 use-browser-capabilities-dbfalse/use-browser-capabilities-db
 use-session-parametersfalse/use-session-parameters
 use-cookie-parametersfalse/use-cookie-parameters
 xslt-processor-rolesaxon/xslt-processor-role
 check-includestrue/check-includes
   /map:transformer
 
 But then Cocoon spits out:
 
  Internal Server Error
  Message: Could not find component (key
 [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon])
  Description: org.apache.cocoon.ProcessingException: Lookup of
 transformer 'xslt' failed at map:transform -
 file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71
  Sender: org.apache.cocoon.servlet.CocoonServlet
  Source: Cocoon Servlet
 
  cause
  org.apache.avalon.framework.component.ComponentException: Could not
 find component (key
 [org.apache.excalibur.xml.xslt.XSLTProcessor/saxon])
  full exception chain stacktrace
  org.apache.cocoon.ProcessingException: Lookup of transformer 'xslt'
 failed
  at map:transform -
 file:///usr/share/tomcat5/webapps/ROOT/sitemap.xmap:1174:71
  at
 org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.
 java:113)
 
 What is it actually looking for when it says
 org.apache.excalibur.xml.xslt.XSLTProcessor/saxon? I have no idea what
 or where org.apache.excalibur.xml.xslt.XSLTProcessor points to (I'm
 sure it's possible to find out, but I'm not a Java programmer :-)
 
 ///Peter
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Very large Generator file

2010-05-11 Thread Schmitz, Jeffrey A
Thanks Huib,
   I'm afraid my document is very interconnected.  I'm coming to realize that 
xslt has pretty much a hard limit on the size of files you can process with it, 
i.e. if it can't fit into memory and you need the full power of xslt you're 
pretty much out of luck.  What about going to a 64 bit machine and just 
allocating a huge amount of ram to Tomcat?  Can this been done with 
tomcat/cocoon?

 -Original Message-
 From: Huib Verweij [mailto:h...@home.nl]
 Sent: Tuesday, May 11, 2010 3:51 AM
 To: users@cocoon.apache.org
 Cc: Huib Verweij
 Subject: Re: Very large Generator file
 
 Hi Jeff,
 
 You wrote: I guess I was under the impression that SAX based xsl
 transformers didn't use much memory regardless file size, but perhaps
 that's not true?
 
 It's true. However, when you do a XSLT transformation the entire XML
 document needs to be available to the XSLT processor, because you can
 access any node in the document, e.g.
 /very/large/path/to/some/dark/corner/of/the/XML/node.
 
 I'm not sure about your use-case so I don't know if it will help, but
 you could try using the MultiFragmentTraxTransformer from the
 cocooncomponents project on Google code. It reduces memory consumption
 drastically by allowing you to specify a fragment in the XML that you
 want transformed. If you have a very large document that looks like
 this:
 
 root
item/
item/
 
 item/
 /root
 
 and all you want to do is transform the item/ elements then the
 MultiFragmentTraxTransformer is your friend.
 
 Huib.
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org


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



RE: Very large Generator file

2010-05-10 Thread Schmitz, Jeffrey A
Correct, it's not being turned into a web page.  Is a SAX pipeline part of 
Cocoon?  I'm still on Cocoon 2.1, but I've never heard that term specifically, 
I thought the default generator did use SAX.  

 -Original Message-
 From: Jos Snellings [mailto:jos.snelli...@pandora.be]
 Sent: Saturday, May 08, 2010 12:06 AM
 To: users@cocoon.apache.org
 Subject: Re: Very large Generator file
 
 Hi Jeff,
 
 That depends a great deal on what you want to do exactly with the large
 file. I guess you do not want to transform it into one huge web page?
 In general, if you have to deal with lengthy inputs, a SAX pipeline is
 the way to go.
 
 Jos
 
 On Fri, 2010-05-07 at 18:14 -0500, Schmitz, Jeffrey A wrote:
  Hello,
 
 I was wondering if there’s a way to handle very large files as
  inputs to the default cocoon generator?  As it is, I am getting a
  memory heap error when trying to process an input file because it’s
 so
  large.  Am I going to have to process it in some other manner, or is
  there a way to make Cocoon perform the transform for me?
 
 
 
  Thanks,
  Jeff
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Very large Generator file

2010-05-10 Thread Schmitz, Jeffrey A
Hi Jos,
   I've already written my own Transformer (extends AbstractSAXTransformer) 
that currently takes the output of the default cocoon xsl transformer (via the 
sitemap) and performs subsequent, non-xsl transforms, writes the results to 
file and generates the returned web-page  
e.g.
  map:match pattern=*/*/*In/*/*In.flow/* 
 map:generate src=inputs/{4} /
 map:transform src=xsl/{3}InAdapter.xsl
map:parameter name=instanceName value={2}/
 /map:transform
 map:transform type=SPARQLinTrans
map:parameter name=inputFile value={4}/
map:parameter name=SPARQLFlow value={5}/
 /map:transform
 map:serialize type=xhtml/
  /map:match

I'm currently heading in the direction of just adding the initial xsl 
transformation as part of my own Transformer's duties (I think your option 3) 
so that it can hopefully handle the larger files, but I was wondering if there 
might be a way to easily keep things as they are and continue using the default 
cocoon xsl tranform as the first step.  Sounds like there's not?


 -Original Message-
 From: Jos Snellings [mailto:jos.snelli...@pandora.be]
 Sent: Monday, May 10, 2010 8:39 AM
 To: users@cocoon.apache.org
 Subject: RE: Very large Generator file
 
 A SAX pipeline is part of cocoon.
 Can you explain briefly what you want to do?
 Consider using a cocoon-3 pipeline.
 Consider using a SAX transformation:
 - read xml
 - do something with it (transforming, for instance)
 - write output to a file
 
 Jos
 
 On Mon, 2010-05-10 at 08:23 -0500, Schmitz, Jeffrey A wrote:
  Correct, it's not being turned into a web page.  Is a SAX pipeline
 part of Cocoon?  I'm still on Cocoon 2.1, but I've never heard that
 term specifically, I thought the default generator did use SAX.
 
   -Original Message-
   From: Jos Snellings [mailto:jos.snelli...@pandora.be]
   Sent: Saturday, May 08, 2010 12:06 AM
   To: users@cocoon.apache.org
   Subject: Re: Very large Generator file
  
   Hi Jeff,
  
   That depends a great deal on what you want to do exactly with the
 large
   file. I guess you do not want to transform it into one huge web
 page?
   In general, if you have to deal with lengthy inputs, a SAX pipeline
 is
   the way to go.
  
   Jos
  
   On Fri, 2010-05-07 at 18:14 -0500, Schmitz, Jeffrey A wrote:
Hello,
   
   I was wondering if there’s a way to handle very large files as
inputs to the default cocoon generator?  As it is, I am getting a
memory heap error when trying to process an input file because
 it’s
   so
large.  Am I going to have to process it in some other manner, or
 is
there a way to make Cocoon perform the transform for me?
   
   
   
Thanks,
Jeff
   
   
  
  
  
   ---
 --
   To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
   For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Very large Generator file

2010-05-10 Thread Schmitz, Jeffrey A
Yes, the resulting XHTML file is not for online use.

And yes, I've given max memory to the tomcat instance.  So, will having my 
specialized transformer do the xsl transform directly using a SAX transformer 
not work either?  e.g. something like:

   TransformerFactory tfactory = TransformerFactory.newInstance();
   Transformer transformer = tfactory.newTransformer(new StreamSource(
xslID));
   transformer.transform(new StreamSource(sourceFile), new StreamResult(
new File(modelFile)));


I guess I was under the impression that SAX based xsl transformers didn't use 
much memory regardless file size, but perhaps that's not true?

If that's not going to work, would moving to a 64 bit machine so I can give 
more memory to Tomcat be an option (is there a 64 bit Tomcat)?  

 If this is the case a short java program can make that xhtml file for
 you.
I'm not exactly sure what you're suggesting here.  Do you mean for the 
tomcat/cocoon process to exec a separate java program that will do the xsl 
transform on the large file?  Won't any java program come up against the 2 Gig 
max memory limitation?

Thanks,
Jeff

 -Original Message-
 From: Jos Snellings [mailto:jos.snelli...@pandora.be]
 Sent: Monday, May 10, 2010 9:30 AM
 To: users@cocoon.apache.org
 Subject: RE: Very large Generator file
 
 Hi Jeff,
 
 If you have been trying giving all the available memory to your tomcat
 instance (JVM options) you are at the end of you tether for the current
 solutions, unless somebody has a different idea.
 
 I understood from your previous mail that the resulting xhtml is not
 for
 on-line use, it is a sort of report/summary.
 If this is the case a short java program can make that xhtml file for
 you.
 
 Cheers,
 Jos
 
 
 On Mon, 2010-05-10 at 09:17 -0500, Schmitz, Jeffrey A wrote:
  Hi Jos,
 I've already written my own Transformer (extends
 AbstractSAXTransformer) that currently takes the output of the default
 cocoon xsl transformer (via the sitemap) and performs subsequent, non-
 xsl transforms, writes the results to file and generates the returned
 web-page
  e.g.
map:match pattern=*/*/*In/*/*In.flow/* 
   map:generate src=inputs/{4} /
   map:transform src=xsl/{3}InAdapter.xsl
  map:parameter name=instanceName value={2}/
   /map:transform
   map:transform type=SPARQLinTrans
  map:parameter name=inputFile value={4}/
  map:parameter name=SPARQLFlow value={5}/
   /map:transform
   map:serialize type=xhtml/
/map:match
 
  I'm currently heading in the direction of just adding the initial xsl
 transformation as part of my own Transformer's duties (I think your
 option 3) so that it can hopefully handle the larger files, but I was
 wondering if there might be a way to easily keep things as they are and
 continue using the default cocoon xsl tranform as the first step.
 Sounds like there's not?
 
 
   -Original Message-
   From: Jos Snellings [mailto:jos.snelli...@pandora.be]
   Sent: Monday, May 10, 2010 8:39 AM
   To: users@cocoon.apache.org
   Subject: RE: Very large Generator file
  
   A SAX pipeline is part of cocoon.
   Can you explain briefly what you want to do?
   Consider using a cocoon-3 pipeline.
   Consider using a SAX transformation:
   - read xml
   - do something with it (transforming, for instance)
   - write output to a file
  
   Jos
  
   On Mon, 2010-05-10 at 08:23 -0500, Schmitz, Jeffrey A wrote:
Correct, it's not being turned into a web page.  Is a SAX
 pipeline
   part of Cocoon?  I'm still on Cocoon 2.1, but I've never heard that
   term specifically, I thought the default generator did use SAX.
   
 -Original Message-
 From: Jos Snellings [mailto:jos.snelli...@pandora.be]
 Sent: Saturday, May 08, 2010 12:06 AM
 To: users@cocoon.apache.org
 Subject: Re: Very large Generator file

 Hi Jeff,

 That depends a great deal on what you want to do exactly with
 the
   large
 file. I guess you do not want to transform it into one huge web
   page?
 In general, if you have to deal with lengthy inputs, a SAX
 pipeline
   is
 the way to go.

 Jos

 On Fri, 2010-05-07 at 18:14 -0500, Schmitz, Jeffrey A wrote:
  Hello,
 
 I was wondering if there’s a way to handle very large
 files as
  inputs to the default cocoon generator?  As it is, I am
 getting a
  memory heap error when trying to process an input file
 because
   it’s
 so
  large.  Am I going to have to process it in some other
 manner, or
   is
  there a way to make Cocoon perform the transform for me?
 
 
 
  Thanks,
  Jeff
 
 



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

RE: Very large Generator file

2010-05-10 Thread Schmitz, Jeffrey A
Thanks Jos,
   I have tried moving the tfactory stuff into my specialized cocoon 
transformer (com.boeing.transform.SPARQLinTrans), and I've also tried 
processing the file in a stand-alone java program with 1 Gig of memory assigned 
to it, and in both cases I'm still running out of heap space (see exception 
stack below).  So, the current problem must lie in the xsl transform libraries 
I'm using (i.e. not really a cocoon problem at this point). I know there must 
be techniques for doing xsl on very large files, do you have any pointers or 
ideas for this problem in general?  

Thanks!
Jeff 

java.lang.OutOfMemoryError: Java heap space
net.sf.saxon.tinytree.TinyTree.ensureNodeCapacity(TinyTree.java:215)
net.sf.saxon.tinytree.TinyTree.addNode(TinyTree.java:309)
net.sf.saxon.tinytree.TinyBuilder.characters(TinyBuilder.java:306)

net.sf.saxon.event.ReceivingContentHandler.flush(ReceivingContentHandler.java:544)

net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:275)
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)

org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)

org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
net.sf.saxon.event.Sender.sendSAXSource(Sender.java:354)
net.sf.saxon.event.Sender.send(Sender.java:184)
net.sf.saxon.event.Sender.send(Sender.java:49)
net.sf.saxon.Controller.transform(Controller.java:1550)
com.boeing.transform.SPARQLinTrans.adapt(SPARQLinTrans.java:143)

Of course this is still a part of the Tomcat process.


 -Original Message-
 From: Jos Snellings [mailto:jos.snelli...@pandora.be]
 Sent: Monday, May 10, 2010 10:04 AM
 To: users@cocoon.apache.org
 Subject: RE: Very large Generator file
 
 Yes, Jeff, my guess is that the tfactory stuff will accomplish the job
 for you without complaining about memory shortage! Your tomcat instance
 may have other things around increasing the memory footprint all the
 time.
 
 
 On Mon, 2010-05-10 at 09:43 -0500, Schmitz, Jeffrey A wrote:
  Yes, the resulting XHTML file is not for online use.
 
  And yes, I've given max memory to the tomcat instance.  So, will
 having my specialized transformer do the xsl transform directly using a
 SAX transformer not work either?  e.g. something like:
 
 TransformerFactory tfactory = TransformerFactory.newInstance();
 Transformer transformer = tfactory.newTransformer(new
 StreamSource(
  xslID));
 transformer.transform(new StreamSource(sourceFile), new
 StreamResult(
  new File(modelFile)));
 
 
  I guess I was under the impression that SAX based xsl transformers
 didn't use much memory regardless file size, but perhaps that's not
 true?
 
  If that's not going to work, would moving to a 64 bit machine so I
 can give more memory to Tomcat be an option (is there a 64 bit Tomcat)?
 
   If this is the case a short java program can make that xhtml file
 for
   you.
  I'm not exactly sure what you're suggesting here.  Do you mean for
 the tomcat/cocoon process to exec a separate java program that will do
 the xsl transform on the large file?  Won't any java program come up
 against the 2 Gig max memory limitation?
 
  Thanks,
  Jeff
 
   -Original Message-
   From: Jos Snellings [mailto:jos.snelli...@pandora.be]
   Sent: Monday, May 10, 2010 9:30 AM
   To: users@cocoon.apache.org
   Subject: RE: Very large Generator file
  
   Hi Jeff,
  
   If you have been trying giving all the available memory to your
 tomcat
   instance (JVM options) you are at the end of you tether for the
 current
   solutions, unless somebody has a different idea.
  
   I understood from your previous mail that the resulting xhtml is
 not
   for
   on-line use, it is a sort of report/summary.
   If this is the case a short java program can make that xhtml file
 for
   you.
  
   Cheers,
   Jos
  
  
   On Mon, 2010-05-10 at 09:17 -0500, Schmitz, Jeffrey A wrote:
Hi Jos,
   I've already written my own Transformer (extends
   AbstractSAXTransformer) that currently takes the output of the
 default
   cocoon xsl transformer (via the sitemap) and performs subsequent,
 non-
   xsl transforms, writes the results to file and generates the
 returned
   web-page
e.g

Very large Generator file

2010-05-07 Thread Schmitz, Jeffrey A
Hello,
   I was wondering if there's a way to handle very large files as inputs to the 
default cocoon generator?  As it is, I am getting a memory heap error when 
trying to process an input file because it's so large.  Am I going to have to 
process it in some other manner, or is there a way to make Cocoon perform the 
transform for me?

Thanks,
Jeff


RE: cocoon upload {SOLVED}

2010-02-22 Thread Schmitz, Jeffrey A
Ended up being the user-roles attribute got inadvertantly deleted in the cocoon 
element of the cocoon.xconf file.  That linked example still works fine with 2.1


cocoon version=2.1 user-roles=/WEB-INF/user.xroles

Jeff
Work: 314-232-1997
Cell: 636-448-5990




From: Francesco Chicchiriccò [mailto:francesco.chicchiri...@everett.it]
Sent: Monday, February 22, 2010 2:09 AM
To: users@cocoon.apache.org
Subject: Re: cocoon upload

On 22/feb/10, at 05:07, Jeff Schmitz wrote:

hello,
   I'm trying to implement the file upload functionality outlined here:

http://wiki.apache.org/cocoon/FileUploadsWithFlow

But when I try to upload, I'm getting the following error.  It looks like some 
kind of config error, but I think I've set things up per the instructions.  Any 
ideas?
[...]

Hi Jeff,
assuming that you are using 2.1 (2.1.11?), I don't know how much updated is the 
link that you reported above.

I would suggest to start from the upload sample in the forms block (see [1]).

Cheers.

[1] 
http://svn.apache.org/repos/asf/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/



Validator ?s

2010-02-18 Thread Schmitz, Jeffrey A
Hello,
   In the validator documentation is states the following:

As an alternative for fd:java, you can also add validators at run time to a 
form instance, using the addValidator method on a form or widget. Since you 
then instantiate the validator yourself, you can pass it anything you want, and 
it can be stateful.

However, it doesn't really say where in the cocoon ecosystem this injection of 
a validator needs to occur.  Can anyone provide specifics on this?  E.g. is 
this done somewhere in the flowscript?

Also, I've tried following the instructions for added a java validtor using 
fd:java, but it's not getting triggered.  Below is my code, any ideas why it 
doesn't seem to be working?

fd:field id=name required=true
  fd:labelName:/fd:label
  fd:datatype base=string/
  fd:validation
fd:length min=2/
  /fd:validation
  fd:validation
 fd:java class=com.boeing.ssp.cforms.LoginValidator/
 fd:failmessageUser does not exist./fd:failmessage
   /fd:validation
/fd:field

package com.boeing.ssp.cforms;

import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.cocoon.forms.formmodel.Widget;
import org.apache.cocoon.forms.validation.WidgetValidator;

import com.boeing.mifssp.CFormUtils;

public class LoginValidator extends AbstractLogEnabled  implements 
WidgetValidator {

  /**
 * @see 
org.apache.cocoon.forms.validation.WidgetValidator#validate(org.apache.cocoon.forms.formmodel.Widget)
 */
public boolean validate(Widget widget) {
  String loginStrs[] = new String[1];
  getLogger().info(Validating user  + (String) widget.getValue());

  loginStrs[0] = (String) widget.getValue();
  boolean goodLogin = CFormUtils.submitIfQuery(loginCheck, ivhm, 
ModelManagement, null, null, loginStrs);
  return goodLogin;
}
}

Thanks,
Jeff




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



RE: Cocoon.load

2010-02-17 Thread Schmitz, Jeffrey A
I've determined that the referenced Form.js script actually is being located 
and loaded by the cocoon.load call, so that wasn't my problem.  This leaves me 
with the problem that I really don't know what the problem might be.  I've 
looked up the below exception and can't really find much on it.  Any other 
ideas out there?  Again, I'm trying to run the simple Cforms example under 
Tomcat, and am getting the exception on the Form constructor in the below code 
snippet:

cocoon.load(resource://org/apache/cocoon/forms/flow/javascript/Form.js);
function registration() {
var form = new Form(registration_definition.xml);
...

EXCEPTION:
org.apache.avalon.framework.service.ServiceException: Non-existing component 
for this hint (Key='form')
at 
org.apache.cocoon.forms.util.SimpleServiceSelector.select(SimpleServiceSelector.java:124)
at 
org.apache.cocoon.forms.DefaultFormManager.createFormDefinition(DefaultFormManager.java:236)
at 
org.apache.cocoon.forms.DefaultFormManager.createFormDefinition(DefaultFormManager.java:223)
at 
org.apache.cocoon.forms.DefaultFormManager.createForm(DefaultFormManager.java:167)
at 
org.apache.cocoon.forms.DefaultFormManager.createForm(DefaultFormManager.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:145)
at 
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:204)
at 
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3085)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
at 
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
at 
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:915)
at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:764)
at 
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:139)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
at 
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
at 
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
at 
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
at 
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
at 
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)

Jeff
Work: 314-232-1997
Cell: 636-448-5990
 

 -Original Message-
 From: Schmitz, Jeffrey A 
 Sent: Tuesday, February

RE: Cocoon.load [SOLVED]

2010-02-17 Thread Schmitz, Jeffrey A
The problem was I wasn't using an updated cocoon.xconf file after rebuilding 
cocoon to include cforms, although I thought I had previously created the 
cocoon.xconf file with everything included.

More specifically it was all the forms/widget related stuff that was missing, 
e.g...

  !--+
  | Cocoon Forms bindings
  +--
  forms-binding logger=forms.bindings
bindings
  binding name=value 
src=org.apache.cocoon.forms.binding.ValueJXPathBindingBuilder/
  binding name=multi-value 
src=org.apache.cocoon.forms.binding.MultiValueJXPathBindingBuilder/
  binding name=context 
src=org.apache.cocoon.forms.binding.ContextJXPathBindingBuilder/
  binding name=repeater 
src=org.apache.cocoon.forms.binding.RepeaterJXPathBindingBuilder/
  binding name=simple-repeater 
src=org.apache.cocoon.forms.binding.SimpleRepeaterJXPathBindingBuilder/



 !--+
  | Cocoon Forms FormManager component and form model definition
  +--
  forms-formmanager logger=forms.model
widgets
  widget name=form 
src=org.apache.cocoon.forms.formmodel.FormDefinitionBuilder/
  widget name=import 
src=org.apache.cocoon.forms.formmodel.ImportDefinitionBuilder/


Anyway, very glad to have this one behind me :-)  I would perhaps suggest that 
the Cforms example writeup should have a reminder of what blocks need to be 
included, as to what files will need to be updated (jars, cocoon.xconf, 
others?) to work.

Jeff

 

 -Original Message-
 From: Schmitz, Jeffrey A 
 Sent: Wednesday, February 17, 2010 2:45 PM
 To: users@cocoon.apache.org
 Subject: RE: Cocoon.load
 
 I've determined that the referenced Form.js script actually 
 is being located and loaded by the cocoon.load call, so that 
 wasn't my problem.  This leaves me with the problem that I 
 really don't know what the problem might be.  I've looked up 
 the below exception and can't really find much on it.  Any 
 other ideas out there?  Again, I'm trying to run the simple 
 Cforms example under Tomcat, and am getting the exception on 
 the Form constructor in the below code snippet:
 
 cocoon.load(resource://org/apache/cocoon/forms/flow/javascrip
 t/Form.js);
 function registration() {
 var form = new Form(registration_definition.xml);
 ...
 
 EXCEPTION:
 org.apache.avalon.framework.service.ServiceException: 
 Non-existing component for this hint (Key='form')
   at 
 org.apache.cocoon.forms.util.SimpleServiceSelector.select(Simp
 leServiceSelector.java:124)
   at 
 org.apache.cocoon.forms.DefaultFormManager.createFormDefinitio
 n(DefaultFormManager.java:236)
   at 
 org.apache.cocoon.forms.DefaultFormManager.createFormDefinitio
 n(DefaultFormManager.java:223)
   at 
 org.apache.cocoon.forms.DefaultFormManager.createForm(DefaultF
 ormManager.java:167)
   at 
 org.apache.cocoon.forms.DefaultFormManager.createForm(DefaultF
 ormManager.java:155)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:145)
   at 
 org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.
 java:204)
   at 
 org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.j
 ava:3085)
   at 
 org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
   at 
 org.mozilla.javascript.InterpretedFunction.call(InterpretedFun
 ction.java:161)
   at 
 org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory
 .java:340)
   at 
 org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.j
 ava:2758)
   at 
 org.mozilla.javascript.InterpretedFunction.call(InterpretedFun
 ction.java:159)
   at 
 org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:915)
   at 
 org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScrip
 tInterpreter.callFunction(FOM_JavaScriptInterpreter.java:764)
   at 
 org.apache.cocoon.components.treeprocessor.sitemap.CallFunctio
 nNode.invoke(CallFunctionNode.java:139)
   at 
 org.apache.cocoon.components.treeprocessor.AbstractParentProce
 ssingNode.invokeNodes(AbstractParentProcessingNode.java:47)
   at 
 org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.i
 nvoke(MatchNode.java:108)
   at 
 org.apache.cocoon.components.treeprocessor.AbstractParentProce
 ssingNode.invokeNodes(AbstractParentProcessingNode.java:69)
   at 
 org.apache.cocoon.components.treeprocessor.sitemap.PipelineNod
 e.invoke(PipelineNode.java:143)
   at 
 org.apache.cocoon.components.treeprocessor.AbstractParentProce
 ssingNode.invokeNodes(AbstractParentProcessingNode.java:69)
   at 
 org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNo
 de.invoke(PipelinesNode.java:93)
   at 
 org.apache.cocoon.components.treeprocessor.ConcreteTreeProcess
 or.process

RE: Cocoon.load

2010-02-16 Thread Schmitz, Jeffrey A
Thanks,
   
   I do have the cocoon-forms-block.jar in my lib folder, but it still can't 
seem to find it.  And actually, I have all the same jar files that are in the 
jetty WEB-INF lib in my tomcat webapp lib too.  

I also tried moving the js file to the same folder as the sitemap and changing 
the reference to just 

cocoon.load(Form.js);

And still no luck.

Also, is there somewhere that describes what all the prefixes mean for the 
cocoon.load call?


Jeff

 

 -Original Message-
 From: Francesco Chicchiriccò 
 [mailto:francesco.chicchiri...@everett.it] 
 Sent: Tuesday, February 16, 2010 3:29 AM
 To: users@cocoon.apache.org
 Subject: Re: Cocoon.load
 
 On 15/feb/10, at 19:30, Schmitz, Jeffrey A wrote:
 
  Hello,
I'm running my cocoon app under tomcat, and am trying to 
 figure out 
  where to place the target of a cocoon.load call in my flowscript so 
  that it will be found at runtime.
 
  For example, I'm trying to use:
 
  cocoon.load(resource://org/apache/cocoon/forms/flow/javascript/
  Form.js);
 
  While I've gotten this to work under the included jetty server, I'm 
  not sure how to transfer this over so it will work correctly as a 
  tomcat webapp.  Any help would be greatly appreciated.
 
 Hi,
 if you use the resource:// protocol to find your JS, this 
 means that the JS file is usually located inside a JAR file, 
 under the specified package. The JAR file must of course be 
 in the classpath of your web application, usually under 
 WEB-INF/lib folder.
 
 If you want instead to refer to a JS file not in any JAR, you 
 should consider the path from the folder in which the sitemap 
 including the referring JS is located.
 
 For example:
 
 A/
  sitemap.xmap
  flow/
  main.js
  external.js
 
 if sitemap.xmap loads flow/main.js, you can include 
 external.js by putting
 
 cocoon.load(flow/external.js);
 
 inside main.js.
 
 
 Note that what I wrote above only derives from my personal 
 experience, so it is very likely that the underlying theory 
 about loaders is far much involved than this. Nevertheless, 
 this is working ;-)
 
 Cheers.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Cocoon.load

2010-02-15 Thread Schmitz, Jeffrey A
Hello,
   I'm running my cocoon app under tomcat, and am trying to figure out where to 
place the target of a cocoon.load call in my flowscript so that it will be 
found at runtime.

For example, I'm trying to use:

cocoon.load(resource://org/apache/cocoon/forms/flow/javascript/Form.js);

While I've gotten this to work under the included jetty server, I'm not sure 
how to transfer this over so it will work correctly as a tomcat webapp.  Any 
help would be greatly appreciated.

Thanks,
Jeff


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



RE: Can't use switch with cocoon.request.get in flowscript [SOLUTION]

2010-02-11 Thread Schmitz, Jeffrey A
Thanks!  Really cleans up my code.  I'm just surprised this issue hasn't been 
raised before here.

Jeff

 

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@ciber.com] 
 Sent: Tuesday, February 09, 2010 4:03 AM
 To: users@cocoon.apache.org
 Subject: RE: Can't use switch with cocoon.request.get in 
 flowscript [SOLUTION]
 
 Hi Jeff,
 
 I did a similar setup in  a Cocoon2.2 block and the same 
 problem occurs:
 
 function testSwitch() {
   var cmd = cocoon.request.getParameter(cmd);
   
   print(cmd= + cmd);
   print(cmd.getClass().getName());
   
   switch(cmd) {
   case save: 
   print(request parameter was save);
   break;
   case delete: 
   print(request parameter was delete);
   break;
   default:
   print(request parameter was none of the above);
   break;  
   }
 }
 
 
 Output in console:
 cmd=delete
 java.lang.String
 request parameter was none of the above
 
 By the way... cmd.getClass().getName() is only possible if 
 the object is in fact a java object.  They use LiveConnect so 
 you can easily use Java and JavaScript together.  I suspect 
 that the switch does not work properly on java.lang.String.
 
 So when you convert the cmd to a native javascript object it 
 suddenly will work again.  A better solution is demonstrated below:
 
 
 
 function testSwitch() {
   var cmd = getCmd(cmd);
   switch(cmd) {
   case save: 
   print(request parameter was save);
   break;
   case delete: 
   print(request parameter was delete);
   break;
   default:
   print(request parameter was none of the above);
   break;  
   }
 }
 
 
 function getCmd(name) {
   return  + cocoon.request.getParameter(name);  // -- 
 we need to make sure we get a native javascript object so our 
 switch will work }
 
 Kind regards,
 Robby
 
 -Original Message-
 From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com]
 Sent: Monday, February 08, 2010 6:59 PM
 To: users@cocoon.apache.org
 Subject: RE: Can't use switch with cocoon.request.get in flowscript
 
 In effect, I already do that with the following code which is 
 my workaround.  In this case the switch DOES work.
 
  var cmd = cocoon.request.get(Cmd);
 
  //For some reason, the switch doesn't work with the
  //string returned from cocoon.request.get, but if
  //statements do.
  if (cmd == Open) {
 cmd = Open;
  }
  if (cmd == Create Model) {
 cmd = Create Model;
  } 
  if (cmd == Account) {
  cmd = Account;
   } 
  if (cmd == Logout) {
 cmd = Logout;
  } 
  
  switch (cmd) {
 
 case Open:
 
 Jeff
 Work: 314-232-1997
 Cell: 636-448-5990
  
 
  -Original Message-
  From: Robby Pelssers [mailto:robby.pelss...@ciber.com]
  Sent: Monday, February 08, 2010 11:56 AM
  To: users@cocoon.apache.org
  Subject: RE: Can't use switch with cocoon.request.get in flowscript
  
  A next step would be to try something like
  
   var cmd = Open;
   print(cmd=' + cmd = ');
  
   switch (cmd) {
  case Open: 
  {
  print(Command is Open);
  break;
  }
  case Create Model: 
  {
  print(Command is Create Model);
  break;   
  }
 case default:
  {
  print(Command did not match any of the above);
  break;   
  }
   }
  
  If this snippet still does print the default output you 
 know for sure 
  the switch is not behaving properly.
  
  https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference
  /Statements/switch
  
  So can you first see what the output of the snippet above is?
  
  Cheers,
  Robby
  
  
  
  -Original Message-
  From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com]
  Sent: Monday, February 08, 2010 5:45 PM
  To: users@cocoon.apache.org
  Subject: RE: Can't use switch with cocoon.request.get in flowscript
  
  Here's the output.  Very strange.  Again, 'if' check's work 
 on it, but 
  the switch command doesn't unless I do the workaround.
  
   cmd='Open'
   Command did not match any of the above
  
  Jeff
  Work: 314-232-1997
  Cell: 636-448-5990
   
  
   -Original Message-
   From: Robby Pelssers [mailto:robby.pelss...@ciber.com]
   Sent: Monday, February 08, 2010 10:27 AM
   To: users@cocoon.apache.org
   Subject: RE: Can't use switch with cocoon.request.get in 
 flowscript
   
   Well,
   
   I know for sure the switch works fine in cocoon2.2.  Might not be 
   implemented properly in an older version of Rhino?
   
   Anyway...
   
   What happens if you use this snippet

Can't use switch with cocoon.request.get in flowscript

2010-02-08 Thread Schmitz, Jeffrey A
Hello,
   In Cocoonn 2.1, does anyone know why I can't use a switch command with the 
result of cocoon.request.get in flowscript?  if's work just fine, but switch 
doesn't.  E.g. to get the switch to work I have to do the following:

 var cmd = cocoon.request.get(Cmd);

 //For some reason, the switch doesn't work with the
 //string returned from cocoon.request.get, but if
 //statements do.
 if (cmd == Open) {
cmd = Open;
 }
 if (cmd == Create Model) {
cmd = Create Model;
 }
 if (cmd == Account) {
 cmd = Account;
  }
 if (cmd == Logout) {
cmd = Logout;
 }

 switch (cmd) {

case Open:
  ...

I have tried adding .toString() to the end of the get function and also the cmd 
variable in various places, but that doesn't work either.

Thanks!
Jeff




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



RE: Can't use switch with cocoon.request.get in flowscript

2010-02-08 Thread Schmitz, Jeffrey A
Here's the output.  Very strange.  Again, 'if' check's work on it, but the 
switch command doesn't unless I do the workaround.

 cmd='Open'
 Command did not match any of the above

Jeff
Work: 314-232-1997
Cell: 636-448-5990
 

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@ciber.com] 
 Sent: Monday, February 08, 2010 10:27 AM
 To: users@cocoon.apache.org
 Subject: RE: Can't use switch with cocoon.request.get in flowscript
 
 Well,
 
 I know for sure the switch works fine in cocoon2.2.  Might 
 not be implemented properly in an older version of Rhino?
 
 Anyway...
 
 What happens if you use this snippet??  It should at least 
 print something to your console.
 
  var cmd = cocoon.request.get(Cmd);
  print(cmd=' + cmd = ');
 
  switch (cmd) {
 case Open: 
 {
 print(Command is Open);
 break;
 }
 case Create Model: 
 {
 print(Command is Create Model);
 break;   
 }
...
Case default:
 {
 print(Command did not match any of the above);
 break;   
 }
  }
 
 Kind regards,
 Robby Pelssers
 
 
 
 -Original Message-
 From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com]
 Sent: Monday, February 08, 2010 4:55 PM
 To: users@cocoon.apache.org
 Subject: Can't use switch with cocoon.request.get in flowscript
 
 Hello,
In Cocoonn 2.1, does anyone know why I can't use a switch 
 command with the result of cocoon.request.get in flowscript?  
 if's work just fine, but switch doesn't.  E.g. to get the 
 switch to work I have to do the following:
 
  var cmd = cocoon.request.get(Cmd);
 
  //For some reason, the switch doesn't work with the
  //string returned from cocoon.request.get, but if
  //statements do.
  if (cmd == Open) {
 cmd = Open;
  }
  if (cmd == Create Model) {
 cmd = Create Model;
  }
  if (cmd == Account) {
  cmd = Account;
   }
  if (cmd == Logout) {
 cmd = Logout;
  }
 
  switch (cmd) {
 
 case Open:
   ...
 
 I have tried adding .toString() to the end of the get 
 function and also the cmd variable in various places, but 
 that doesn't work either.
 
 Thanks!
 Jeff
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



RE: Can't use switch with cocoon.request.get in flowscript

2010-02-08 Thread Schmitz, Jeffrey A
In effect, I already do that with the following code which is my workaround.  
In this case the switch DOES work.

 var cmd = cocoon.request.get(Cmd);

 //For some reason, the switch doesn't work with the
 //string returned from cocoon.request.get, but if
 //statements do.
 if (cmd == Open) {
cmd = Open;
 }
 if (cmd == Create Model) {
cmd = Create Model;
 } 
 if (cmd == Account) {
 cmd = Account;
  } 
 if (cmd == Logout) {
cmd = Logout;
 } 
 
 switch (cmd) {

case Open:

Jeff
Work: 314-232-1997
Cell: 636-448-5990
 

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@ciber.com] 
 Sent: Monday, February 08, 2010 11:56 AM
 To: users@cocoon.apache.org
 Subject: RE: Can't use switch with cocoon.request.get in flowscript
 
 A next step would be to try something like 
 
  var cmd = Open;
  print(cmd=' + cmd = ');
 
  switch (cmd) {
 case Open: 
 {
 print(Command is Open);
 break;
 }
 case Create Model: 
 {
 print(Command is Create Model);
 break;   
 }
case default:
 {
 print(Command did not match any of the above);
 break;   
 }
  }
 
 If this snippet still does print the default output you know 
 for sure the switch is not behaving properly. 
 
 https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference
 /Statements/switch
 
 So can you first see what the output of the snippet above is?
 
 Cheers,
 Robby
 
 
 
 -Original Message-
 From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com]
 Sent: Monday, February 08, 2010 5:45 PM
 To: users@cocoon.apache.org
 Subject: RE: Can't use switch with cocoon.request.get in flowscript
 
 Here's the output.  Very strange.  Again, 'if' check's work 
 on it, but the switch command doesn't unless I do the workaround.
 
  cmd='Open'
  Command did not match any of the above
 
 Jeff
 Work: 314-232-1997
 Cell: 636-448-5990
  
 
  -Original Message-
  From: Robby Pelssers [mailto:robby.pelss...@ciber.com]
  Sent: Monday, February 08, 2010 10:27 AM
  To: users@cocoon.apache.org
  Subject: RE: Can't use switch with cocoon.request.get in flowscript
  
  Well,
  
  I know for sure the switch works fine in cocoon2.2.  Might not be 
  implemented properly in an older version of Rhino?
  
  Anyway...
  
  What happens if you use this snippet??  It should at least print 
  something to your console.
  
   var cmd = cocoon.request.get(Cmd);
   print(cmd=' + cmd = ');
  
   switch (cmd) {
  case Open: 
  {
  print(Command is Open);
  break;
  }
  case Create Model: 
  {
  print(Command is Create Model);
  break;   
  }
 ...
 Case default:
  {
  print(Command did not match any of the above);
  break;   
  }
   }
  
  Kind regards,
  Robby Pelssers
  
  
  
  -Original Message-
  From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com]
  Sent: Monday, February 08, 2010 4:55 PM
  To: users@cocoon.apache.org
  Subject: Can't use switch with cocoon.request.get in flowscript
  
  Hello,
 In Cocoonn 2.1, does anyone know why I can't use a 
 switch command 
  with the result of cocoon.request.get in flowscript?
  if's work just fine, but switch doesn't.  E.g. to get the switch to 
  work I have to do the following:
  
   var cmd = cocoon.request.get(Cmd);
  
   //For some reason, the switch doesn't work with the
   //string returned from cocoon.request.get, but if
   //statements do.
   if (cmd == Open) {
  cmd = Open;
   }
   if (cmd == Create Model) {
  cmd = Create Model;
   }
   if (cmd == Account) {
   cmd = Account;
}
   if (cmd == Logout) {
  cmd = Logout;
   }
  
   switch (cmd) {
  
  case Open:
...
  
  I have tried adding .toString() to the end of the get function and 
  also the cmd variable in various places, but that doesn't 
 work either.
  
  Thanks!
  Jeff
  
  
  
  
  
 -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
  
  
 -
 To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



esql

2007-08-14 Thread Schmitz, Jeffrey A
Hello,
   I'm trying to get esql query to work within my xsp page, but am
having no luck.  I don't get any errors, but I don't get any data
either, and also the no-results tag doesn't get invoked, nor does the
get-message tag.  It looks pretty simple, but with no results and no
error messages to go by, I'm pretty much at a loss.  I've pasted the
applicable entries in my cocoon.xconf file, along with my xsp page
below.  Note that the greeting logic sheet part of the xsp is working.
Any help would be appreciated.

Thanks,
Jeff

Cocoon.xconf:
  builtin-logicsheet
  parameter name=prefix value=esql/
  parameter name=uri
value=http://apache.org/cocoon/SQL/v2/
  parameter name=href
value=resource://org/apache/cocoon/components/language/markup/xsp/java/
esql.xsl/
  /builtin-logicsheet


  datasources

jdbc name=SIF
  pool-controller min=5 max=10/
  dburljdbc:mysql://localhost/ivhm/dburl
  userivhm/user
  passwordivhm/password
/jdbc

  /datasources

Greeting3.xsp:

?xml version=1.0?
?xml-logicsheet href=logicsheet.greeting.xsl?

xsp:page xmlns:xsp=http://apache.org/xsp;
  xmlns:greeting=http://duke.edu/tutorial/greeting;
  xmlns:esql=http://apache.org/cocoon/SQL/v2;
  greeting
greeting:hello-world/
  /greeting
  esql:connection
esql:poolSIF/esql:pool
esql:execute-query
  esql:querySELECT Name FROM myTable/esql:query
esql:results
  table
esql:row-results
  tr
tdesql:get-string column=Name//td
  /tr
/esql:row-results
  /table
/esql:results
esql:no-results
   pSorry, no results!/p
/esql:no-results

  esql:error-results
Pesql:get-message//P 
  /esql:error-results
 

  /esql:execute-query
/esql:connection


/xsp:page

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



Simple Java from flowscript ?

2007-07-25 Thread Schmitz, Jeffrey A
 Hello,
   I've tried to call java from my flowscript as shown here:

http://cocoon.apache.org/2.1/userdocs/flow/java.html

However, I get a compilation error when I try to load my webpage. First,
is there anywhere to see specifics about the compilation error
encountered?  All it tells me is Compilation produced 1 syntax error on
line 1.

Also, are there any more complete examples of calling java from
flowscript?

And finally, any ideas on what may be wrong?

Here's my main flowscript function, which otherwise works until I add
the java Date stuff: 

function main()
{
   var d = new java.util.Date();
   d.year = 2003;// same effect as d.setYear(2003);
   getInfo();
   upload();
   var uri = neutralInstModel / + inputType + In/ + inputFile + /
+ inputType + In.trans/ + cocoon.continuation.id;
   cocoon.sendPage(uri);  
}

And here's my flow-interpreters entry in cocoon.xcon:

  flow-interpreters default=javascript logger=flow
!-- FOM (Flow Object Model) --
component-instance
class=org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptIn
terpreter name=javascript
 
load-on-startupresource://org/apache/cocoon/components/flow/javascript
/fom/fom_system.js/load-on-startup
  reload-scriptstrue/reload-scripts
  check-time4000/check-time
  classpathfile:C:/Program Files/Apache Software Foundation/Tomcat
6.0/webapps/SIF/WEB-INF/lib/classpath
  !--  debuggerenabled/debugger --  !-- JavaScript Debugger
support --
/component-instance
  !--. Start configuration from 'apples-processor' --#13;


  component-instance
class=org.apache.cocoon.components.flow.apples.ApplesProcessor
logger=apples name=apples
  !--
 
load-on-startupresource://org/apache/cocoon/components/flow/javascript
/fom/fom_system.js/load-on-startup
  reload-scriptstrue/reload-scripts
  check-time4000/check-time
  --
  /component-instance

!--. End configuration from 'apples-processor' --#13;
!--. Start configuration from 'javaflow' --#13;

  component-instance
class=org.apache.cocoon.components.flow.java.JavaInterpreter
name=java/
!--. End configuration from 'javaflow' --#13;
/flow-interpreters


Thanks!
Jeff

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



RE: File Update with flowscript

2007-06-13 Thread Schmitz, Jeffrey A
Hello,
  I'm still working on getting a file upload to work using flowscript
per Joerg's Wiki entry:

http://wiki.apache.org/cocoon/FileUploadsWithFlow


But the FileUploadManagerImpl.java code is hanging in:

public void upload(Part source, String destfilename) throws Exception {

And more specifically, on the call to source.getInputStream(). 

Any ideas?  The Part object (source) seems to be coming into the
operation OK as the getFileName() function works correctly on it (it
returns just the name, not the full path), but it just hangs when I try
to get its input stream.

Thanks,
Jeff


-Original Message-
From: Schmitz, Jeffrey A 
Sent: Tuesday, June 12, 2007 12:25 PM
To: 'users@cocoon.apache.org'
Subject: RE: File Update with flowscript

I was able to build it myself from the source, jar it and install it and
that seems to have gotten me past the class not found error.

Jeff 

-Original Message-
From: Schmitz, Jeffrey A
Sent: Tuesday, June 12, 2007 12:08 PM
To: users@cocoon.apache.org
Subject: File Update with flowscript

 Hello,
   I was trying to follow the instructions here:

http://wiki.apache.org/cocoon/FileUploadsWithFlow

But am getting a class not found exception on
org.apache.cocoon.components.upload.FileUploadManagerImpl

I did download and install the referenced cocoon-upload.jar file. 

Any ideas?

Thanks,
Jeff

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


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



RE: File Update with flowscript

2007-06-13 Thread Schmitz, Jeffrey A
Nevermind, it was the max size variable in web.xml.  Docs say default is
10Mb, 

http://wiki.apache.org/cocoon/FileUploadsWithCocoon2.1

but then in the default web.xml file installed with cocoon, it is
actually set to 100k.  That's kind of misleading.

Jeff
 

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Wednesday, June 13, 2007 12:02 PM
To: Schmitz, Jeffrey A; 'users@cocoon.apache.org'
Cc: 'Joerg Heinicke'
Subject: RE: File Update with flowscript

Hello,
  I'm still working on getting a file upload to work using flowscript
per Joerg's Wiki entry:

http://wiki.apache.org/cocoon/FileUploadsWithFlow


But the FileUploadManagerImpl.java code is hanging in:

public void upload(Part source, String destfilename) throws Exception {

And more specifically, on the call to source.getInputStream(). 

Any ideas?  The Part object (source) seems to be coming into the
operation OK as the getFileName() function works correctly on it (it
returns just the name, not the full path), but it just hangs when I try
to get its input stream.

Thanks,
Jeff


-Original Message-
From: Schmitz, Jeffrey A
Sent: Tuesday, June 12, 2007 12:25 PM
To: 'users@cocoon.apache.org'
Subject: RE: File Update with flowscript

I was able to build it myself from the source, jar it and install it and
that seems to have gotten me past the class not found error.

Jeff 

-Original Message-
From: Schmitz, Jeffrey A
Sent: Tuesday, June 12, 2007 12:08 PM
To: users@cocoon.apache.org
Subject: File Update with flowscript

 Hello,
   I was trying to follow the instructions here:

http://wiki.apache.org/cocoon/FileUploadsWithFlow

But am getting a class not found exception on
org.apache.cocoon.components.upload.FileUploadManagerImpl

I did download and install the referenced cocoon-upload.jar file. 

Any ideas?

Thanks,
Jeff

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


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



RE: Flowscript Continuation ID parameter

2007-06-13 Thread Schmitz, Jeffrey A
On this subject, I'm thinking my scheme isn't going to work.  It looks
like it's the call to sendPageAndWait that generates a new
continuationID.  Since I'm using sendPageAndWait to invoke my
non-JXTemplateGenerator sitemap entry, I have no way to access the new
continuation ID from within my javascript before making the
sendPageAndWait call (since the ID doesn't yet exist), and after the
call it's too late since the new ID needs to be part of the input
parameter to the call.  It's a catch-22.  Is this right?  If so, what's
the solution?

Thanks,
Jeff

-Original Message-
From: Joerg Heinicke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 2:07 PM
To: users@cocoon.apache.org
Subject: Re: Flowscript Continuation ID parameter

On 12.06.2007 16:11, Askild Aaberg Olsen wrote:

 Is there anything wrong with this approach (it seems to work)?  Is 
 there a better way?
   
 I guess passing the continuation.id in the URI prevents caching in 
 your pipeline.

Actually you don't want to have that cached anyways since you need the
updated continuation id :)

Joerg

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


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



Flowscript Continuation ID parameter

2007-06-12 Thread Schmitz, Jeffrey A
Hello,
   I see how the continuration ID can be accessed from within a .jx file
as follows:

  form method=post action=${cocoon.continuation.id}.kont

As long as the .jx file is processed by the JXTemplateGenerator, e.g.   

map:match pattern=*.jx
  map:generate type=jx src=documents/{1}.jx/
  map:serialize type=xhtml/
/map:match

However, as part of my page flow I want to invoke an already existing
transform that uses the file generator (not the JXTemplateGenerator),
after which I want to re-enter my flowscript.  My solution is to
manually pass the continuation ID as a parameter (parameter 4) to the
existing sitemap pipeline entry for my current transform as follows:

 var uri = inputType + In/ + inputFile + / + inputType +
In.trans/ + cocoon.continuation.id;
 cocoon.sendPageAndWait(uri);

This URI matches the following, non JXTemplateGenerator pipline, the
fourth parameter being the continuation ID, which in turn is passed into
the xsl/importResult.xsl script:

  map:match pattern=*In/*/*.trans/* 
 map:generate src=inputs/{2}.xml /
 map:transform src=xsl/{1}InAdapter.xsl
 /map:transform
 map:transform src=xsl/updateNeutralRefs.xsl/
 map:transform type=PersistModelTrans
   map:parameter name=saveToFile value=true/
   map:parameter name=saveToDB value=true/
   map:parameter name=dataFormat value=Neutral/
   map:parameter name=passThrough value=false/
 /map:transform
 map:transform src=xsl/importResult.xsl
   map:parameter name=continueID value={4}/
 /map:transform
 map:serialize type=xhtml/
  /map:match

And then I use the continuation ID parameter in the return page xsl
(xsl/importResult.xsl) as follows to create a submit action that will
re-invoke my flowscript from the previous continuation point:

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
version=2.0 
 xsl:param name=continueID/

   form method=post action={$continueID}.kont

Is there anything wrong with this approach (it seems to work)?  Is there
a better way?

Thanks,
Jeff


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



File Update with flowscript

2007-06-12 Thread Schmitz, Jeffrey A
 Hello,
   I was trying to follow the instructions here:

http://wiki.apache.org/cocoon/FileUploadsWithFlow

But am getting a class not found exception on
org.apache.cocoon.components.upload.FileUploadManagerImpl

I did download and install the referenced cocoon-upload.jar file. 

Any ideas?

Thanks,
Jeff

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



RE: File Update with flowscript

2007-06-12 Thread Schmitz, Jeffrey A
I was able to build it myself from the source, jar it and install it and
that seems to have gotten me past the class not found error.

Jeff 

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Tuesday, June 12, 2007 12:08 PM
To: users@cocoon.apache.org
Subject: File Update with flowscript

 Hello,
   I was trying to follow the instructions here:

http://wiki.apache.org/cocoon/FileUploadsWithFlow

But am getting a class not found exception on
org.apache.cocoon.components.upload.FileUploadManagerImpl

I did download and install the referenced cocoon-upload.jar file. 

Any ideas?

Thanks,
Jeff

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


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



Build against Java 6

2007-05-09 Thread Schmitz, Jeffrey A
 Hello,
   I downloaded Cocoon 2.1.10 and tried to build against jdk1.6.0_01 but
get the error below.  Does cocoon not yet work with java 6?  

C:\Program Files\Apache Software
Foundation\cocoon-2.1.10\src\blocks\databases\j
ava\org\apache\cocoon\databases\ibatis\ExcaliburDataSourceFactory.java:8
2: org.a
pache.cocoon.databases.ibatis.ExcaliburDataSourceFactory.DataSourceWrapp
er is no
t abstract and does not override abstract method
isWrapperFor(java.lang.Class?
) in java.sql.Wrapper
protected static final class DataSourceWrapper implements DataSource
{
   ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

BUILD FAILED
C:\Program Files\Apache Software
Foundation\cocoon-2.1.10\tools\targets\compile-
build.xml:263: The following error occurred while executing this line:
C:\Program Files\Apache Software
Foundation\cocoon-2.1.10\build\cocoon\temp\bloc
ks-build.xml:1633: The following error occurred while executing this
line:
C:\Program Files\Apache Software
Foundation\cocoon-2.1.10\build\cocoon\temp\bloc
ks-build.xml:95: Compile failed; see the compiler error output for
details.

Total time: 8 seconds

C:\Program Files\Apache Software Foundation\cocoon-2.1.10

Thanks,
Jeff

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



RE: Build against Java 6

2007-05-09 Thread Schmitz, Jeffrey A
Sorry,
   But I'm unsure of how to use the linked files and where exactly to
put them in my build.  I'm guessing one (the second link) goes under:

{cocoon root}/src/blocks/databases/java/org/apache/databases/ibatis

But where does the other one go (if anywhere)? 

-Original Message-
From: Joerg Heinicke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 09, 2007 2:23 PM
To: users@cocoon.apache.org
Subject: Re: Build against Java 6

On 09.05.2007 20:28, Schmitz, Jeffrey A wrote:

I downloaded Cocoon 2.1.10 and tried to build against jdk1.6.0_01 
 but get the error below.  Does cocoon not yet work with java 6?

Changes have been made [1] but after 2.1.10.

Joerg

[1] http://svn.apache.org/viewvc?view=revrevision=495743
[2] http://svn.apache.org/viewvc?view=revrevision=495744

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


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



RE: XML Transforms and namespaceURI

2007-03-07 Thread Schmitz, Jeffrey A
Nevermind,
   My ultimate problem was I wasn't calling super.setup() in my
transformer's setup method, thus the namespaceURI variable was not
getting initialized (i.e. it was null), and caused a
nullPointerException during translation.

As I struggled a little with this, and I couldn't find a such an example
anywhere, I thought I'd post my simple custom transformer here.  Please
take it with a grain of salt, I'm very new to this, so I'm sure there
are better ways, but this at least seems to work.  Also, the log stuff
isn't required, but nice to have when debugging.  It outputs the log
file to your tomcat (not your cocoon) directory.

And to the experts out there, please let me know of improvements I could
make to this basic setup...

import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.Serializable;
import java.util.Map;
import java.util.Properties;

import java.io.IOException;
import javax.xml.transform.*;
import org.apache.cocoon.caching.CacheableProcessingComponent;
import org.xml.sax.SAXException;

import org.apache.avalon.framework.parameters.Parameters;
import org.apache.excalibur.source.SourceValidity;
import org.apache.excalibur.source.impl.validity.NOPValidity;

import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.xml.*;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.transformation.AbstractSAXTransformer;
import org.apache.cocoon.caching.CacheableProcessingComponent;

public class Simpletrans extends AbstractSAXTransformer implements
CacheableProcessingComponent {

File logFile = new File(Simpletrans.log);

PrintStream log;
Properties format;

public Simpletrans() {
format = new Properties();
format.put(OutputKeys.METHOD, xml);
format.put(OutputKeys.OMIT_XML_DECLARATION, yes);
}

public void setup(SourceResolver resolver, Map objectModel,
String src,
Parameters params) throws ProcessingException,
SAXException,
IOException {
try {
  super.setup(resolver, objectModel, src, params);
FileOutputStream logOut = new
FileOutputStream(logFile);
log = new PrintStream(logOut);
log.println(setup called!!);

} catch (Exception e) {
e.printStackTrace(log);
}
}

public void startDocument() throws SAXException {
log.println(Start Document called!!);
this.startSerializedXMLRecording(format);
}

public void endDocument() throws SAXException {
String content;

log.println(endDocument called!!);
try {
content = this.endSerializedXMLRecording();
} catch (ProcessingException pe) {
throw new SAXException(pe.getMessage());
}

log.println(content);
StringXMLizable xmlStr = new StringXMLizable(content);
xmlStr.toSAX(contentHandler);

}

public String generate(String xmlStr) {

return xmlStr;
}

public Serializable getKey() {
return 1;
}

public SourceValidity getValidity() {
return NOPValidity.SHARED_INSTANCE;
}
}

 

-Original Message-
From: Schmitz, Jeffrey A
Sent: Wednesday, March 07, 2007 10:26 AM
To: users@cocoon.apache.org
Subject: XML Transforms and namespaceURI

This is hopefully a very simple question.  I'm trying to figure out the
whole namespace concept as it applies to a custom transformation.  For
my xml data, I don't use namespaces, and I don't want any filtering on
any namespace, i.e. I want to process all the data in the xml file.  For
this situation, what do I set the namespaceURI string to in my custom
transformer, and what is the best way to set the string? 

Also, what would the format be if I actually want to filter on some
namespace?  I have read the following form the source code, but an
example would be very nice.

* h3Namespace handling/h3
 * By setting the instance variable namespaceURI to the namespace the
 * events are filtered and only events with this namespace are send to
 * the two hooks: codestartTransformingElement/code and
 * codeendTransformingElement/code. It is possible to override the
default
 * namespace for the transformer by specifying the parameter
namespaceURI
 * in the pipeline. This avoids possible namespace collisions.

/**
 * The namespace used by the transformer for the SAX events
filtering.
 * This either equals to the [EMAIL PROTECTED] #defaultNamespaceURI} or to 
the
value
 * set by the codenamespaceURI/code sitemap parameter for the
pipeline.
 * Must never be null.
 */

Thanks,
Jeff

RE: Implementing a series of transformations

2007-03-01 Thread Schmitz, Jeffrey A
Yeah, I think you've hit on the realization I hit on this morning (thus my 
recent posting).  What I really need to implement is a custom tranformer 
instead of a logic sheet.  That's what I'm working on right now.  Any examples 
you could provide?

The xml I'm generating will be fed into an xslt tranform.  And actually, I need 
to feed the result of an xslt transform into my transformer, thus I think 
implementing a custom tranformer (and not a xsp or custom generator) is going 
to be required.  Right?

Thanks,
Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 8:25 AM
To: users@cocoon.apache.org
Subject: Re: Implementing a series of transformations

Schmitz, Jeffrey A napisał(a):
 Hello,
I've been struggling with the following scenario for some time and 
 thought it was time to post.  Basically, I need to be able to perform 
 the following types of translations, in the order specified, all with 
 one pipeline, and I can't figure out how to do it using Cocoon:

 1.  Transform an existing XML File using XSLT 2.  Transform the result 
 of step one using an XSP (i.e. Java code) that produces new XML.
 3.  Transform result of Step 2 using two more XSLT scripts 4.  Use the 
 result of step 3 in another XSP

   
What your XSP pages really perform? I see that you want to use them as 
trasnformers but XSP files can be used in generators. How would you make use of 
xml generated by Cocoon's pipeline in your XML?

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
OK (you asked for it), basically I have some xml that needs to be massaged 
first by a simple xslt before being fed into my transformer, and then once my 
transformer is done, I need to result to be massaged again with another xslt.

My transformer relies on some predefined and specific transformer libraries 
that I have no control over, so the xml has to be massaged to fit into the 
format required by these libraries.  If I can just build a string with the 
incoming xml (from the first xslt), I can then feed this string of xml into the 
custom transform libraries (as long as the xml contained in the string is 
structured correctly). So basically, here is what I need my custom tranformer 
to do:

1. Accept SAX events and build a string of the incoming xml
2. Perform transform on the received xml string
3. Output the resulting xml in the form of more Sax events for the next 
tranformer/serializer in line.  i.e. something like this:

  String message = doMyCustomTransform(incomingXMLString);
  
  //Create a reader for turning a string into an InputSource
  XMLReader xmlreader = XMLReaderFactory.createXMLReader();

  //Set the content handler into the XMLReader class.
  xmlreader.setContentHandler(contentHandler);

  //Now feed the source into the xml reader, which will turn around and
  //invoke the proper handlers in the contentHandler based on the
  //string. 
  InputSource source = new InputSource(new StringReader(message));
  xmlreader.parse(source);


I've pretty much got steps 2 and 3 worked out.  I just need the step 1 part.

Need anymore details?

Thanks,
Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 8:29 AM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
  Is there a simple implementation of a Custom Transformer using 
 AbstractSAXTransformer anywhere?  Would love to see just a Hello World 
 program, but can't seem to find one.
   
The most simple transformer I can think of is StripNamespacesTransformer[1].

It would be much better if you could come up with some details of your own 
transformer you want to write so we could give you some clues.

[1]
https://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/StripNameSpacesTransformer.java?view=markup

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
Thanks!

So something like this (did I get the SaxBuffer stuff right?):

public class Mytrans extends AbstractTransformer implements
CacheableProcessingComponent {

XMLConsumer tempConsumer;
SaxBuffer mySaxConsumer = new SaxBuffer();
String content;

public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters params) throws ProcessingException, 
SAXException,
IOException {

tempConsumer = xmlConsumer;
xmlConsumer = mySaxConsumer;

   }


public void endDocument() throws SAXException {

super.endDocument();
content = mySaxConsumer.toString();
xmlConsumer = tempConsumer;

content = myTransform(content);

StringXMLizable xmlStr = new StringXMLizable(content);

xmlStr.toSAX(contentHandler);
  
}

 }

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 9:22 AM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 OK (you asked for it), basically I have some xml that needs to be massaged 
 first by a simple xslt before being fed into my transformer, and then once my 
 transformer is done, I need to result to be massaged again with another xslt.

 My transformer relies on some predefined and specific transformer libraries 
 that I have no control over, so the xml has to be massaged to fit into the 
 format required by these libraries.  If I can just build a string with the 
 incoming xml (from the first xslt), I can then feed this string of xml into 
 the custom transform libraries (as long as the xml contained in the string is 
 structured correctly). So basically, here is what I need my custom tranformer 
 to do:

 1. Accept SAX events and build a string of the incoming xml 2. Perform 
 transform on the received xml string 3. Output the resulting xml in 
 the form of more Sax events for the next tranformer/serializer in line.  i.e. 
 something like this:

   String message = doMyCustomTransform(incomingXMLString);
   
   //Create a reader for turning a string into an InputSource
   XMLReader xmlreader = XMLReaderFactory.createXMLReader();

   //Set the content handler into the XMLReader class.
   xmlreader.setContentHandler(contentHandler);

   //Now feed the source into the xml reader, which will turn around and
   //invoke the proper handlers in the contentHandler based on the
   //string. 
   InputSource source = new InputSource(new StringReader(message));
   xmlreader.parse(source);
   
I think it's overkill to use reader here. You should use StringXMLizable[1] 
instead. Basically you have to do this:
extend AbstractTransformer and in setup() remember it's current value of 
xmlConsumer and replace by instance of SaxBuffer[2].
SaxBuffer will record all events and you can serialize them into String. 
Do your transformations and create StringXMLizable instance and call toSAX 
method with original xmlConsumer as parameter.
You should do this in overloaded endDocument() methods but do not forget to 
call super method otherwise your SaxBuffer would be incomplete.

Hope that helps.

 I've pretty much got steps 2 and 3 worked out.  I just need the step 1 part.

 Need anymore details?
   
No. I really like answering this kind of questions: precise, showing 
preparation and effort involved before asking for anything.

[1]
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/xml/StringXMLizable.html
[2]
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/xml/SaxBuffer.html

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
Sounds like I'm at least in the ballpark, I'll take a look at setConsumer.

Thanks for your help, would have taken me a LONG time looking all this up.

Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 10:36 AM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 Thanks!

 So something like this (did I get the SaxBuffer stuff right?):

 public class Mytrans extends AbstractTransformer implements
   CacheableProcessingComponent {

 XMLConsumer tempConsumer;
 SaxBuffer mySaxConsumer = new SaxBuffer();
 String content;

 public void setup(SourceResolver resolver, Map objectModel, String src,
   Parameters params) throws ProcessingException, 
 SAXException,
   IOException {

   tempConsumer = xmlConsumer;
   xmlConsumer = mySaxConsumer;

}


   public void endDocument() throws SAXException {
   
   super.endDocument();
   content = mySaxConsumer.toString();
   xmlConsumer = tempConsumer;
   
   content = myTransform(content);
   
   StringXMLizable xmlStr = new StringXMLizable(content);

   xmlStr.toSAX(contentHandler);
 
   }

  }
   
I've never used SaxBuffer so I can't tell you if you use it correctly but I 
believe so. You should set your own consumer calling setConsumer method (take 
look on it to see why).
The rest seems to look ok. The best way is to try it and eventually debug.

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
I think it's pretty close (see below), but I'm getting the following exception 
when running from Tomcat:

java.lang.NoClassDefFoundError: 
org/apache/cocoon/caching/CacheableProcessingComponent

I was going to build and install the latest from Cocoon but I can't because the 
build script doesn't work since my JAVA_HOME variable includes a space 
(C:\Program files...).

So... How can I get the latest Cocoon stuff built and/or where can I get the 
missing class/jar from?

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 10:36 AM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 Thanks!

 So something like this (did I get the SaxBuffer stuff right?):

 public class Mytrans extends AbstractTransformer implements
   CacheableProcessingComponent {

 XMLConsumer tempConsumer;
 SaxBuffer mySaxConsumer = new SaxBuffer();
 String content;

 public void setup(SourceResolver resolver, Map objectModel, String src,
   Parameters params) throws ProcessingException, 
 SAXException,
   IOException {

   tempConsumer = xmlConsumer;
   xmlConsumer = mySaxConsumer;

}


   public void endDocument() throws SAXException {
   
   super.endDocument();
   content = mySaxConsumer.toString();
   xmlConsumer = tempConsumer;
   
   content = myTransform(content);
   
   StringXMLizable xmlStr = new StringXMLizable(content);

   xmlStr.toSAX(contentHandler);
 
   }

  }
   
I've never used SaxBuffer so I can't tell you if you use it correctly but I 
believe so. You should set your own consumer calling setConsumer method (take 
look on it to see why).
The rest seems to look ok. The best way is to try it and eventually debug.

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
Here's what I did to try and run my transformer:

I built and installed my transformer jar into ...\tomcat\common\lib, updated my 
sitemaps and invoked the transformer using my web browser.  When I invoke it, I 
get the undefined class error returned from Tomcat as follows (i.e. this shows 
up in my web browser):

Exception report

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: 
org/apache/cocoon/caching/CacheableProcessingComponent
java.lang.ClassLoader.defineClass1(Native Method) ...


I did try using quotation marks to set JAVA_HOME, but the build script still 
doesn't like it.  I still get the following error back from the build command:

Files\Java\jdk1.5.0_07 was unexpected

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 1:07 PM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 I think it's pretty close (see below), but I'm getting the following 
 exception when running from Tomcat:

 java.lang.NoClassDefFoundError: 
 org/apache/cocoon/caching/CacheableProcessingComponent

 I was going to build and install the latest from Cocoon but I can't because 
 the build script doesn't work since my JAVA_HOME variable includes a space 
 (C:\Program files...).

 So... How can I get the latest Cocoon stuff built and/or where can I get the 
 missing class/jar from?
   
 From description above I do not understand completely what you have done 
leading to this error.

What can I advice to you is enclosing JAVA_HOME path in quotation marks, so it 
should be like this:
JAVA_HOME=C:\Program files\...

doing this always solve my problems related to spaces in paths

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
OK, got the build to work, I was using double quotes.  I'll have to set it up 
and try with my transformer.

Jeff 

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Thursday, March 01, 2007 1:17 PM
To: users@cocoon.apache.org
Subject: RE: Custom Transformer

Here's what I did to try and run my transformer:

I built and installed my transformer jar into ...\tomcat\common\lib, updated my 
sitemaps and invoked the transformer using my web browser.  When I invoke it, I 
get the undefined class error returned from Tomcat as follows (i.e. this shows 
up in my web browser):

Exception report

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: 
org/apache/cocoon/caching/CacheableProcessingComponent
java.lang.ClassLoader.defineClass1(Native Method) ...


I did try using quotation marks to set JAVA_HOME, but the build script still 
doesn't like it.  I still get the following error back from the build command:

Files\Java\jdk1.5.0_07 was unexpected

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 01, 2007 1:07 PM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 I think it's pretty close (see below), but I'm getting the following 
 exception when running from Tomcat:

 java.lang.NoClassDefFoundError: 
 org/apache/cocoon/caching/CacheableProcessingComponent

 I was going to build and install the latest from Cocoon but I can't because 
 the build script doesn't work since my JAVA_HOME variable includes a space 
 (C:\Program files...).

 So... How can I get the latest Cocoon stuff built and/or where can I get the 
 missing class/jar from?
   
 From description above I do not understand completely what you have done 
leading to this error.

What can I advice to you is enclosing JAVA_HOME path in quotation marks, so it 
should be like this:
JAVA_HOME=C:\Program files\...

doing this always solve my problems related to spaces in paths

--
Grzegorz Kossakowski

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


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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
Sorry to be a pain, but the build still isn't working.

What exactly does the JAVA_HOME need to be set to?  I'm setting it to:

'C:\Program Files\Java\jdk1.5.0_07'

But it says it can't find tools.jar, or the javac compiler.  The folder does 
exist, and tools.jar is in JAVA_HOME/lib and javac is in JAVA_HOME/bin 

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 1:07 PM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 I think it's pretty close (see below), but I'm getting the following 
 exception when running from Tomcat:

 java.lang.NoClassDefFoundError: 
 org/apache/cocoon/caching/CacheableProcessingComponent

 I was going to build and install the latest from Cocoon but I can't because 
 the build script doesn't work since my JAVA_HOME variable includes a space 
 (C:\Program files...).

 So... How can I get the latest Cocoon stuff built and/or where can I get the 
 missing class/jar from?
   
 From description above I do not understand completely what you have done 
leading to this error.

What can I advice to you is enclosing JAVA_HOME path in quotation marks, so it 
should be like this:
JAVA_HOME=C:\Program files\...

doing this always solve my problems related to spaces in paths

--
Grzegorz Kossakowski

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


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



RE: Custom Transformer

2007-03-01 Thread Schmitz, Jeffrey A
Thanks,
   I got it working.  Seems Windows doesn't care if you do 

SET JAVA_HOME=c:\path\to\java

from the command line.  It takes whatever you have set JAVA_HOME to in your 
System Control Panel.  In fact, I had to set it in the Control panel, and then 
reboot to get the build script to use the new path.

Someone might want to think about updating the install.txt document, as is, it 
doesn't work as written (at least not for me).  

OK, no I'll see if I can run my new transformer.

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 2:01 PM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 Sorry to be a pain, but the build still isn't working.

 What exactly does the JAVA_HOME need to be set to?  I'm setting it to:

 'C:\Program Files\Java\jdk1.5.0_07'

 But it says it can't find tools.jar, or the javac compiler.  The 
 folder does exist, and tools.jar is in JAVA_HOME/lib and javac is in 
 JAVA_HOME/bin

   
Oups, it always helped me under linux, not windows. I've confused things more 
than needed, sorry.
I've just tried svn checkout of 2.1.x and run:

G:\cocoon-2.1.xecho %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0

G:\cocoon-2.1.xbuild
Buildfile: build.xml

prepare:

 Apache Cocoon 2.1.11-dev [1999-2007] 

 Building with Apache Ant version 1.6.5 compiled on June 2 2005

 Using build file G:\cocoon-2.1.x\build.xml

 Compiler options:
   - debug . [on]
   - optimize .. [on]
   - deprecation ... [off]


compile-core:
Compiling jdk 1.4 core classes

[...]
BUILD SUCCESSFUL
Total time: 2 minutes 41 seconds

So it works as is, without any special adjustments. I cannot help you much with 
this issue as it's tightly related to your environment .
You should have started any work with having Cocoon's build working as it's 
crucial, really.

--
Grzegorz Kossakowski

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


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



org.apache.cocoon.caching is missing from build

2007-03-01 Thread Schmitz, Jeffrey A
I'm still back where I was, tomcat can't find the 
org/apache/cocoon/caching/CacheableProcessingComponent class.

When I look in .../cocoon/WEB-INF/classes/org/apache/cocoon I see several 
packages:

Acting
Components
Faces
Forms
Ojb
Samples

But I don't see caching.  I'm thinking I need this caching package, but I 
don't know where to get it.  I just did a build of cocoon-2.1.10, but it didn't 
show up as part of the build.   Any ideas?

Thanks,
Jeff

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 2:01 PM
To: users@cocoon.apache.org
Subject: Re: Custom Transformer

Schmitz, Jeffrey A napisał(a):
 Sorry to be a pain, but the build still isn't working.

 What exactly does the JAVA_HOME need to be set to?  I'm setting it to:

 'C:\Program Files\Java\jdk1.5.0_07'

 But it says it can't find tools.jar, or the javac compiler.  The 
 folder does exist, and tools.jar is in JAVA_HOME/lib and javac is in 
 JAVA_HOME/bin

   
Oups, it always helped me under linux, not windows. I've confused things more 
than needed, sorry.
I've just tried svn checkout of 2.1.x and run:

G:\cocoon-2.1.xecho %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0

G:\cocoon-2.1.xbuild
Buildfile: build.xml

prepare:

 Apache Cocoon 2.1.11-dev [1999-2007] 

 Building with Apache Ant version 1.6.5 compiled on June 2 2005

 Using build file G:\cocoon-2.1.x\build.xml

 Compiler options:
   - debug . [on]
   - optimize .. [on]
   - deprecation ... [off]


compile-core:
Compiling jdk 1.4 core classes

[...]
BUILD SUCCESSFUL
Total time: 2 minutes 41 seconds

So it works as is, without any special adjustments. I cannot help you much with 
this issue as it's tightly related to your environment .
You should have started any work with having Cocoon's build working as it's 
crucial, really.

--
Grzegorz Kossakowski

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


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



RE: org.apache.cocoon.caching is missing from build

2007-03-01 Thread Schmitz, Jeffrey A
Yes, the src\java\org\apache\cocoon\caching directory is there.  I'll build 
again and lookout for any intermediate errors.

Thanks,
Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 01, 2007 3:08 PM
To: users@cocoon.apache.org
Subject: Re: org.apache.cocoon.caching is missing from build

Schmitz, Jeffrey A napisał(a):
 I'm still back where I was, tomcat can't find the 
 org/apache/cocoon/caching/CacheableProcessingComponent class.

 When I look in .../cocoon/WEB-INF/classes/org/apache/cocoon I see several 
 packages:

 Acting
 Components
 Faces
 Forms
 Ojb
 Samples

 But I don't see caching.  I'm thinking I need this caching package, but I 
 don't know where to get it.  I just did a build of cocoon-2.1.10, but it 
 didn't show up as part of the build.   Any ideas?

   
You should have this directory:
build\cocoon\classes\org\apache\cocoon\caching

but first check if you have this directory:
src\java\org\apache\cocoon\caching

It's really weird. There is no way to exclude this package from the build so I 
assume that your source checkout is somehow broken.

--
Grzegorz Kossakowski

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


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



RE: org.apache.cocoon.caching is missing from build

2007-03-01 Thread Schmitz, Jeffrey A
OK, it built, no errors, but still no caching package.  I downloaded 
cocoon-2.1.10 just a couple days ago.  Perhaps there is a problem with the 
build file? 

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Thursday, March 01, 2007 3:13 PM
To: users@cocoon.apache.org
Subject: RE: org.apache.cocoon.caching is missing from build

Yes, the src\java\org\apache\cocoon\caching directory is there.  I'll build 
again and lookout for any intermediate errors.

Thanks,
Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 01, 2007 3:08 PM
To: users@cocoon.apache.org
Subject: Re: org.apache.cocoon.caching is missing from build

Schmitz, Jeffrey A napisał(a):
 I'm still back where I was, tomcat can't find the 
 org/apache/cocoon/caching/CacheableProcessingComponent class.

 When I look in .../cocoon/WEB-INF/classes/org/apache/cocoon I see several 
 packages:

 Acting
 Components
 Faces
 Forms
 Ojb
 Samples

 But I don't see caching.  I'm thinking I need this caching package, but I 
 don't know where to get it.  I just did a build of cocoon-2.1.10, but it 
 didn't show up as part of the build.   Any ideas?

   
You should have this directory:
build\cocoon\classes\org\apache\cocoon\caching

but first check if you have this directory:
src\java\org\apache\cocoon\caching

It's really weird. There is no way to exclude this package from the build so I 
assume that your source checkout is somehow broken.

--
Grzegorz Kossakowski

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


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


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



RE: Implementing a series of transformations

2007-02-28 Thread Schmitz, Jeffrey A
Thanks Jason,
   One thing I don't quite understand is, I don't see where the actual
xsp/logic sheet would get invoked.  i.e. When I said I need to invoke a
xsp, I really meant I need to invoke the following generator implemented
as a logic sheet library:

   map:generate type=serverpages src=DiagMLImport.xsp 
 map:parameter name=baseFilename value={1}/
   /map:generate 

The real root of my problem is this generator creates, and returns XML,
not sax events, i.e. any subsequent xslt sees lt; and not .

The xsp being invoked (that in turn invokes the logicsheet/java code)
looks as follows:

 xsp:page language=java
xmlns:xsp=http://apache.org/xsp;
xmlns:util=http://apache.org/xsp/util/2.0;
xmlns:DiagML=http://www.boeing.com/IVHM/DiagML;

Model

   DiagML:diagMLImport
 param1get-parameter name=baseFilename default=//param1
   /DiagML:diagMLImport

/Model
/xsp:page

And all the 's and 's between the Model tags turn into lt; and gt;
for the xslt transform.

I REALLY don't want to have to create sax events in my logic sheet, and
can use an intermediate file and reader if need be, but I still can't
seem to get the flow I need using this approach.

Thanks,
Jeff

-Original Message-
From: Jason Johnston [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 9:29 AM
To: users@cocoon.apache.org
Subject: Re: Implementing a series of transformations

Schmitz, Jeffrey A wrote:
 Hello,
I've been struggling with the following scenario for some time and 
 thought it was time to post.  Basically, I need to be able to perform 
 the following types of translations, in the order specified, all with 
 one pipeline, and I can't figure out how to do it using Cocoon:
 
 1.  Transform an existing XML File using XSLT 2.  Transform the result

 of step one using an XSP (i.e. Java code) that produces new XML.
 3.  Transform result of Step 2 using two more XSLT scripts 4.  Use the

 result of step 3 in another XSP

So something like this?

map:match pattern=step1
   map:generate src=xml-file.xml /
   map:transform src=xslt1.xsl /
   map:serialize type=xml /
/map:match

map:match pattern=step2
   map:generate type=xsp src=cocoon:/step1 /
   map:transform src=xslt2.xsl /
   map:transform src=xslt3.xsl /
   map:serialize type=xml /
/map:match

map:match pattern=main-pipeline
   map:generate type=xsp src=cocoon:/step2 /
   ...
/map:match

This should work, but keep in mind that performance will be poor due to
the fact that the 'step2' pipeline is not cacheable, and therefore the
XSP engine cannot cache the precompiled code for the main-pipeline's
XSP.

 
 Any help on the general direction to take (aggregate?, write my own 
 components?, flowscript?, etc.) would be GREATLY appreciated.

As with most things in Cocoon there are more than one way to do it, so
if you wanted to give us more detail about what you're trying to
achieve, we can probably recommend other approaches that may be cleaner
and perform better.

--Jason





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


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



Creating pipeline with aggregate?

2007-02-27 Thread Schmitz, Jeffrey A
 Hello,
I'm trying to create a pipeline with an aggregate, and I must be
doing something wrong in the syntax that I just can't see.  Below are my
sitemap definitions, and when the second map:part isn't specified in the
map:aggregate element, everything works fine, but simply adding the
second part:

   map:part src=cocoon:/ReadDiagMLModel/{1} strip-root=true/

Causes me to get the following error:

   Message: Resource Not Found
   Description: The requested resource /cocoon/owlTrans/DiagMLIn/PV
could not be found
   Sender: org.apache.cocoon.servlet.CocoonServlet
   Source: Cocoon Servlet

Why would adding the second map:part element cause the DiagMLIn/*
resource not to be found at all?

   map:pipeline internal-only=true
 !-- Define parts of aggregate pipeline for importing DiagML Model
--
 map:match pattern=DiagMLImport/* 
   map:generate type=serverpages src=DiagMLImport.xsp 
 map:parameter name=baseFilename value={1}/
   /map:generate
   map:serialize type=xml/
 /map:match
 map:match pattern=ReadDiagMLModel/*
   map:generate src=../../../NewModel.owl/
  /map:match
   /map:pipeline
   
   map:pipeline type=noncaching
 map:match pattern=DiagMLIn/*
   map:aggregate element=model
 map:part src=cocoon:/DiagMLImport/{1}/
 map:part src=cocoon:/ReadDiagMLModel/{1}/
   /map:aggregate
   map:transform src=processbNodes.xsl/
   map:transform src=updateRefs.xsl/
   map:serialize type=xml/
 /map:match
   /map:pipeline


 When like below it works fine -

   map:pipeline type=noncaching
 map:match pattern=DiagMLIn/*
   map:aggregate element=model
 map:part src=cocoon:/DiagMLImport/{1}/
   /map:aggregate
   map:transform src=processbNodes.xsl/
   map:transform src=updateRefs.xsl/
   map:serialize type=xml/
 /map:match
   /map:pipeline

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



RE: Creating pipeline with aggregate?

2007-02-27 Thread Schmitz, Jeffrey A
THANK YOU, One of those cases where I could have looked at it all day and not 
seen it.

Jeff 

-Original Message-
From: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 27, 2007 11:10 AM
To: users@cocoon.apache.org
Subject: Re: Creating pipeline with aggregate?

Schmitz, Jeffrey A napisał(a):
  Hello,
 I'm trying to create a pipeline with an aggregate, and I must be 
 doing something wrong in the syntax that I just can't see.  Below are 
 my sitemap definitions, and when the second map:part isn't specified 
 in the map:aggregate element, everything works fine, but simply adding 
 the second part:

map:part src=cocoon:/ReadDiagMLModel/{1} strip-root=true/

 Causes me to get the following error:

Message: Resource Not Found
Description: The requested resource /cocoon/owlTrans/DiagMLIn/PV
 could not be found
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet

 Why would adding the second map:part element cause the DiagMLIn/*
 resource not to be found at all?

  map:match pattern=ReadDiagMLModel/*
map:generate src=../../../NewModel.owl/
   /map:match
Does missing serializer confuses the Cocoon badly? :)

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


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



Installing

2007-02-27 Thread Schmitz, Jeffrey A
 OK, I tried following the Don't worry - this is really easy if you
follow the instructions in the INSTALL.txt file  (see below) process to
build the latest version of Cocoon on Windows XP.  However, when I get
to step three below, I don't know where to execute the build command
from.  I tried from the cocoon directory, but just get an unrecognized
command error.  What do I need to do to build Cocoon?

Thanks,
Jeff

 1) Unpack the distribution

  Obviously you've done this already, but if you got errors when
unpacking
  the archive with tar, you might need to use gnutar instead. Our
archives
  contain long paths and filenames which cause problems with some
versions
  of the tar command.
 
 2) Set your JAVA_HOME environment
  
  You have to set your JAVA_HOME environment to point to the root
directory of
  the Java Virtual Machine (JDK 1.3.x or later) installed on your
machine. 

  To do this simply type:
  
[unix] JAVA_HOME=/path/to/java/
[win32] SET JAVA_HOME=c:\path\to\java

  your mileage may vary depending on your shell, but you know how to
setup 
  environments, right?

  If you're using JDK 1.3.x, you have to exclude the JCR block before
building
  Cocoon. Have a look at the Choosing the blocks section below on how
to
  exculude a block. Please note that some samples require JDK 1.4 or
above.

 3) Build Cocoon by typing build or ./build.sh

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



RE: Installing

2007-02-27 Thread Schmitz, Jeffrey A
OK, I got past that problem, but now it doesn't like the space in my
JAVA_HOME environment variable path(C:\Program Files\Java\jdk1.5.0_07).
How can I get around this?

Thanks,
Jeff 

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Tuesday, February 27, 2007 4:28 PM
To: users@cocoon.apache.org
Subject: Installing

 OK, I tried following the Don't worry - this is really easy if you
follow the instructions in the INSTALL.txt file  (see below) process to
build the latest version of Cocoon on Windows XP.  However, when I get
to step three below, I don't know where to execute the build command
from.  I tried from the cocoon directory, but just get an unrecognized
command error.  What do I need to do to build Cocoon?

Thanks,
Jeff

 1) Unpack the distribution

  Obviously you've done this already, but if you got errors when
unpacking
  the archive with tar, you might need to use gnutar instead. Our
archives
  contain long paths and filenames which cause problems with some
versions
  of the tar command.
 
 2) Set your JAVA_HOME environment
  
  You have to set your JAVA_HOME environment to point to the root
directory of
  the Java Virtual Machine (JDK 1.3.x or later) installed on your
machine. 

  To do this simply type:
  
[unix] JAVA_HOME=/path/to/java/
[win32] SET JAVA_HOME=c:\path\to\java

  your mileage may vary depending on your shell, but you know how to
setup
  environments, right?

  If you're using JDK 1.3.x, you have to exclude the JCR block before
building
  Cocoon. Have a look at the Choosing the blocks section below on how
to
  exculude a block. Please note that some samples require JDK 1.4 or
above.

 3) Build Cocoon by typing build or ./build.sh

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


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



RE: Xsp logicsheet method invocation

2007-02-06 Thread Schmitz, Jeffrey A
Ok, let me try to phrase it simpler.

My logicsheet function which serves as my generator produces (and
returns) an xml string.  Why, before it gets passed to my xsl
transformer are all the angle brackets converted to lt; and gt;, and
is there a way to stop this behavior? 

I've searched for an answer and read through all the xsp/logicsheet
stuff and don't see this described anywhere.

Thanks,
Jeff

-Original Message-
From: Schmitz, Jeffrey A 
Sent: Monday, February 05, 2007 3:12 PM
To: users@cocoon.apache.org
Subject: RE: Xsp logicsheet method invocation

In a related question, my java code is generating XML code to return to
the cocoon pipeline via the xsp generator.  However, somewhere along the
way all the angle brackets are getting converted into lt; and gt;,
before getting sent to my xsl transformer.  Is there a way to make
cocoon NOT do this conversion on my generator output so that my xsl
transform will properly transform the code?

Thanks
Jeff 

-Original Message-
From: Schmitz, Jeffrey A
Sent: Monday, February 05, 2007 1:49 PM
To: users@cocoon.apache.org
Subject: Xsp logicsheet method invocation

Hello,
   I'm trying use and xsp generator that uses a logic sheet, and I'm
almost there, but there's something I don't understand.  For some
reason, in my logicsheet xsl file, I have to put xml tags around my java
function invocation, otherwise, when I try to invoke the associated
sitemap pipeline, cocoon returns immediately with no data, without ever
invoking my function.  

Here's what I have to make my logicsheet xsl look like in order to get
it to run:

xsl:template match=MyTag:runFunc
junkTag
xsp:exprrunfunc()/xsp:expr
/junkTag
/xsl:template

However, I don't want the junkTags returned as I don't want to process
them in my xml transform.  I'd rather be able to just do:

xsl:template match=MyTag:runFunc
xsp:exprrunfunc()/xsp:expr
/xsl:template

Here is the xsp file that references the logicsheet xsl.
 xsp:page language=java
xmlns:xsp=http://apache.org/xsp;
xmlns:util=http://apache.org/xsp/util/2.0;
xmlns:DiagML=http://www.boeing.com/MyTag;
   MyTag:runFunc
   /MyTag:runFunc
/xsp:page

Again, it works fine as long as I have the junkTag's, so I must have
everything configured ok for the logicsheet.

Thanks,
jeff

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


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


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



RE: Xsp logicsheet method invocation

2007-02-06 Thread Schmitz, Jeffrey A
Thanks,
   That seems like a lot of work since I already have a nice java
utility that I was hoping to use as my generator to create xml from
database data.  How is something like this usually done with Cocoon?
i.e. My generator already produces regular xml which I'd like to feed to
an xsl stylsheet.  I guess I could do it using files instead of trying
to pass it directly from generator to transformer, but that seems kind
of kludgy.

Jeff 

-Original Message-
From: Tobia [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 06, 2007 8:35 AM
To: users@cocoon.apache.org
Subject: Re: Xsp logicsheet method invocation

Schmitz, Jeffrey A wrote:
 My logicsheet function which serves as my generator produces (and
 returns) an xml string.  Why, before it gets passed to my xsl 
 transformer are all the angle brackets converted to lt; and gt;, and

 is there a way to stop this behavior?

Because your xml string is just a text node (a string) inside the xml
document you're generating.  You cannot write literal  and  in xml
text nodes, because they delimit tags, so Cocoon escapes them for you.

The only reason you would need to output literal  and  is to create
output elements, but that is done with xsp:element and
xsp:attribute.  
See the samples in src/blocks/xsp/samples/java/

  xsp:element
xsp:param
name=namexsp:exprP.toLowerCase()/xsp:expr/xsp:param
xsp:attribute name=alignleft/xsp:attribute
Hello
  /xsp:element

generates:

  p align=leftHello/p
  

Tobia

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


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



Xsp logicsheet method invocation

2007-02-05 Thread Schmitz, Jeffrey A
Hello,
   I'm trying use and xsp generator that uses a logic sheet, and I'm
almost there, but there's something I don't understand.  For some
reason, in my logicsheet xsl file, I have to put xml tags around my java
function invocation, otherwise, when I try to invoke the associated
sitemap pipeline, cocoon returns immediately with no data, without ever
invoking my function.  

Here's what I have to make my logicsheet xsl look like in order to get
it to run:

xsl:template match=MyTag:runFunc
junkTag
xsp:exprrunfunc()/xsp:expr
/junkTag
/xsl:template

However, I don't want the junkTags returned as I don't want to process
them in my xml transform.  I'd rather be able to just do:

xsl:template match=MyTag:runFunc
xsp:exprrunfunc()/xsp:expr
/xsl:template

Here is the xsp file that references the logicsheet xsl.
 xsp:page language=java
xmlns:xsp=http://apache.org/xsp;
xmlns:util=http://apache.org/xsp/util/2.0;
xmlns:DiagML=http://www.boeing.com/MyTag;
   MyTag:runFunc
   /MyTag:runFunc
/xsp:page

Again, it works fine as long as I have the junkTag's, so I must have
everything configured ok for the logicsheet.

Thanks,
jeff

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