Merge branch 'feature/RM-4375_WrongErrorForDuplicateRMIdentifier' into 'master'

Feature/rm 4375 wrong error for duplicate rm identifier

RM-4375 - Handling duplicate "rma:identifier" values in POST /fileplan-components/{fileplanComponentId}/children

DuplicateAttributeException was not mapped to an error code in core. I extended the exception mapper so we ca add our custom mapping.

See merge request !643
This commit is contained in:
Ana Bozianu
2016-11-18 10:26:41 +00:00

View File

@@ -77,4 +77,17 @@
<bean class="org.alfresco.rm.rest.api.sites.RMSiteEntityResource">
<property name="sites" ref="rm.Sites" />
</bean>
<!-- Map RM exceptions to HTML status codes -->
<bean id="rm.simpleMappingExceptionResolver" abstract="true" parent="simpleMappingExceptionResolver">
<property name="exceptionMappings">
<map merge="true">
<entry key="org.alfresco.service.cmr.attributes.DuplicateAttributeException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
</map>
</property>
</bean>
<bean class="org.alfresco.util.BeanExtender">
<property name="beanName" value="simpleMappingExceptionResolver"/>
<property name="extendingBeanName" value="rm.simpleMappingExceptionResolver"/>
</bean>
</beans>