Re: Batch processing of XML documents

2007-05-28 Thread Derek Hohls
Aseem
 
If all you need to do is process a bunch of XML files to create HTML,
then a simple scripting approach, possibly mixed with XSLT, would
do the job.  Cocoon is primarily used for dynamic generation of 
pages.
 
>>> "Aseem Monga" <[EMAIL PROTECTED]> 2007/05/29 07:24:55 AM
>>>

 Hi, I am a novice in cocoon. We have to develop an offline batch
process for generating html pages statically, For this we are evaluating
if we can use cocoon.  Question 1: Should we wait for cocoon 2.2, which
the list says is coming soon. When exactly is it expected? The data is
in XML format in a client proprietary DTD. We would need to process a
group of XMLs. From what I know is that only a single document is
processed in pipelines. Question2: How can a pipeline be executed in a
loop for source XML documents in a folder, so all the input XMLs can be
processed in the pipeline defined, one after another. Thanks in advance.
Aseem MongaSenior Software Engineer,HCL Technologies Ltd,STP-II,
Infocity, Sec-34,Gurgaon, HR. IndiaMail: [EMAIL PROTECTED]  


-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.



Re: Cocoon Productivity

2007-05-28 Thread Reinhard Poetz

Niels van Kampenhout wrote:

Reinhard Poetz wrote:





Of course all the software engineering principles apply as much to
Cocoon applications as to any other, but most people find it difficult
to abstract away from the "traditional" frameworks for which they
learned their patterns, and apply their knowledge to Cocoon. And that's
no surprise, because Cocoon is so big, you can do so much with it, and
you can do it in so many ways. There are some best practices that are
known in the community, about which we speak at the GetTogether, but
that's pretty much it. You really have to learn everything about Cocoon
from the bottom up to find out how a particular type of application is
best set up in Cocoon. Getting up and running with your first Cocoon
project, and this is why this discussion started, is therefor really
difficult. Even the best documentation about how sitemaps and pipelines 
work will not solve this!


I have been working on 
http://cocoon.zones.apache.org/daisy/cdocs/g2/g1/1370.html. I hope that it helps.



What really works in my experience is turning the learning curve upside
down and providing people with patterns and components that simply work, 
and work transparently, so that at first they don't have to think about 
it. For example, Ard put a lot of work in making a website skeleton 
generator, which basically does that whole first step of deciding how to 
set up the application for you. The generated skeleton is preconfigured 
with subsitemaps, caching and everything, and it contains many little 
components that do things like paging of lists, mounting subsitemaps 
based on our specific navigation concept, etc. This skeleton generator 
meant a giant leap in productivity for our implementation partners. 
Getting up and running is no longer a problem, and through the pre set 
up skeleton the developers seem to get better at working with the Cocoon 
concepts much faster. At some point they might even discover that things 
could be done in a better way than in the skeleton!


could be a great enhancement for the Cocoon Maven 2 plugin

Of course we have our very specific use case of a web site presenting 
content from a certain CMS/Repository and our patterns may not work for 
other situations, but what I am trying to say is that in my opinion the 
missing link between Cocoon as a brilliant framework and Cocoon as a 
widely accepted framework is the lack of a mapping between the bare 
concepts and actual real-life application development.


Filling this gap is of course more difficult for Cocoon than for web 
sites based on a specific CMS, but a first step could be describing how 
some common use cases (there's a user list out there == use cases!) 
could be implemented with Cocoon, or even better, providing reference 
implementations that go much further than the current samples. In my 
dream I even see a wizard through which one can generate a preconfigured 
application skeleton for a number of different cases. These things exist 
for other frameworks you know!


(Blocks and Maven 2 archetypes might be a small first step towards this 
dream, I don't know, I haven't been able to check it out yet.)


The archetypes yes but blocks solve a different but somehow related problem.

Anyway, these are just my 2 cents (needed a lot of words for those 2 
cents though), I hope it is a useful contribution to this discussion. :-)


Thanks Niels. What I learn from your response is that it would be great to have 
an equivalent to the RoR scaffolding command. What skeleton apps would you like 
to generate?



