RM-563 (Add group id and title to Capability API and definitions)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@44277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-12-03 22:32:42 +00:00
parent 583b4412a8
commit a06ba9d3c3
17 changed files with 1413 additions and 1047 deletions

View File

@@ -0,0 +1,91 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="groupBase"
abstract="true"
init-method="init"
class="org.alfresco.module.org_alfresco_module_rm.capability.GroupImpl">
<property name="capabilityService" ref="CapabilityService"/>
</bean>
<bean id="auditGroup"
parent="groupBase">
<property name="id" value="audit"/>
<property name="index" value="1"/>
</bean>
<bean id="classifiedRecordsGroup"
parent="groupBase">
<property name="id" value="classifiedRecords"/>
<property name="index" value="2"/>
</bean>
<bean id="cutoffGroup"
parent="groupBase">
<property name="id" value="cutoff"/>
<property name="index" value="3"/>
</bean>
<bean id="dispositionAndTransfersGroup"
parent="groupBase">
<property name="id" value="dispositionAndTransfers"/>
<property name="index" value="4"/>
</bean>
<bean id="eventsGroup"
parent="groupBase">
<property name="id" value="events"/>
<property name="index" value="5"/>
</bean>
<bean id="filePlanMetadataListsAndEmailGroup"
parent="groupBase">
<property name="id" value="filePlanMetadataListsAndEmail"/>
<property name="index" value="6"/>
</bean>
<bean id="folderControlGroup"
parent="groupBase">
<property name="id" value="folderControl"/>
<property name="index" value="7"/>
</bean>
<bean id="holdControlsGroup"
parent="groupBase">
<property name="id" value="holdControls"/>
<property name="index" value="8"/>
</bean>
<bean id="metadataControlGroup"
parent="groupBase">
<property name="id" value="metadataControl"/>
<property name="index" value="9"/>
</bean>
<bean id="recordsGroup"
parent="groupBase">
<property name="id" value="records"/>
<property name="index" value="10"/>
</bean>
<bean id="referencesAndLinksGroup"
parent="groupBase">
<property name="id" value="referencesAndLinks"/>
<property name="index" value="11"/>
</bean>
<bean id="rolesAndAccessRightsGroup"
parent="groupBase">
<property name="id" value="rolesAndAccessRights"/>
<property name="index" value="12"/>
</bean>
<bean id="vitalRecordsGroup"
parent="groupBase">
<property name="id" value="vitalRecords"/>
<property name="index" value="13"/>
</bean>
</beans>

View File

@@ -8,42 +8,42 @@
parent="declarativeCapability">
<property name="name" value="AccessAudit"/>
<property name="permission" value="AccessAudit"/>
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<bean id="rmDeclareAuditAsRecordCapability"
parent="declarativeCapability">
<property name="name" value="DeclareAuditAsRecord" />
<property name="permission" value="DeclareAuditAsRecord" />
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<bean id="rmDeleteAuditCapability"
parent="declarativeCapability">
<property name="name" value="DeleteAudit" />
<property name="permission" value="DeleteAudit" />
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<bean id="rmEnableDisableAuditByTypesCapability"
parent="declarativeCapability">
<property name="name" value="EnableDisableAuditByTypes" />
<property name="permission" value="EnableDisableAuditByTypes" />
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<bean id="rmExportAuditCapability"
parent="declarativeCapability">
<property name="name" value="ExportAudit" />
<property name="permission" value="ExportAudit" />
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<bean id="rmSelectAuditMetadataCapability"
parent="declarativeCapability">
<property name="name" value="SelectAuditMetadata" />
<property name="permission" value="SelectAuditMetadata" />
<property name="groupId" value="audit" />
<property name="group"><ref bean="auditGroup"/></property>
</bean>
<!-- Non-Assignable Capabilities -->

View File

@@ -21,7 +21,7 @@
<entry key="capabilityCondition.frozenOrFrozenChildren" value="false"/>
</map>
</property>
<property name="groupId" value="cutoff" />
<property name="group"><ref bean="cutoffGroup"/></property>
</bean>
<!-- Transfer -->
@@ -35,7 +35,7 @@
<ref bean="rmCompleteAllTransfersCapability"/>
</list>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<!-- Accession -->
@@ -49,7 +49,7 @@
<ref bean="rmCompleteNominatedTransfersCapability"/>
</list>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<!-- Destroy -->
@@ -70,7 +70,7 @@
<entry key="capabilityCondition.destroyIsScheduled" value="true"/>
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<!-- Unscheduled Destroy -->
@@ -91,7 +91,7 @@
<entry key="capabilityCondition.destroyMayBeScheduled" value="true"/>
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<!-- Manually Change Disposition Dates -->
@@ -113,7 +113,7 @@
<entry key="capabilityCondition.isTransferring" value="false" />
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<!-- Non-assignable Capabilities -->

View File

@@ -3,86 +3,86 @@
<beans>
<!-- Assignable Capabilities -->
<!-- Assignable Capabilities -->
<bean id="rmCreateModifyDestroyFileplanMetadataCapability"
parent="compositeCapability">
<property name="name" value="CreateModifyDestroyFileplanMetadata"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="capabilities">
<list>
<ref bean="rmCreateRootRecordCategoryCapability"/>
<ref bean="rmCreateModifyDestroyRecordCategoryCapability"/>
<ref bean="rmCreateModifyDestroyUnfiledRecordContainerCapability"/>
</list>
</property>
<property name="groupId" value="filePlanMetadataListsAndEmail" />
</bean>
<bean id="rmCreateModifyDestroyFileplanMetadataCapability"
parent="compositeCapability">
<property name="name" value="CreateModifyDestroyFileplanMetadata"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="capabilities">
<list>
<ref bean="rmCreateRootRecordCategoryCapability"/>
<ref bean="rmCreateModifyDestroyRecordCategoryCapability"/>
<ref bean="rmCreateModifyDestroyUnfiledRecordContainerCapability"/>
</list>
</property>
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<!-- Unassignable Capabilities -->
<!-- Unassignable Capabilities -->
<bean id="rmCreateRootRecordCategoryCapability"
parent="declarativeCapability">
<property name="name" value="CreateRootRecordCategory"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>FILE_PLAN</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
<bean id="rmCreateModifyDestroyRecordCategoryCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyRecordCategory"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>RECORD_CATEGORY</value>
<value>DISPOSITION_SCHEDULE</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
<bean id="rmMoveRecordCategoryCapability"
parent="compositeCapability">
<property name="name" value="MoveRecordCategory"/>
<property name="private" value="true"/>
<property name="undetermined" value="true"/>
<property name="capabilities">
<list>
<ref bean="rmCreateModifyDestroyFileplanMetadataCapability"/>
</list>
</property>
<property name="targetCapability" ref="rmCreateModifyDestroyFileplanMetadataCapability"/>
</bean>
<bean id="rmCreateModifyDestroyUnfiledRecordContainerCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyUnfiledRecordContainer"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>UNFILED_RECORD_CONTAINER</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
<bean id="rmCreateRootRecordCategoryCapability"
parent="declarativeCapability">
<property name="name" value="CreateRootRecordCategory"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>FILE_PLAN</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
<bean id="rmCreateModifyDestroyRecordCategoryCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyRecordCategory"/>
<property name="permission" value="CreateModifyDestroyFileplanMetadata"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>RECORD_CATEGORY</value>
<value>DISPOSITION_SCHEDULE</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
<bean id="rmMoveRecordCategoryCapability"
parent="compositeCapability">
<property name="name" value="MoveRecordCategory"/>
<property name="private" value="true"/>
<property name="undetermined" value="true"/>
<property name="capabilities">
<list>
<ref bean="rmCreateModifyDestroyFileplanMetadataCapability"/>
</list>
</property>
<property name="targetCapability" ref="rmCreateModifyDestroyFileplanMetadataCapability"/>
</bean>
<bean id="rmCreateModifyDestroyUnfiledRecordContainerCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyUnfiledRecordContainer"/>
<property name="private" value="true"/>
<property name="kinds">
<list>
<value>UNFILED_RECORD_CONTAINER</value>
</list>
</property>
<property name="conditions">
<map>
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
</bean>
</beans>

View File

