Re: Jackrabbit Observation with Spring

2010-02-05 Thread AElshereay
Thank you very much Ben. I am using now the way of how to add the listeners in the applicationContext.xml, and in any case I will need to add listeners externally, sure I will use the code you sent to me. I just was curious to know why the jcrTemplate was not able to add the listeners. Have a n

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Ben Short
Here is the code. /** * @see org.springmodules.jcr.SessionFactory#getSession() */ public Session getSession() throws RepositoryException { return addListeners(repository.login(credentials, workspaceName)); } /** * Hook for adding listeners to the newly returned session. We have to treat

Re: Jackrabbit Observation with Spring

2010-02-04 Thread AElshereay
will do. Thank you once more for your help.

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Ben Short
Maybe have a look at the jcrsessionfactory source code and see how it registers the listeners. On 2/4/10, aelsher...@idc.com wrote: > Ben, that's really wonderful I got it working finally as I added the stuff > you sent to the applicationContext.xml and removed the listenerRegistrar > bean too. T

Re: Jackrabbit Observation with Spring

2010-02-04 Thread AElshereay
Ben, that's really wonderful I got it working finally as I added the stuff you sent to the applicationContext.xml and removed the listenerRegistrar bean too. Thank you so much. But I am really wondering what was wrong with observationManager.addEventListener() method in the ListenerRegistrar?

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Alexander Klimetschek
On Thu, Feb 4, 2010 at 13:06, wrote: > When I try to get the number of registered listeners with the same session > before to return as you see below I also get -1! This could also indicate that your listeners list is empty for some reason. Regards, Alex -- Alexander Klimetschek alexander.kli

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Ben Short
Sorry that should of been 'can add the event listener' You could pass the JcrSessionFactory into your ListenerRegistrar and in the init method get a session and add the listeners via it. Make sure you implement a destroy method that logs out the session. On 4 February 2010 15:05, Ben Short wrote

Re: Jackrabbit Observation with Spring

2010-02-04 Thread AElshereay
When I try to get the number of registered listeners with the same session before to return as you see below I also get -1! @PostConstruct public void register(){ jcrTemplate.execute(new JcrCallback() { public Object doInJcr(final Session session) throws Repos

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Ben Short
Hi, Looking at the documentation [1] you have to add the Event Listener to the JcrSessionFactory bean. ... [1] https://springmodules.dev.java.net/docs/reference/0.8/html_single/#d0e5257 On 4 February 2010 15:00, Alexander Klimetschek wrote:

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Alexander Klimetschek
On Thu, Feb 4, 2010 at 12:27, wrote: >                jcrTemplate.execute(new JcrCallback() { >            public Object doInJcr(final Session session) throws > RepositoryException { >                ObservationManager observationManager = > session.getWorkspace().getObservationManager(); I th

Re: Jackrabbit Observation with Spring

2010-02-04 Thread AElshereay
Hi Alexander, Thank you very much for replying. Here I provide more details: Here're the java classes: - public class ListenerProperties { private EventListener eventListener; private int eventTypes; private String absPath; priv

Re: Jackrabbit Observation with Spring

2010-02-04 Thread Alexander Klimetschek
On Tue, Feb 2, 2010 at 09:04, wrote: > The problem is that the message NEW NODE ADDED is never been printed means > onEvent() method is never invocked!! Can you provide the code that does the event listener registration and the code snippet you use to create content (to see the node structure cr

Jackrabbit Observation with Spring

2010-02-02 Thread AElshereay
Hi All, I am new to observation, although the repository supports observation, onEvent() is never invocked. Here're the details: I created a Param class, and it's just a POJO with setters and getters hasing properties that each represents a parameter for: ObservationManager.addEventListener()