Re: migrating to cocoon 3.0
Francesco Chicchiriccò <[email protected]>
| Newsgroups | gmane.text.xml.cocoon.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Mansour, you'll find my replies embedded below. Regards. On 28/01/2013 03:07, Mansour Al Akeel wrote: > To be more specific, where can I find examples for SAX components. For example: > > looking at this > http://cocoon.apache.org/3.0/apidocs/org/apache/cocoon/sax/AbstractSAXGenerator.html > > I don't understand the parameters for : > > > void setup(Map<String,Object> parameters) > > The shared object map for this pipeline run. > > and for: > > void setConfiguration(Map<String,? extends Object> configuration) Take a look at interface eventually implemented by AbstractSAXGenerator, i.e. PipelineComponent: http://cocoon.apache.org/3.0/apidocs/org/apache/cocoon/pipeline/component/PipelineComponent.html Don't forget that "Apache Cocoon 3 is a major rewrite of Cocoon 2.2. Like Cocoon 2 it is based around the concept of pipelines and sitemaps and it is very similar to Cocoon 2.2 in many respects but is slimmed down and designed to be easily used with Java code (= no frameworks required!)." This has many consequences, including the fact that everything that you do in C2.1 and C2.2 via sitemap.xmap can be done via pure Java code: here's the reason why there are two different setup() and setConfiguration() methods, even though very often they can be considered almost equivalent. > additionally, in previous versions of cocoon, I was able to do this > for custom components: > > <map:components> > <map:generators/> > <map:transformers/> > <map:serializers/> > <map:readers/> > <map:selectors/> > <map:matchers/> > <map:actions/> > <map:pipes/> > </map:components> > > Is this still possible in C3.0 ?? Of course yes, but not in the sitemap.xmap. The availability of generators, transformer, etc is handled by Spring via the cocoon-spring-configurator. For example, the "standard" components are declared in [7] while optional are declared in [8]. You can of course declare your own components in your own sources: consider for example what I did for a project of mine [9] where I have developed a reader and a transformer for Hippo CMS. > On Mon, Jan 28, 2013 at 1:12 AM, Mansour Al Akeel > <[email protected]> wrote: >> I have few components written against cocoon 2.2. >> For example, extending those classes: >> >> FileGenerator This is now a subclass of XMLGenerator: you will find it in [1]. >> TraxTransformer It is now called XSLTTransformer (easier, isn't it?); you will find it in [2]. >> AbstractInputModule There is no support for input modules in C3 sitemap. However, there is a similar concept, i.e. language interpreters [3]; currently, there are some of there available: JEXL [4], Settings [5] and so on. You can see them in action in cocoon-sample sitemap [6] (for example in things like {jexl:cocoon.request.fileName}). >> I am looking to port them to 3.0, but can not find a reference for the >> components. I can see here some components, but no examples and not >> even the classes. >> http://cocoon.apache.org/3.0/reference/html/pipelines.html#d0e363 >> >> Is there a place where I can get the help I need ?? Oh yes, this mailing list ;-) [1] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XMLGenerator.java [2] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java [3] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/LanguageInterpreter.java [4] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/JexlLanguageInterpreter.java [5] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java [6] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap [7] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-component.xml [8] https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-optional/src/main/resources/META-INF/cocoon/spring-optional/cocoon-optional-generators.xml [9] https://github.com/Tirasa/HippoCocoonToolkit/blob/hct-baby-steps/hctsite/src/main/resources/META-INF/cocoon/spring/hct-sitemap-components.xml -- Francesco Chicchiriccò ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member http://people.apache.org/~ilgrosso/