--
Reinhard Pötz   Independent Consultant, Trainer & (IT)-Coach 


{Software Engineering, Open Source, Web Applications, Apache Cocoon}

   web(log): http://www.poetz.cc


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



Batch processing of XML documents

2007-05-28 Thread Aseem Monga
 

Hi, I am a novice in cocoon. We have to develop an offline batch process for
generating html pages statically, For this we are evaluating if we can use
cocoon. 

 

Question 1: Should we wait for cocoon 2.2, which the list says is coming
soon. When exactly is it expected?

 

The data is in XML format in a client proprietary DTD. We would need to
process a group of XMLs. From what I know is that only a single document is
processed in pipelines.

 

Question2: How can a pipeline be executed in a loop for source XML documents
in a folder, so all the input XMLs can be processed in the pipeline defined,
one after another.

 

Thanks in advance.

 

Aseem Monga

Senior Software Engineer,

HCL Technologies Ltd,

STP-II, Infocity, Sec-34,

Gurgaon, HR. India

Mail:   [EMAIL PROTECTED]

 

 



Re: Cocoon / Hibernate revisited

2007-05-28 Thread Tricia Williams

Hi Johannes,

   Thanks for your work on this!  I'm currently in the process of setting 
up hibernate 3 with cocoon 2.1.10 and have been back and forth between the 
the tutorials (simple application) at 
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#tutorial-firstapp 
and http://wiki.apache.org/cocoon/CocoonAndHibernateTutorial.


   I can see that the first part of your re-write merges the setup that 
hibernate instructs (use of the hibernate.cfg.xml) and Util class to 
manage the session.  I haven't gone all the way through the tutorial but I 
thought I'd mention that there is an error in the _Installing the filter_ 
section.  the org.test.HibernateFilter should
become 
org.apache.cocoon.hibernate.OpenSessionInViewFilter 
in the new tutorial (I think).


   What is the advantage of using a DAO?

Tricia

On Mon, 28 May 2007, Johannes Textor wrote:


Hello,

following an inspiring discussion with Fabrizio here on the User's list, I 
reworked the Cocoon and Hibernate tutorial and the underlying "glue" classes. 
The solution is now free of major architectural sins (as far as I can say) 
and allows a "clean" implementation of DAOs. No more opening sessions in 
flowscript (although you're free to do that if you want to). However, it is 
based on 2.1.10, as I'm still lacking the necessary knowledge to see if this 
is even necessary in 2.2.


I encourage everyone who uses the approach described in the old version to 
check out and test the new one, and bug me or this list with questions, 
problems and feedback :)


Cheers,
Johannes

P.S. Fabrizio, I think it should be easy to extend the presented pattern to 
your need of "long conversations". Would be nice to have that also 



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



Cocoon / Hibernate revisited

2007-05-28 Thread Johannes Textor

Hello,

following an inspiring discussion with Fabrizio here on the User's list, 
I reworked the Cocoon and Hibernate tutorial and the underlying "glue" 
classes. The solution is now free of major architectural sins (as far as 
I can say) and allows a "clean" implementation of DAOs. No more opening 
sessions in flowscript (although you're free to do that if you want to). 
However, it is based on 2.1.10, as I'm still lacking the necessary 
knowledge to see if this is even necessary in 2.2.


I encourage everyone who uses the approach described in the old version 
to check out and test the new one, and bug me or this list with 
questions, problems and feedback :)


Cheers,
Johannes

P.S. Fabrizio, I think it should be easy to extend the presented pattern 
to your need of "long conversations". Would be nice to have that also 



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



Custom Cocoon 2.2 projects: Alternatives to Maven 2

2007-05-28 Thread Reinhard Poetz


I've started with a prototyp of a non-Maven Cocoon 2.2 archetype. It should be 
useful to people that want to avoid Maven 2 as build system for their Cocoon 
based projects. The mail below that I sent to the users lists explains in more 
detail how this prototyp is supposed to work.


Feedback would be much appreciated.


