[opencms-dev] Get file currently being edited

rm ruben at disk0.de
Fri Mar 12 03:00:58 CET 2010


hi,

i did a similar thing here ... and one thing would be to get the path  
from a property. in my case:

- i have a content type that includes a field called "headline style"
- i have a content type that defines font styles
- i have a property on called "_fontstyles"

for editing:
- i have a custom source select widget that does a lookup on the  
property, then looks into the font style content xml and displays a  
list of available font styles to select from

for rendering:
- the font renderer does the same thing to look up the right font  
style and render the text accordingly

now, this doesn't help with the deletion thing, but it will a.) give  
you more flexibility, because you can define the property on higher-up  
folders and override it below and b.) you can get rid of hardcoding  
the path.

hth

.rm



On 12 Mar 2010, at 9:44 AM, Graeme Kidd wrote:

>
> Another alternative that might work is if the data is not placed in  
> a separate file but instead placed in the same file, under a  
> separate tab. Would I then be able to create a data source class  
> that could read from the file that is currently open. This should  
> mean I no longer need to specify a file location in the schema since  
> I just need to tell it to read data from itself.
>
> My first hurdle is getting at the currently opened file, I tried  
> getURI in the CmsRequestContex class but it simply returned the  
> editor JSP found in the browser address bar. Does anyone know what  
> part of the API would be able to get the current file being edited?



More information about the opencms-dev mailing list