grails elfinder plugin: use placeholder in rootDir

谁说我不能喝 提交于 2019-12-11 15:35:51

问题


in my Grails project I'm using elfinder plugin to manage files and directories. I want to have a dynamic root directory, because I use the plugin for different folders. The path of directory is like the following:

grails.plugin.elfinder.rootDir = "${userHome}/docm_patients_doc/{patientcf}/"

where patientcf is the id of an entity in my application. When I enter into the show.gsp page of that entity, I need to replace the patientcf with the related value. How can I do it?

EDIT: I've tried to modify the placeholder before the script and div that shows elfinder in gsp page, but I notice that the path is not modified. Maybe the gsp is not the place in which the placeholder can be modified...


回答1:


I am author of elfinder plugin, though plugins isn't developed with multiple roots in mind.

You can try this. Plugin registers a spring bean with name elfinderFileManager which has a property with name ‘root’ which is path to your root directory. Try setting the root property at runtime. The bean can be injected in your controller/service and you can try changing the root property.



来源:https://stackoverflow.com/questions/20547566/grails-elfinder-plugin-use-placeholder-in-rootdir

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!