cancel
Showing results for 
Search instead for 
Did you mean: 

AMP module initialization code

stijndereede
Champ in-the-making
Champ in-the-making
Hi all,

I have and AMP module, and for this module to work correctly it is necessary that two folders exist in the workspace (because nodes get moved there). I could of course every time the module tries to move a node check if the folders exists, and if not create it, but I think this would cause a performance hit.
Instead, when Alfresco loads the module (probably at startup), I would like to run an (Java) init() method that allows me to create the folders if they don't exist. How would I do this? What do I need to place in the module-context.xml and where do I need to place the Java code?

Regards,

Stijn

PS: I would also like to create rules on one of the folders, this would need to go in the same init() method I think?
1 REPLY 1

stijndereede
Champ in-the-making
Champ in-the-making
I'm a bit further already: I understand that I can create a bean in my module-context.xml which references a class of in module. In this bean and in my class I can then put an init() method where I might check for the existence of the folder.
However, the next problem is that I'm not allowed to use the nodeService at the time of the init() execution.
For details, see my post in this topic: http://forums.alfresco.com/viewtopic.php?t=10532