RM-360: Upgrade from RM 1.0 to RM 2.0 failed

* By passed issues caused by changing AMP name ... seems the component registry isn't updated so some are re-run, potentially causing issues
  * Added compatibility class ... is referenced by a 1.0 custom model .. also gives us a slot if other issues arrise .. may move some of the other compatibility code in here if I get time
  * Tested upgrading from V3.4.x to V4.0.1 with RM 2.0



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@36597 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-05-21 06:20:01 +00:00
parent af1120574f
commit d7d9f151ec
7 changed files with 101 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="source/java"/> <classpathentry kind="src" path="source/java"/>
<classpathentry kind="src" path="source/compatibility"/>
<classpathentry kind="src" path="test/java"/> <classpathentry kind="src" path="test/java"/>
<classpathentry kind="src" path="test/resources"/> <classpathentry kind="src" path="test/resources"/>
<classpathentry kind="src" path="explodedDeps/config"/> <classpathentry kind="src" path="explodedDeps/config"/>

View File

@@ -1,3 +1,6 @@
sourceSets.main.java.srcDirs = [sourceJavaDir, 'source/compatibility']
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') compile fileTree(dir: 'libs', include: '*.jar')

View File

@@ -61,7 +61,7 @@
<cm:content>contentUrl=classpath:alfresco/module/org_alfresco_module_rm/bootstrap/content/recordsCustomModel.xml|mimetype=text/plain|encoding=UTF-8</cm:content> <cm:content>contentUrl=classpath:alfresco/module/org_alfresco_module_rm/bootstrap/content/recordsCustomModel.xml|mimetype=text/plain|encoding=UTF-8</cm:content>
<cm:title>recordsCustomModel.xml</cm:title> <cm:title>recordsCustomModel.xml</cm:title>
<cm:name>recordsCustomModel.xml</cm:name> <cm:name>recordsCustomModel.xml</cm:name>
<cm:modelName>{http://www.alfresco.org/model/rmcustom/1.0}rmc</cm:modelName> <cm:modelName>{http://www.alfresco.org/model/rmcustom/1.0}rmcustom</cm:modelName>
<cm:modelDescription>Records Management Custom Model</cm:modelDescription> <cm:modelDescription>Records Management Custom Model</cm:modelDescription>
<cm:modelAuthor>Alfresco</cm:modelAuthor> <cm:modelAuthor>Alfresco</cm:modelAuthor>
<cm:modelVersion>1.0</cm:modelVersion> <cm:modelVersion>1.0</cm:modelVersion>

View File

@@ -4,16 +4,15 @@
<beans> <beans>
<!-- Bootstrap records management data --> <!-- Bootstrap records management data -->
<bean id="org_alfresco_module_rm_bootstrapData" <bean id="org_alfresco_module_rm_bootstrapData"
class="org.alfresco.repo.module.ImporterModuleComponent" class="org.alfresco.module.org_alfresco_module_rm.bootstrap.BootstrapImporterModuleComponent"
parent="module.baseComponent"> parent="module.baseComponent">
<property name="nodeService" ref="nodeService" />
<property name="moduleId" value="org_alfresco_module_rm"/> <property name="moduleId" value="org_alfresco_module_rm"/>
<property name="name" value="org_alfresco_module_rm_bootstrapData"/> <property name="name" value="org_alfresco_module_rm_bootstrapData"/>
<property name="description" value="Bootstrap records management data"/> <property name="description" value="Bootstrap records management data"/>
<property name="sinceVersion" value="1.0"/> <property name="sinceVersion" value="1.0"/>
<property name="appliesFromVersion" value="1.0"/> <property name="appliesFromVersion" value="1.0"/>
<!-- Data properties -->
<property name="importer" ref="spacesBootstrap"/> <property name="importer" ref="spacesBootstrap"/>
<property name="bootstrapViews"> <property name="bootstrapViews">
<list> <list>
@@ -155,7 +154,8 @@
<!-- Job context --> <!-- Job context -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-job-context.xml"/> <import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-job-context.xml"/>
<bean id="RecordsManagementBootstrap" class="org.alfresco.module.org_alfresco_module_rm.RecordsManagementBootstrap"> <!-- Bootstrap bean -->
<bean id="RecordsManagementBootstrap" class="org.alfresco.module.org_alfresco_module_rm.bootstrap.RecordsManagementBootstrap">
<property name="transactionService" ref="transactionService"/> <property name="transactionService" ref="transactionService"/>
<!-- init caveatConfig behaviours --> <!-- init caveatConfig behaviours -->

View File

@@ -0,0 +1,32 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_dod5015.caveat;
/**
* Compatibility Implementation.
* <p>
* Used as a compatibility implementation when migrating from V1.0 to V2.0. RMCustom model still references
* this class implementation, but package has been changed.
*
* @author Roy Wetherall
*/
public class RMListOfValuesConstraint extends org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint
{
// No implementation
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.bootstrap;
import org.alfresco.repo.module.ImporterModuleComponent;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
/**
* Custom implementation of module component importer
*
* @author Roy Wetherall
* @since 2.0
*/
public class BootstrapImporterModuleComponent extends ImporterModuleComponent
{
private static final String CONFIG_NODEID = "rm_config_folder";
private NodeService nodeService;
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* Need to check whether this module has already been executed.
*
* @see org.alfresco.repo.module.ImporterModuleComponent#executeInternal()
*/
@Override
protected void executeInternal() throws Throwable
{
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, CONFIG_NODEID);
if (nodeService.exists(nodeRef) == false)
{
super.executeInternal();
}
}
}

View File

@@ -16,8 +16,9 @@
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.alfresco.module.org_alfresco_module_rm; package org.alfresco.module.org_alfresco_module_rm.bootstrap;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
import org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigService; import org.alfresco.module.org_alfresco_module_rm.caveat.RMCaveatConfigService;
import org.alfresco.module.org_alfresco_module_rm.email.CustomEmailMappingService; import org.alfresco.module.org_alfresco_module_rm.email.CustomEmailMappingService;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;