From d0e3daba6654b3156418f83b40ce85ed1feee5e4 Mon Sep 17 00:00:00 2001 From: Mihai Cozma Date: Wed, 6 Jul 2016 10:29:07 +0300 Subject: [PATCH 1/5] Verify if node exists --- .../impl/ExtendedPermissionServiceImpl.java | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java index 74e9e818ce..7c1e196544 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java @@ -70,7 +70,7 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl /** File plan service */ private FilePlanService filePlanService; - + /** Permission processor registry */ private PermissionProcessorRegistry permissionProcessorRegistry; @@ -93,13 +93,13 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl { this.filePlanService = filePlanService; } - + /** * Sets the permission processor registry - * + * * @param permissionProcessorRegistry the permissions processor registry */ - public void setPermissionProcessorRegistry(PermissionProcessorRegistry permissionProcessorRegistry) + public void setPermissionProcessorRegistry(PermissionProcessorRegistry permissionProcessorRegistry) { this.permissionProcessorRegistry = permissionProcessorRegistry; } @@ -146,40 +146,42 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl public AccessStatus hasPermission(NodeRef nodeRef, String perm) { AccessStatus result = AccessStatus.UNDETERMINED; - - // permission pre-processors - List preProcessors = permissionProcessorRegistry.getPermissionPreProcessors(); - for (PermissionPreProcessor preProcessor : preProcessors) - { - // pre process permission - result = preProcessor.process(nodeRef, perm); - - // veto if denied - if (AccessStatus.DENIED.equals(result)) - { - return result; + if (nodeService.exists(nodeRef)) + { + + // permission pre-processors + List preProcessors = permissionProcessorRegistry.getPermissionPreProcessors(); + for (PermissionPreProcessor preProcessor : preProcessors) + { + // pre process permission + result = preProcessor.process(nodeRef, perm); + + // veto if denied + if (AccessStatus.DENIED.equals(result)) + { + return result; + } } - } - - // evaluate permission - result = hasPermissionImpl(nodeRef, perm); - - // permission post-processors - List postProcessors = permissionProcessorRegistry.getPermissionPostProcessors(); - for (PermissionPostProcessor postProcessor : postProcessors) - { - // post process permission - result = postProcessor.process(result, nodeRef, perm); - } - + + // evaluate permission + result = hasPermissionImpl(nodeRef, perm); + + // permission post-processors + List postProcessors = permissionProcessorRegistry.getPermissionPostProcessors(); + for (PermissionPostProcessor postProcessor : postProcessors) + { + // post process permission + result = postProcessor.process(result, nodeRef, perm); + } + } return result; } - + /** * Implementation of hasPermission method call. *

* Separation also convenient for unit testing. - * + * * @param nodeRef node reference * @param perm permission * @return {@link AccessStatus} access status result From b35a942fbb353e00f008bff09868fe9c0f40a6b2 Mon Sep 17 00:00:00 2001 From: Mihai Cozma Date: Wed, 6 Jul 2016 11:28:12 +0300 Subject: [PATCH 2/5] Format code --- .../impl/ExtendedPermissionServiceImpl.java | 148 ++++++++---------- 1 file changed, 63 insertions(+), 85 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java index 7c1e196544..27a5fd4f7e 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/repo/security/permissions/impl/ExtendedPermissionServiceImpl.java @@ -55,17 +55,15 @@ import org.alfresco.util.PropertyCheck; import org.springframework.context.ApplicationEvent; /** - * Extends the core permission service implementation allowing the consideration of the read records - * permission. + * Extends the core permission service implementation allowing the consideration of the read records permission. *

* This is required for SOLR support. * * @author Roy Wetherall */ -public class ExtendedPermissionServiceImpl extends PermissionServiceImpl - implements ExtendedPermissionService +public class ExtendedPermissionServiceImpl extends PermissionServiceImpl implements ExtendedPermissionService { - /** Writers simple cache */ + /** Writers simple cache */ protected SimpleCache> writersCache; /** File plan service */ @@ -97,12 +95,12 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl /** * Sets the permission processor registry * - * @param permissionProcessorRegistry the permissions processor registry + * @param permissionProcessorRegistry the permissions processor registry */ public void setPermissionProcessorRegistry(PermissionProcessorRegistry permissionProcessorRegistry) { - this.permissionProcessorRegistry = permissionProcessorRegistry; - } + this.permissionProcessorRegistry = permissionProcessorRegistry; + } /** * @see org.alfresco.repo.security.permissions.impl.PermissionServiceImpl#setAnyDenyDenies(boolean) @@ -113,7 +111,7 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl super.setAnyDenyDenies(anyDenyDenies); if (writersCache != null) { - writersCache.clear(); + writersCache.clear(); } } @@ -136,43 +134,40 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl } /** - * Override to deal with the possibility of hard coded permission checks in core code. + * Override to deal with the possibility of hard coded permission checks in core code. Note: Eventually we need to + * merge the RM permission model into the core to make this more robust. * - * Note: Eventually we need to merge the RM permission model into the core to make this more rebust. - * - * @see org.alfresco.repo.security.permissions.impl.ExtendedPermissionService#hasPermission(org.alfresco.service.cmr.repository.NodeRef, java.lang.String) + * @see org.alfresco.repo.security.permissions.impl.ExtendedPermissionService#hasPermission(org.alfresco.service.cmr.repository.NodeRef, + * java.lang.String) */ @Override public AccessStatus hasPermission(NodeRef nodeRef, String perm) { - AccessStatus result = AccessStatus.UNDETERMINED; - if (nodeService.exists(nodeRef)) + AccessStatus result = AccessStatus.UNDETERMINED; + if (nodeService.exists(nodeRef)) + { + + // permission pre-processors + List preProcessors = permissionProcessorRegistry.getPermissionPreProcessors(); + for (PermissionPreProcessor preProcessor : preProcessors) { + // pre process permission + result = preProcessor.process(nodeRef, perm); - // permission pre-processors - List preProcessors = permissionProcessorRegistry.getPermissionPreProcessors(); - for (PermissionPreProcessor preProcessor : preProcessors) - { - // pre process permission - result = preProcessor.process(nodeRef, perm); + // veto if denied + if (AccessStatus.DENIED.equals(result)) { return result; } + } - // veto if denied - if (AccessStatus.DENIED.equals(result)) - { - return result; - } - } - - // evaluate permission + // evaluate permission result = hasPermissionImpl(nodeRef, perm); // permission post-processors List postProcessors = permissionProcessorRegistry.getPermissionPostProcessors(); for (PermissionPostProcessor postProcessor : postProcessors) { - // post process permission - result = postProcessor.process(result, nodeRef, perm); - } + // post process permission + result = postProcessor.process(result, nodeRef, perm); + } } return result; } @@ -182,13 +177,13 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl *

* Separation also convenient for unit testing. * - * @param nodeRef node reference - * @param perm permission - * @return {@link AccessStatus} access status result + * @param nodeRef node reference + * @param perm permission + * @return {@link AccessStatus} access status result */ protected AccessStatus hasPermissionImpl(NodeRef nodeRef, String perm) { - return super.hasPermission(nodeRef, perm); + return super.hasPermission(nodeRef, perm); } /** @@ -201,17 +196,14 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl // test denied - if(anyDenyDenies) + if (anyDenyDenies) { Set aclReadersDenied = getReadersDenied(aclId); - for(String auth : aclReadersDenied) + for (String auth : aclReadersDenied) { - if(authorities.contains(auth)) - { - return AccessStatus.DENIED; - } + if (authorities.contains(auth)) { return AccessStatus.DENIED; } } } @@ -219,12 +211,9 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl // test acl readers Set aclReaders = getReaders(aclId); - for(String auth : aclReaders) + for (String auth : aclReaders) { - if(authorities.contains(auth)) - { - return AccessStatus.ALLOWED; - } + if (authorities.contains(auth)) { return AccessStatus.ALLOWED; } } return AccessStatus.DENIED; @@ -237,16 +226,10 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl public Set getReaders(Long aclId) { AccessControlList acl = aclDaoComponent.getAccessControlList(aclId); - if (acl == null) - { - return Collections.emptySet(); - } + if (acl == null) { return Collections.emptySet(); } - Set aclReaders = readersCache.get((Serializable)acl.getProperties()); - if (aclReaders != null) - { - return aclReaders; - } + Set aclReaders = readersCache.get((Serializable) acl.getProperties()); + if (aclReaders != null) { return aclReaders; } HashSet assigned = new HashSet(); HashSet readers = new HashSet(); @@ -259,7 +242,8 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl for (String authority : assigned) { UnconditionalAclTest test = new UnconditionalAclTest(getPermissionReference(PermissionService.READ)); - UnconditionalAclTest rmTest = new UnconditionalAclTest(getPermissionReference(RMPermissionModel.READ_RECORDS)); + UnconditionalAclTest rmTest = new UnconditionalAclTest( + getPermissionReference(RMPermissionModel.READ_RECORDS)); if (test.evaluate(authority, aclId) || rmTest.evaluate(authority, aclId)) { readers.add(authority); @@ -267,7 +251,7 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl } aclReaders = Collections.unmodifiableSet(readers); - readersCache.put((Serializable)acl.getProperties(), aclReaders); + readersCache.put((Serializable) acl.getProperties(), aclReaders); return aclReaders; } @@ -281,15 +265,9 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl { AccessControlList acl = aclDaoComponent.getAccessControlList(aclId); - if (acl == null) - { - return Collections.emptySet(); - } + if (acl == null) { return Collections.emptySet(); } Set denied = readersDeniedCache.get(aclId); - if (denied != null) - { - return denied; - } + if (denied != null) { return denied; } denied = new HashSet(); Set assigned = new HashSet(); @@ -298,17 +276,19 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl assigned.add(ace.getAuthority()); } - for(String authority : assigned) + for (String authority : assigned) { - UnconditionalDeniedAclTest test = new UnconditionalDeniedAclTest(getPermissionReference(PermissionService.READ)); - UnconditionalDeniedAclTest rmTest = new UnconditionalDeniedAclTest(getPermissionReference(RMPermissionModel.READ_RECORDS)); - if(test.evaluate(authority, aclId) || rmTest.evaluate(authority, aclId)) + UnconditionalDeniedAclTest test = new UnconditionalDeniedAclTest( + getPermissionReference(PermissionService.READ)); + UnconditionalDeniedAclTest rmTest = new UnconditionalDeniedAclTest( + getPermissionReference(RMPermissionModel.READ_RECORDS)); + if (test.evaluate(authority, aclId) || rmTest.evaluate(authority, aclId)) { denied.add(authority); } } - readersDeniedCache.put((Serializable)acl.getProperties(), denied); + readersDeniedCache.put((Serializable) acl.getProperties(), denied); return denied; } @@ -319,16 +299,10 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl public Set getWriters(Long aclId) { AccessControlList acl = aclDaoComponent.getAccessControlList(aclId); - if (acl == null) - { - return Collections.emptySet(); - } + if (acl == null) { return Collections.emptySet(); } - Set aclWriters = writersCache.get((Serializable)acl.getProperties()); - if (aclWriters != null) - { - return aclWriters; - } + Set aclWriters = writersCache.get((Serializable) acl.getProperties()); + if (aclWriters != null) { return aclWriters; } HashSet assigned = new HashSet(); HashSet readers = new HashSet(); @@ -348,20 +322,23 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl } aclWriters = Collections.unmodifiableSet(readers); - writersCache.put((Serializable)acl.getProperties(), aclWriters); + writersCache.put((Serializable) acl.getProperties(), aclWriters); return aclWriters; } /** - * @see org.alfresco.repo.security.permissions.impl.PermissionServiceImpl#setInheritParentPermissions(org.alfresco.service.cmr.repository.NodeRef, boolean) + * @see org.alfresco.repo.security.permissions.impl.PermissionServiceImpl#setInheritParentPermissions(org.alfresco.service.cmr.repository.NodeRef, + * boolean) */ @Override public void setInheritParentPermissions(final NodeRef nodeRef, boolean inheritParentPermissions) { final String adminRole = getAdminRole(nodeRef); - if (nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT) && isNotBlank(adminRole) && !inheritParentPermissions) + if (nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT) && isNotBlank(adminRole) + && !inheritParentPermissions) { - setPermission(nodeRef, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS, true); + setPermission(nodeRef, ExtendedReaderDynamicAuthority.EXTENDED_READER, RMPermissionModel.READ_RECORDS, + true); setPermission(nodeRef, ExtendedWriterDynamicAuthority.EXTENDED_WRITER, RMPermissionModel.FILING, true); setPermission(nodeRef, adminRole, RMPermissionModel.FILING, true); } @@ -374,7 +351,8 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl NodeRef filePlan = getFilePlanService().getFilePlan(nodeRef); if (filePlan != null) { - adminRole = authorityService.getName(AuthorityType.GROUP, FilePlanRoleService.ROLE_ADMIN + filePlan.getId()); + adminRole = authorityService.getName(AuthorityType.GROUP, + FilePlanRoleService.ROLE_ADMIN + filePlan.getId()); } return adminRole; } From 8ca85000e1ee41302652143e269997c685de32ac Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Mon, 11 Jul 2016 10:27:18 +0300 Subject: [PATCH 3/5] Revert "Revert "Merge branch 'feature/RM-3339_IndependentDBSchemaNumber_2' into 'master'"" This reverts commit d9f9372da317441d28d1f72ee692dcd1e49d8a79. --- .../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 2e1cc03bf4e6358925feb5555261d25dc2ac6336 Mon Sep 17 00:00:00 2001 From: Silviu Dinuta Date: Mon, 11 Jul 2016 18:26:46 +0300 Subject: [PATCH 4/5] RM-3651: workaround to skip code execution when first element is not a record --- .../RecordsManagementNotificationHelper.java | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/notification/RecordsManagementNotificationHelper.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/notification/RecordsManagementNotificationHelper.java index 41c075c4f8..b5c81378f4 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/notification/RecordsManagementNotificationHelper.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/notification/RecordsManagementNotificationHelper.java @@ -244,34 +244,38 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod ParameterCheck.mandatory("records", records); if (!records.isEmpty()) { - NodeRef root = getRMRoot(records.get(0)); - String groupName = getGroupName(root); - - if (doesGroupContainUsers(groupName)) + if (nodeService.hasAspect(records.get(0), RecordsManagementModel.ASPECT_RECORD)) { - NotificationContext notificationContext = new NotificationContext(); - notificationContext.setSubject(I18NUtil.getMessage(MSG_SUBJECT_RECORDS_DUE_FOR_REVIEW)); - notificationContext.setAsyncNotification(false); - notificationContext.setIgnoreNotificationFailure(true); + NodeRef root = getRMRoot(records.get(0)); + String groupName = getGroupName(root); - notificationContext.setBodyTemplate(getDueForReviewTemplate().toString()); - Map args = new HashMap(1, 1.0f); - args.put("records", (Serializable)records); - args.put("site", getSiteName(root)); - notificationContext.setTemplateArgs(args); - - notificationContext.addTo(groupName); - - notificationService.sendNotification(EMailNotificationProvider.NAME, notificationContext); - } - else - { - if (logger.isWarnEnabled()) + if (doesGroupContainUsers(groupName)) { - logger.warn("Unable to send record due for review email notification, because notification group was empty."); - } + NotificationContext notificationContext = new NotificationContext(); + notificationContext.setSubject(I18NUtil.getMessage(MSG_SUBJECT_RECORDS_DUE_FOR_REVIEW)); + notificationContext.setAsyncNotification(false); + notificationContext.setIgnoreNotificationFailure(true); - throw new AlfrescoRuntimeException("Unable to send record due for review email notification, because notification group was empty."); + notificationContext.setBodyTemplate(getDueForReviewTemplate().toString()); + Map args = new HashMap(1, 1.0f); + args.put("records", (Serializable) records); + args.put("site", getSiteName(root)); + notificationContext.setTemplateArgs(args); + + notificationContext.addTo(groupName); + + notificationService.sendNotification(EMailNotificationProvider.NAME, notificationContext); + } + else + { + if (logger.isWarnEnabled()) + { + logger.warn("Unable to send record due for review email notification, because notification group was empty."); + } + + throw new AlfrescoRuntimeException( + "Unable to send record due for review email notification, because notification group was empty."); + } } } } From 6979f6ce44d6448d24522dbf536e851aec24421f Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Tue, 12 Jul 2016 17:31:37 +0300 Subject: [PATCH 5/5] RM-3339 - review updates --- .../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()); } /**