cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] ModuleSource 3DCocoon2.1DevSetupWin2000%2C CocoonDocsDrafts XModuleSource HanJonTheus Tue Jan 27 16:00:05 2004
Date Tue, 27 Jan 2004 15:00:05 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=ModuleSource , version: 2 on Tue Jan 27 14:59:46
2004 by DanielFagerstrom

- {{module:<input-module>:<attribute-name>[#xpath]}}
+ {{{module:<input-module>:<attribute-name>[#xpath]}}}
? +                                                  +

- {{<map:generate type="file" src="module:request:inputStream"/>}}
+ {{{<map:generate type="file" src="module:request:inputStream"/>}}}
? +                                                                +

- {{<map:generate type="html" src="module:request-param:html-field"/>}}
+ {{{<map:generate type="html" src="module:request-param:html-field"/>}}}
? +                                                                     +

- {{module:raw-request-param:foo}}
+ {{{module:raw-request-param:foo}}}
? +                                +

- {{
+ {{{
?   +

- }}
+ }}}
?   +

- I didin't made the module source modifiable as I had no clear use cases for it, nor was
it obvious to me in what form to save the input.
?      -

+ I didn't made the module source modifiable as I had no clear use cases for it, nor was it
obvious to me in what form to save the input.
- 
- AFAIK the new sources can cover all use cases for the mentioned components (as well as doing
plenty of new things):
- {{<map:generate type="file" src="module:request:inputStream"/>}}
+ {{{<map:generate type="file" src="module:request:inputStream"/>}}}
? +                                                                +

- {{<map:generate type="file" src="module:request-param:form-name"/>}}
+ {{{<map:generate type="file" src="module:request-param:form-name"/>}}}
? +                                                                    +

- {{upload://formField1}}
+ {{{upload://formField1}}}
? +                       +

- {{module:raw-request-param:formField1}}
+ {{{module:raw-request-param:formField1}}}
? +                                       +



Page: http://wiki.cocoondev.org/Wiki.jsp?page=3DCocoon2.1DevSetupWin2000%2C , version: 1 on
Tue Jan 27 14:40:13 2004 by 193.110.190.156

New page created:
+ ????
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=CocoonDocsDrafts , version: 13 on Tue Jan 27
14:46:01 2004 by DanielFagerstrom

+ * [ModuleSource]
+ * [XModuleSource]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=XModuleSource , version: 1 on Tue Jan 27 15:11:22
2004 by DanielFagerstrom

New page created:
+ Read and write XML data (DOM and XMLizable) from input and output modules. Can replace the
[[Read|Write]DOMSessionTransformers and should also be usfull in flowscripts together with
processToStream.
+ 
+ ----
+ 
+ Read and writable source that are accessed with uri:s like:
+ 
+ {{{xmodule:[<input-module>|<output-module>]:<attribute-name>[#xpath]}}}
+ 
+ For reading the object that is found by applying the XPath (JXPath), on the attribute from
the input-module, is supposed to be a DOM Document, a DOM Node or an XMLizable object, the
object is serialized to SAX.
+ 
+ For writing the input is serialized into a DOM Document, this document is put in the attribute
from the output-module if the XPath is empty. If the XPath not is empty, an input-module is
used to find the attribute and JXPath is applied.
+ If the object that is found is a DOM tree, the input document is imported into it, otherwize
it is just assigned into that position.
+ 
+ There is a delete fuction as well, that use removeAll(xpath) from JXPath.
+ 
+ !!Flow example
+ 
+ [http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107279968120084&w=2]
+ 
+ !!Configuration
+ 
+ RequestAttributeOutputModule and SessionAttributeOutputModule as default prefix all attribute
names with org.apache.cocoon.components.modules.output.OutputModule".
+ 
+ To make the samples for the xmodule source work this must be reconfigured to using attribute
names without prefixes. This is done in the cocoon.xconf by puting an empty key-prefix" element:
+ 
+   <key-prefix/>
+ 
+ as child to the configurations of the output-modules "request-attr" and "session-attr".
+ 
+ To make writing with or without XPaths work in a decent way, there is supposed to be booth
an input and an output module that are configured to have the same name and that gets and
sets the same attribute.
+ 
+ !!Relation to [[Read|Write]SessionTransformers
+ 
+ For the [[Read|Write]DOMSessionTransformers as well as the [[Read|Write]DOMTransformers
submitted in [http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23921], I would guess that
the read functionality can be replaced by using URIs like:
+ 
+ {{{xmodule:session-attr:field}}}
+ 
+ together with the [[C|X]IncludeTransformer or the FileGenerator. The write functionality
can probably be replaced by using URIs on the same form together with the SourceWritingTransformer
or doing the writing by using processToStream within flowscripts.
+ 
+ Writing to the xmodule stream is less efficient than using the WriteDOMSessionTransformer,
as a serialize/reparse step is needed. This would be quite easy to fix, what we need is a
convention for what interface a source that one can write SAX to should implement. I think
that it would be most convinient to implement the XMLConsumer interface.  Then the SourceWritingTransformer
can check if the source implements XMLConsumer and in that case redirect the input events
to that instead. For use within flowscripts, processToSAX can be used. 
+ 
+ !!Future work
+ 
+ A nice enhancement would be to let the XModuleSource implement ContentHandler, then one
would avoid the serialize/parse step in some cases. It could e.g. be used with processToSAX
in flowscripts.
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=HanJonTheus , version: 1 on Tue Jan 27 14:10:02
2004 by HanJonTheus

New page created:
+ Hello i am student.
+ 



Mime
View raw message