[opencms-dev] Re: Direct edit
Christian Steinert
christian_steinert at web.de
Sat Mar 4 15:06:28 CET 2006
Uhlig, Roman wrote:
>> Hi Roman,
>>
>> I must admit, that I have not tried this yet.
>>
>> What happens, if you do not redirect, but after logging in, etc output
>>
> the following:
>
>> <cms:user property="name"/>
>> <%=cmsObject.getRequestContext().getCurrentProject().getName() %>
>> <%=cmsObject.getRequestContext().getSiteRoot() %>
>>
>>
>> Regards
>> Christian
>>
>
>
> Hi Christian,
>
> I tried what you suggested and additionally changed the usage of
> CmsObject from
>
> CmsObject cmsObject = OpenCms.initCmsObject();
>
> to
>
> CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> request, response);
> cms.getCmsObject().....
>
> so I get this piece of testing code:
>
> <% CmsJspActionElement cms = new
> CmsJspActionElement(pageContext, request, response); %>
>
> // before user login and project switch
> <cms:user property="name"/>
> <%=
> cms.getCmsObject().getRequestContext().currentProject().getName() %>
> <%= cms.getCmsObject().getRequestContext().getSiteRoot() %>
>
> <%
> cms.getCmsObject().loginUser("xxx","yyy");
> CmsProject cmsproject = cms.getCmsObject().readProject(
> "Offline" );
> cms.getCmsObject().getRequestContext().setCurrentProject(
> cmsproject );
> cms.getCmsObject().getRequestContext().setSiteRoot(
> "/sites/default" );
> %>
>
> // after user login and project switch
> <cms:user property="name"/>
> <%=
> cms.getCmsObject().getRequestContext().currentProject().getName() %>
> <%= cms.getCmsObject().getRequestContext().getSiteRoot() %>
>
> It's giving me an output like this:
>
> Guest
> Online
> /sites/default
>
> xxx
> Offline
> /sites/default
>
> So project switching and logging in seems to work, but the odd thing is,
> that direct edit features still dont show up. If I reload that test
> page, I'm getting the same output again, what means I was guest user
> inside the Online project again. Seems like the page has finished
> loading, I'm set back to guest user and Online project?
>
> I must confess, I'm a bit confused. It would be great if someone could
> clearify that a bit. Again, all I wanna do is providing a custom login
> page for granting access to the direct edit features for workplace users
> without accessing the workplace.
>
> Thank you in advance,
> Roman Uhlig
>
>
>
> _______________________________________________
> 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
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
Dear Roman,
Looks as if the session gets lost. Of course your browser needs to
accept cookies, but that will probably not be the reason.
But did you write a
<%@ page session="true" %>
at the beginning of your jsp page?
Christian
More information about the opencms-dev
mailing list