[opencms-dev] Adding a user-defined relation
flakstad at npolar.no
Tue Aug 25 17:10:09 CEST 2009
I've tried to add a user-defined relation to OpenCms using the following approaches:
1.) in a JSP file by calling the constructor in org.opencms.relations.CmsRelationType.
2.) by creating a module with an action class, and calling the above mentioned constructor
from the action class' initialize-method.
Approach 1.) produced an error.
Approach 2.) did not produce any error, but when getting the list of relation types from
CmsRelationType.getAll(), my user-defined relation is not there. Also, trying to use
my user-defined relation with addRelationToResource() does not work. It gives an
exception telling me that:
The value "801" can not be parsed into an enum element of type "org.opencms.relations.CmsRelationType"
(Which btw is kinda interesting, sice I actually try to use the value "901", not "801", which is
the ID I assigned my user-defined relation.)
Is anyone able to tell me how to add a user-defined relation?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the opencms-dev