You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carlos Tejo Alonso <ca...@fundacionctic.org> on 2009/01/13 09:54:41 UTC

[Documentation] Develop a Generator

Hello,

I was looking for documentacion about "how to develop a Generator" and
"how to develop a serializer". This is the last documentation that I
have found:  [1] and [2].

Is this documentation the properly one to create generators for
Cocoon-3? 

Regards,

Carlos Tejo Alonso
R&D and Innovation Department
CTIC Foundation [Asturias, Spain]
www.fundacionctic.org


[1] http://cocoon.apache.org/2.2/core-modules/core/2.2/688_1_1.html
[2] http://cocoon.apache.org/2.2/core-modules/core/2.2/725_1_1.html

Re: [Documentation] Develop a Generator

Posted by Simone Gianni <si...@apache.org>.
Hi Carlos and Steven,
Carlos, if you decide to go thru the process of trying to write a 
generator or serializer for Cocoon 3, I'm pretty sure that writing a 
wiki page on how to do it would be a very welcome contribution!

Simone

Steven Dolg wrote:
> Carlos Tejo Alonso schrieb:
>> Hello,
>>   
> Hello,
>> I was looking for documentacion about "how to develop a Generator" and
>> "how to develop a serializer". This is the last documentation that I
>> have found:  [1] and [2].
>>
>> Is this documentation the properly one to create generators for
>> Cocoon-3?   
> The documentation mentioned is specific for Cocoon 2.2.
>
> Unfortunately we have very little documentation for Cocoon 3 as of 
> this time and none of that contains anything about writing custom 
> generators or serializers, I'm afraid.
> So at this moment I can only suggest to have a look at the generators 
> and serializers already available and come back with specific questions.
> The module "cocoon-optional" contains some custom generators and 
> serializers contributed recently by Simone Tripodi - they all are 
> compatible with the other SAX components from Cocoon 3.
> So this may be a good starting point (I assume you intend to build 
> generators/serializers for XML processed with SAX).
>
>
> I am willing to offer as much assistance as my time schedule allows 
> and answer any question that may arise.
> I am sorry for this inconvenience and hope this is sufficient support 
> for you...
>
> Regards,
>
> Steven
>> Regards,
>>
>> Carlos Tejo Alonso
>> R&D and Innovation Department
>> CTIC Foundation [Asturias, Spain]
>> www.fundacionctic.org
>>
>>
>> [1] http://cocoon.apache.org/2.2/core-modules/core/2.2/688_1_1.html
>> [2] http://cocoon.apache.org/2.2/core-modules/core/2.2/725_1_1.html
>>
>>   
>


-- 
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/


Re: [Documentation] Develop a Generator

Posted by Steven Dolg <st...@indoqa.com>.
Carlos Tejo Alonso schrieb:
> [Sorry for the last empty email.]
>
> Hello,
>
>   
>>> I was looking for documentacion about "how to develop a 
>>>       
>> Generator" and
>>     
>>> "how to develop a serializer". This is the last documentation that I
>>> have found:  [1] and [2].
>>>
>>> Is this documentation the properly one to create generators for
>>> Cocoon-3? 
>>>   
>>>       
>> The documentation mentioned is specific for Cocoon 2.2.
>>     
>
> :-(
>  
>   
>> Unfortunately we have very little documentation for Cocoon 3 
>> as of this 
>> time and none of that contains anything about writing custom 
>> generators 
>> or serializers, I'm afraid.
>> So at this moment I can only suggest to have a look at the generators 
>> and serializers already available and come back with specific 
>> questions.
>>     
>
>   
>> The module "cocoon-optional" contains some custom generators and 
>> serializers contributed recently by Simone Tripodi - they all are 
>> compatible with the other SAX components from Cocoon 3.
>> So this may be a good starting point (I assume you intend to build 
>> generators/serializers for XML processed with SAX).
>>     
>
> That's the situation:
>
> I want to extract information using different "ways" (http, svn, cvs).
> This information is encoded using different formats (xml, .odt). The
> result of the generator or the generator+transformer should be the same
> information in an intermediate format.
> I would like to know if I have to develop a generator for the "way" and
> a transformer to the intermediate format or I just need to develop a
> transformer.
>
>   
The SAX generators currently available in Cocoon 3 retrieve data using 
URLs and connections opened on those URLs.
In most cases this mechanism allows to uniformly access different input 
sources as the protocol handling deals with the actuals transport 
mechanisms.
So reading directly from file:// or from http://... makes no difference 
to the generator.
As long as your protocol is already covered by the runtime, you should 
be fine (svn://... will require an additional library or 
URLStreamHandler implementation).

The other point is the actual format.
The SAX generators actually expect XML and cannot process .odt or .csv 
files directly.
That would require a new generator no matter which protocol is used to 
retrieve the data.

The general assumption is that a generator delivers the content of the 
source as is and that transformers perform the necessary changes.
However no one keeps you from creating a generator that produces the 
correct XML from the CSV directly.


To summarize my suggestion:
* If you can handle all required protocols with the URL resolution of 
Java, you don't need to care about the actual protocol.
* Produce a generator for each format you need to process: .odt, .csv; 
XML is already available
* Use either an existing Transformer (e.g. XSLTTransformer) or create a 
specialized transformer that handles the conversion to your intermediate 
format.

If you intent to do the transformation with a specialized transformer, 
StAX might be an interesting alternative as modifying the XML data is 
usually less complicated (but a bit slower than SAX)
Please keep in mind that the StAX components are pretty new and probably 
still need some refinement - they haven't seen as much action as their 
SAX counterparts... ;-)


