[opencms-dev] How to add a new resource type

M Butcher mbutcher at grcomputing.net
Mon Feb 16 18:34:01 CET 2004


Olli,

Wooo hoooo!

Thanks for sharing the information. I'll be trying this right away.

Matt



Olli Aro wrote:
> Hi All,
> 
> I got this working:) The process for adding new resource types is as below:-
> 
> 1) Add new content type in register.xml e.g.
> 
> <restype>
>     <name>MyNewType</name>
>     <launcherType>1</launcherType>
>     <launcherClass/>
>  <resourceClass>com.opencms.file. CmsResourceTypeMyNewType</resourceClass>
>         </restype>
> 
> The launcherType attribute depends on your resource type, however the most
> cases you can use the type 1, which does not include any template parsing
> and delivers the content as it is stored in your file.
> 
> 2) Write your own CmsResourceType class. It has to be part of the package
> com.opencms.file, so that the protected methods will work properly. Your
> class must implement I_CmsResourceType, I_CmsConstants, Serializable and
> overwrite all required workplace methods. Class
> com.opencms.file.CmsResourceTypePlain provides an useful example for the
> class structure.
> 
> 3) Customise the explorer popup menu for your new content type by adding
> relevant file to /system/workplace/restypes/ directory. Again file
> compatiblePlain provides an useful example.
> 
> Now you can create new resources based on your type with cms.createResource
> whereby you must use your new resource type name as the type reference.
> 
> Regards,
> 
> Olli     
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.580 / Virus Database: 367 - Release Date: 06/02/2004
>  
> 
> _______________________________________________
> 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