<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes, I have added a new method OpenCmsCore, which is used by the
filter. The filter has access to OpenCmsCore.getInstance().<br>
Regards<br>
Hernan<br>
<br>
Mathias Lin|SYSVISION wrote:
<blockquote cite="mid:22070382.post@talk.nabble.com" type="cite">
<pre wrap="">Have you already done it? I also wanted to put it into the request filter,
but the problem I found was that OpenCmsCore.getInstance() is protected. Or
which method are you using to retrieve or init the CmsObject?
Mathias
Hernán Leoni wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Thanks Mathias, I'm adding a request filter to obtain the cms object, I
hope to be able to contribute it to opencms.
Thanks,
Hernan
Mathias Lin|SYSVISION wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Not sure if it's the best approach but I modified and rebuilt the OpenCms
core, changing the OpenCmsServlet and putting the CmsObject into the
session
in the get-method of the servlet, using
OpenCmsCore.getInstance().initCmsObjectFromSession(req)
Let me know if you found any other/better approach.
Hi Mathias,
Thanks, sure, I'm using that in other places y my system, the most of
the time in tests, but I'm trying to ger the CmsObject when the person
is already logged in, the scenario would be:
- the user access the opencms console (log in)
- clicks on a resource which gets rendered in an html
- the html page has dwr-ajax code which generates a request to the dwr
servlet
- the dwr service needs the CmsObject, the user is already logged in,
so, I don't want to use loginUser again, and actually, I should not have
the password every time.
Thanks
Hernan
Mathias Lin|SYSVISION wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Hernan,
I use Spring w/ OpenCms but not DWR.
The CmsObject can be initialized as follows:
CmsObject cmsObj =
OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());
...and then do something like login for example...
String s = cmsObj.loginUser("Admin", "admin");
HTH,
Mathias
Hernán Leoni wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I'm working with opencms and dwr + spring.
I'm doing it quite well, but at this moment I'm stuck here, the
question
is: how can I access the CmsObject from a servlet other than the
opencms
servlet.
As far as I could see the CmsObject is generated in OpenCmsCore
<a class="moz-txt-link-rfc2396E" href="http://files.opencms.org/javadoc/core/org/opencms/main/OpenCmsCore.html"><http://files.opencms.org/javadoc/core/org/opencms/main/OpenCmsCore.html></a>,
but all methods are privates and I think I should not touch code in
there.
I would thanks any help.
</pre>
</blockquote>
</blockquote>
<pre wrap="">-----
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
<pre wrap=""><!---->
-----
Mathias Lin
SYSVISION Ltd., China
<a class="moz-txt-link-freetext" href="http://www.sysvision.com">http://www.sysvision.com</a>
</pre>
</blockquote>
</body>
</html>