@@ -21,7 +21,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="holdControls" />
<property name="group"><ref bean="holdControlsGroup"/></property>
</bean>
<bean id="rmUnfreezeCapability"
@@ -34,7 +34,7 @@
<entry key="capabilityCondition.frozenOrHold" value="true"/>
</map>
</property>
<property name="groupId" value="holdControls" />
<property name="group"><ref bean="holdControlsGroup"/></property>
</bean>
<bean id="rmViewUpdateReasonsForFreezeCapability"
@@ -46,7 +46,7 @@
<entry key="capabilityCondition.frozenOrHold" value="true"/>
</map>
</property>
<property name="groupId" value="holdControls" />
<property name="group"><ref bean="holdControlsGroup"/></property>
</bean>
</beans>

View File

@@ -9,14 +9,14 @@
parent="declarativeCapability">
<property name="name" value="CreateAndAssociateSelectionLists"/>
<property name="permission" value="CreateAndAssociateSelectionLists"/>
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmEditSelectionListsCapability"
parent="declarativeCapability">
<property name="name" value="EditSelectionLists" />
<property name="permission" value="EditSelectionLists" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<!-- Non-Assignable Capabilities -->

View File

@@ -7,7 +7,7 @@
parent="rmBaseCapability"
class="org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability">
<property name="name" value="ViewRecords" />
<property name="groupId" value="records" />
<property name="group"><ref bean="recordsGroup"/></property>
</bean>
<bean id="rmUndeclareRecordsCapability"
@@ -27,7 +27,7 @@
<entry key="capabilityCondition.cutoff" value="false"/>
</map>
</property>
<property name="groupId" value="records" />
<property name="group"><ref bean="recordsGroup"/></property>
</bean>
<bean id="rmCreateModifyRecordsInCuttoffFoldersCapability"
@@ -48,7 +48,7 @@
<entry key="capabilityCondition.closed" value="false"/>
</map>
</property>
<property name="groupId" value="cutoff" />
<property name="group"><ref bean="cutoffGroup"/></property>
</bean>
<bean id="rmFileCapability"
@@ -106,7 +106,7 @@
<entry key="capabilityCondition.declared" value="false"/>
</map>
</property>
<property name="groupId" value="records"/>
<property name="group"><ref bean="recordsGroup"/></property>
</bean>
<bean id="rmDeleteRecordsCapability"
@@ -123,7 +123,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<bean id="rmEditDeclaredRecordMetadataCapability"
@@ -143,7 +143,7 @@
<entry key="capabilityCondition.declared" value="true"/>
</map>
</property>
<property name="groupId" value="metadataControl"/>
<property name="group"><ref bean="metadataControlGroup"/></property>
</bean>
<!-- TODO .. this is being used for the wrong thing! ... should indicate that the use can edit the non-record meta-data of a record -->
@@ -159,7 +159,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="metadataControl"/>
<property name="group"><ref bean="metadataControlGroup"/></property>
</bean>
<bean id="rmEditRecordMetadataCapability"
@@ -181,7 +181,7 @@
<entry key="capabilityCondition.declared" value="false"/>
</map>
</property>
<property name="groupId" value="metadataControl"/>
<property name="group"><ref bean="metadataControlGroup"/></property>
</bean>
<bean id="rmMoveRecordsCapability"
@@ -197,7 +197,7 @@
</map>
</property>
<property name="targetCapability" ref="rmFileRecordsCapability"/>
<property name="groupId" value="metadataControl"/>
<property name="group"><ref bean="metadataControlGroup"/></property>
</bean>
<bean id="rmUpgradeDowngradeAndDeclassifyRecordsCapability"
@@ -209,7 +209,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
</beans>

View File

@@ -20,7 +20,7 @@
<entry key="capabilityCondition.closed" value="false"/>
</map>
</property>
<property name="groupId" value="folderControl" />
<property name="group"><ref bean="folderControlGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyFoldersCapability"
@@ -41,7 +41,7 @@
<entry key="capabilityCondition.closed" value="false"/>
</map>
</property>
<property name="groupId" value="folderControl" />
<property name="group"><ref bean="folderControlGroup"/></property>
</bean>
<bean id="rmMoveRecordFolderCapability"
@@ -74,7 +74,7 @@
<entry key="capabilityCondition.closed" value="true"/>
</map>
</property>
<property name="groupId" value="folderControl" />
<property name="group"><ref bean="folderControlGroup"/></property>
</bean>
<bean id="rmDeclareRecordsInClosedFoldersCapability"
@@ -95,6 +95,6 @@
<entry key="capabilityCondition.declared" value="false"/>
</map>
</property>
<property name="groupId" value="folderControl" />
<property name="group"><ref bean="folderControlGroup"/></property>
</bean>
</beans>

View File

