[opencms-dev] Alpha 1 - Alternate location to define resourcetypes.
Alexander Kandzior
alex at opencms.org
Thu Sep 23 19:35:02 CEST 2004
Frank,
Regarding the XML configuration....
> > > 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.
>
> If we could use XML Schema they have ways of including other
> Schema defined in separate files. Either that or make each
> module have a config/ directory and allow the files of the
> same structure to be in config/, such as module-vfs.xml,
> module-workspace.xml.
Sure XML scheme includes are a way to go. We actually use XML schemas for
Xmlpage content storage and validation (BTE replacing the old "page" with
reparate "control" and "body" file). So also validating the configuration
XML with schema would sure makre sense. From my experience it's just much
harder and more akward to define some simple things with XML schemas...
Anyway, if someone contributes (XML schema instead of DTD) this I will for
sure add this to the core.
> > 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.
>
> Are these XML configurations written out as part of the
> export process?
Hmmm. Let's give an example: All module configuration in 6 are located in
the file "opencms-modules.xml". SO if you install a new module,
opencms-module.xml is re-written and the new module is added. Internally
during runtime all modules are managed by the module manager, see class
org.opencms.modules.*.
> I can see how it would get tricky. Maybe all
> configurable resources must have an "origin" that defines
> where it was loaded, and that will assist in it's export.
My thinking exactly. It's just that it somehow needs to be inmplemented.
> I was thinking of these modules as like a WAR or EAR file (in
> concept) in that they could be entirely self contained, that
> will require more work but will make these modules easier to
> distribute and install.
My thinking again.
> Also, is it possible to define the Back Office UIs for my new
> Resource Types inside the module, or must they be in the
> /system/workspace/common folder with the other UIs?
The UI istself should usually be a view or administration point. So you need
just to add the folder where this is located to the module as a module
resource (there's new XML but go GUI yet, so you still need to use the
"additionalresources", but this is only a workaround until we get the new
JSP GUI for this part).
Best Regards,
Alex.
Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com
More information about the opencms-dev
mailing list