[opencms-dev] Alpha 1 - Alternate location to define resource types.
Alexander Kandzior
alex at opencms.org
Wed Sep 22 23:13:06 CEST 2004
Frank
> I see that I can add these types to opencms-vfs.xml and
> opencms-workplace.xml in order to have the Back Office make
> use of these new types.
>
> Is there a way to add these definitions to a file that is
> included in the module to be delivered so that we do not have
> to directly modify opencms configurations.
Unfortunatly this is currently not possible for resource types and the
required workplace XML entries. See below for the reason why...
> As I see it now, I will have to publish a module that
> contains the classes for these new resource types, then I
> will have to edit opencms-*.xml, then restart tomcat for
> OpenCMS to recognize my new resource types.
This is correct.
> I guess I'm looking for a way to have that configuration
> included in the module itself, making as few mods to the
> OpenCMS installation as possible.
As already said this is not yet implemented.
There are 2 main reasons for this:
1. All XML is checked by DTD. So adding these to the module XML would mean
adding this to the module DTD also. Now since there are many XML
configuration nodes (other users will certrainly need to add other
configuration features to a module) we need a more clever way of doing this
without actually duplication all possible DTDs from other configuration
parts to the module DTD.
2. The whole XML configuration is read-write. After reading the
configuration the XML is transformed to Java objects. E.g. the resource
types are managed in a java.util.List inside the
org.opencms.loader.CmsResourceManager (or so) class. Now the "read from
configuration" part would be easy to implement if 1) above is figured out
somehow. BUT how to implement the "write" part? How do I know what resource
in the List has been added by what module, and so must be written to
opencms-modules.xml or opencms-system.xml? Somehow one must devise a clever
way to distinguish the configurated objects so that it's still possible to
write the XML again.
I'm sure there's a way to solve this, but so far we have settled with
modifiying the configuration manually if required. If someone comes up with
a good idea and contributes a solution to 1) or 2) just don't forget to send
it to me :-)
> Thanks for the help. Once I get a bunch of these module
> issues figured out I am aplnning to write up a howto or
> tutorial and post it somewhere generally useful to the community.
Great.
Best Regards,
Alex.
Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com
More information about the opencms-dev
mailing list