On 12/21/2010 01:13 PM, Vito Impagliazzo wrote:
> Thanks Marius,
> yes I already found out about the .gwtrpc filter and this is working fine,
> also I was already able to lookup other components, including the Execution
> component, where, I just found out, I can
>
> XWikiContext xwikicontext =
> (XWikiContext)execution.getContext().getProperty("xwikicontext");
> XWikiUser user = xwikicontext.getXWikiUser();
> if ( user.getUser().equals("XWiki.Guest") ) {
> //User is not authenticated
> }
>
> in fact I think I was before trying to access the old context as it would be
> accessed by old plugins or something like that, I am slowly finding my way
> in the new component structure. Thanks for your prompt answer!
> Vito
>
> P.S. great and smart integration for the gwt servlets! enough to declare
> them as a normal component! Just strange to find the
> XWikiRemoteServiceServlet in the wysiwig component.
It's there because:
* it was developed for the WYSIWYG editor which is the only module
relying on it so far and
* it depends on the old XWiki core to lookup components, specifically
com.xpn.xwiki.web.Utils.getComponent(Class), so I couldn't move it to
one of the new component-oriented modules
* I hesitated to move it to the old XWiki core because the current
practice is to move things out of the core not in.
Since you don't have to depend on the WYSIWYG editor module to be able
to use it we can keep it where it is for now.
Thanks,
Marius
>
> On Tue, Dec 21, 2010 at 12:03 PM, Marius Dumitru Florea<
> [email protected]> wrote:
>
>> Hi Vito,
>>
>> On 12/21/2010 11:51 AM, Vito Impagliazzo wrote:
>>> I have written a gwt servlet which I could successfully use in a gwt
>> client
>>> inserted through a component into a xwiki page. I now wonder how I can
>> check
>>> user authentication from the gwt servlet, since even though I can lookup
>>> other components, the context variables are empty.
>>
>> First of all, you should know that we have a generic GWT-RPC servlet
>> which is mapped to all URLs ending with .gwtrpc and which looks up XWiki
>> components. In other words, you can implement a RemoteService as an
>> XWiki component without touching the web.xml file (i.e. without adding a
>> new servlet mapping).
>>
>> See
>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module
>> for details about XWiki components. You can take as an example
>>
>> http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-client/src/main/java/org/xwiki/gwt/wysiwyg/client/cleaner/HTMLCleaner.java
>> with its implementation
>>
>> http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-server/src/main/java/com/xpn/xwiki/wysiwyg/server/internal/cleaner/DefaultHTMLCleaner.java
>> .
>>
>> If you still want to use your own GWT-RPC servlet then in order to have
>> the XWiki context initialized you need to map the
>> XWikiContextInitializationFilter to your servlet. Checkout web.xml to
>> see what is done for "gwtrpc" servlet.
>>
>> Hope this helps,
>> Marius
>>
>>>
>>> thanks
>>> Vito Impagliazzo
>>> _______________________________________________
>>> devs mailing list
>>> [email protected]
>>> http://lists.xwiki.org/mailman/listinfo/devs
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>
>
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs