mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-2123 Create a new service for content classification.
Move methods to do with content from the ClassificationService and the SecurityClearanceService into the ContentClassificationService. Remove the dependency of SecurityClearanceService on ClassificationService which will allow us to reverse this dependency in the next commit. This is needed in order to filter classifications by the current user's clearance. Nb. This included adding a method in the SecurityClearanceService called isClearedForClassification, which looks quite similar to a new API Roy created hasClearance (see ContentClassificationService). In the future we should look to see if we can consolidate these. Remove dependency of ClassificationServiceBootstrap on the services, so that it can be passed into them. This allows us to provide access to the POJO managers in the services (this is made harder as the POJO managers aren't Spring beans). In order to initialise these objects, change the POJO managers to use setters rather than constructor arguments. This allows us to store a reference to the manager before the data has been loaded. Move the attribute service keys for classification levels and reasons into the ClassifiedContentModel. Expect NO_CLEARANCE to be passed into the ClearanceLevelManager, as otherwise we have to have logic to exclude it (see initialise in the old SecurityClearanceService) and then more logic to include it again (see the old constructor for ClearanceLevelManager). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104375 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,9 +39,8 @@
|
||||
|
||||
<bean id="classificationService"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceImpl"
|
||||
parent="baseService">
|
||||
<property name="attributeService" ref="AttributeService"/>
|
||||
<property name="classificationServiceDAO" ref="classificationServiceDAO"/>
|
||||
parent="baseService" init-method="init">
|
||||
<property name="classificationServiceBootstrap" ref="classificationServiceBootstrap"/>
|
||||
</bean>
|
||||
|
||||
<bean id="ClassificationService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
@@ -76,9 +75,7 @@
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationLevels=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getCurrentClassification=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationReasons=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.classifyContent=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationLevelById=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getClassificationReasonById=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ClassificationService.getUnclassifiedClassificationLevel=ACL_ALLOW
|
||||
@@ -94,9 +91,9 @@
|
||||
<bean id="classificationServiceBootstrap"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.ClassificationServiceBootstrap">
|
||||
<constructor-arg ref="rm.authenticationUtil"/>
|
||||
<constructor-arg ref="classificationService"/> <!-- Intentionally using the small 'c' here -->
|
||||
<constructor-arg ref="securityClearanceService"/> <!-- Intentionally using the small 's' here -->
|
||||
<constructor-arg ref="TransactionService"/>
|
||||
<constructor-arg ref="attributeService"/>
|
||||
<constructor-arg ref="classificationServiceDAO"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -104,9 +101,9 @@
|
||||
|
||||
<bean id="securityClearanceService"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceServiceImpl"
|
||||
parent="baseService">
|
||||
<property name="classificationService" ref="ClassificationService"/> <!-- Intentionally using capital 'C' -->
|
||||
parent="baseService" init-method="init">
|
||||
<property name="personService" ref="PersonService"/>
|
||||
<property name="classificationServiceBootstrap" ref="classificationServiceBootstrap"/>
|
||||
</bean>
|
||||
|
||||
<bean id="SecurityClearanceService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
@@ -140,7 +137,6 @@
|
||||
<bean id="SecurityClearanceService_security" parent="baseSecurity">
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService.hasClearance=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService.getUserSecurityClearance=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService.getUsersSecurityClearance=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.SecurityClearanceService.setUserSecurityClearance=ACL_ALLOW
|
||||
@@ -149,4 +145,52 @@
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Content Classification Service -->
|
||||
|
||||
<bean id="contentClassificationService"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationServiceImpl"
|
||||
parent="baseService" init-method="init">
|
||||
<property name="securityClearanceService" ref="SecurityClearanceService"/>
|
||||
<property name="classificationServiceBootstrap" ref="classificationServiceBootstrap"/>
|
||||
</bean>
|
||||
|
||||
<bean id="ContentClassificationService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces">
|
||||
<value>org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService</value>
|
||||
</property>
|
||||
<property name="target">
|
||||
<ref bean="contentClassificationService"/>
|
||||
</property>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
<idref local="ContentClassificationService_transaction"/>
|
||||
<idref bean="exceptionTranslator"/>
|
||||
<idref local="ContentClassificationService_security"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="ContentClassificationService_transaction" class="org.springframework.transaction.interceptor.TransactionInterceptor">
|
||||
<property name="transactionManager">
|
||||
<ref bean="transactionManager"/>
|
||||
</property>
|
||||
<property name="transactionAttributes">
|
||||
<props>
|
||||
<prop key="*">${server.transaction.mode.default}</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- FIXME: We have to restrict methods in the classification service (with capabilities, etc.) -->
|
||||
<bean id="ContentClassificationService_security" parent="baseSecurity">
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService.getCurrentClassification=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService.classifyContent=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService.hasClearance=ACL_ALLOW
|
||||
org.alfresco.module.org_alfresco_module_rm.classification.ContentClassificationService.*=ACL_DENY
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
<!-- extending bean definition -->
|
||||
<bean id="rm.jsonConversionComponent"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.jscript.app.JSONConversionComponent"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.jscript.app.JSONConversionComponent"
|
||||
parent="baseJsonConversionComponent"
|
||||
init-method="init">
|
||||
<property name="recordContributorsGroupEnabled" value="${rm.record.contributors.group.enabled}"/>
|
||||
|
@@ -674,7 +674,7 @@
|
||||
<bean id="webscript.org.alfresco.rma.classification.classifycontent.post"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.script.classification.ClassifyContentPost"
|
||||
parent="rmBaseWebscript">
|
||||
<property name="classificationService" ref="ClassificationService" />
|
||||
<property name="contentClassificationService" ref="contentClassificationService" />
|
||||
</bean>
|
||||
|
||||
<!-- REST impl for GET user security clearance -->
|
||||
|
Reference in New Issue
Block a user