From 1b1dce9447b210165d7c28155ddb31cef9dd622b Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Fri, 8 Jul 2016 18:42:40 +0300 Subject: [PATCH 1/2] RM-3339 - added db enterprise schema --- .../patch/rm-patch-context.xml | 1 + .../patch/ModulePatchExecuterImpl.java | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml index 95f4003fe2..411c43c668 100755 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml @@ -7,6 +7,7 @@ + diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java index 6c77a8d883..efac5a4ee3 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java @@ -55,7 +55,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent private static final int START_SCHEMA = 0; /** attribute key */ - private static final String KEY_MODULE_SCHEMA = "module-schema"; + private String moduleSchemaKeyName; /** configured module schema version */ protected int moduleSchema = START_SCHEMA; @@ -66,6 +66,14 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent /** module patches */ protected Map modulePatches = new HashMap(21); + /** + * @param moduleSchemaKeyName configured module schema key name + */ + public void setModuleSchemaKeyName(String moduleSchemaKeyName) + { + this.moduleSchemaKeyName = moduleSchemaKeyName; + } + /** * @param attributeService attribute service */ @@ -149,9 +157,9 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent protected int getCurrentSchema() { Integer result = START_SCHEMA; - if (attributeService.exists(KEY_MODULE_SCHEMA, getModuleId())) + if (attributeService.exists(moduleSchemaKeyName, getModuleId())) { - result = (Integer)attributeService.getAttribute(KEY_MODULE_SCHEMA, getModuleId()); + result = (Integer)attributeService.getAttribute(moduleSchemaKeyName, getModuleId()); } return result; } @@ -163,7 +171,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent */ protected void updateSchema(int newSchema) { - attributeService.setAttribute(Integer.valueOf(newSchema), KEY_MODULE_SCHEMA, getModuleId()); + attributeService.setAttribute(Integer.valueOf(newSchema), moduleSchemaKeyName, getModuleId()); } /** From d9f9372da317441d28d1f72ee692dcd1e49d8a79 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Mon, 11 Jul 2016 10:25:20 +0300 Subject: [PATCH 2/2] Revert "Merge branch 'feature/RM-3339_IndependentDBSchemaNumber_2' into 'master'" This reverts commit 4bdfcfc5594c909a2d2e651d09ab211c1a7638f6, reversing changes made to 25d5b19908395e59543473b574818845dcb207ba. --- .../patch/rm-patch-context.xml | 1 - .../patch/ModulePatchExecuterImpl.java | 16 ++++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml index 411c43c668..95f4003fe2 100755 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/patch/rm-patch-context.xml @@ -7,7 +7,6 @@ - diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java index efac5a4ee3..6c77a8d883 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/patch/ModulePatchExecuterImpl.java @@ -55,7 +55,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent private static final int START_SCHEMA = 0; /** attribute key */ - private String moduleSchemaKeyName; + private static final String KEY_MODULE_SCHEMA = "module-schema"; /** configured module schema version */ protected int moduleSchema = START_SCHEMA; @@ -66,14 +66,6 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent /** module patches */ protected Map modulePatches = new HashMap(21); - /** - * @param moduleSchemaKeyName configured module schema key name - */ - public void setModuleSchemaKeyName(String moduleSchemaKeyName) - { - this.moduleSchemaKeyName = moduleSchemaKeyName; - } - /** * @param attributeService attribute service */ @@ -157,9 +149,9 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent protected int getCurrentSchema() { Integer result = START_SCHEMA; - if (attributeService.exists(moduleSchemaKeyName, getModuleId())) + if (attributeService.exists(KEY_MODULE_SCHEMA, getModuleId())) { - result = (Integer)attributeService.getAttribute(moduleSchemaKeyName, getModuleId()); + result = (Integer)attributeService.getAttribute(KEY_MODULE_SCHEMA, getModuleId()); } return result; } @@ -171,7 +163,7 @@ public class ModulePatchExecuterImpl extends AbstractModuleComponent */ protected void updateSchema(int newSchema) { - attributeService.setAttribute(Integer.valueOf(newSchema), moduleSchemaKeyName, getModuleId()); + attributeService.setAttribute(Integer.valueOf(newSchema), KEY_MODULE_SCHEMA, getModuleId()); } /**