Regards,
Steven

>> I am willing to offer as much assistance as my time schedule 
>> allows and 
>> answer any question that may arise.
>>     
>
> Thanks!
>
> Regards,
>
> Carlos Tejo
>
>   


RE: [Documentation] Develop a Generator

Posted by Carlos Tejo Alonso <ca...@fundacionctic.org>.
[Sorry for the last empty email.]

Hello,

> > I was looking for documentacion about "how to develop a 
> Generator" and
> > "how to develop a serializer". This is the last documentation that I
> > have found:  [1] and [2].
> >
> > Is this documentation the properly one to create generators for
> > Cocoon-3? 
> >   
> The documentation mentioned is specific for Cocoon 2.2.

:-(
 
> Unfortunately we have very little documentation for Cocoon 3 
> as of this 
> time and none of that contains anything about writing custom 
> generators 
> or serializers, I'm afraid.
> So at this moment I can only suggest to have a look at the generators 
> and serializers already available and come back with specific 
> questions.

> The module "cocoon-optional" contains some custom generators and 
> serializers contributed recently by Simone Tripodi - they all are 
> compatible with the other SAX components from Cocoon 3.
> So this may be a good starting point (I assume you intend to build 
> generators/serializers for XML processed with SAX).

That's the situation:

I want to extract information using different "ways" (http, svn, cvs).
This information is encoded using different formats (xml, .odt). The
result of the generator or the generator+transformer should be the same
information in an intermediate format.
I would like to know if I have to develop a generator for the "way" and
a transformer to the intermediate format or I just need to develop a
transformer.

> I am willing to offer as much assistance as my time schedule 
> allows and 
> answer any question that may arise.

Thanks!

Regards,

Carlos Tejo

RE: [Documentation] Develop a Generator

Posted by Carlos Tejo Alonso <ca...@fundacionctic.org>.
Hello,



> -----Original Message-----
> From: Steven Dolg [mailto:steven.dolg@indoqa.com] 
> Sent: Tuesday, January 13, 2009 5:11 PM
> To: dev@cocoon.apache.org
> Subject: Re: [Documentation] Develop a Generator
> 
> Carlos Tejo Alonso schrieb:
> > Hello,
> >   
> Hello,
> > I was looking for documentacion about "how to develop a 
> Generator" and
> > "how to develop a serializer". This is the last documentation that I
> > have found:  [1] and [2].
> >
> > Is this documentation the properly one to create generators for
> > Cocoon-3? 
> >   
> The documentation mentioned is specific for Cocoon 2.2.
> 
> Unfortunately we have very little documentation for Cocoon 3 
> as of this 
> time and none of that contains anything about writing custom 
> generators 
> or serializers, I'm afraid.
> So at this moment I can only suggest to have a look at the generators 
> and serializers already available and come back with specific 
> questions.
> The module "cocoon-optional" contains some custom generators and 
> serializers contributed recently by Simone Tripodi - they all are 
> compatible with the other SAX components from Cocoon 3.
> So this may be a good starting point (I assume you intend to build 
> generators/serializers for XML processed with SAX).
> 
> 
> I am willing to offer as much assistance as my time schedule 
> allows and 
> answer any question that may arise.
> I am sorry for this inconvenience and hope this is sufficient support 
> for you...
> 
> Regards,
> 
> Steven
> > Regards,
> >
> > Carlos Tejo Alonso
> > R&D and Innovation Department
> > CTIC Foundation [Asturias, Spain]
> > www.fundacionctic.org
> >
> >
> > [1] http://cocoon.apache.org/2.2/core-modules/core/2.2/688_1_1.html
> > [2] http://cocoon.apache.org/2.2/core-modules/core/2.2/725_1_1.html
> >
> >   
> 
> 

Re: [Documentation] Develop a Generator

Posted by Steven Dolg <st...@indoqa.com>.
Carlos Tejo Alonso schrieb:
> Hello,
>   
Hello,
> I was looking for documentacion about "how to develop a Generator" and
> "how to develop a serializer". This is the last documentation that I
> have found:  [1] and [2].
>
> Is this documentation the properly one to create generators for
> Cocoon-3? 
>   
The documentation mentioned is specific for Cocoon 2.2.

Unfortunately we have very little documentation for Cocoon 3 as of this 
time and none of that contains anything about writing custom generators 
or serializers, I'm afraid.
So at this moment I can only suggest to have a look at the generators 
and serializers already available and come back with specific questions.
The module "cocoon-optional" contains some custom generators and 
serializers contributed recently by Simone Tripodi - they all are 
compatible with the other SAX components from Cocoon 3.
So this may be a good starting point (I assume you intend to build 
generators/serializers for XML processed with SAX).


I am willing to offer as much assistance as my time schedule allows and 
answer any question that may arise.
I am sorry for this inconvenience and hope this is sufficient support 
for you...

Regards,

Steven
> Regards,
>
> Carlos Tejo Alonso
> R&D and Innovation Department
> CTIC Foundation [Asturias, Spain]
> www.fundacionctic.org
>
>
> [1] http://cocoon.apache.org/2.2/core-modules/core/2.2/688_1_1.html
> [2] http://cocoon.apache.org/2.2/core-modules/core/2.2/725_1_1.html
>
>