AnsweredAssumed Answered

Deployment Config Alfresco 3.2

Question asked by lynnders on Mar 11, 2010
Latest reply on Apr 14, 2010 by lynnders
I'm upgrading from Alfresco 3.0 to 3.2 - I've got stuck on the config in the Deployment application-context.xml

My original 3.0 application-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
   <bean id="deployScript" class="org.alfresco.deployment.ProgramRunnable">
         <property name="program"><value>/opt/application/deployments/deploy.sh</value></property>
         <!– Arguments that get appended to the final command line –>
         <property name="arguments">
             <list>
                 <value></value>
             </list>
         </property>
         <!– The directory that the program runs in. –>
         <property name="directory"><value>/</value></property>
    </bean>

    <bean id="properties"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:deployment.properties</value>
            </list>
        </property>
    </bean>

    <bean id="configuration" class="org.alfresco.deployment.config.Configuration"
          init-method="init">
        <property name="dataDirectory">
            <value>${dep.datadir}</value>
        </property>
        <property name="logDirectory">
            <value>${dep.logdir}</value>
        </property>
        <property name="metaDataDirectory">
            <value>${dep.metadatadir}</value>
        </property>
        <!– Target Configuration. Modify for your site. –>
        <property name="targetData">
            <map>
                <entry key="default">
                    <map>
                        <entry key="root"><value>/opt/application/deployments/data</value></entry>
                        <entry key="user"><value>user</value></entry>
                        <entry key="password"><value>password</value></entry>
                        <entry key="runnables">
                          <list>
                             <ref bean="deployScript"/>
                          </list>
                        </entry>
                    </map>
                </entry>
            </map>
        </property>
    </bean>

    <bean id="deploymentReceiverService" class="org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl"
          init-method="init">
        <property name="configuration">
            <ref bean="configuration"/>
        </property>
    </bean>

    <bean id="deploymentReceiverTransport" class="org.alfresco.deployment.impl.server.DeploymentReceiverTransportImpl">
        <property name="deploymentReceiverService">
            <ref bean="deploymentReceiverService"/>
        </property>
    </bean>

        <bean id="deploymentReceiverTransportRMI" class="org.springframework.remoting.rmi.RmiServiceExporter">
                <property name="service">
                        <ref bean="deploymentReceiverTransport"/>
                </property>
                <property name="serviceInterface">
                        <value>org.alfresco.deployment.DeploymentReceiverTransport</value>
                </property>
                <property name="serviceName">
                        <value>deployment</value>
                </property>
                <property name="registryPort">
                        <value>${dep.rmi.port}</value>
                </property>
        </bean>
</beans>

I'm trying to replicate the functionality in "configurartion" bean that sets "targetData" property that calls "deployScript".

My new 3.2 application-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!– Stand alone deployment server –>