@@ -2,276 +2,279 @@
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.impl.RMPermissionServiceImpl" init-method="init">
<property name="nodeService">
<ref bean="mtAwareNodeService" />
</property>
<property name="tenantService">
<ref bean="tenantService"/>
</property>
<property name="dictionaryService">
<ref bean="dictionaryService" />
</property>
<property name="permissionsDaoComponent">
<ref bean="permissionsDaoComponent" />
</property>
<property name="modelDAO">
<ref bean="permissionsModelDAO" />
</property>
<property name="authorityService">
<ref bean="authorityService" />
</property>
<property name="accessCache">
<ref bean="permissionsAccessCache" />
</property>
<property name="readersCache">
<ref bean="readersCache" />
</property>
<property name="readersDeniedCache">
<ref bean="readersDeniedCache" />
</property>
<property name="policyComponent">
<ref bean="policyComponent" />
</property>
<property name="aclDAO">
<ref bean="aclDAO" />
</property>
<property name="ownableService">
<ref bean="ownableService" />
</property>
<property name="anyDenyDenies">
<value>${security.anyDenyDenies}</value>
</property>
<property name="dynamicAuthorities">
<list>
<ref bean="ownerDynamicAuthority" />
<ref bean="lockOwnerDynamicAuthority" />
<ref bean="extendedReaderDynamicAuthority" />
</list>
</property>
</bean>
<bean id="extendedReaderDynamicAuthority" class="org.alfresco.module.org_alfresco_module_rm.security.ExtendedReaderDynamicAuthority" />
<!-- Bootstrap records management data -->
<bean id="org_alfresco_module_rm_bootstrapData"
class="org.alfresco.module.org_alfresco_module_rm.bootstrap.BootstrapImporterModuleComponent"
parent="module.baseComponent">
<property name="nodeService" ref="nodeService" />
<property name="moduleId" value="org_alfresco_module_rm"/>
<property name="name" value="org_alfresco_module_rm_bootstrapData"/>
<property name="description" value="Bootstrap records management data"/>
<property name="sinceVersion" value="1.0"/>
<property name="appliesFromVersion" value="1.0"/>
<property name="importer" ref="spacesBootstrap"/>
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
<prop key="location">alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml</prop>
</props>
</list>
</property>
</bean>
<!-- Bootstap the message property files -->
<bean id="org_alfresco_module_rm_resourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.messages.notification-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.admin-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.records-management-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.action-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.audit-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.capability-service</value>
</list>
</property>
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.impl.RMPermissionServiceImpl" init-method="init">
<property name="nodeService">
<ref bean="mtAwareNodeService" />
</property>
<property name="tenantService">
<ref bean="tenantService"/>
</property>
<property name="dictionaryService">
<ref bean="dictionaryService" />
</property>
<property name="permissionsDaoComponent">
<ref bean="permissionsDaoComponent" />
</property>
<property name="modelDAO">
<ref bean="permissionsModelDAO" />
</property>
<property name="authorityService">
<ref bean="authorityService" />
</property>
<property name="accessCache">
<ref bean="permissionsAccessCache" />
</property>
<property name="readersCache">
<ref bean="readersCache" />
</property>
<property name="readersDeniedCache">
<ref bean="readersDeniedCache" />
</property>
<property name="policyComponent">
<ref bean="policyComponent" />
</property>
<property name="aclDAO">
<ref bean="aclDAO" />
</property>
<property name="ownableService">
<ref bean="ownableService" />
</property>
<property name="anyDenyDenies">
<value>${security.anyDenyDenies}</value>
</property>
<property name="dynamicAuthorities">
<list>
<ref bean="ownerDynamicAuthority" />
<ref bean="lockOwnerDynamicAuthority" />
<ref bean="extendedReaderDynamicAuthority" />
</list>
</property>
</bean>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-model-context.xml"/>
<!-- Load audit config -->
<bean id="org_alfresco_module_rm_userRolesExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.AuthenticatedUserRolesDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
<property name="rmSecurityService" ref="recordsManagementSecurityService" />
</bean>
<bean id="org_alfresco_module_rm_namePathExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanNamePathDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
</bean>
<bean id="org_alfresco_module_rm_nodeRefPathExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanNodeRefPathDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
</bean>
<bean id="org_alfresco_module_rm_identifierExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanIdentifierDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
</bean>
<!-- Bootstrap the permission model -->
<bean id="org_alfresco_module_rm_permissionBootstrap" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml"/>
</bean>
<!-- Import fixed permission definitions for RM -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml"/>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/security/rm-method-security-context.xml"/>
<!-- Import the RM service's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-service-context.xml"/>
<!-- Import DOD 5015 -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/dod5015/dod5015-context.xml"/>
<!-- Import the RM identifier service's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-id-context.xml"/>
<!-- Import capabilities -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml"/>
<!-- Import the RM action's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-action-context.xml"/>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/action-context.xml"/>
<!-- Import the RM module patches -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-patch-context.xml"/>
<!-- Import RM UI evaluators -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml"/>
<!-- Import disposition properties -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-disposition-properties-context.xml"/>
<!-- RM Script API -->
<bean id="scriptRecordsManagementService" parent="baseJavaScriptExtension" class="org.alfresco.module.org_alfresco_module_rm.jscript.ScriptRecordsManagmentService">
<property name="extensionName">
<value>rmService</value>
</property>
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry"/>
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
</bean>
<!-- Event types -->
<bean id="rmEventResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.rm-events</value>
</list>
</property>
</bean>
<bean id="rmEventType" init-method="init" abstract="true">
<property name="recordsManagementEventService" ref="recordsManagementEventService"/>
</bean>
<bean id="rmEventType.simple" class="org.alfresco.module.org_alfresco_module_rm.event.SimpleRecordsManagementEventTypeImpl" parent="rmEventType"/>
<bean id="rmEventType.superseded" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferenceCreateEventType" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}supersedes"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<bean id="rmEventType.obsolete" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferenceCreateEventType" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}obsoletes"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<bean id="rmEventType.crossReferencedRecordTransfered" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferencedRecordActionedUpon" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}crossreference"/>
<property name="actionName" value="transferComplete"/>
<property name="nodeService" ref="nodeService"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<!-- Job context -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-job-context.xml"/>
<!-- Bootstrap bean -->
<bean id="RecordsManagementBootstrap" class="org.alfresco.module.org_alfresco_module_rm.bootstrap.RecordsManagementBootstrap">
<property name="transactionService" ref="transactionService"/>
<!-- init caveatConfig behaviours -->
<property name="caveatConfigService" ref="caveatConfigService"/>
<property name="customEmailMappingService" ref="customEmailMappingService"/>
<property name="recordsManagementAdminService" ref="RecordsManagementAdminService"/>
</bean>
<!-- Java script interface for rm caveat config-->
<bean id="rmConfigServiceScript" parent="baseJavaScriptExtension" class="org.alfresco.module.org_alfresco_module_rm.caveat.ScriptRMCaveatConfigService">
<property name="extensionName">
<value>caveatConfig</value>
</property>
<property name="caveatConfigService" ref="caveatConfigService"/>
<property name="authorityService" ref="authorityService"/>
</bean>
<!-- Form Processor Filters to process RM nodes and types -->
<bean id="baseRMFormFilter" parent="baseFormFilter" abstract="true">
<property name="namespaceService" ref="NamespaceService"/>
<property name="nodeService" ref="NodeService"/>
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry" />
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="recordService" ref="recordService"/>
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
</bean>
<bean id="rmNodeFormFilter"
parent="baseRMFormFilter"
class="org.alfresco.module.org_alfresco_module_rm.forms.RecordsManagementNodeFormFilter">
<property name="filterRegistry" ref="nodeFilterRegistry" />
<property name="dictionaryService" ref="DictionaryService" />
<property name="dispositionService" ref="dispositionService"/>
</bean>
<bean id="rmTypeFormFilter"
parent="baseRMFormFilter"
class="org.alfresco.module.org_alfresco_module_rm.forms.RecordsManagementTypeFormFilter">
<property name="filterRegistry" ref="typeFilterRegistry" />
<property name="identifierService" ref="recordsManagementIdentifierService"/>
</bean>
<!-- Override email extractor implementation -->
<bean id="extracter.RFC822"
class="org.alfresco.module.org_alfresco_module_rm.email.RFC822MetadataExtracter"
parent="baseMetadataExtracter" >
<property name="nodeService" ref="nodeService"/>
<property name="supportedDateFormats">
<list>
<value>EEE, d MMM yyyy HH:mm:ss Z</value>
<value>EEE, d MMM yy HH:mm:ss Z</value>
</list>
</property>
</bean>
<!-- Prevent ghosted records being renditioned -->
<bean id="noRenditionsForGhosts" parent="baseRenditionPreventionClass">
<constructor-arg value="rma:ghosted"/>
</bean>
<!-- Import the RM webscript's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-webscript-context.xml"/>
<bean id="extendedReaderDynamicAuthority" class="org.alfresco.module.org_alfresco_module_rm.security.ExtendedReaderDynamicAuthority" />
<!-- Bootstrap records management data -->
<bean id="org_alfresco_module_rm_bootstrapData"
class="org.alfresco.module.org_alfresco_module_rm.bootstrap.BootstrapImporterModuleComponent"
parent="module.baseComponent">
<property name="nodeService" ref="nodeService" />
<property name="moduleId" value="org_alfresco_module_rm"/>
<property name="name" value="org_alfresco_module_rm_bootstrapData"/>
<property name="description" value="Bootstrap records management data"/>
<property name="sinceVersion" value="1.0"/>
<property name="appliesFromVersion" value="1.0"/>
<property name="importer" ref="spacesBootstrap"/>
<property name="bootstrapViews">
<list>
<props>
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
<prop key="location">alfresco/module/org_alfresco_module_rm/bootstrap/RMDataDictionaryBootstrap.xml</prop>
</props>
</list>
</property>
</bean>
<!-- Bootstap the message property files -->
<bean id="org_alfresco_module_rm_resourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.messages.notification-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.admin-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.records-management-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.action-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.audit-service</value>
<value>alfresco.module.org_alfresco_module_rm.messages.capability-service</value>
</list>
</property>
</bean>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-model-context.xml"/>
<!-- Load audit config -->
<bean id="org_alfresco_module_rm_userRolesExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.AuthenticatedUserRolesDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
<property name="rmSecurityService" ref="recordsManagementSecurityService" />
</bean>
<bean id="org_alfresco_module_rm_namePathExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanNamePathDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
</bean>
<bean id="org_alfresco_module_rm_nodeRefPathExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanNodeRefPathDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
<property name="rmService" ref="recordsManagementService" />
</bean>
<bean id="org_alfresco_module_rm_identifierExtractor" class="org.alfresco.module.org_alfresco_module_rm.audit.FilePlanIdentifierDataExtractor">
<property name="registry" ref="auditModel.extractorRegistry" />
<property name="nodeService" ref="nodeService" />
</bean>
<!-- Bootstrap the permission model -->
<bean id="org_alfresco_module_rm_permissionBootstrap" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml"/>
</bean>
<!-- Import fixed permission definitions for RM -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml"/>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/security/rm-method-security-context.xml"/>
<!-- Import the RM service's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-service-context.xml"/>
<!-- Import DOD 5015 -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/dod5015/dod5015-context.xml"/>
<!-- Import the RM identifier service's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-id-context.xml"/>
<!-- Import capabilities -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-capabilities-context.xml"/>
<!-- Import capability groups -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/capability/groups/rm-capability-groups-context.xml"/>
<!-- Import the RM action's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-action-context.xml"/>
<import resource="classpath:alfresco/module/org_alfresco_module_rm/action-context.xml"/>
<!-- Import the RM module patches -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-patch-context.xml"/>
<!-- Import RM UI evaluators -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml"/>
<!-- Import disposition properties -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-disposition-properties-context.xml"/>
<!-- RM Script API -->
<bean id="scriptRecordsManagementService" parent="baseJavaScriptExtension" class="org.alfresco.module.org_alfresco_module_rm.jscript.ScriptRecordsManagmentService">
<property name="extensionName">
<value>rmService</value>
</property>
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry"/>
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
</bean>
<!-- Event types -->
<bean id="rmEventResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.module.org_alfresco_module_rm.rm-events</value>
</list>
</property>
</bean>
<bean id="rmEventType" init-method="init" abstract="true">
<property name="recordsManagementEventService" ref="recordsManagementEventService"/>
</bean>
<bean id="rmEventType.simple" class="org.alfresco.module.org_alfresco_module_rm.event.SimpleRecordsManagementEventTypeImpl" parent="rmEventType"/>
<bean id="rmEventType.superseded" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferenceCreateEventType" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}supersedes"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<bean id="rmEventType.obsolete" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferenceCreateEventType" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}obsoletes"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<bean id="rmEventType.crossReferencedRecordTransfered" class="org.alfresco.module.org_alfresco_module_rm.event.OnReferencedRecordActionedUpon" parent="rmEventType">
<property name="referenceName" value="{http://www.alfresco.org/model/rmcustom/1.0}crossreference"/>
<property name="actionName" value="transferComplete"/>
<property name="nodeService" ref="nodeService"/>
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="dispositionService" ref="dispositionService"/>
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
<property name="recordsManagementActionService" ref="recordsManagementActionService"/>
<property name="policyComponent" ref="policyComponent"/>
</bean>
<!-- Job context -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-job-context.xml"/>
<!-- Bootstrap bean -->
<bean id="RecordsManagementBootstrap" class="org.alfresco.module.org_alfresco_module_rm.bootstrap.RecordsManagementBootstrap">
<property name="transactionService" ref="transactionService"/>
<!-- init caveatConfig behaviours -->
<property name="caveatConfigService" ref="caveatConfigService"/>
<property name="customEmailMappingService" ref="customEmailMappingService"/>
<property name="recordsManagementAdminService" ref="RecordsManagementAdminService"/>
</bean>
<!-- Java script interface for rm caveat config-->
<bean id="rmConfigServiceScript" parent="baseJavaScriptExtension" class="org.alfresco.module.org_alfresco_module_rm.caveat.ScriptRMCaveatConfigService">
<property name="extensionName">
<value>caveatConfig</value>
</property>
<property name="caveatConfigService" ref="caveatConfigService"/>
<property name="authorityService" ref="authorityService"/>
</bean>
<!-- Form Processor Filters to process RM nodes and types -->
<bean id="baseRMFormFilter" parent="baseFormFilter" abstract="true">
<property name="namespaceService" ref="NamespaceService"/>
<property name="nodeService" ref="NodeService"/>
<property name="recordsManagementServiceRegistry" ref="RecordsManagementServiceRegistry" />
<property name="recordsManagementService" ref="recordsManagementService"/>
<property name="recordService" ref="recordService"/>
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
</bean>
<bean id="rmNodeFormFilter"
parent="baseRMFormFilter"
class="org.alfresco.module.org_alfresco_module_rm.forms.RecordsManagementNodeFormFilter">
<property name="filterRegistry" ref="nodeFilterRegistry" />
<property name="dictionaryService" ref="DictionaryService" />
<property name="dispositionService" ref="dispositionService"/>
</bean>
<bean id="rmTypeFormFilter"
parent="baseRMFormFilter"
class="org.alfresco.module.org_alfresco_module_rm.forms.RecordsManagementTypeFormFilter">
<property name="filterRegistry" ref="typeFilterRegistry" />
<property name="identifierService" ref="recordsManagementIdentifierService"/>
</bean>
<!-- Override email extractor implementation -->
<bean id="extracter.RFC822"
class="org.alfresco.module.org_alfresco_module_rm.email.RFC822MetadataExtracter"
parent="baseMetadataExtracter" >
<property name="nodeService" ref="nodeService"/>
<property name="supportedDateFormats">
<list>
<value>EEE, d MMM yyyy HH:mm:ss Z</value>
<value>EEE, d MMM yy HH:mm:ss Z</value>
</list>
</property>
</bean>
<!-- Prevent ghosted records being renditioned -->
<bean id="noRenditionsForGhosts" parent="baseRenditionPreventionClass">
<constructor-arg value="rma:ghosted"/>
</bean>
<!-- Import the RM webscript's -->
<import resource="classpath:alfresco/module/org_alfresco_module_rm/rm-webscript-context.xml"/>
</beans>