Reinhard Poetz wrote:

Carsten Ziegeler wrote:
If someone can document the steps (which we should do anyway) I can 
try and come up with the ant script.


I've started with a prototyp of a non-Maven Cocoon 2.2 archetype. You 
can download it from 
http://people.apache.org/~reinhard/cocoon-22-bootstrap.zip.


It contains a build.xml that has two targets:

 - webapp
   Build a web application
 - run
   Starts the webapp using Jetty

Some words to the directory structure:

[root]
 +-src
 |  +-webapp The Cocoon web application
 |  +-block1 A Cocoon demo block
 +-lib   All required libraries and Cocoon blocks
 +-jetty Minimum files to run a Jetty 6.1.3 instance
 +-build.xml The Ant build script

The Ant build is only a starting point but it shows how things are 
supposed to work together. It works well for me but it misses two 
important things in order to be useful for others:


1) make it simple to add just another _own_ block
   (adding a third-party block only means copying the libs into ./lib)

2) create a properties file that configures all servlet services to use the
   src/block1/src/main/resources/COB-INF files as block contexts

   Having this feature allows working on the sources with support for
   hot reload.

I think the build script shouldn't do much more because if people prefer 
to use Ant, they have their own way of building/deploying their Java 
applications anyway. Using this build script as template for that 
purpose, should give them a enough ideas to integrate it into their own 
build and deployment architectures.



--
Reinhard Pötz   Independent Consultant, Trainer & (IT)-Coach 


{Software Engineering, Open Source, Web Applications, Apache Cocoon}

   web(log): http://www.poetz.cc


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



RE: unpack/unizp a complete zip file?

2007-05-28 Thread Geert Josten
Hi,

It was a rather short and quick answer, but yes, depending on the
component that extracts the files and writes them, it is in principle
possible to extract all types of files. SourceWriting component however
uses XML/DOM as intermediate, so that component is unuseable as it is.
(At least how it was around versions 2.1.4 - 2.1.6..)

The SaveFiles transformer however is exactly written for this task. It
doesn't cache anything, it redirect an inputstream to an outputstream
internally and is therefore capable of handling binary. Only the outcome
(fail or success) is passed to cocoon as xml. More about it on wiki:
http://wiki.apache.org/cocoon/SaveFilesTransformer

My zipsource produces on long xml with the full contents. One xsl pass
converts this to savefiles instruction sheet, just a long list of
save:file elements with a src and a target attribute. These can be
processed in a single pass with the transformer. The end result of this
transform can be used to produce a fail/success report.

One final note on Cocoon Actions, the alternative on which Joerg
Heinicke responded:
be aware of the moment on which actions are executed. Regardless of
where they are called within a request-chain, they are always executed
_before_ the actual processing in a pipeline. This is only important if
you intend to process the files with the same request that also extracts
the files. It might be very useful, but can be a bottle-neck just as
easily.

Kind regards,
Geert

