cancel
Showing results for 
Search instead for 
Did you mean: 

FTR postCommit callback

benswitzer
Champ in-the-making
Champ in-the-making
Good day,

Looking for some guidance on how to call a bash shell script from FTR after a successful replication job.

There are references to being able to execute a callback here: http://wiki.alfresco.com/wiki/FSR#postCommit_callback

I can also see that code exists in FileSystemDeploymentTarget.java to do so.

My question is, where and how do I configure FSR to perform a callback?

Thanks,
Ben
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
You inject your callback via spring into the definition of your deployment target.

Here's an extract from filesystem-target-sample.xml

            <!–  Add your prepare callbacks here –>
            <property name="prepare">
               <list>
                  <bean class="org.alfresco.deployment.SampleRunnable" />
               </list>
            </property>
            
            <!–  Add your postCommit callbacks here –>
            <property name="postCommit">
               <list>
                  <bean class="org.alfresco.deployment.SampleRunnable" />
               </list>
            </property>
   

There's a sample Java class org.alfresco.deployment.ProgramRunnable that can run a program such as bash.   It has three properties, program, directory and arguments.

benswitzer
Champ in-the-making
Champ in-the-making
Hi Mark,

Thanks for you quick response.

Sorry, I'm not following.  There's a hole in my knowledge.  Does the filesystem-target-sample.xml live under the File Transfer Target folder of your desired destination in your repo or is it deployed to the FSR?

Thanks,
Ben

Ahh, please excuse my ignorance.  I was using the File Transfer Receiver as opposed to the Deployment Receiver.

Trying the Deployment Receiver now.

Hi again Mark,

After doing some more research, I have another Q.  Is there anyway to call a script using File Transfer Receiver as opposed to the Deployment Receiver?  I have no interest in boot-strapping AVM.

The FTR works well and is straight forward enough to setup.  Just need to invoke an external script.

Ok well, in the end I downloaded the Alfresco source code and created a mechanism to handle the callbacks.  Based my patch on existing code from the Deployment Receiver.