[opencms-dev] current folder in widget

Marek mareknow-pbc at o2.pl
Fri May 6 10:36:53 CEST 2005


Hi

It is not a good solution, because CmsResource.getFolderPath(uri) will 
return /system/workplace/editors/xmlcontent (I guess). And what I need is 
name of the current folder.
As I said, I have already solved my problem. While I am creating 
CmsRequestContext I extract parameters from HttpServletReqest. One of these 
parameters is "resource" which is path to the resource I am editing (e.g. 
/cars/myCar.html). I added one field "parameters" which is Map to the 
CmsRequestContext class. While creating CmsRequestContext object I set this 
filed which proper value. And then in my widget I can extract from this Map 
value of key "resource" and from this value I can extract path to the 
current folder.

Regards,
Marek

----- Original Message ----- 
From: "Wiesner, Daniel" <daniel.wiesner at av-studio.de>
To: "The OpenCms mailing list" <opencms-dev at opencms.org>
Sent: Thursday, May 05, 2005 7:15 PM
Subject: Re: [opencms-dev] current folder in widget


> marec,
>
> try this:
>
> String uri = cms.getRequestContext().getUri();
> String folderName = CmsResource.getFolderPath(uri);
>
> regards
> Daniel
>
>
>
> Marek schrieb:
>
>> no, no, no
>>
>> cms.getRequestContext().getUri() returns 
>> /system/workplace/editors/xmlcontent/editor_form.jsp
>>
>> I solved the problem by adding parameters of reqest from 
>> HttpServletReqest to CmsRequestContext
>>
>> Regards,
>> Marek
>>
>>
>> ----- Original Message ----- From: "Thomas Maerz" <thomasmaerz at gmx.de>
>> To: "The OpenCms mailing list" <opencms-dev at opencms.org>
>> Sent: Thursday, May 05, 2005 4:32 PM
>> Subject: Re: [opencms-dev] current folder in widget
>>
>>
>>> "Marek" <mareknow-pbc at o2.pl> writes:
>>>
>>>> access to CmsObject and cms.getRequestContext() but it is not what can
>>>
>>>
>>> Returns the OpenCms VFS URI of the requested resource:
>>> cms.getRequestContext().getUri()
>>>
>>> ,----[ org.opencms.file.CmsRequestContext ]
>>> |     /**
>>> |      * Returns the OpenCms VFS URI of the requested resource.<p>
>>> |      *
>>> |      * @return the OpenCms VFS URI of the requested resource
>>> |      */
>>> |     public String getUri() {
>>> `----
>>>
>>>
>>> Regards,
>>> Thomas
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
>
>
> _______________________________________________
> 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