APPS-139 fixes

This commit is contained in:
Roxana Lucanu
2020-05-20 21:16:34 +03:00
parent 7ecc50c01e
commit 6dd87e73ec
2 changed files with 15 additions and 6 deletions

View File

@@ -7,11 +7,12 @@
<!-- Declare as Record action --> <!-- Declare as Record action -->
<!-- TODO rename --> <!-- TODO rename -->
<bean id="create-record" parent="action-executer" class="org.alfresco.module.org_alfresco_module_rm.action.dm.CreateRecordAction"> <bean id="create-record" parent="action-executer"
class="org.alfresco.module.org_alfresco_module_rm.action.dm.CreateRecordAction">
<property name="recordService" ref="RecordService" /> <property name="recordService" ref="RecordService" />
<property name="authenticationUtil" ref="rm.authenticationUtil" /> <property name="authenticationUtil" ref="rm.authenticationUtil" />
<property name="filePlanService" ref="FilePlanService" /> <property name="filePlanService" ref="FilePlanService" />
<property name="nodeService" ref="NodeService" /> <property name="nodeService" ref="NodeService" />
<property name="applicableTypes"> <property name="applicableTypes">
<list> <list>
<value>{http://www.alfresco.org/model/content/1.0}content</value> <value>{http://www.alfresco.org/model/content/1.0}content</value>
@@ -26,6 +27,7 @@
<property name="filePlanService" ref="FilePlanService" /> <property name="filePlanService" ref="FilePlanService" />
<property name="dictionaryService" ref="DictionaryService" /> <property name="dictionaryService" ref="DictionaryService" />
<property name="authenticationUtil" ref="rm.authenticationUtil" /> <property name="authenticationUtil" ref="rm.authenticationUtil" />
<property name="recordService" ref="RecordService" />
<property name="applicableTypes"> <property name="applicableTypes">
<list> <list>
<value>{http://www.alfresco.org/model/content/1.0}content</value> <value>{http://www.alfresco.org/model/content/1.0}content</value>

View File

@@ -243,7 +243,6 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
{ {
Map<QName, String> mapedAspects = new HashMap<>(); Map<QName, String> mapedAspects = new HashMap<>();
mapedAspects.put(ContentModel.ASPECT_VERSIONABLE, " does not have the versionable aspect applied.");
mapedAspects.put(ASPECT_RECORD, " is already a record."); mapedAspects.put(ASPECT_RECORD, " is already a record.");
mapedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy."); mapedAspects.put(ContentModel.ASPECT_WORKING_COPY, " is a working copy.");
mapedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected."); mapedAspects.put(ASPECT_RECORD_REJECTION_DETAILS, " has previously been rejected.");
@@ -251,7 +250,7 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
for (Map.Entry<QName, String> aspect : mapedAspects.entrySet()) for (Map.Entry<QName, String> aspect : mapedAspects.entrySet())
{ {
if (!nodeService.hasAspect(actionedUponNodeRef, aspect.getKey())) if (nodeService.hasAspect(actionedUponNodeRef, aspect.getKey()))
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
@@ -260,6 +259,14 @@ public class DeclareAsVersionRecordAction extends AuditableActionExecuterAbstrac
return true; return true;
} }
} }
if (!nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE))
{
if (logger.isDebugEnabled())
{
logger.debug("Can not declare version record, because " + actionedUponNodeRef.toString() + " does not have the versionable aspect applied.");
}
return true;
}
return false; return false;
} }