Files
alfresco-community-repo/config/alfresco/bootstrap-context.xml
Derek Hulley 97654618ad Fix for AR-1432: Patches for FK indexes
Fix for AR-1433: Upgrade failures on PostgreSQL
Partial fix for AR-160: Concurrency fix for version counter
Partial fix for AR-1483: Synchronization issues

This is an overhaul of the current state of the upgrade scripts.  All redundant scripts have been ripped out and replaced
with fresh 2.1 scripts.  Indexes for FK relationships have been put in place where required.  Several edge cases have been
dealt with including columns being added to two indexes, Sybase not allowing column additions for NOT NULL columns of
certain types, etc.

These changes have been tested for 1.4.0 -> 2.0 -> 2.1 on
MySQL
Oracle
Sybase
PostgreSQL

Found a bug in the VersionCounter Hibernate classes where the optimistic version support was not implemented.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-07-11 23:38:59 +00:00

403 lines
15 KiB
XML

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
Repository Bootstrap Sequence.
This file specifies the initialisation (and order of initialisation) to perform during Repository startup.
The pattern for adding new initialisation to the bootstrap sequence is as follows:
1) Develop a bean that implements the Spring interface ApplicationListener
2) Place the initialisation logic in the method onApplicationEvent(ApplicationEvent event)...
public void onApplicationEvent(ApplicationEvent event)
{
if (event instanceof ContextRefreshedEvent)
{
// initialisation logic here
}
}
3) Add the bean definition to this file - Note: the beans are initialised in the order they are specified.
-->
<beans>
<!-- ensure that the schema is bootstrapped -->
<bean id="schemaBootstrap" class="org.alfresco.repo.domain.schema.SchemaBootstrap" >
<property name="localSessionFactory">
<ref bean="&amp;sessionFactory"></ref> <!-- inject the actual factory, not a session -->
</property>
<property name="updateSchema">
<value>${db.schema.update}</value>
</property>
<property name="postCreateScriptUrls">
<list>
<value>classpath:alfresco/dbscripts/create/2.1/${db.script.dialect}/AlfrescoPostCreate-2.1-FKIndexes.sql</value>
</list>
</property>
<property name="validateUpdateScriptPatches">
<list>
</list>
</property>
<property name="preUpdateScriptPatches">
<list>
<ref bean="patch.schemaUpdateScript-V1.4-1" />
<ref bean="patch.schemaUpdateScript-V1.4-2" />
<ref bean="patch.db-V2.1-NotNullColumns" />
</list>
</property>
<property name="postUpdateScriptPatches">
<list>
<ref bean="patch.db-V2.1-FKIndexes" />
<ref bean="patch.db-V2.1-ExplicitIndexes" />
<ref bean="patch.db-V2.1-JBPMData" />
<ref bean="patch.db-V2.1-VersionColumns2" />
<ref bean="patch.db-V2.1-JBPMProcessKey" />
</list>
</property>
</bean>
<!-- Bootstrap the AVM -->
<bean id="avmBootstrap" class="org.alfresco.repo.avm.AvmBootstrap" >
<property name="issuers">
<list>
<ref bean="nodeIssuer" />
<ref bean="layerIssuer" />
</list>
</property>
<property name="avmLockingAwareService">
<ref bean="avmLockingAwareService"/>
</property>
</bean>
<!-- Bootstrap AVM Locking Service. -->
<bean id="avmLockingBootstrap" class="org.alfresco.repo.avm.locking.AVMLockingBootstrap">
<property name="avmLockingService">
<ref bean="avmLockingService"/>
</property>
</bean>
<!-- Bootstrap Files -->
<bean id="systemInfoBootstrap" parent="systemInfoImporter">
</bean>
<bean id="userBootstrap" parent="userStoreImporter">
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/alfrescoUserStore.xml</prop>
</props>
<props>
<prop key="path">/${alfresco_user_store.system_container.childname}</prop>
<prop key="location">alfresco/bootstrap/alfrescoAuthorityStore.xml</prop>
</props>
<props>
<prop key="path">/${alfresco_user_store.system_container.childname}</prop>
<prop key="location">alfresco/bootstrap/alfrescoAuthorityStorePermission.xml</prop>
</props>
</list>
</property>
</bean>
<bean id="systemBootstrap" parent="systemStoreImporter">
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/descriptor.xml</prop>
</props>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/systemRegistry.xml</prop>
</props>
</list>
</property>
</bean>
<bean id="versionBootstrap" parent="versionStoreImporter">
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/lightWeightVersionStore.xml</prop>
</props>
</list>
</property>
</bean>
<bean id="spacesArchiveBootstrap" parent="spacesArchiveStoreImporter">
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/spacesArchive.xml</prop>
</props>
</list>
</property>
</bean>
<bean id="spacesBootstrap" parent="spacesStoreImporter">
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/spaces.xml</prop>
<prop key="messages">alfresco/messages/bootstrap-spaces</prop>
</props>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/system.xml</prop>
</props>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/categories.xml</prop>
</props>
<props>
<prop key="path">/</prop>
<prop key="location">alfresco/bootstrap/multilingualRoot.xml</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.guest_home.childname}</prop>
<prop key="location">alfresco/bootstrap/tutorial.xml</prop>
<prop key="messages">alfresco/messages/bootstrap-tutorial</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.childname}</prop>
<prop key="location">alfresco/templates/software_engineering_project.xml</prop>
<prop key="messages">alfresco/messages/bootstrap-templates</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname}</prop>
<prop key="location">alfresco/templates/content_template_examples.xml</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname}</prop>
<prop key="location">alfresco/templates/readme_template.xml</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</prop>
<prop key="location">alfresco/templates/email_templates.acp</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.rss.childname}</prop>
<prop key="location">alfresco/templates/rss_templates.acp</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.scripts.childname}</prop>
<prop key="location">alfresco/bootstrap/example_javascripts.acp</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
<prop key="location">alfresco/bootstrap/webScripts.xml</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
<prop key="location">alfresco/bootstrap/webScriptsExtensions.xml</prop>
</props>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
<prop key="location">alfresco/bootstrap/webScriptsReadme.xml</prop>
</props>
</list>
</property>
</bean>
<bean id="workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/review_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/adhoc_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
<props>
<!-- WCM workflow definition -->
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/submit_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
<props>
<!-- WCM workflow definition -->
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/changerequest_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
</list>
</property>
<property name="models">
<list>
<value>alfresco/workflow/workflowModel.xml</value>
<value>alfresco/workflow/wcmWorkflowModel.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/workflow/workflow-messages</value>
<value>alfresco/workflow/wcm-workflow-messages</value>
</list>
</property>
</bean>
<!-- Bootstrap any extensions -->
<import resource="classpath*:alfresco/extension/bootstrap/*-context.xml" />
<!-- Descriptor Service -->
<bean id="descriptorComponent" class="org.alfresco.repo.descriptor.DescriptorServiceImpl">
<property name="descriptor">
<value>classpath:alfresco/version.properties</value>
</property>
<property name="systemBootstrap">
<ref bean="systemBootstrap"/>
</property>
<property name="transactionService">
<ref bean="transactionService"/>
</property>
<property name="namespaceService">
<ref bean="namespaceService"/>
</property>
<property name="nodeService">
<ref bean="nodeService"/>
</property>
<property name="searchService">
<ref bean="searchService"/>
</property>
</bean>
<!-- Perform index recovery before applying any patches -->
<!-- rebuild the index if required - before we check that it is there -->
<bean id="indexRecoveryBootstrap" class="org.alfresco.repo.node.index.IndexRecoveryBootstrapBean" >
<property name="indexRecoveryComponent">
<ref bean="indexRecoveryComponent"/>
</property>
</bean>
<bean id="avmIndexRecoveryBootstrap" class="org.alfresco.repo.node.index.IndexRecoveryBootstrapBean" >
<property name="indexRecoveryComponent">
<ref bean="avmIndexRecoveryComponent"/>
</property>
</bean>
<!-- This component checks the interconnection between the metadata, indexes and content -->
<bean id="configurationChecker" class="org.alfresco.repo.admin.ConfigurationChecker">
<property name="strict">
<value>${system.bootstrap.config_check.strict}</value>
</property>
<property name="dirRoot">
<value>${dir.root}</value>
</property>
<property name="indexRecoveryMode">
<value>${index.recovery.mode}</value>
</property>
<!-- helper beans -->
<property name="transactionService">
<ref bean="transactionService"/>
</property>
<property name="systemBootstrap">
<ref bean="systemBootstrap"/>
</property>
<property name="namespaceService">
<ref bean="namespaceService"/>
</property>
<property name="nodeService">
<ref bean="nodeService"/>
</property>
<property name="searchService">
<ref bean="searchService"/>
</property>
<property name="contentService">
<ref bean="contentService"/>
</property>
</bean>
<!-- This component ensures that patches get applied on startup -->
<bean id="patchExecuter" class="org.alfresco.repo.admin.patch.PatchExecuter">
<property name="transactionService">
<ref bean="transactionService" />
</property>
<property name="patchService">
<ref bean="PatchService" />
</property>
</bean>
<!-- Import other Alfresco bootstrap components -->
<import resource="classpath*:alfresco/alfresco-*-bootstrap-context.xml" />
<!-- Start module components -->
<bean id="moduleStarter" class="org.alfresco.repo.module.ModuleStarter">
<property name="moduleService">
<ref bean="ModuleService" />
</property>
</bean>
<!-- CIFS Server -->
<bean id="fileServerConfiguration" class="org.alfresco.filesys.server.config.ServerConfiguration" parent="fileServerConfigurationBase">
<property name="configService">
<ref bean="fileServersConfigService"/>
</property>
</bean>
<bean id="cifsServer" class="org.alfresco.filesys.CIFSServer" destroy-method="stopServer">
<constructor-arg>
<ref local="fileServerConfiguration"/>
</constructor-arg>
</bean>
<!-- FTP Server -->
<bean id="ftpServer" class="org.alfresco.filesys.FTPServer" destroy-method="stopServer">
<constructor-arg>
<ref local="fileServerConfiguration"/>
</constructor-arg>
</bean>
<!-- NFS Server -->
<bean id="nfsServer" class="org.alfresco.filesys.NFSServer" destroy-method="stopServer">
<constructor-arg>
<ref local="fileServerConfiguration"/>
</constructor-arg>
</bean>
<!-- Start the quartz scheduler -->
<bean id="schedulerStarter" class="org.alfresco.util.SchedulerStarterBean" >
<property name="scheduler">
<ref bean="schedulerFactory"/>
</property>
</bean>
<!-- Startup Message -->
<bean id="startupLog" class="org.alfresco.repo.descriptor.DescriptorStartupLog">
<property name="descriptorService">
<ref local="descriptorComponent"/>
</property>
</bean>
<!-- Workflow Scheduler -->
<bean id="workflowScheduler" class="org.alfresco.repo.workflow.jbpm.JBPMScheduler">
<property name="JBPMTemplate" ref="jbpm_template" />
</bean>
</beans>