Re: doctypes

Christian Stocker <[email protected]>
Newsgroups gmane.comp.cms.bitflux.general
Organization Bitflux GmbH
Message-ID <[email protected]>

On 24.11.2005 8:39 Uhr, Christian Stocker wrote:
> Thursday, November 24, 2005, 12:28:34 PM, Christian Stocker wrote:
> CS> On 23.11.2005 11:30 Uhr, qMax wrote:
> CS> Do I see that correctly, that you want to have different XML documents
> CS> (doctypes) throughout the whole websites, which should be translated by
> CS> different xslts?
> CS> So for example
> CS> /foo/addresses.xml <- adress.xslt
> CS> /bar/agenda.xml <- calendar.xslt
> CS> /gnarf/alsoaddresses.xml <- adress.xslt
> Yes, exactly like this.
> I guess that i need to tell one text/xml from another using some
> resource property,
> i just dont know how to access it from sitemap pipeline.

Ok, got it :)

The best thing is you start with the bx_plugin_xhtml and copy that and
make your adjustement.

You're right about the properties. Add a field for the actual doctype.

For the desicion of which stylesheet should be used, you can implement the

public function getStylesheetNameById($path = NULL, $id = NULL) {}

method in the new plugin and return an stylesheet according to the
doctype. I don't know, how lenya does it, but I would suggest you just
return  $doctype.'2html.xsl' for each different doctype. otherwise we
need a central place for defining which xslt should be used for which
doctype. We still can extend that later to make it more advanced.

> CS> What you basically need here is a special plugin and then it should be
> CS> doable. But before I'm not really sure, what you want, I wait with more
> CS> explanations :)
> 
> Tonight i figured out that i need at least three plugins
> to integrate new resource type:
> == for resource handling:
> bx_resource_foo, extending bx_resource
> with some additional methods out of interfaces.

you can also start with bx_resources_text_html here. the whole html
stuff is just a special case to what you want, IMHO

> == for actual resource management:
> bx_plugin_foo, extending bx_plugin
> again with some additional methods out of interfaces used in
> collection operations (copy/move/delete)

yes

> == for specific content editor, with some forms, buttons and whistles:
> bx_editors_fooedit, ext bx_editor

Editors are "doctype" independent, so you could basically just use the
BXE or oneform editor for your files. or write your own, of course.

> And then setup them alltogether in
> BX_HOME/conf/properties/properties.xml for property editor,
> BX_HOME/conf/editors/foo.xml for content editor.
> 
> I'm just not sure how to allow several resource types in the same
> collection.
> Is declaring them all in <plugins> in .configxml the right way ?

Too much redundancy maybe? You certainly have to define your doctypes
somewhere. Maybe in conf/doctypes/, so that you can display them to
choose from.

> At the moment i don't know how to properly distinguish doctypes of the
> same mimetype, but it's probably a matter of using a property
> (and an addresource-usecase parameter at moment of creation).

 public function getResourceTypes() {}

in the plugin can return the different "doctypes". They are then
displayed in the "create new xxx" section

I hope, this information is somehow useful, although not really
extensive, therefore just ask, if you need to know more. But it's
certainly doable what you want and I think a nice addition :)

chregu

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | [email protected] |  GPG 0x5CE1DECB
-- 
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.