[opencms-dev] Add new resources type ??? (bis)

M Butcher mbutcher at grcomputing.net
Tue Mar 9 17:12:02 CET 2004


I did something similar, but with fewer modifications, since my restype 
was pretty basic.

I created a generic XML type (genxml) by subclassing 
CmsResourceTypePlain in CmsResourceTypeGenericXml. I ended up putting 
the class in the actual OpenCms package since I usually build OpenCms 
from source anyway.

Then, all I had to add were the workplace/restypes/genxml file and the 
icon file. I changed the workplace*.properties files to include 
locale-specific labels, too.

Otherwise, it just uses the same templates as Plain -- which is what I 
wanted.

It shows up along with the rest of the file types, and I can create one 
with the "new" button in the Explorer view.

Matt

Vincent Hanniet wrote:
> Jim 20100 wrote:
> 
>> Thanks but it does not work. I do not have my new type if I click on 
>> New button.
>> Do you know how to import the workplace without going through the setup.
>> Regards
> 
> 
> I have succesfully added a new resource type (NP for New Page) derived 
> from type "page" which appears in the "New" button. To do so, I have 
> created/modified the files :
> 
> * workplace/action/edit_NP.html
> * workplace/action/edit_NP_main.html
> * workplace/action/explorer_files_new_NP.htm
> * workplace/restypes/NP
> * workplace/templates/explorer_files_new
> * workplace/templates/explorer_files_new_NP
> * workplace/templates/edit_NP_main
> * workplace/resources/ic_file_NP.gif
> * 
> /system/modules/com.opencms.file/classes/com/opencms/file/CmsResourceTypeNP
> * 
> /system/modules/com.opencms.file/classes/com/opencms/file/CmsNewResourceNP
> 
> and added some lines to registry.xml (after the lines which describe the 
> jsp type as it seems that the order of the resources types is hard coded 
> somewhere in opencms) :
> 
> <restype>
>   <name>NP</name>
>   <launcherType>3</launcherType>
>   <launcherClass/> 
> <resourceClass>com.opencms.file.CmsResourceTypeNP</resourceClass>
> </restype>
> 
> In fact, if you just duplicate/rename the files used by the "page" type 
> it runs.
> 
> I hope this helps.
> Vincent Hanniet
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list