hello,
I am using CKeditor and CKfinder in a JSP/Servlet env
i have it kind of working, but i need to change the baseDir and baseURL based on the user
I created a MyFinderConfiguration extends Configuration and see where i can override getBaseDir and getBaseURL
I can not make the connection on how to access this class from my JSP where basically i have
<ckfinder:setupCKEditor basePath="/ckfinder/" editor="editor1" />
can someone help me connect the dots or show me a better way to change the params?
Thanks
Randy
I am using CKeditor and CKfinder in a JSP/Servlet env
i have it kind of working, but i need to change the baseDir and baseURL based on the user
I created a MyFinderConfiguration extends Configuration and see where i can override getBaseDir and getBaseURL
I can not make the connection on how to access this class from my JSP where basically i have
<ckfinder:setupCKEditor basePath="/ckfinder/" editor="editor1" />
can someone help me connect the dots or show me a better way to change the params?
Thanks
Randy
Re: [java]- trying to change baseDir/baseURL for each user
Re: [java]- trying to change baseDir/baseURL for each user
Have you read http://docs.cksource.com/CKFinder_2.x/D ... /Extending and others similar - http://docs.cksource.com/CKFinder_2.x/Developers_Guide ?
If you want to access your configuration file from JSP - you can do it the old school way via scriplet or you can place your configuration class in scope like 'session' or 'application' and call this class using JSTL an EL.
Re: [java]- trying to change baseDir/baseURL for each user
i had extended Configuration and created MyConfiguration
i was just not sure how to access it via the JSP that has the editor and finder
Re: [java]- trying to change baseDir/baseURL for each user
Re: [java]- trying to change baseDir/baseURL for each user
A much better approach would be to extend ConnectorServlet. All methods in new servlet would only call super.methodName(…) and init method would additionally have something similar to this line getServletContext().setAttribute("ConfigurationKeyName", configurationField);
Of course changes in web.xml are also required in this case.
Re: [java]- trying to change baseDir/baseURL for each user
Jakub
thankyou for the response.
I think i am getting closer.
here is where i am.
if a particular users edits their page http://mydomain.com/user1 using ckeditor/ckfinder
they have their own image dir http://mydomain.com/user1/images
i created my own MyPathBuilder extends DefaultPathBuilder
based on User Logged In session data i build the BaseDir and BaseUrl Successfully and ckfinder shows the correct images/files
here is where i am having problems.
if i go from user1 to user2's page http://mydomain.com/user2 and log in
and then edit the page, i still get the images from user1
when i debug/step through MyPathBuilder is getting call and is returning the correct BaseDir and BaseUrl
for user2
in ConfigurationFactory line 134 conf.setThumbsURL(PathUtils.escape(thumbUrl));
has the correct URL for user2
but the wrong folders and images are being displayed
Thanks
Randy
Re: [java]- trying to change baseDir/baseURL for each user
What addresses for requests do you see in Firebug?
This might have something to do with my previous post. I have told you that you can place your configuration in the scope of application - it means that configuration object will be in server memory as long as the application runs thus it will be the same for every session. This method is good for resources that can be used by every user of your application, are not changed very often or/and loading them into memory might take some time.
If you want to use new configuration object for every user (READ EVERY SESSION) you should place such configuration object in session scope for every user (and of course invalidate session when user logs out).