cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject [Update] slash-edit and SourceWritingTransformer
Date Wed, 13 Mar 2002 21:03:35 GMT
Dear All,

I just updated cvs with new <slash-edit/> stuff.

I think I have the final name for the Transformer ;)

	SourceWritingTransformer (was: WriteableSourceTransformer)

I also simplified the Exception handling according to Sylvain's advice.

Slash-edit now has a pattern for multiple editors, I call sub-editors,
there are two provided, 'alpha' and 'bravo', with more to come.

Sub-editors can be used either for providing different edit-views of the
same DocType, or for editing different DocTypes.

	/edit/get(alpha)/path/file - gives you a "whole xml" form
                               non well-formed XML results in partial Source

	/edit/get(bravo)/path/file - gives you the xml broken down into fields
                               <para> -> double linefeed -> <para> conversion
                               <br/> -> single linefeed -> <br/> conversion
                               all xml tags are converted to Entities

Developing your own sub-editors will involve something like this:

1. Modify editor.xmap to add internal "fetch handlers" for your sub-editor;
for instance 'alpha' and 'bravo' use different generators to capture the
form data during a 'put', but share generic pipelines for other behaviours.

2. Make an editor-[sub-editor]-components.xsl with the specific templates
you need for your particular editing job and doctype; in the samples, this
is where the forms are made during a 'get' or 'new'.

3. Make a [source/doctype]2editor.xsl file to prepare your Source or
Request for the editor; in the samples, this is where request data is
turned into a new Source.

3. Modify editor-page2html.xsl so it imports your new xsl components.

4. Add a test for your sub-editor to editor-page2html.xsl.

5. Make a config file for your editor's static strings etc.

I have ideas for more sub-editors; one that appends or inserts new content
into an existing Source and one that maybe handles a few specific xml tags
by extending the techniques used in bravo editor for parsing paragraphs,
though that is going to mean some tricky XSL.

The way to move forward on allowing specific XML in certain fields still
relies I think on a RequestParsingGenerator which has plug-in Parsers of
different types for different markups.

I think of <slash-edit/> as experimenting in public, what is there is
probably not useful to anybody in it's current form, but could provide a
useful pattern for users to develop editors for their own doctypes.

regards Jeremy

BTW. The supplied 'editor.xmap' may provide ideas for people wanting to
make generic pipelines that can perform different tasks according to
context but don't need full-blown multiplexing.

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <>     		 <>
   <phone:+44.[0].20.7737.6831>             <>

To unsubscribe, e-mail:
For additional commands, email:

View raw message