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

Vincent Hanniet vhanniet at free.fr
Mon Feb 16 19:05:01 CET 2004


It works fine, thanks all.
But does anybody know the meaning of the parameters
"rules_key(d d aaai dddd dddd dddd dddd)"
in the files in /system/workplace/restypes/ directory ?

Vincent


> 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
> 
> 
> _______________________________________________
> 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