[opencms-dev] adding a new resource type

Dan Moore Dan.Moore at xor.com
Wed Apr 24 21:29:42 CEST 2002


Hi folks,

I'm new to OpenCMS, but I think it's a pretty cool project.

We have a specific type of resource that I'd like to add to the
administration sections.

I searched the mailing list, but didn't find anything.  The closest thing
was the discussion of the velocity integration.  In that thread, this
message (http://www.opencms.org/majordomo/opencms-dev/0203/msg00106.html)
contains an interesting comment:

"...So my suggestion for a simpler integration would require a bit more
inital Java programming by adding a new resource type (Velocity template)
and a new launcher to the system...." 

I'm interested in adding a new resource type (not Velocity), and this
sentence implies that it is possible.  The new resource is a binary file
with some additional attributes (author, suggested category, etc).

I was wondering what the steps would be to add this resource.  So far
I've found:

1. add the resource to the system/workplace/restypes folder.
    the files here seem to be javascript setting permissions and mapping
    actions to html files.  Is there any further explanation of these
    files available?  I'm not sure what '"rules_key(d d iiid iaid dddd dddd
    dddd)");' means
2. subclass com.opencms.file.CmsResourceTypePlain or at least implement
com.opencms.file.I_CmsResourceType. 
    This class will map operations that admin users can perform in the
    admin interface into operations on the cms object (I think?).
3. subclass com.opencms.workplace.CmsNewResourcePage and create a template
in /system/workplace/action/
    This class is responsible for the template display and processing
    when the user has chooses the new type.

Am I on the right track?  Are there other resources (other than the javadoc
the CMSUserGuide and a copy of the data model) that I should be consulting?

Thanks for any help!
Dan




More information about the opencms-dev mailing list