cancel
Showing results for 
Search instead for 
Did you mean: 

AMP bootstrap

kma
Champ in-the-making
Champ in-the-making
Hi,

I am working with a Alfresco module where I use bootstrap functionality
to create folders and content, this works perfect.

My problem is when I add more folders and content, they are not created
because the bootstrap process is only executed once. If I use the property
'executeOnceOnly'  I get a 'DuplicateChildNodeNameException' exception on
the folder which already exist in the repository.

How can I avoid this situation ?

Thanks,
Karsten
1 REPLY 1

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

Yeah, this is a pain when developing an AMP .. in reality you only want this bootstrap to run once in the installed AMP, but whilst your are developing you want to be able to re-run this bean to add your changes.

The most obvious and time consuming way is to clear your dB and indexes out and re-install your AMP everytime  you make a change to bootstrap. 

Another, less painful, technique I use is to create a unit test that calls the bootstrap XML files by hand and re-uploads them, thus refreshing the repo and testing the updates to the bootstrap.

Have a look in the PHP module for an example of this. (PHPUpdateExamplesTest.java)

Cheers,
Roy