View File

@@ -45,14 +45,14 @@
<entry key="capabilityCondition.hasEvents" value="true"/>
</map>
</property>
<property name="groupId" value="events" />
<property name="group"><ref bean="eventsGroup"/></property>
</bean>
<bean id="rmAttachRulesToMetadataPropertiesCapability"
parent="declarativeCapability">
<property name="name" value="AttachRulesToMetadataProperties"/>
<property name="permission" value="AttachRulesToMetadataProperties"/>
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmChangeOrDeleteReferencesCapability"
@@ -66,63 +66,63 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="referencesAndLinks" />
<property name="group"><ref bean="referencesAndLinksGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyClassificationGuidesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyClassificationGuides"/>
<property name="permission" value="CreateModifyDestroyClassificationGuides"/>
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyEventsCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyEvents" />
<property name="permission" value="CreateModifyDestroyEvents" />
<property name="groupId" value="events" />
<property name="group"><ref bean="eventsGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyFileplanTypesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyFileplanTypes" />
<property name="permission" value="CreateModifyDestroyFileplanTypes" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyRecordTypesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyRecordTypes" />
<property name="permission" value="CreateModifyDestroyRecordTypes" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyReferenceTypesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyReferenceTypes" />
<property name="permission" value="CreateModifyDestroyReferenceTypes" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyRolesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyRoles" />
<property name="permission" value="CreateModifyDestroyRoles" />
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyTimeframesCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyTimeframes" />
<property name="permission" value="CreateModifyDestroyTimeframes" />
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
<bean id="rmCreateModifyDestroyUsersAndGroupsCapability"
parent="declarativeCapability">
<property name="name" value="CreateModifyDestroyUsersAndGroups" />
<property name="permission" value="CreateModifyDestroyUsersAndGroups" />
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmCycleVitalRecordsCapability"
@@ -145,7 +145,7 @@
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
</map>
</property>
<property name="groupId" value="vitalRecords" />
<property name="group"><ref bean="vitalRecordsGroup"/></property>
</bean>
<bean id="rmDeleteLinksCapability"
@@ -160,28 +160,28 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="referencesAndLinks" />
<property name="group"><ref bean="referencesAndLinksGroup"/></property>
</bean>
<bean id="rmDisplayRightsReportCapability"
parent="declarativeCapability">
<property name="name" value="DisplayRightsReport" />
<property name="permission" value="DisplayRightsReport" />
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmMakeOptionalPropertiesMandatoryCapability"
parent="declarativeCapability">
<property name="name" value="MakeOptionalParametersMandatory" />
<property name="permission" value="MakeOptionalParametersMandatory" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmManageAccessControlsCapability"
parent="declarativeCapability">
<property name="name" value="ManageAccessControls" />
<property name="permission" value="ManageAccessControls" />
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmManageAccessRightsCapability"
@@ -194,28 +194,28 @@
<entry key="capabilityCondition.filling" value="true"/>
</map>
</property>
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmMapClassificationGuideMetadataCapability"
parent="declarativeCapability">
<property name="name" value="MapClassificationGuideMetadata" />
<property name="permission" value="MapClassificationGuideMetadata" />
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
<bean id="rmMapEmailMetadataCapability"
parent="declarativeCapability">
<property name="name" value="MapEmailMetadata" />
<property name="permission" value="MapEmailMetadata" />
<property name="groupId" value="filePlanMetadataListsAndEmail" />
<property name="group"><ref bean="filePlanMetadataListsAndEmailGroup"/></property>
</bean>
<bean id="rmPasswordControlCapability"
parent="declarativeCapability">
<property name="name" value="PasswordControl" />
<property name="permission" value="PasswordControl" />
<property name="groupId" value="rolesAndAccessRights" />
<property name="group"><ref bean="rolesAndAccessRightsGroup"/></property>
</bean>
<bean id="rmPlanningReviewCyclesCapability"
@@ -230,7 +230,7 @@
<entry key="capabilityCondition.vitalRecordOrFolder" value="true"/>
</map>
</property>
<property name="groupId" value="vitalRecords" />
<property name="group"><ref bean="vitalRecordsGroup"/></property>
</bean>
<bean id="rmTriggerAnEventCapability"
@@ -250,21 +250,21 @@
<entry key="capabilityCondition.hasEvents" value="true"/>
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<bean id="rmUpdateClassificationDatesCapability"
parent="declarativeCapability">
<property name="name" value="UpdateClassificationDates" />
<property name="permission" value="UpdateClassificationDates" />
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
<bean id="rmUpdateExemptionCategoriesCapability"
parent="declarativeCapability">
<property name="name" value="UpdateExemptionCategories" />
<property name="permission" value="UpdateExemptionCategories" />
<property name="groupId" value="classifiedRecords" />
<property name="group"><ref bean="classifiedRecordsGroup"/></property>
</bean>
<bean id="rmUpdateTriggerDatesCapability"
@@ -276,7 +276,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="dispositionAndTransfers" />
<property name="group"><ref bean="dispositionAndTransfersGroup"/></property>
</bean>
<bean id="rmUpdateVitalRecordCycleInformationCapability"
@@ -288,7 +288,7 @@
<entry key="capabilityCondition.frozen" value="false"/>
</map>
</property>
<property name="groupId" value="vitalRecords" />
<property name="group"><ref bean="vitalRecordsGroup"/></property>
</bean>
<!-- Record Folder capabilities -->

