[opencms-dev] XML Content Demo

Jonathan Woods jonathan.woods at scintillance.com
Wed Nov 8 10:56:45 CET 2006


I agree with Christian - without heavy customisation, there's no way to use
the existing XML editing framework to do what you suggest.  There was talk
some while ago of re-implementing the XML editing framework to use a nice
AJAX framework, but nothing has yet come of it.

Concerning your question about combo box values: as you probably know,
they're usually retrieved from a properties file named in the XSD:

<xsd:annotation>
		<xsd:appinfo>
			<resourcebundle
name="{{runtime.opencms.module.name}}.workplace"/>

Actually, they're resolved through the usual Java properties mechanism, so
instead of providing a fully qualified Java class which actually maps to a
file (workplace.properties here), you could provide a fully qualified Java
class name which maps to... a Java class of your own which extends
java.util.ResourceBundle.  That Java class could get its values from
wherever you like.  Warning: I think OpenCms caches property values thus
obtained, so you might find you need to reload the module, or even restart
OpenCms, for new values to be picked up.  Come to think of it, though, there
is a Workplace function to 'reload the Workplace' - that might also flush
property caches, and you may even be able to hook into that
programmatically.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christian Steinert
Sent: 08 November 2006 10:19
To: The OpenCms mailing list
Subject: Re: [opencms-dev] XML Content Demo

Rafael Reyes López schrieb:
> Hi, I'm creating an XSD for my XML content and already working :-) My 
> question is how to add functionality as "if I fill one field in my 
> content then another one becomes mandatory" ? I saw that there are 
> rules to use regular expressions and so to check different conditions 
> but still haven't found the way to do this that I need.
>
> Also instead of getting the values of a combo from a properties file 
> or directly typing them in the XSD file to retrieve them from a 
> database table.
>
> Thanks.
>
> Kind regards.
>
AFAIK, regular expressions are only meant for checking the format of an
individual field.
Sadly I don't know if there is a way to perform more complicated checks.

I think you would have to digg around - maybe you can extend the generic XML
resource type class so that it can do what you need.

christian




More information about the opencms-dev mailing list