[opencms-dev] Get file currently being edited

Graeme Kidd coolkidd3 at hotmail.com
Fri Mar 12 02:44:22 CET 2010








Hi,

I am using the CustomSourceSelectWidget to pull in data from another file which is then displayed in a select widget. This works nicely but I am worried that a user may rename/move/delete this file accidently and complain the select box doesn't work anymore. There is also the risk of increased maintenance since the file is specified statically in the schema file and needs to be updated every time the file moves or is renamed. 

One way to get round this problem is to move the file into a more secure place like the system/workplace/admin section or in the modules folder. However this is not ideal for me since the file does need to be editable by normal workspace users.

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?

Thanks


 


 		 	   		  
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100312/8cf0d196/attachment.htm>


More information about the opencms-dev mailing list