[opencms-dev] controlcode & XML template modules
Chris Tiernan
CTiernan at salesforce.com
Wed Jun 7 20:59:21 CEST 2006
Well, that was frustrating. Okay, here's the deal. I had everything
setup correctly the first time around. However, the system did not copy
my 'workplace.properties' and 'workplace_en.properties' files to disc
(e.g. <OpenCmsHome>\WEB-INF\classes\com\salesforce\intranet). I had to
recreate these files again locally (i.e. not in the OpenCms VFS). I
also noticed that when I update my *.properties files in the VFS that
those changes aren't reflected on my local disc.
At any rate my original problem has been resolved. However, I feel I
can't trust the VFS until I find the root cause for writing to disc.
Have I missed a setup/configuration setting?
Best,
Chris
________________________________
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
Sent: Tuesday, June 06, 2006 9:46 PM
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] controlcode & XML template modules
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.propert
ies, 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/9081ad5a/attachment.htm>
More information about the opencms-dev
mailing list