[opencms-dev] controlcode & XML template modules

Jonathan Woods jonathan.woods at scintillance.com
Wed Jun 7 06:46:09 CEST 2006


When I had the problem it was because I wasn't naming the workplace file
correctly/putting it in the right place/referring to it correctly in the
<appinfo> node.  You probably need to check all three of these things again
(at least, that's what got things working for me).  Most likely problem is
that your file isn't on the applicable classpath.  To recap:
 
- file called workplace.properties and (redundant? copy)
workplace_en.properties
 
- file placed in (say) directory which you know is in your module's
classpath -  e.g. in its 'classes' directory
 
- appinfo node referring to file as appropriate
 
I confess that I'm also storing the properties file in the RFS in the
equivalent classpath location, i.e. in <opencms
home>/WEB-INF/classes/com/scintillance/mymodulename/workplace_en.properties,
as a by-product of all the messing around I had to do to get this working.
 
Jon

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Chris Tiernan
Sent: 07 June 2006 00:40
To: The OpenCms mailing list
Subject: RE: [opencms-dev] controlcode & XML template modules



Yup, I have followed all those step already.  I think OpenCms is not reading
my workplace.properties file(s) correctly.  I say this because my custom XML
templates are not showing the correct labels from the workplace.properties
file(s) either.  They just show the element name in my schema XSD.  Is there
some file that sets my locals and/or properties path? I see that the
opencms-system.xml has an <internationalization> node and the is set to
<locale>en</locale> only.

 

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
Sent: Monday, June 05, 2006 9:22 PM
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] controlcode & XML template modules

 

Sorry; left some build artefacts in this.  The appinfo resourcebundle node
ends up evaluating to a fully qualified class name as if 'workplace' were
the class.  (Probably teaching you to suck eggs, but that's how Java
properties files are treated.)  So:

 

    ...<resourcebundle name="com.scintillance.mymodulename.properties"

 

J

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
Sent: 06 June 2006 05:14
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] controlcode & XML template modules

I had a lot of trouble with this at first.  Here's what I ended up doing:

 

1.  In my XSD file, I referred to the workplace properties file thus:

 

 <xsd:annotation>
  <xsd:appinfo>
   <resourcebundle name="{{runtime.opencms.module.name}}.workplace"/>
   ...
   
(note: no .properties extension).

 

2.  I stored the file workplace.properties in my module's classpath, at the
bottom of the package hierarchy (i.e. in VFS location
/system/modules/com.scintillance.modulename).  I ended up creating a copy
too, called workplace_en.properties, just in case the reason OpenCms hadn't
been finding the file was that it was looking only for the locale-specific
version.

 

3.  As the instructions say (and as you're doing, it seems) the
workplace.properties entries then become

 

fileicon.myResourceType = My resource type

title.newmyResourceType = New my resource type

 

Hope this helps.

 

Jon

 

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Chris Tiernan
Sent: 05 June 2006 22:12
To: The OpenCms mailing list
Subject: RE: [opencms-dev] controlcode & XML template modules

Jon -

 

Those resources help a lot, thanks.

 

However, I don't think OpenCms is reading my workplace.properties file
correctly.  Its showing "???fileicon.topstory???" instead of the value for
it when I create a new type for the magic wand button.  Also, my labels in
workplace.properties don't seem to being read as well. The templates just
show's the coded name instead of the value of the coded name.

 

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
Sent: Wednesday, May 31, 2006 9:25 PM
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] controlcode & XML template modules

 

Chris -

 

There are four things involved in creating a new Explorer-selectable XML
content type: (i) schema creation, (ii) resource type definition, (iii)
explorer linkage, and (iv) (optional) fancy display config.  There's a good
FAQ posted by Alexander Kandzior:
http://mail.opencms.org/pipermail/opencms-dev/2004q4/013609.html which deals
with (i), (ii) and (iii); and (iv) is covered nicely by
http://www.opencms-forum.de/viewtopic.php?t=648 (both pages; start two
thirds of the way down the first page).

 

You'll see workplace.properties mentioned quite a bit.  This is used as a
place to stash things like field labels, field help and so on.  It's in Java
property file format and is loaded when it's on the classpath of your
installation.  There are multiple workplace.properties files, and when
looking for properties OpenCms hunts through them all until it finds a
match.  You should be developing within the context of a module, and so the
best place for your workplace.properties is in the (folder which is
equivalent to the bottom of the) classpath hierearchy.  Have a file called
workplace.properties and a copy called workplace.properties_en (and ditto
for any other localisations you're doing).

 

Jon

 

 

  _____  

  From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Chris Tiernan
Sent: 01 June 2006 01:21
To: The OpenCms mailing list
Subject: RE: [opencms-dev] controlcode & XML template modules

Gottcha.  It seems that I can't register or create a new XML content type.
I've created the  XSD file, my XML content file, and the template, but it
seems that it does not does create the XML content type under the "New >
Structured content" area.  How do I 'register' that content type with
OpenCms?

 

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
Sent: Wednesday, May 24, 2006 11:29 AM
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] controlcode & XML template modules

 

If I understand you correctly and you're talking about custom XML content
types, then yes - OpenCms should be able to generate document instances
automatically, e.g. when clicking on a direct edit 'new' button or when
creating a new resource of the XML content type.  The document instance
includes all mandatory elements with empty contents (I think).

 

Jon

 

  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Chris Tiernan
Sent: 24 May 2006 18:51
To: opencms-dev at opencms.org
Subject: [opencms-dev] controlcode & XML template modules

Does anybody know if the controlcode for a custom XML template module is
supposed to be generated by the OpenCms system?  I have to keep creating a
base controlcode XML file for the system to work, which seems odd.  Thanks!

 

Best,

Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060607/7a8a949e/attachment.htm>


More information about the opencms-dev mailing list