[opencms-dev] Java Action class for checking content changed/created

Sylvain Courcelle s.courcelle at eurelis.com
Tue Dec 11 10:28:09 CET 2007


Hi,
Concerning Action classes, you have to respect only 3 steps :
1) declaring the action class ( full package name without ".class" termination ) in the module configuration
2) developing your own Java class as Action Class : this action class must implement I_CmsModuleAction ( an OpenCMS API interface ).
3) place the brand new class in the Classes directory of your module.

NB: ActionClasses are always used in a Module context. If you don't have one, you should create it.

Then, concerning events capture ...
The I_CmsModuleAction interface defines many methods :
- initialize
- moduleUninstall
- publishProject
And a more important one :
cmsEvent(CmsEvent event)

in this method's body, you can analyse the type of the "event" param to trigger your own actions.

Nevertheless, I don't have a precise idea concerning the manner you could detect changes on a precise Ressource of VFS. Maybe You'll have to declare your own CmsEvent, and make the system listen to it ( look at method AddCmsEventListener of class CmsEventManager, reachable via OpenCms.getEventManager() ).

Hope it will help,
Regards,
Sylvain Courcelle
EURELIS




-----Message d'origine-----
De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de gsriman
Envoyé : mardi 11 décembre 2007 05:37
À : opencms-dev at opencms.org
Objet : [opencms-dev] Java Action class for checking content changed/created


Hi All,
  I am new to Opencms and Java. I am trying to write a java class as event
listener that triggers wheneever the file/content in opencms is changed or
created and send an email to the project manager that file has been changed.
Could anybody help me the steps needed to create java class for this and
necessary steps required to make this happen.

Thanks in advance
Sriman
-- 
View this message in context: http://www.nabble.com/Java-Action-class-for-checking-content-changed-created-tp14019559p14019559.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.


_______________________________________________
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



More information about the opencms-dev mailing list