[opencms-dev] Adding a user-defined relation

Paul-Inge Flakstad flakstad at npolar.no
Tue Aug 25 17:10:09 CEST 2009


Hello list!

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?

Thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090825/91170cb3/attachment.htm>


More information about the opencms-dev mailing list