Re: [xwiki-users] On Space Created Event

2012-04-18 Thread mohit gupta
Just to give you heads up you can mention  below property in xwiki.cfg file

xwiki.authentication.authclass=com.MyAuthClass.

Now in MyAuthClass  you can check
XWikiContext.getAction().equals("create")// it means user is creating some
doc. I am not sure if we have some variable in  XWikiContext thru which you
can distinguish if it is a space or not(may be some yo can check the parent
of doc to be created). If Not, you can follow the convention that user
always create the space document suffixed with "MySpace" and one more check
in this custom class

(XWikiContext.getURL().toString().contains("MySpace/")).

Hope it helps.

On Tue, Apr 17, 2012 at 7:01 PM, _diego  wrote:

> Hi,
>
> How can I register a java event listener against a space created event? I
> would need this to add some stuff to another database everytime a new space
> was created.
>
> Thanks
>
> --
> View this message in context:
> http://xwiki.475771.n2.nabble.com/On-Space-Created-Event-tp7473505p7473505.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] On Space Created Event

2012-04-18 Thread _diego
Thanks, 

However I'm still having a problem. I'm implementing an EventListener as
described 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Observation+Module+Local
here  with the component annotation and the corresponding line in
components.txt. However when I try to start xwiki, there's a
NoClassDefFound:

java.lang.NoClassDefFoundError: Could not initialize class org.MyExample.

I've checked and it is in the jar file I created.

--
View this message in context: 
http://xwiki.475771.n2.nabble.com/On-Space-Created-Event-tp7473505p7476387.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] On Space Created Event

2012-04-17 Thread Vincent Massol
Hi Diego,

On Apr 17, 2012, at 3:31 PM, _diego wrote:

> Hi,
> 
> How can I register a java event listener against a space created event? I
> would need this to add some stuff to another database everytime a new space
> was created. 

You cannot because spaces don't exist in the model! :) Spaces are just document 
namespaces.

You can register an event when a document is created and then check the space 
the document is in.

Thanks
-Vincent

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] On Space Created Event

2012-04-17 Thread _diego
Hi,

How can I register a java event listener against a space created event? I
would need this to add some stuff to another database everytime a new space
was created. 

Thanks

--
View this message in context: 
http://xwiki.475771.n2.nabble.com/On-Space-Created-Event-tp7473505p7473505.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users