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

Vincent Hanniet vhanniet at free.fr
Tue Mar 9 16:25:03 CET 2004


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




More information about the opencms-dev mailing list