View File

@@ -30,350 +30,331 @@ import org.springframework.extensions.surf.util.I18NUtil;
/**
* Abstract capability implementation.
*
*
* @author Andy Hind
* @author Roy Wetherall
*/
public abstract class AbstractCapability extends RMSecurityCommon
implements Capability, RecordsManagementModel, RMPermissionModel
{
/** Logger */
@SuppressWarnings("unused")
private static Log logger = LogFactory.getLog(AbstractCapability.class);
/** Logger */
@SuppressWarnings("unused")
private static Log logger = LogFactory.getLog(AbstractCapability.class);
/** RM entry voter */
protected RMEntryVoter voter;
/** RM entry voter */
protected RMEntryVoter voter;
/** Capability service */
protected CapabilityService capabilityService;
/** Capability service */
protected CapabilityService capabilityService;
/** Capability name */
protected String name;
/** Capability name */
protected String name;
/** Capability title and description */
protected String title;
protected String description;
/** Capability title and description */
protected String title;
protected String description;
/** Capability group id and title*/
protected String groupId;
protected String groupTitle;
/** Capability Group */
protected Group group;
/** Indicates whether this is a private capability or not */
protected boolean isPrivate = false;
/** Indicates whether this is a private capability or not */
protected boolean isPrivate = false;
/** List of actions */
// protected List<RecordsManagementAction> actions = new ArrayList<RecordsManagementAction>(1);
/** List of actions */
// protected List<RecordsManagementAction> actions = new ArrayList<RecordsManagementAction>(1);
/** Action names */
// protected List<String> actionNames = new ArrayList<String>(1);
/** Action names */
// protected List<String> actionNames = new ArrayList<String>(1);
/**
* @param voter RM entry voter
*/
public void setVoter(RMEntryVoter voter)
{
this.voter = voter;
}
/**
* @param voter RM entry voter
*/
public void setVoter(RMEntryVoter voter)
{
this.voter = voter;
}
/**
* @param capabilityService capability service
*/
public void setCapabilityService(CapabilityService capabilityService)
{
this.capabilityService = capabilityService;
}
/**
* @param capabilityService capability service
*/
public void setCapabilityService(CapabilityService capabilityService)
{
this.capabilityService = capabilityService;
}
/**
* Init method
*/
public void init()
{
capabilityService.registerCapability(this);
}
/**
* Init method
*/
public void init()
{
capabilityService.registerCapability(this);
}
/**
* Registers an action
*
* @param action
*/
// public void registerAction(RecordsManagementAction action)
// {
// this.actions.add(action);
// this.actionNames.add(action.getName());
// }
/**
* Registers an action
*
* @param action
*/
// public void registerAction(RecordsManagementAction action)
// {
// this.actions.add(action);
// this.actionNames.add(action.getName());
// }
/**
* @param name capability name
*/
public void setName(String name)
{
this.name = name;
}
/**
* @param name capability name
*/
public void setName(String name)
{
this.name = name;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getName()
*/
@Override
public String getName()
{
return name;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getName()
*/
@Override
public String getName()
{
return name;
}
/**
* @param title capability title
*/
public void setTitle(String title)
{
this.title = title;
}
/**
* @param title capability title
*/
public void setTitle(String title)
{
this.title = title;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getTitle()
*/
@Override
public String getTitle()
{
String title = this.title;
if (StringUtils.isBlank(title))
{
title = I18NUtil.getMessage("capability." + getName() + ".title");
}
return title;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getTitle()
*/
@Override
public String getTitle()
{
String title = this.title;
if (StringUtils.isBlank(title))
{
title = I18NUtil.getMessage("capability." + getName() + ".title");
}
return title;
}
/**
* @param description capability description
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @param description capability description
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @param descriptionId message id
*/
public void setDescriptionId(String descriptionId)
{
this.description = I18NUtil.getMessage(descriptionId);
}
/**
* @param descriptionId message id
*/
public void setDescriptionId(String descriptionId)
{
this.description = I18NUtil.getMessage(descriptionId);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getDescription()
*/
@Override
public String getDescription()
{
return description;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getDescription()
*/
@Override
public String getDescription()
{
return description;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#isPrivate()
*/
public boolean isPrivate()
{
return isPrivate;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#isPrivate()
*/
public boolean isPrivate()
{
return isPrivate;
}
/**
* @param isPrivate indicates whether the capability is private or not
*/
public void setPrivate(boolean isPrivate)
{
this.isPrivate = isPrivate;
}
/**
* @param isPrivate indicates whether the capability is private or not
*/
public void setPrivate(boolean isPrivate)
{
this.isPrivate = isPrivate;
}
/**
* Translates the vote to an AccessStatus
*
* @param vote
* @return
*/
private AccessStatus translate(int vote)
{
switch (vote)
{
case AccessDecisionVoter.ACCESS_ABSTAIN:
/**
* Translates the vote to an AccessStatus
*
* @param vote
* @return
*/
private AccessStatus translate(int vote)
{
switch (vote)
{
case AccessDecisionVoter.ACCESS_ABSTAIN:
return AccessStatus.UNDETERMINED;
case AccessDecisionVoter.ACCESS_GRANTED:
case AccessDecisionVoter.ACCESS_GRANTED:
return AccessStatus.ALLOWED;
case AccessDecisionVoter.ACCESS_DENIED:
case AccessDecisionVoter.ACCESS_DENIED:
return AccessStatus.DENIED;
default:
default:
return AccessStatus.UNDETERMINED;
}
}
}
}
/**
*
* @param nodeRef
* @return
*/
// public int checkActionConditionsIfPresent(NodeRef nodeRef)
// {
// String prefix = "checkActionConditionsIfPresent" + getName();
// int result = getTransactionCache(prefix, nodeRef);
// if (result != NOSET_VALUE)
// {
// return result;
// }
/**
*
* @param nodeRef
* @return
*/
// public int checkActionConditionsIfPresent(NodeRef nodeRef)
// {
// String prefix = "checkActionConditionsIfPresent" + getName();
// int result = getTransactionCache(prefix, nodeRef);
// if (result != NOSET_VALUE)
// {
// return result;
// }
//
// if (actions.size() > 0)
// {
// for (RecordsManagementAction action : actions)
// {
// if (action.isExecutable(nodeRef, null))
// if (actions.size() > 0)
// {
// for (RecordsManagementAction action : actions)
// {
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
// if (action.isExecutable(nodeRef, null))
// {
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
// }
// }
// }
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_DENIED);
// }
// else
// {
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
// }
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_DENIED);
// }
// else
// {
// return setTransactionCache(prefix, nodeRef, AccessDecisionVoter.ACCESS_GRANTED);
// }
// }
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#hasPermission(org.alfresco.service.cmr.repository.NodeRef)
*/
public AccessStatus hasPermission(NodeRef nodeRef)
{
return translate(hasPermissionRaw(nodeRef));
}
/**
* Determines whether the current user has permission on this capability.
* <p>
* Returns the raw permission value.
*
* @param nodeRef node reference
* @return raw permission value
*/
public int hasPermissionRaw(NodeRef nodeRef)
{
String prefix = "hasPermissionRaw" + getName();
int result = getTransactionCache(prefix, nodeRef);
if (result != NOSET_VALUE)
{
return result;
}
if (checkRmRead(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
{
result = AccessDecisionVoter.ACCESS_DENIED;
}
// else if (checkActionConditionsIfPresent(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
// {
// result = AccessDecisionVoter.ACCESS_DENIED;
// }
else
{
result = hasPermissionImpl(nodeRef);
}
return setTransactionCache(prefix, nodeRef, result);
}
/**
* Default implementation. Override if different behaviour required.
*
* @param nodeRef
* @return
*/
protected int hasPermissionImpl(NodeRef nodeRef)
{
return evaluate(nodeRef);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
*/
public int evaluate(NodeRef source, NodeRef target)
{
return AccessDecisionVoter.ACCESS_ABSTAIN;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActionNames()
*/
// public List<String> getActionNames()
// {
// return actionNames;
// }
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActions()
*/
// public List<RecordsManagementAction> getActions()
// {
// return actions;
// }
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#hasPermission(org.alfresco.service.cmr.repository.NodeRef)
*/
public AccessStatus hasPermission(NodeRef nodeRef)
{
return translate(hasPermissionRaw(nodeRef));
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getGroup()
*/
public Group getGroup()
{
return this.group;
}
/**
* Determines whether the current user has permission on this capability.
* <p>
* Returns the raw permission value.
*
* @param nodeRef node reference
* @return raw permission value
*/
public int hasPermissionRaw(NodeRef nodeRef)
{
String prefix = "hasPermissionRaw" + getName();
int result = getTransactionCache(prefix, nodeRef);
if (result != NOSET_VALUE)
{
return result;
}
public void setGroup(Group group)
{
this.group = group;
}
if (checkRmRead(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
{
result = AccessDecisionVoter.ACCESS_DENIED;
}
//else if (checkActionConditionsIfPresent(nodeRef) == AccessDecisionVoter.ACCESS_DENIED)
// {
// result = AccessDecisionVoter.ACCESS_DENIED;
// }
else
{
result = hasPermissionImpl(nodeRef);
}
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
return result;
}
return setTransactionCache(prefix, nodeRef, result);
}
/**
* Default implementation. Override if different behaviour required.
*
* @param nodeRef
* @return
*/
protected int hasPermissionImpl(NodeRef nodeRef)
{
return evaluate(nodeRef);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#evaluate(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)
*/
public int evaluate(NodeRef source, NodeRef target)
{
return AccessDecisionVoter.ACCESS_ABSTAIN;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActionNames()
*/
// public List<String> getActionNames()
// {
// return actionNames;
// }
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getActions()
*/
// public List<RecordsManagementAction> getActions()
// {
// return actions;
// }
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getGroupId()
*/
public String getGroupId()
{
return this.groupId;
}
public void setGroupId(String groupId)
{
this.groupId = groupId;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Capability#getGroupTitle()
*/
public String getGroupTitle()
{
String groupTitle = this.groupTitle;
if (StringUtils.isBlank(groupTitle))
{
groupTitle = I18NUtil.getMessage("capability.group." + getGroupId() + ".title");
}
return groupTitle;
}
public void setGroupTitle(String groupTitle)
{
this.groupTitle = groupTitle;
}
/**
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
return result;
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final AbstractCapability other = (AbstractCapability) obj;
if (getName() == null)
{
if (other.getName() != null)
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
}
else if (!getName().equals(other.getName()))
return false;
return true;
}
if (getClass() != obj.getClass())
return false;
final AbstractCapability other = (AbstractCapability) obj;
if (getName() == null)
{
if (other.getName() != null)
return false;
}
else if (!getName().equals(other.getName()))
return false;
return true;
}
}

View File

@@ -18,91 +18,81 @@
*/
package org.alfresco.module.org_alfresco_module_rm.capability;
import java.util.List;
import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
/**
* Capability Interface.
*
*
* @author andyh
* @author Roy Wetherall
*/
public interface Capability
{
/**
* Does this capability apply to this nodeRef?
* @param nodeRef
* @return
*/
AccessStatus hasPermission(NodeRef nodeRef);
/**
* Does this capability apply to this nodeRef?
* @param nodeRef
* @return
*/
AccessStatus hasPermission(NodeRef nodeRef);
/**
*
* @param nodeRef
* @return
*/
int hasPermissionRaw(NodeRef nodeRef);
/**
*
* @param nodeRef
* @return
*/
int hasPermissionRaw(NodeRef nodeRef);
/**
* Evaluates the capability.
*
* @param nodeRef
* @return
*/
int evaluate(NodeRef nodeRef);
/**
* Evaluates the capability.
*
* @param nodeRef
* @return
*/
int evaluate(NodeRef nodeRef);
/**
* Evaluates the capability, taking into account a target.
*
* @param source source node reference
* @param target target node reference
* @return int permission value
*/
int evaluate(NodeRef source, NodeRef target);
/**
* Evaluates the capability, taking into account a target.
*
* @param source source node reference
* @param target target node reference
* @return int permission value
*/
int evaluate(NodeRef source, NodeRef target);
/**
* Indicates whether this is a private capability or not. Private capabilities are used internally, otherwise
* they are made available to the user to assign to roles.
*
* @return boolean true if private, false otherwise
*/
boolean isPrivate();
/**
* Indicates whether this is a private capability or not. Private capabilities are used internally, otherwise
* they are made available to the user to assign to roles.
*
* @return boolean true if private, false otherwise
*/
boolean isPrivate();
/**
* Get the name of the capability
*
* @return String capability name
*/
String getName();
/**
* Get the name of the capability
*
* @return String capability name
*/
String getName();
/**
* Get the title of the capability
*
* @return String capability title
*/
String getTitle();
/**
* Get the title of the capability
*
* @return String capability title
*/
String getTitle();
/**
* Get the description of the capability
*
* @return String capability description
*/
String getDescription();
/**
* Get the description of the capability
*
* @return String capability description
*/
String getDescription();
/**
* Gets the group id of a capability
*
* @return String capability group id
*/
String getGroupId();
/**
* Gets the group title of a capability
*
* @return String capability group title
*/
String getGroupTitle();
/**
* Gets the group of a capability
*
* @return Group capability group
*/
Group getGroup();
}

View File

@@ -27,7 +27,7 @@ import org.alfresco.service.cmr.security.AccessStatus;
/**
* Capability service implementation
*
*
* @author Roy Wetherall
* @since 2.0
*/
@@ -35,14 +35,14 @@ public interface CapabilityService
{
/**
* Register a capability
*
*
* @param capability capability
*/
void registerCapability(Capability capability);
/**
* Get a named capability.
*
*
* @param name capability name
* @return {@link Capability} capability or null if not found
*/
@@ -50,14 +50,14 @@ public interface CapabilityService
/**
* Get a list of all the assignable capabilities.
*
*
* @return {@link Set}<{@link Capability}> set of all the assignable capabilities
*/
Set<Capability> getCapabilities();
/**
* Get a list of all the capabilities, optionally including those that are non-assignable.
*
*
* @param includePrivate indicates that the private, or non-assignable capabilities are included in the result
* @return {@link Set}<{@link Capability}> set of capabilities
*/
@@ -65,7 +65,7 @@ public interface CapabilityService
/**
* Get all the capabilities access state based on the current user for the assignable capabilities.
*
*
* @param nodeRef node reference
* @return
*/
@@ -73,14 +73,14 @@ public interface CapabilityService
/**
* Get all the capabilities access state based on the current user.
*
*
* @param nodeRef node reference
* @return
*/
Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate);
/**
*
*
* @param nodeRef
* @param capabilityNames
* @return
@@ -89,10 +89,55 @@ public interface CapabilityService
/**
* Helper method to get the access state for a single capability.
*
*
* @param nodeRef
* @param capabilityName
* @return
*/
AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName);
/**
* Gets the list of all the capability groups (in index order)
*
* @return {@link List}<{@link Group}> List of all the capability groups (in index order)
*/
List<Group> getGroups();
/**
* Gets a list of capabilities for the given group id
*
* @param groupId The id of a group for which the list of capabilities should be retrieved
* @return {@link List}<{@link Capability}> List of capabilities for the given group
*/
List<Capability> getCapabilitiesByGroup(String groupId);
/**
* Get a list of capabilities for the given group
*
* @param group The group for which the list of capabilities should be retrieved
* @return {@link List}<{@link Capability}> List of capabilities for the given group
*/
List<Capability> getCapabilitiesByGroup(Group group);
/**
* Gets a group from it's id
*
* @param groupId The id of the group which should be retrieved
* @return Group The group with the id groupId
*/
Group getGroup(String groupId);
/**
* Adds a group to the list of groups
*
* @param group The group which should be added
*/
void addGroup(Group group);
/**
* Removes a group from the list of groups
*
* @param group The group which should be removed
*/
void removeGroup(Group group);
}

View File

@@ -18,7 +18,9 @@
*/
package org.alfresco.module.org_alfresco_module_rm.capability;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -35,138 +37,233 @@ import org.alfresco.util.ParameterCheck;
*/
public class CapabilityServiceImpl implements CapabilityService
{
/** Capabilities */
private Map<String, Capability> capabilities = new HashMap<String, Capability>(57);
/** Capabilities */
private Map<String, Capability> capabilities = new HashMap<String, Capability>(57);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapability(java.lang.String)
*/
@Override
public Capability getCapability(String name)
{
ParameterCheck.mandatoryString("name", name);
/** Groups */
private Map<String, Group> groups = new HashMap<String, Group>(13);
return capabilities.get(name);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapability(java.lang.String)
*/
@Override
public Capability getCapability(String name)
{
ParameterCheck.mandatoryString("name", name);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#registerCapability(org.alfresco.module.org_alfresco_module_rm.capability.Capability)
*/
@Override
public void registerCapability(Capability capability)
{
ParameterCheck.mandatory("capability", capability);
return capabilities.get(name);
}
capabilities.put(capability.getName(), capability);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#registerCapability(org.alfresco.module.org_alfresco_module_rm.capability.Capability)
*/
@Override
public void registerCapability(Capability capability)
{
ParameterCheck.mandatory("capability", capability);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities()
*/
@Override
public Set<Capability> getCapabilities()
{
return getCapabilities(true);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities(boolean)
*/
@Override
public Set<Capability> getCapabilities(boolean includePrivate)
{
Set<Capability> result = null;
if (includePrivate == true)
{
result = new HashSet<Capability>(capabilities.values());
}
else
{
result = new HashSet<Capability>(capabilities.size());
for (Capability capability : capabilities.values())
{
if (capability.isPrivate() == false)
capabilities.put(capability.getName(), capability);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities()
*/
@Override
public Set<Capability> getCapabilities()
{
return getCapabilities(true);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilities(boolean)
*/
@Override
public Set<Capability> getCapabilities(boolean includePrivate)
{
Set<Capability> result = null;
if (includePrivate == true)
{
result = new HashSet<Capability>(capabilities.values());
}
else
{
result = new HashSet<Capability>(capabilities.size());
for (Capability capability : capabilities.values())
{
result.add(capability);
if (capability.isPrivate() == false)
{
result.add(capability);
}
}
}
}
}
return result;
}
return result;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef)
*/
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef)
*/
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
return getCapabilitiesAccessState(nodeRef, false);
}
return getCapabilitiesAccessState(nodeRef, false);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
*/
@Override
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, boolean)
*/
@Override
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, boolean includePrivate)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
for (Capability capability : listOfCapabilites)
{
AccessStatus status = capability.hasPermission(nodeRef);
if (answer.put(capability, status) != null)
{
throw new IllegalStateException();
}
}
return answer;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
*/
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("capabilityNames", capabilityNames);
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
for (String capabilityName : capabilityNames)
{
Capability capability = capabilities.get(capabilityName);
if (capability != null)
{
Set<Capability> listOfCapabilites = getCapabilities(includePrivate);
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
for (Capability capability : listOfCapabilites)
{
AccessStatus status = capability.hasPermission(nodeRef);
if (answer.put(capability, status) != null)
{
throw new IllegalStateException();
throw new IllegalStateException();
}
}
}
return answer;
}
}
return answer;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilityAccessState(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
*/
@Override
public AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("capabilityName", capabilityName);
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesAccessState(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
*/
public Map<Capability, AccessStatus> getCapabilitiesAccessState(NodeRef nodeRef, List<String> capabilityNames)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("capabilityNames", capabilityNames);
AccessStatus result = AccessStatus.UNDETERMINED;
Capability capability = getCapability(capabilityName);
if (capability != null)
{
List<String> list = Collections.singletonList(capabilityName);
Map<Capability, AccessStatus> map = getCapabilitiesAccessState(nodeRef, list);
result = map.get(capability);
}
return result;
}
HashMap<Capability, AccessStatus> answer = new HashMap<Capability, AccessStatus>();
for (String capabilityName : capabilityNames)
{
Capability capability = capabilities.get(capabilityName);
if (capability != null)
{
AccessStatus status = capability.hasPermission(nodeRef);
if (answer.put(capability, status) != null)
{
throw new IllegalStateException();
}
}
}
return answer;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilityAccessState(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
*/
@Override
public AccessStatus getCapabilityAccessState(NodeRef nodeRef, String capabilityName)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
ParameterCheck.mandatory("capabilityName", capabilityName);
AccessStatus result = AccessStatus.UNDETERMINED;
Capability capability = getCapability(capabilityName);
if (capability != null)
{
List<String> list = Collections.singletonList(capabilityName);
Map<Capability, AccessStatus> map = getCapabilitiesAccessState(nodeRef, list);
result = map.get(capability);
}
return result;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getGroups()
*/
@Override
public List<Group> getGroups()
{
List<Group> groups = new ArrayList<Group>();
for (Map.Entry<String, Group> entry : this.groups.entrySet())
{
groups.add(entry.getValue());
}
Collections.sort(groups, new Comparator<Group>()
{
public int compare(Group g1, Group g2)
{
return Integer.parseInt(g1.getIndex()) - Integer.parseInt(g2.getIndex());
}
});
return groups;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesByGroup(java.lang.String)
*/
@Override
public List<Capability> getCapabilitiesByGroup(String groupId)
{
ParameterCheck.mandatoryString("groupId", groupId);
String id = this.groups.get(groupId).getId();
List<Capability> capabilities = new ArrayList<Capability>();
for (Capability capability : getCapabilities())
{
Group group = capability.getGroup();
if (group != null)
{
if (group.getId().equalsIgnoreCase(id))
{
capabilities.add(capability);
}
}
}
return capabilities;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getCapabilitiesByGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
*/
@Override
public List<Capability> getCapabilitiesByGroup(Group group)
{
ParameterCheck.mandatory("group", group);
return getCapabilitiesByGroup(group.getId());
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#getGroup(java.lang.String)
*/
@Override
public Group getGroup(String groupId)
{
ParameterCheck.mandatoryString("groupId", groupId);
return this.groups.get(groupId);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#addGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
*/
@Override
public void addGroup(Group group)
{
ParameterCheck.mandatory("group", group);
groups.put(group.getId(), group);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService#removeGroup(org.alfresco.module.org_alfresco_module_rm.capability.Group)
*/
@Override
public void removeGroup(Group group)
{
ParameterCheck.mandatory("group", group);
groups.remove(group.getId());
}
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2005-2012 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.capability;
/**
* Group interface
*
* @author Tuna Aksoy
* @since 2.1
*/
public interface Group
{
/**
* Gets the id of a group (Get the id of the group)
*
* @return String the group id
*/
String getId();
/**
* Gets the title of a group
*
* @return String the group title
*/
String getTitle();
/**
* Gets the index of a group
*
* @return String the group index
*/
String getIndex();
}

View File

@@ -0,0 +1,105 @@
/*
* Copyright (C) 2005-2012 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.module.org_alfresco_module_rm.capability;
import org.apache.commons.lang.StringUtils;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Group implementation
*
* @author Tuna Aksoy
* @since 2.1
*/
public class GroupImpl implements Group
{
/** The group id */
private String id;
/** The group title */
private String title;
/** The group index */
private String index;
/** Capability service */
private CapabilityService capabilityService;
/**
* Sets the capability service
*
* @param capabilityService the capability service
*/
public void setCapabilityService(CapabilityService capabilityService)
{
this.capabilityService = capabilityService;
}
public void init()
{
this.capabilityService.addGroup(this);
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Group#getId()
*/
@Override
public String getId()
{
return this.id;
}
public void setId(String id)
{
this.id = id;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Group#getTitle()
*/
@Override
public String getTitle()
{
String title = this.title;
if (StringUtils.isBlank(title))
{
title = I18NUtil.getMessage("capability.group." + getId() + ".title");
}
return title;
}
public void setTitle(String title)
{
this.title = title;
}
/**
* @see org.alfresco.module.org_alfresco_module_rm.capability.Group#getIndex()
*/
@Override
public String getIndex()
{
return this.index;
}
public void setIndex(String index)
{
this.index = index;
}
}

View File

@@ -22,13 +22,14 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.capability.Group;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.AccessStatus;
@@ -41,165 +42,169 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
public class CapabilitiesGet extends DeclarativeWebScript
{
private RecordsManagementService recordsManagementService;
private RecordsManagementService recordsManagementService;
private CapabilityService capabilityService;
private CapabilityService capabilityService;
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
{
this.recordsManagementService = recordsManagementService;
}
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
{
this.recordsManagementService = recordsManagementService;
}
public void setCapabilityService(CapabilityService capabilityService)
{
this.capabilityService = capabilityService;
}
public void setCapabilityService(CapabilityService capabilityService)
{
this.capabilityService = capabilityService;
}
/**
* @see org.alfresco.repo.web.scripts.content.StreamContent#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
*/
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String storeType = templateVars.get("store_type");
String storeId = templateVars.get("store_id");
String nodeId = templateVars.get("id");
/**
* @see org.alfresco.repo.web.scripts.content.StreamContent#executeImpl(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.Status, org.springframework.extensions.webscripts.Cache)
*/
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
String storeType = templateVars.get("store_type");
String storeId = templateVars.get("store_id");
String nodeId = templateVars.get("id");
NodeRef nodeRef = null;
if (StringUtils.isNotBlank(storeType) && StringUtils.isNotBlank(storeId) && StringUtils.isNotBlank(nodeId))
{
nodeRef = new NodeRef(new StoreRef(storeType, storeId), nodeId);
}
else
{
// we are talking about the file plan node
// TODO we are making the assumption there is only one file plan here!
List<NodeRef> filePlans = recordsManagementService.getFilePlans();
if (filePlans.isEmpty() == true)
{
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No file plan node has been found.");
}
else if (filePlans.size() != 1)
{
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "More than one file plan has been found.");
}
nodeRef = filePlans.get(0);
}
boolean grouped = false;
String groupedString = req.getParameter("grouped");
if (StringUtils.isNotBlank(groupedString))
{
grouped = Boolean.parseBoolean(groupedString);
}
Map<String, Object> model = new HashMap<String, Object>(1);
if (grouped == true)
{
// Construct the map which is needed to build the model
Map<String, GroupedCapabilities> groupedCapabilitiesMap = new HashMap<String, GroupedCapabilities>(13);
Set<Capability> capabilities = capabilityService.getCapabilities();
for (Capability capability : capabilities)
{
String capabilityGroupTitle = capability.getGroupTitle();
if (StringUtils.isNotBlank(capabilityGroupTitle))
NodeRef nodeRef = null;
if (StringUtils.isNotBlank(storeType) && StringUtils.isNotBlank(storeId) && StringUtils.isNotBlank(nodeId))
{
nodeRef = new NodeRef(new StoreRef(storeType, storeId), nodeId);
}
else
{
// we are talking about the file plan node
// TODO we are making the assumption there is only one file plan here!
List<NodeRef> filePlans = recordsManagementService.getFilePlans();
if (filePlans.isEmpty() == true)
{
String capabilityGroupId = capability.getGroupId();
String capabilityName = capability.getName();
String capabilityTitle = capability.getTitle();
if (groupedCapabilitiesMap.containsKey(capabilityGroupId))
{
groupedCapabilitiesMap.get(capabilityGroupId).addCapability(capabilityName, capabilityTitle);
}
else
{
GroupedCapabilities groupedCapabilities = new GroupedCapabilities(capabilityGroupId, capabilityGroupTitle, capabilityName, capabilityTitle);
groupedCapabilities.addCapability(capabilityName, capabilityTitle);
groupedCapabilitiesMap.put(capabilityGroupId, groupedCapabilities);
}
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No file plan node has been found.");
}
}
model.put("groupedCapabilities", groupedCapabilitiesMap);
}
else
{
boolean includePrivate = false;
String includePrivateString = req.getParameter("includeAll");
if (StringUtils.isNotBlank(includePrivateString))
{
includePrivate = Boolean.parseBoolean(includePrivateString);
}
Map<Capability, AccessStatus> map = capabilityService.getCapabilitiesAccessState(nodeRef, includePrivate);
List<String> list = new ArrayList<String>(map.size());
for (Map.Entry<Capability, AccessStatus> entry : map.entrySet())
{
AccessStatus accessStatus = entry.getValue();
if (AccessStatus.DENIED.equals(accessStatus) == false)
else if (filePlans.size() != 1)
{
Capability capability = entry.getKey();
list.add(capability.getName());
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "More than one file plan has been found.");
}
}
model.put("capabilities", list);
}
nodeRef = filePlans.get(0);
}
return model;
}
boolean grouped = false;
String groupedString = req.getParameter("grouped");
if (StringUtils.isNotBlank(groupedString))
{
grouped = Boolean.parseBoolean(groupedString);
}
/**
* Class to represent grouped capabilities for use in a Freemarker template
*
*/
public class GroupedCapabilities
{
private String capabilityGroupId;
private String capabilityGroupTitle;
private String capabilityName;
private String capabilityTitle;
private Map<String, String> capabilities;
Map<String, Object> model = new HashMap<String, Object>(1);
if (grouped == true)
{
// Construct the map which is needed to build the model
Map<String, GroupedCapabilities> groupedCapabilitiesMap = new TreeMap<String, GroupedCapabilities>();
public GroupedCapabilities(String capabilityGroupId, String capabilityGroupTitle, String capabilityName, String capabilityTitle)
{
this.capabilityGroupId = capabilityGroupId;
this.capabilityGroupTitle = capabilityGroupTitle;
this.capabilityName = capabilityName;
this.capabilityTitle = capabilityTitle;
this.capabilities = new HashMap<String, String>(5);
}
List<Group> groups = capabilityService.getGroups();
for (Group group : groups)
{
String capabilityGroupTitle = group.getTitle();
if (StringUtils.isNotBlank(capabilityGroupTitle))
{
String capabilityGroupId = group.getId();
public String getGroupId()
{
return this.capabilityGroupId;
}
List<Capability> capabilities = capabilityService.getCapabilitiesByGroup(capabilityGroupId);
for (Capability capability : capabilities)
{
String capabilityName = capability.getName();
String capabilityTitle = capability.getTitle();
public String getGroupTitle()
{
return this.capabilityGroupTitle;
}
if (groupedCapabilitiesMap.containsKey(capabilityGroupId))
{
groupedCapabilitiesMap.get(capabilityGroupId).addCapability(capabilityName, capabilityTitle);
}
else
{
GroupedCapabilities groupedCapabilities = new GroupedCapabilities(capabilityGroupId, capabilityGroupTitle, capabilityName, capabilityTitle);
groupedCapabilities.addCapability(capabilityName, capabilityTitle);
groupedCapabilitiesMap.put(capabilityGroupId, groupedCapabilities);
}
}
}
}
model.put("groupedCapabilities", groupedCapabilitiesMap);
}
else
{
boolean includePrivate = false;
String includePrivateString = req.getParameter("includeAll");
if (StringUtils.isNotBlank(includePrivateString))
{
includePrivate = Boolean.parseBoolean(includePrivateString);
}
public String getCapabilityName()
{
return this.capabilityName;
}
Map<Capability, AccessStatus> map = capabilityService.getCapabilitiesAccessState(nodeRef, includePrivate);
List<String> list = new ArrayList<String>(map.size());
for (Map.Entry<Capability, AccessStatus> entry : map.entrySet())
{
AccessStatus accessStatus = entry.getValue();
if (AccessStatus.DENIED.equals(accessStatus) == false)
{
Capability capability = entry.getKey();
list.add(capability.getName());
}
}
model.put("capabilities", list);
}
public String getCapabilityTitle()
{
return this.capabilityTitle;
}
return model;
}
public Map<String, String> getCapabilities()
{
return this.capabilities;
}
/**
* Class to represent grouped capabilities for use in a Freemarker template
*
*/
public class GroupedCapabilities
{
private String capabilityGroupId;
private String capabilityGroupTitle;
private String capabilityName;
private String capabilityTitle;
private Map<String, String> capabilities;
public void addCapability(String capabilityName, String capabilityTitle)
{
this.capabilities.put(capabilityName, capabilityTitle);
}
}
public GroupedCapabilities(String capabilityGroupId, String capabilityGroupTitle, String capabilityName, String capabilityTitle)
{
this.capabilityGroupId = capabilityGroupId;
this.capabilityGroupTitle = capabilityGroupTitle;
this.capabilityName = capabilityName;
this.capabilityTitle = capabilityTitle;
this.capabilities = new HashMap<String, String>(5);
}
public String getGroupId()
{
return this.capabilityGroupId;
}
public String getGroupTitle()
{
return this.capabilityGroupTitle;
}
public String getCapabilityName()
{
return this.capabilityName;
}
public String getCapabilityTitle()
{
return this.capabilityTitle;
}
public Map<String, String> getCapabilities()
{
return this.capabilities;
}
public void addCapability(String capabilityName, String capabilityTitle)
{
this.capabilities.put(capabilityName, capabilityTitle);
}
}
}