> -Original Message-
> From: HGENTO [mailto:[EMAIL PROTECTED] 
> Sent: vrijdag 25 mei 2007 15:59
> To: users@cocoon.apache.org
> Subject: Re: unpack/unizp a complete zip file?
> 
> Thank you for your answer ,
> 
> but I'm a little bit confused, would this methode also work, 
> if the zip file contains not only xml-files but also 
> pictures. For example ein Open Document Writer file. I would 
> like to have a methode where I can unpack the full odt files.
> 
> Best regards,
> H.
> 
> Geert Josten wrote:
> > Hi,
> >
> > I extended the ZipSource component to accept zip-protocol patterns 
> > without the addition of special files. But the Source is 
> supposed to 
> > produce content and you cannot produce the literal zip 
> contents, so I 
> > chose to produce a dir-listing of the zip. I use that to 
> generate new 
> > zip-url's that exhaustingly point to all files inside zip. 
> Processing 
> > that list with a component like savefiles or writesource 
> should result 
> > in extraction of a complete zip.
> >
> > HTH,
> > Geert
> >
> >   
> >
> >  
> > Drs. G.P.H. Josten
> > Consultant
> >  
> >  
> >
> > Daidalos BV
> > Source of Innovation
> > Hoekeindsehof 1-4
> > 2665  JZ  Bleiswijk
> > Tel.: +31 (0) 10 850 1200
> > Fax: +31 (0) 10 850 1199
> > www.daidalos.nl
> > KvK 27164984
> >
> >
> > De informatie - verzonden in of met dit emailbericht - is 
> afkomstig van Daidalos BV en is uitsluitend bestemd voor de 
> geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, 
> verzoeken wij u het te verwijderen. Aan dit bericht kunnen 
> geen rechten worden ontleend.
> >  
> >
> >   
> >> From: HGENTO [mailto:[EMAIL PROTECTED]
> >> Sent: vrijdag 25 mei 2007 13:52
> >> To: users@cocoon.apache.org
> >> Subject: unpack/unizp a complete zip file?
> >>
> >> Hi,
> >>
> >> how can I unzip a zip file with an sitemap instruction. I 
> have access 
> >> to a special file with zip:/file.zip!/file.xml but I would like to 
> >> have an instruction to unzip the complete file.zip. Is 
> there a easy 
> >> way to do so in Cocoon 2.1.? I did't found a answer on 
> wiki as well 
> >> as apache cocoon homepage.
> >>
> >> Regards,
> >> Holger
> >>
> >> 
> -
> >> 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]
> 
> 

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



Multi-value field AJAX example?

2007-05-28 Thread Derek Hohls
The samples shipped with Cocoon have a sample
for how to embed Javascript in a form, to update
a form dynamically, based on the selection made
in a drop down list.
 
Does anyone know of a similar example, but working
with a multivalued fields (where a user can make 
multiple selections) - so that a second widget can
be updated by processing (iterating) multiple selections
from a first widget?
 
Code snippets would be welcome!
 
Thanks
Derek

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


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



Re: xml parsing

2007-05-28 Thread Joerg Heinicke

On 25.05.2007 08:49, Varga Zsombor wrote:


Ther is an URL wich provide me an xml. Some data from this xml i have
to load into a database. Can i somehow do this with cocoon or i have
to write a Java program, which will parse the xml and load the data
into the database?


Hi Varga,

there is a proxy block. With its generators (e.g. 
WebServiceProxyGenerator [1]) you can get the XML from the URL. In 
simple cases (GET) it also works with the plain FileGenerator [2].


Writing into the database can happen with the SQLTransformer [3].

Regards,
Joerg

[1] http://cocoon.apache.org/2.1/userdocs/wsproxy-generator.html
[2] http://cocoon.apache.org/2.1/userdocs/default/file-generator.html
[3] http://cocoon.apache.org/2.1/userdocs/sql-transformer.html

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



Re: Cocoon Productivity

2007-05-28 Thread Derek Hohls
Niels
 
You say:

" For example, Ard put a lot of work in making a website skeleton 
generator, which basically does that whole first step of deciding how
to 
set up the application for you. The generated skeleton is preconfigured

with subsitemaps, caching and everything, and it contains many little 
components that do things like paging of lists, mounting subsitemaps 
based on our specific navigation concept, etc. This skeleton generator

meant a giant leap in productivity for our implementation partners. 
Getting up and running is no longer a problem, and through the pre set

up skeleton the developers seem to get better at working with the
Cocoon 
concepts much faster. At some point they might even discover that
things 
could be done in a better way than in the skeleton!"
 
Is there anyway you would consider making this generator - well
documented, of course :-) - available to the community?   It might
inspire
some of us to adopt a similar approach and, who knows, may lead to a
whole, new, better way of doing things.  It seems most people agree
that
getting started with Cocoon is a big leap and, while I do not agree
that 
you need to know *everything* before you start (not for simpler use 
cases, anyway), anything that maximisers the ability to get going
"straight
out of  the box" is surely of great help?

Cheers
Derek

(Who is now wondering how he can do something similar for his 
"simple" flow-based database app...)

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


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