[opencms-dev] Create a sibling dynamically

R. Jonyo richjo2000 at gmail.com
Mon Jul 25 16:10:25 CEST 2011



Thanks Mario. I intend to automatically create sibling only for a special
resource type. Is it simpler to use <copy-resources> on opencms-modules.xml?
if not then i guess i have to create a new class. Also If i have to use
<copy-resources> what is the xml syntax.



regards,
R.Jonyo





Mario Jäger wrote:
> 
> Hi,
> 
> You do not write if you want to have the sibling for all resource types 
> or for a special resource type only.
> 
> If you only want to have it for a special resource type and that is a 
> xml content for example, then you could create a new class which extends 
> the class org.opencms.file.types.CmsResourceTypeXmlContent and which 
> overrides the method createResource(). In that method you could 
> implement that aditional to the new resource automatically the sibling 
> in the other site path is created. That new class is to configure in the 
> WEB-INF/config/opencms-modules.xml in the "class" attribute in the 
> <resourcetypes><type> node from the special resource type. The new class 
> should be in your own module.
> 
> There is a possibility already to configure that other resources are 
> created automatically when a new resource is created with the 
> <copy-resources> node in the opencms-modules.xml. But, you can not use 
> that configuration element for your requirement without to make 
> enhancements on that feature. I would advice to use that possibility 
> only if you want to have siblings for all resource types. Because, I 
> think it is more complicated to enhance that configuration element to 
> your requirement without to touch the OpenCms core.
> 
> Kind Regards,
> Mario.
> 
> 
> 
> Am 21.07.2011 10:23, schrieb R. Jonyo:
>>
>> Hi,
>>
>> Anyone who has code to create a sibling dynamically?
>> e.g. i manually create a resource on "/sites/default/test.html" and a
>> sibling is automatically created on " /sites/mysite/test.html". I guess
>> on
>> has to use ModuleAction but i do not have the right code. Please help!
>>
>>
>>
>> regards,
>> R.Jonyo
> 
> 
> -- 
> -------------------
> Mario Jäger
> 
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 

-- 
View this message in context: http://old.nabble.com/Create-a-sibling-dynamically-tp32105684p32132096.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list