diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml index ce88a33169..16e705a25a 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-action-context.xml @@ -586,7 +586,6 @@ class="org.alfresco.module.org_alfresco_module_rm.vital.BroadcastVitalRecordDefinitionAction" parent="rmAction"> - diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml index 433223bedd..7741c02f69 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-model-context.xml @@ -101,7 +101,6 @@ - diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml index 1ccdc2d8ad..9887108d07 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml @@ -31,9 +31,6 @@ - - - @@ -77,7 +74,6 @@ - diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordAspect.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordAspect.java index f79d10f4cc..f513365b06 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordAspect.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/aspect/RecordAspect.java @@ -28,7 +28,6 @@ import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies; import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel; import org.alfresco.module.org_alfresco_module_rm.model.behaviour.RecordsManagementSearchBehaviour; -import org.alfresco.module.org_alfresco_module_rm.record.RecordService; import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService; import org.alfresco.repo.copy.CopyBehaviourCallback; import org.alfresco.repo.copy.CopyDetails; @@ -47,7 +46,7 @@ import org.alfresco.service.namespace.QName; /** * rma:record behaviour bean - * + * * @author Roy Wetherall * @since 2.2 */ @@ -64,16 +63,13 @@ public class RecordAspect extends BaseBehaviourBean /** Well-known location of the scripts folder. */ // TODO make configurable private NodeRef scriptsFolderNodeRef = new NodeRef("workspace", "SpacesStore", "rm_behavior_scripts"); - + /** extended security service */ protected ExtendedSecurityService extendedSecurityService; - + /** script service */ protected ScriptService scriptService; - - /** record service */ - protected RecordService recordService; - + /** * @param extendedSecurityService extended security service */ @@ -89,18 +85,10 @@ public class RecordAspect extends BaseBehaviourBean { this.scriptService = scriptService; } - - /** - * @param recordService record service - */ - public void setRecordService(RecordService recordService) - { - this.recordService = recordService; - } - + /** * Behaviour to ensure renditions have the appropriate extended security. - * + * * @see org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef, boolean) */ @Override @@ -158,7 +146,7 @@ public class RecordAspect extends BaseBehaviourBean } // Execute script if for the reference event - executeReferenceScript("onCreate", reference, fromNodeRef, toNodeRef); + executeReferenceScript("onCreate", reference, fromNodeRef, toNodeRef); } /** @@ -180,9 +168,9 @@ public class RecordAspect extends BaseBehaviourBean } // Execute script if for the reference event - executeReferenceScript("onRemove", reference, fromNodeRef, toNodeRef); + executeReferenceScript("onRemove", reference, fromNodeRef, toNodeRef); } - + /** * Record copy callback */ @@ -217,7 +205,7 @@ public class RecordAspect extends BaseBehaviourBean /** * Record move behaviour - * + * * @see org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy#onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef, org.alfresco.service.cmr.repository.ChildAssociationRef) */ @Override @@ -247,7 +235,7 @@ public class RecordAspect extends BaseBehaviourBean }, AuthenticationUtil.getAdminUserName()); } } - + /** * Executes a reference script if present * diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java index 39e5df9b41..5ecfc139ee 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java @@ -28,7 +28,6 @@ import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService; import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; -import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; @@ -48,7 +47,7 @@ import org.alfresco.util.PropertyMap; /** * Behaviour associated with the RM Site type - * + * * @author Roy Wetherall * @since 2.2 */ @@ -65,40 +64,28 @@ public class RmSiteType extends BaseBehaviourBean public static final String COMPONENT_DOCUMENT_LIBRARY = "documentLibrary"; public static final String DEFAULT_SITE_NAME = "rm"; public static final QName DEFAULT_FILE_PLAN_TYPE = TYPE_FILE_PLAN; - - /** Policy component */ - protected PolicyComponent policyComponent; - + /** Site service */ protected SiteService siteService; - + /** Record Management Search Service */ protected RecordsManagementSearchService recordsManagementSearchService; - + /** Capability service */ protected CapabilityService capabilityService; - + /** Map of file plan type's key'ed by corresponding site types */ protected Map mapFilePlanType = new HashMap(3); - - /** - * Set the policy component - * @param policyComponent policy component - */ - public void setPolicyComponent(PolicyComponent policyComponent) - { - this.policyComponent = policyComponent; - } - + /** * Set the site service * @param siteService site service */ - public void setSiteService(SiteService siteService) + public void setSiteService(SiteService siteService) { this.siteService = siteService; } - + /** * @param recordsManagementSearchService records management search service */ @@ -106,7 +93,7 @@ public class RmSiteType extends BaseBehaviourBean { this.recordsManagementSearchService = recordsManagementSearchService; } - + /** * @param capabilityService capability service */ @@ -114,10 +101,10 @@ public class RmSiteType extends BaseBehaviourBean { this.capabilityService = capabilityService; } - + /** * Registers a file plan type for a specific site type. - * + * * @param siteType siteType sub-type of rma:rmsite * @param filePlanType filePlanType sub-type of rma:filePlan * @since 2.2 @@ -126,21 +113,21 @@ public class RmSiteType extends BaseBehaviourBean { ParameterCheck.mandatory("siteType", siteType); ParameterCheck.mandatory("filePlanType", filePlanType); - + // check that the registered site type is a subtype of rma:rmsite if (dictionaryService.isSubClass(siteType, TYPE_RM_SITE) == false) { throw new AlfrescoRuntimeException( "Can't register site type, because site type is not a sub type of rma:rmsite (siteType=" + siteType.toString() + ")"); } - + // check that the registered file plan type is a sub type of rma:filePlan if (dictionaryService.isSubClass(filePlanType, TYPE_FILE_PLAN) == false) { throw new AlfrescoRuntimeException( "Can't register file plan type, because site type is not a sub type of rma:filePlan (filePlanType=" + filePlanType.toString() + ")"); } - + // add site and file plan types to map mapFilePlanType.put(siteType, filePlanType); } @@ -154,17 +141,17 @@ public class RmSiteType extends BaseBehaviourBean kind = BehaviourKind.CLASS, notificationFrequency = NotificationFrequency.FIRST_EVENT ) - public void onCreateNode(ChildAssociationRef childAssocRef) - { + public void onCreateNode(ChildAssociationRef childAssocRef) + { final NodeRef rmSite = childAssocRef.getChildRef(); - + // Do not execute behaviour if this has been created in the archive store if(rmSite.getStoreRef().equals(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE) == true) { // This is not the spaces store - probably the archive store return; } - + if (nodeService.exists(rmSite) == true) { AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork() @@ -173,10 +160,10 @@ public class RmSiteType extends BaseBehaviourBean { SiteInfo siteInfo = siteService.getSite(rmSite); if (siteInfo != null) - { + { // Create the file plan component siteService.createContainer(siteInfo.getShortName(), COMPONENT_DOCUMENT_LIBRARY, getFilePlanType(siteInfo), null); - + // Add the reports recordsManagementSearchService.addReports(siteInfo.getShortName()); } @@ -185,10 +172,10 @@ public class RmSiteType extends BaseBehaviourBean }, AuthenticationUtil.getAdminUserName()); } } - + /** * Get the file plan type for the given site. - * + * * @param siteInfo site info * @return QName file plan type to create as a container * @since 2.2 @@ -196,25 +183,25 @@ public class RmSiteType extends BaseBehaviourBean private QName getFilePlanType(SiteInfo siteInfo) { ParameterCheck.mandatory("siteInfo", siteInfo); - + // set default file plan QName result = DEFAULT_FILE_PLAN_TYPE; - + // check to see if there is an 'override' for the file plan type given the site type QName siteType = nodeService.getType(siteInfo.getNodeRef()); if (mapFilePlanType.containsKey(siteType) == true) { result = mapFilePlanType.get(siteType); } - + return result; } /** * Ensure that the visibility of a RM site can not be changed to anything but public. - * + * * TODO support other site visibilities - * + * * @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map) */ @Behaviour @@ -226,10 +213,10 @@ public class RmSiteType extends BaseBehaviourBean { if (nodeService.exists(nodeRef) == true) { - Map changed = PropertyMap.getChangedProperties(before, after); + Map changed = PropertyMap.getChangedProperties(before, after); if (changed.containsKey(SiteModel.PROP_SITE_VISIBILITY) == true && changed.get(SiteModel.PROP_SITE_VISIBILITY) != null && - SiteVisibility.PUBLIC.equals(changed.get(SiteModel.PROP_SITE_VISIBILITY)) == false) + SiteVisibility.PUBLIC.equals(changed.get(SiteModel.PROP_SITE_VISIBILITY)) == false) { // we do not current support non-public RM sites throw new AlfrescoRuntimeException("The records management site must have public visibility. It can't be changed to " + changed.get(SiteModel.PROP_SITE_VISIBILITY)); @@ -251,16 +238,16 @@ public class RmSiteType extends BaseBehaviourBean if (siteInfo != null) { // grab the file plan for the RM site - NodeRef filePlan = AuthenticationUtil.runAsSystem(new RunAsWork() + NodeRef filePlan = AuthenticationUtil.runAsSystem(new RunAsWork() { @Override public NodeRef doWork() throws Exception { return siteService.getContainer(siteInfo.getShortName(), COMPONENT_DOCUMENT_LIBRARY); } - + }); - + if (filePlan != null) { // determine whether the current user has delete capability on the file plan node diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/ReportServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/ReportServiceImpl.java index 808c8e32da..f0ce806699 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/ReportServiceImpl.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/ReportServiceImpl.java @@ -24,12 +24,9 @@ import java.util.Map; import java.util.Set; import org.alfresco.error.AlfrescoRuntimeException; -import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.record.RecordService; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; import org.alfresco.repo.content.MimetypeMap; -import org.alfresco.service.cmr.model.FileFolderService; -import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.springframework.extensions.surf.util.ParameterCheck; @@ -43,45 +40,12 @@ import org.springframework.extensions.surf.util.ParameterCheck; public class ReportServiceImpl extends ServiceBaseImpl implements ReportService { - /** file folder service */ - protected FileFolderService fileFolderService; - - /** file plan service */ - protected FilePlanService filePlanService; - - /** content service */ - protected ContentService contentService; - /** record service */ protected RecordService recordService; /** report generator registry */ private Map registry = new HashMap(); - /** - * @param fileFolderService file folder service - */ - public void setFileFolderService(FileFolderService fileFolderService) - { - this.fileFolderService = fileFolderService; - } - - /** - * @param filePlanService file plan service - */ - public void setFilePlanService(FilePlanService filePlanService) - { - this.filePlanService = filePlanService; - } - - /** - * @param contentService content service - */ - public void setContentService(ContentService contentService) - { - this.contentService = contentService; - } - /** * @param recordService record service */ diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/generator/DeclarativeReportGenerator.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/generator/DeclarativeReportGenerator.java index e8b3dcbe3d..5dc5d0b1d0 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/generator/DeclarativeReportGenerator.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/report/generator/DeclarativeReportGenerator.java @@ -32,7 +32,6 @@ import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.ContentWriter; import org.alfresco.service.cmr.repository.MimetypeService; import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.repository.TemplateService; import org.alfresco.util.UrlUtil; @@ -65,9 +64,6 @@ public class DeclarativeReportGenerator extends BaseReportGenerator /** template service */ protected TemplateService templateService; - /** node service */ - protected NodeService nodeService; - /** repository helper */ protected Repository repository; @@ -109,14 +105,6 @@ public class DeclarativeReportGenerator extends BaseReportGenerator this.contentService = contentService; } - /** - * @param nodeService node service - */ - public void setNodeService(NodeService nodeService) - { - this.nodeService = nodeService; - } - /** * @param parameterProcessorComponent parameter processor component */ diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/vital/BroadcastVitalRecordDefinitionAction.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/vital/BroadcastVitalRecordDefinitionAction.java index 1658660045..695144f4c1 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/vital/BroadcastVitalRecordDefinitionAction.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/vital/BroadcastVitalRecordDefinitionAction.java @@ -27,7 +27,6 @@ import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; -import org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.service.cmr.action.Action; @@ -42,25 +41,18 @@ import org.alfresco.service.namespace.RegexQNamePattern; * VitalRecordIndicator or the reviewPeriod properties are changed on a record container, then any descendant folders or * records must be updated as a consequence. Descendant folders should have their reviewPeriods and/or * vitalRecordIndicators updated to match the new value. Descendant records should have their reviewAsOf date updated. - * + * * @author Neil McErlean */ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstractBase { protected FilePlanService filePlanService; - - protected FilePlanAuthenticationService filePlanAuthenticationService; - - public void setFilePlanService(FilePlanService filePlanService) + + public void setFilePlanService(FilePlanService filePlanService) { - this.filePlanService = filePlanService; - } - - public void setFilePlanAuthenticationService(FilePlanAuthenticationService filePlanAuthenticationService) - { - this.filePlanAuthenticationService = filePlanAuthenticationService; + this.filePlanService = filePlanService; } - + /** * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, * org.alfresco.service.cmr.repository.NodeRef) @@ -76,18 +68,18 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra propagateChangeToChildrenOf(actionedUponNodeRef); return null; } - }, AuthenticationUtil.getAdminUserName()); + }, AuthenticationUtil.getAdminUserName()); } /** * Propagates the changes to the children of the node specified. - * + * * @param actionedUponNodeRef actioned upon node reference */ private void propagateChangeToChildrenOf(NodeRef actionedUponNodeRef) { Map parentProps = nodeService.getProperties(actionedUponNodeRef); - + // parent vital record indicator, default to null if not set boolean parentVri = false; Boolean parentVriValue = (Boolean) parentProps.get(PROP_VITAL_RECORD_INDICATOR); @@ -95,7 +87,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra { parentVri = parentVriValue.booleanValue(); } - + Period parentReviewPeriod = (Period) parentProps.get(PROP_REVIEW_PERIOD); List assocs = this.nodeService.getChildAssocs(actionedUponNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL); @@ -114,7 +106,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra VitalRecordDefinition vrDefn = vitalRecordService.getVitalRecordDefinition(nextChild); Map aspectProps = new HashMap(); aspectProps.put(PROP_REVIEW_AS_OF, vrDefn.getNextReviewDate()); - + nodeService.addAspect(nextChild, RecordsManagementModel.ASPECT_VITAL_RECORD, aspectProps); } else @@ -130,7 +122,7 @@ public class BroadcastVitalRecordDefinitionAction extends RMActionExecuterAbstra childProps.put(PROP_VITAL_RECORD_INDICATOR, parentVri); nodeService.setProperties(nextChild, childProps); } - + // Recurse down the containment hierarchy to all containers if (recordService.isRecord(nextChild) == false) {