[opencms-dev] get CmsResource in Widget#getDialogWidget

Alexander Kandzior alex at opencms.org
Thu Oct 20 11:13:22 CEST 2005

In #getDialogWidget you have a I_CmsWidgetParameter parameter.

With that parameter, do somehting like this 
(this will limit the use of the widget only for XML contents):

I_CmsWidgetParameter parameter;
I_CmsXmlContentValue value = (I_CmsXmlContentValue)parameter;
I_CmsXmlDocument document = value.getDocument();
CmsFile file = document.getFile();
String rootPath = file.getRootPath(); // actually you don't need this
CmsProperty titleProp = cms.readPropertyObject(file, "Title", false);
Best Regards,

Alexander Kandzior
Alkacon Software - The OpenCms Experts


> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of 
> Christof Dallermassl
> Sent: Thursday, October 20, 2005 10:27 AM
> To: The OpenCms mailing list
> Subject: [opencms-dev] get CmsResource in Widget#getDialogWidget
> Hi!
> We wrote a new widget type that needs some information from 
> the CmsResouce that is being edited (content of widget 
> depends on a property of the resource). Is there a way to get 
> the resource? 
> I thought the request context might help as the path is 
> passed as a parameter in the url, but I cannot find a method 
> to get the url's params.
> regards
> Christof
> _______________________________________________
> 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