<beans>

    <bean id="deployScript" class="org.alfresco.deployment.ProgramRunnable">
         <property name="program"><value>/opt/application/deployments/deploy.sh</value></property>
         <!– Arguments that get appended to the final command line –>
         <property name="arguments">
             <list>
                 <value></value>
             </list>
         </property>
         <!– The directory that the program runs in. –>
         <property name="directory"><value>/</value></property>
    </bean>
   
     <bean id="properties"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:deployment.properties</value>
            </list>
        </property>
    </bean>
   
    <import resource="classpath*:deployment/*-context.xml" />  
    <import resource="classpath*:deployment/*-target.xml" />
   
    <!–  command queue for deployment service –>
    <bean id="deploymentReceiverCommandQueue" class="org.alfresco.deployment.impl.server.DeploymentCommandQueueImpl" >
    </bean>

       
    <!–  Reader management –>
    <bean id="deploymentReaderManagement" class="org.alfresco.deployment.impl.server.ReaderManagementPool" >
    </bean>
   
    <!–  This is the common configuration for all file system receivers –>
    <bean id="fileSystemReceiverService" class="org.alfresco.deployment.impl.fsr.FileSystemReceiverServiceImpl"
          init-method="init">
         
        <!– Will an error be thrown if the FSR overwrites files outside its control –>
        <property name="errorOnOverwrite"><value>${deployment.filesystem.errorOnOverwrite}</value></property>
       
        <!–  Where to store temporary data –> 
        <property name="dataDirectory">
            <value>${deployment.filesystem.datadir}</value>
        </property>
       
        <!–  Where to log information –>
        <property name="logDirectory">
            <value>${deployment.filesystem.logdir}</value>
        </property>
       
        <property name="commandQueue"><ref bean="deploymentReceiverCommandQueue" /></property>
       
    </bean>
   
    <!–  Housekeeper for the file system service deployment receivers –>
    <bean id="fileSystemReceiverHousekeeper" class="org.alfresco.deployment.impl.fsr.FileSystemReceiverHousekeeper"
       init-method="init">
       <property name="fileSystemReceiverService"><ref bean="fileSystemReceiverService"/></property>
    </bean>
   
    <!–  Housekeeper for the deployment queue  –>
    <bean id="commandQueueHousekeeper" class="org.alfresco.deployment.impl.server.DeploymentCommandQueueHousekeeper"
       init-method="init">
       <property name="commandQueue"><ref bean="deploymentReceiverCommandQueue" /></property>
    </bean>
   
    <!– This is the deployment engine  –>
    <bean id="deploymentReceiverEngine"
       class="org.alfresco.deployment.impl.server.DeploymentReceiverEngineImpl"
        init-method="init">
       
        <!– How long to wait before polling housekeeping –>
        <property name="pollDelay"><value>5000</value></property>
       
        <property name="commandQueue"><ref bean="deploymentReceiverCommandQueue" /></property>
       
        <property name="readerManagement">
           <ref bean="deploymentReaderManagement" />
        </property>
       
        <!–  The authenticator to access the deployment receiver engine (for shutdown) –>
        <property name="authenticator">
           <bean class="org.alfresco.deployment.impl.server.DeploymentReceiverAuthenticatorSimple">
                 <property name="user"><value>${deployment.user}</value></property>
                 <property name="password"><value>${deployment.password}</value></property>
           </bean>
        </property>
       
        <!– Define your content transformers here
        <property name="transformers">
            <list>
            </list>
        </property>
        –>
       
        <!– Define your housekeepers here –>
        <property name="housekeepers">
           <set>
           <ref bean="commandQueueHousekeeper"/>
           </set>
        </property>
    </bean>
   
    <!–  The remote interface for the deployment server –>
   
   <bean id="deploymentReceiverTransportRMI" class="org.springframework.remoting.rmi.RmiServiceExporter">
      <property name="service">
         <ref bean="deploymentReceiverEngine"/>
      </property>
      <property name="serviceInterface">
         <value>org.alfresco.deployment.DeploymentReceiverTransport</value>
      </property>
      <property name="serviceName">
         <value>deployment</value>
      </property>
      <property name="registryPort">
         <value>${deployment.rmi.port}</value>
      </property>
      <property name="servicePort">
         <value>${deployment.rmi.service.port}</value>
      </property>
   </bean>

   <!– 
   
   Defines and registers the deployment target with the name "default"
   Which is a FileSystemDeploymentTarget with the "deploymentReceiverEngine"
   –>

   <bean
      class="org.alfresco.deployment.impl.server.DeploymentTargetRegistrationBean"
      init-method="register">

      <property name="name">
         <value>${deployment.filesystem.default.name}</value>
      </property>
      <property name="registry">
         <ref bean="deploymentReceiverEngine" />
      </property>
      <property name="target">
         <bean class="org.alfresco.deployment.impl.fsr.FileSystemDeploymentTarget"
            init-method="init">
            
            <!–  Where too store content –>
            <property name="rootDirectory">
               <value>${deployment.filesystem.default.rootdir}</value>
            </property>

            <!–  Where to store metadata –>
            <property name="metaDataDirectory">
               <value>${deployment.filesystem.metadatadir}/${deployment.filesystem.default.name}</value>
            </property>

            <property name="autoFix">
               <value>${deployment.filesystem.autofix}</value>
            </property>
            <property name="fileSystemReceiverService">
               <ref bean="fileSystemReceiverService" />
            </property>

            <!–  how to authenticate for this particular target –>
            <property name="authenticator">
               <bean
                  class="org.alfresco.deployment.impl.server.DeploymentReceiverAuthenticatorSimple">
                  <property name="user">
                     <value>${deployment.filesystem.default.user}</value>
                  </property>
                  <property name="password">
                     <value>${deployment.filesystem.default.password}</value>
                  </property>
               </bean>
            </property>

            <property name="name">
               <value>${deployment.filesystem.default.name}</value>
            </property>

            </property>
            <!–
               Target Event Handlers <property name="prepare"> <list> <bean
               class="org.alfresco.deployment.SampleRunnable"/> </list>
               </property> <property name="postCommit"> <list> <bean
               class="org.alfresco.deployment.SampleRunnable"/> </list>
               </property>
            –>
         </bean>
      </property>
   </bean>
   
</beans>

Any ideas what I should be setting/doing/adding?

Thanks in advance…

Outcomes