update license header

This commit is contained in:
Sathish Kumar
2025-01-07 11:33:59 +05:30
parent 3f6a1c6880
commit 40c7b5fd9f
99 changed files with 1591 additions and 1369 deletions

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm;
import org.alfresco.service.namespace.QName;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.service.namespace.QName;
/**
* @deprecated as of 2.1 see {@link org.alfresco.module.org_alfresco_module_rm.admin.CannotApplyConstraintMetadataException}
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm;
import org.alfresco.service.namespace.QName;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.service.namespace.QName;
/**
* @deprecated as of 2.1 see {@link org.alfresco.module.org_alfresco_module_rm.admin.InvalidCustomAspectMetadataException}
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -67,7 +67,8 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
/**
* Set the service registry service
*
* @param serviceRegistry service registry
* @param serviceRegistry
* service registry
*/
public void setRecordsManagementServiceRegistry(RecordsManagementServiceRegistry serviceRegistry)
{
@@ -78,7 +79,9 @@ public class RecordsManagementServiceImpl extends ServiceBaseImpl
/**
* Sets the default RM store reference
* @param defaultStoreRef store reference
*
* @param defaultStoreRef
* store reference
*/
@Deprecated
public void setDefaultStoreRef(StoreRef defaultStoreRef)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -45,6 +45,11 @@ import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import net.sf.acegisecurity.AccessDeniedException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONException;
import org.json.JSONObject;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint.MatchLogic;
@@ -77,10 +82,6 @@ import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.JSONtoFmModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONException;
import org.json.JSONObject;
/**
* RM Caveat Config component impl
@@ -122,12 +123,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
private Lock readLock = lock.readLock();
private Lock writeLock = lock.writeLock();
/*
* Caveat Config (Shared) config
* first string is property name
* second string is authority name (user or group full name)
* third string is list of values of property
*/
/* Caveat Config (Shared) config first string is property name second string is authority name (user or group full name) third string is list of values of property */
private SimpleCache<String, Map<String, List<String>>> caveatConfig;
public void setCaveatConfig(SimpleCache<String, Map<String, List<String>>> caveatConfig)
@@ -227,15 +223,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
}
/**
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean)
* RM-2770 - this method has to be fired on transaction commit to be able to validate the content when the content store is encrypted
* @see org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy#onContentUpdate(org.alfresco.service.cmr.repository.NodeRef, boolean) RM-2770 - this method has to be fired on transaction commit to be able to validate the content when the content store is encrypted
*/
@Override
@Behaviour
(
@Behaviour(
kind = BehaviourKind.CLASS,
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
)
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
public void onContentUpdate(NodeRef nodeRef, boolean newContent)
{
if (logger.isInfoEnabled())
@@ -279,7 +272,8 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
/**
* Validate the caveat config and optionally update the cache.
*
* @param nodeRef The nodeRef of the config
* @param nodeRef
* The nodeRef of the config
*/
@SuppressWarnings("unchecked")
protected void validateAndReset(NodeRef nodeRef)
@@ -385,8 +379,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
if (conName.equals(conStr))
{
// note: assumes only one caveat/LOV against a given property
allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
{
allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
public List<String> doWork()
{
return ((RMListOfValuesConstraint) con).getAllowedValues();
@@ -473,7 +466,6 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
return nodeService.getChildByName(rootNode, RecordsManagementModel.ASSOC_CAVEAT_CONFIG, CAVEAT_CONFIG_NAME);
}
public NodeRef updateOrCreateCaveatConfig(InputStream is)
{
NodeRef caveatConfig = getOrCreateCaveatConfig();
@@ -753,10 +745,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
/**
* Add a single value to an authority in a list. The existing values of the list remain.
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
* @param value
* @throws AlfrescoRuntimeException if either the list or the authority do not already exist.
* @throws AlfrescoRuntimeException
* if either the list or the authority do not already exist.
*/
public void addRMConstraintListValue(String listName, String authorityName, String value)
{
@@ -806,6 +800,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
/**
* Get the member details of the specified list
*
* @param listName
* @return the details of the specified list
*/
@@ -837,12 +832,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
}
/**
* Replace the values for an authority in a list.
* The existing values are removed.
* Replace the values for an authority in a list. The existing values are removed.
*
* If the authority does not already exist in the list, it will be added
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
* @param values
*/
@@ -984,7 +979,8 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
/**
* Remove an authority from a list
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
*/
public void removeRMConstraintListAuthority(String listName, String authorityName)
@@ -1010,7 +1006,8 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
}
/**
* @param config the configuration to convert
* @param config
* the configuration to convert
* @return a String containing the JSON representation of the configuration.
*/
private String convertToJSONString(SimpleCache<String, Map<String, List<String>>> config)
@@ -1070,6 +1067,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
/**
* Get an RMConstraintInfo
*
* @param listQName
* @return the constraint or null if it does not exist
*/
@@ -1086,8 +1084,7 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon
RMConstraintInfo info = new RMConstraintInfo();
info.setName(listQName.toPrefixString());
info.setTitle(con.getTitle());
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>()
{
List<String> allowedValues = AuthenticationUtil.runAs(new RunAsWork<List<String>>() {
public List<String> doWork()
{
return def.getAllowedValues();

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -42,6 +42,7 @@ public interface RMCaveatConfigService
/**
* Get allowed values for given caveat list (for current user)
*
* @param constraintName
* @return
*/
@@ -55,18 +56,15 @@ public interface RMCaveatConfigService
*/
boolean hasAccess(NodeRef nodeRef);
/*
* Get a single RM constraint
*/
/* Get a single RM constraint */
RMConstraintInfo getRMConstraint(String listName);
/*
* Get the names of all the caveat lists
*/
/* Get the names of all the caveat lists */
Set<RMConstraintInfo> getAllRMConstraints();
/**
* Get the details of a caveat list
*
* @param listName
* @return
*/
@@ -80,50 +78,59 @@ public interface RMCaveatConfigService
/**
* add RM constraint list
* @param listName the name of the RMConstraintList
*
* @param listName
* the name of the RMConstraintList
* @param listTitle
*/
RMConstraintInfo addRMConstraint(String listName, String listTitle, String[] allowedValues);
/**
* update RM constraint list allowed values
* @param listName the name of the RMConstraintList - can not be changed
*
* @param listName
* the name of the RMConstraintList - can not be changed
* @param allowedValues
*/
RMConstraintInfo updateRMConstraintAllowedValues(String listName, String[] allowedValues);
/**
* update RM constraint Title
* @param listName the name of the RMConstraintList - can not be changed
* @param newTitle the new value for the title constraint
*
* @param listName
* the name of the RMConstraintList - can not be changed
* @param newTitle
* the new value for the title constraint
*/
RMConstraintInfo updateRMConstraintTitle(String listName, String newTitle);
/**
* delete RM Constraint
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
*/
void deleteRMConstraint(String listName);
/**
* Add a single value to an authority in a list. The existing values of the list remain.
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
* @param value
* @throws AlfrescoRuntimeException if either the list or the authority do not already exist.
* @throws AlfrescoRuntimeException
* if either the list or the authority do not already exist.
*/
void addRMConstraintListValue(String listName, String authorityName, String value);
/**
* Replace the values for an authority in a list.
* The existing values are removed.
* Replace the values for an authority in a list. The existing values are removed.
*
* If the authority does not already exist in the list, it will be added
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
* @param values
*/
@@ -132,18 +139,19 @@ public interface RMCaveatConfigService
/**
* Remove an authority from a list
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param authorityName
*/
void removeRMConstraintListAuthority(String listName, String authorityName);
/**
* Replace the values for an authority in a list.
* The existing values are removed.
* Replace the values for an authority in a list. The existing values are removed.
*
* If the authority does not already exist in the list, it will be added
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param value
* @param authorities
*/
@@ -152,7 +160,8 @@ public interface RMCaveatConfigService
/**
* Remove an authority from a list
*
* @param listName the name of the RMConstraintList
* @param listName
* the name of the RMConstraintList
* @param valueName
*/
void removeRMConstraintListValue(String listName, String valueName);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -40,30 +40,37 @@ public class RMConstraintInfo
{
this.name = name;
}
public String getName()
{
return name;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setCaseSensitive(boolean caseSensitive)
{
this.caseSensitive = caseSensitive;
}
public boolean isCaseSensitive()
{
return caseSensitive;
}
public void setAllowedValues(String[] values)
{
this.allowedValues = values.clone();
}
public String[] getAllowedValues()
{
return allowedValues;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -33,18 +33,18 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.dictionary.ConstraintException;
import org.alfresco.service.cmr.i18n.MessageLookup;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* RM Constraint implementation that ensures the value is one of a constrained
* <i>list of values</i>. By default, this constraint is case-sensitive.
* RM Constraint implementation that ensures the value is one of a constrained <i>list of values</i>. By default, this constraint is case-sensitive.
*
* @see #setAllowedValues(List)
* @see #setCaseSensitive(boolean)
@@ -75,7 +75,6 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
RMListOfValuesConstraint.caveatConfigService = caveatConfigService;
}
@Override
public String toString()
{
@@ -98,8 +97,7 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
}
/**
* Get the allowed values. Note that these are <tt>String</tt> instances, but may
* represent non-<tt>String</tt> values. It is up to the caller to distinguish.
* Get the allowed values. Note that these are <tt>String</tt> instances, but may represent non-<tt>String</tt> values. It is up to the caller to distinguish.
*
* @return Returns the values allowed
*/
@@ -169,10 +167,12 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
return this.allowedValuesUpper;
}
}
/**
* Set the values that are allowed by the constraint.
*
* @param allowedValues a list of allowed values
* @param allowedValues
* a list of allowed values
*/
@SuppressWarnings({"unchecked", "rawtypes"})
@Override

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -35,11 +35,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.alfresco.service.cmr.security.AuthorityService;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.alfresco.service.cmr.security.AuthorityService;
public class ScriptConstraint implements Serializable
{
/**
@@ -64,10 +65,12 @@ public class ScriptConstraint implements Serializable
{
info.setTitle(title);
}
public String getTitle()
{
return info.getTitle();
}
public void setName(String name)
{
info.setName(name);
@@ -128,6 +131,7 @@ public class ScriptConstraint implements Serializable
/**
* Update a value
*
* @param bodge
*/
public void updateValues(JSONArray bodge) throws Exception
@@ -149,6 +153,7 @@ public class ScriptConstraint implements Serializable
/**
* Update a value
*
* @param value
* @param authorities
*/
@@ -160,6 +165,7 @@ public class ScriptConstraint implements Serializable
/**
* Cascade delete an authority
*
* @param authority
*/
public void deleteAuthority(String authority)
@@ -169,6 +175,7 @@ public class ScriptConstraint implements Serializable
/**
* Cascade delete a value
*
* @param value
*/
public void deleteValue(String value)
@@ -176,9 +183,9 @@ public class ScriptConstraint implements Serializable
// Do nothing
}
/**
* Get a single value
*
* @param value
* @return
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -43,14 +43,17 @@ public class ScriptConstraintAuthority implements Serializable
{
this.values = values;
}
public List<String> getValues()
{
return values;
}
public void setAuthorityName(String authorityName)
{
this.authorityName = authorityName;
}
public String getAuthorityName()
{
return authorityName;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -43,22 +43,27 @@ public class ScriptConstraintValue implements Serializable
{
this.authorities = values;
}
public List<ScriptAuthority> getAuthorities()
{
return authorities;
}
public void setValueName(String authorityName)
{
this.value = authorityName;
}
public String getValueName()
{
return value;
}
public void setValueTitle(String authorityName)
{
this.value = authorityName;
}
public String getValueTitle()
{
return value;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -115,8 +115,9 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
/**
* Delete list
*
* @param listName
*
*/
public void deleteConstraintList(String listName)
{
@@ -125,8 +126,6 @@ public class ScriptRMCaveatConfigService extends BaseScopableProcessorExtension
caveatConfigService.deleteRMConstraint(xxx);
}
/**
* Update value
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -29,6 +29,8 @@ package org.alfresco.module.org_alfresco_module_rm.capability.declarative;
import java.util.Map;
import org.springframework.beans.factory.BeanNameAware;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
@@ -40,7 +42,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.PermissionService;
import org.springframework.beans.factory.BeanNameAware;
/**
* Abstract capability condition.
@@ -70,7 +71,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
private TransactionalResourceHelper transactionalResourceHelper;
/**
* @param recordService record service
* @param recordService
* record service
*/
public void setRecordService(RecordService recordService)
{
@@ -78,7 +80,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param permissionService permission service
* @param permissionService
* permission service
*/
public void setPermissionService(PermissionService permissionService)
{
@@ -86,7 +89,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param nodeService node service
* @param nodeService
* node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -94,7 +98,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param freezeService freeze service
* @param freezeService
* freeze service
*/
public void setFreezeService(FreezeService freezeService)
{
@@ -102,7 +107,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param filePlanService file plan service
* @param filePlanService
* file plan service
*/
public void setFilePlanService(FilePlanService filePlanService)
{
@@ -110,7 +116,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param dispositionService disposition service
* @param dispositionService
* disposition service
*/
public void setDispositionService(DispositionService dispositionService)
{
@@ -118,7 +125,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param recordFolderService record folder service
* @param recordFolderService
* record folder service
*/
public void setRecordFolderService(RecordFolderService recordFolderService)
{
@@ -126,7 +134,8 @@ public abstract class AbstractCapabilityCondition implements CapabilityCondition
}
/**
* @param transactionalResourceHelper transactional resource helper
* @param transactionalResourceHelper
* transactional resource helper
*/
public void setTransactionalResourceHelper(TransactionalResourceHelper transactionalResourceHelper)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,7 +47,8 @@ public interface CapabilityCondition
/**
* Evaluates capability condition.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if evaluate success, false otherwise
*/
boolean evaluate(NodeRef nodeRef);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -35,6 +35,9 @@ import java.util.Map;
import java.util.Set;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.capability.AbstractCapability;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
@@ -44,8 +47,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.TransactionalResourceHelper;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Declarative capability implementation.
@@ -76,7 +77,8 @@ public class DeclarativeCapability extends AbstractCapability
private Set<FilePlanComponentKind> availableKinds;
/**
* @param permissions permissions
* @param permissions
* permissions
*/
public void setPermissions(List<String> permissions)
{
@@ -84,7 +86,8 @@ public class DeclarativeCapability extends AbstractCapability
}
/**
* @param conditions conditions and expected values
* @param conditions
* conditions and expected values
*/
public void setConditions(Map<String, Boolean> conditions)
{
@@ -100,7 +103,8 @@ public class DeclarativeCapability extends AbstractCapability
}
/**
* @param kinds list of file plan component kinds
* @param kinds
* list of file plan component kinds
*/
public void setKinds(List<String> kinds)
{
@@ -118,7 +122,8 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Helper method to set a single kind.
*
* @param kind file plan component kind
* @param kind
* file plan component kind
*/
public void setKind(String kind)
{
@@ -126,10 +131,10 @@ public class DeclarativeCapability extends AbstractCapability
}
/**
* Sets whether the capability will return an undetermined result when evaluating permissions
* for a single node reference or not. The default is to return grant.
* Sets whether the capability will return an undetermined result when evaluating permissions for a single node reference or not. The default is to return grant.
*
* @param isUndetermined true if undetermined result, false otherwise
* @param isUndetermined
* true if undetermined result, false otherwise
*/
public void setUndetermined(boolean isUndetermined)
{
@@ -147,7 +152,8 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Helper @see #setPermissions(List)
*
* @param permission permission
* @param permission
* permission
*/
public void setPermission(String permission)
{
@@ -157,7 +163,8 @@ public class DeclarativeCapability extends AbstractCapability
}
/**
* @param targetCapability target capability
* @param targetCapability
* target capability
*/
public void setTargetCapability(Capability targetCapability)
{
@@ -167,7 +174,8 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Check the permissions passed.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if the permissions are present, false otherwise
*/
protected boolean checkPermissionsImpl(NodeRef nodeRef, String... permissions)
@@ -255,7 +263,8 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Checks the set conditions.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if conditions satisfied, false otherwise
*/
protected boolean checkConditions(NodeRef nodeRef)
@@ -369,7 +378,8 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Default implementation. Given extending classes a hook point for further checks.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return
*/
protected int evaluateImpl(NodeRef nodeRef)
@@ -385,8 +395,7 @@ public class DeclarativeCapability extends AbstractCapability
/**
* Default implementation.
*
* Called before evaluate completes. The result returned overwrites the already discovered result.
* Provides a hook point for child implementations that wish to veto the result.
* Called before evaluate completes. The result returned overwrites the already discovered result. Provides a hook point for child implementations that wish to veto the result.
*
* @param nodeRef
* @param result

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -29,12 +29,12 @@ package org.alfresco.module.org_alfresco_module_rm.capability.declarative;
import java.util.Set;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
import org.alfresco.module.org_alfresco_module_rm.capability.CompositeCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
/**
* Generic implementation of a composite capability
*
@@ -47,7 +47,8 @@ public class DeclarativeCompositeCapability extends DeclarativeCapability
private Set<Capability> capabilities;
/**
* @param capabilities set of capabilities
* @param capabilities
* set of capabilities
*/
public void setCapabilities(Set<Capability> capabilities)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -34,8 +34,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.declarative.Capabil
import org.alfresco.service.cmr.repository.NodeRef;
/**
* Composite capability condition implementation that required at least one of the
* capability conditions to be true.
* Composite capability condition implementation that required at least one of the capability conditions to be true.
*
* @author Roy Wetherall
*/
@@ -45,7 +44,8 @@ public class AtLeastOneCondition extends AbstractCapabilityCondition
private List<CapabilityCondition> conditions;
/**
* @param conditions capability conditions
* @param conditions
* capability conditions
*/
public void setConditions(List<CapabilityCondition> conditions)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -57,8 +57,7 @@ public class ClosedCapabilityCondition extends AbstractCapabilityCondition
{
final List<ChildAssociationRef> assocs = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
result = AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
{
result = AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>() {
@Override
public Boolean doWork()
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -31,8 +31,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.declarative.Abstrac
import org.alfresco.service.cmr.repository.NodeRef;
/**
* Helper condition that always fails. Useful for deprecation of
* old capabilities.
* Helper condition that always fails. Useful for deprecation of old capabilities.
*
* @author Roy Wetherall
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -34,8 +34,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
/**
* Fileable capability condition. Indicates whether a node is 'fileable', namely if it extends cm:content
* or extends rma:nonElectronicDocument
* Fileable capability condition. Indicates whether a node is 'fileable', namely if it extends cm:content or extends rma:nonElectronicDocument
*
* @author Roy Wetherall
*/
@@ -45,7 +44,8 @@ public class FileableCapabilityCondition extends AbstractCapabilityCondition
private DictionaryService dictionaryService;
/**
* @param dictionaryService dictionary service
* @param dictionaryService
* dictionary service
*/
public void setDictionaryService(DictionaryService dictionaryService)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,7 +47,8 @@ public class FrozenCapabilityCondition extends AbstractCapabilityCondition
private HoldService holdService;
/**
* @param checkChildren true to check children, false otherwise
* @param checkChildren
* true to check children, false otherwise
*/
public void setCheckChildren(boolean checkChildren)
{
@@ -55,7 +56,8 @@ public class FrozenCapabilityCondition extends AbstractCapabilityCondition
}
/**
* @param holdService hold service
* @param holdService
* hold service
*/
public void setHoldService(HoldService holdService)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -49,7 +49,8 @@ public class IsPropertySetCondition extends AbstractCapabilityCondition
private NamespaceService namespaceService;
/**
* @param propertyName property name (eg: rma:location)
* @param propertyName
* property name (eg: rma:location)
*/
public void setPropertyName(String propertyName)
{
@@ -57,7 +58,8 @@ public class IsPropertySetCondition extends AbstractCapabilityCondition
}
/**
* @param namespaceService namespace service
* @param namespaceService
* namespace service
*/
public void setNamespaceService(NamespaceService namespaceService)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -42,7 +42,8 @@ public class IsScheduledCapabilityCondition extends AbstractCapabilityCondition
private String dispositionAction;
/**
* @param dispositionAction disposition action
* @param dispositionAction
* disposition action
*/
public void setDispositionAction(String dispositionAction)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -43,7 +43,8 @@ public class MayBeScheduledCapabilityCondition extends AbstractCapabilityConditi
private String dispositionAction;
/**
* @param dispositionAction disposition action
* @param dispositionAction
* disposition action
*/
public void setDispositionAction(String dispositionAction)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -30,13 +30,14 @@ package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import java.io.Serializable;
import java.util.Map;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.capability.PolicyRegister;
import org.alfresco.module.org_alfresco_module_rm.capability.RMSecurityCommon;
import org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoterException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.aopalliance.intercept.MethodInvocation;
/**
* Abstract base policy implementation
@@ -57,7 +58,8 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
private String name;
/**
* @param name policy name
* @param name
* policy name
*/
public void setName(String name)
{
@@ -90,7 +92,8 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
}
/**
* @param capabilityService capability service
* @param capabilityService
* capability service
*/
public void setCapabilityService(CapabilityService capabilityService)
{
@@ -98,7 +101,8 @@ public abstract class AbstractBasePolicy extends RMSecurityCommon
}
/**
* @param policyRegister policy register
* @param policyRegister
* policy register
*/
public void setPolicyRegister(PolicyRegister policyRegister)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -28,12 +28,13 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.aopalliance.intercept.MethodInvocation;
public class AssocPolicy extends AbstractBasePolicy
{
@@ -88,4 +89,3 @@ public class AssocPolicy extends AbstractBasePolicy
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -31,13 +31,13 @@ import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import net.sf.acegisecurity.ConfigAttribute;
import org.alfresco.repo.security.permissions.impl.SimplePermissionReference;
import org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoterException;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.QName;
import net.sf.acegisecurity.ConfigAttribute;
/**
* RM security configuration definition.
*
@@ -72,8 +72,10 @@ public class ConfigAttributeDefinition
/**
* Default constructor
*
* @param attr configuration attribute instance
* @param namespacePrefixResolver namespace prefix resolver
* @param attr
* configuration attribute instance
* @param namespacePrefixResolver
* namespace prefix resolver
*/
public ConfigAttributeDefinition(ConfigAttribute attr, NamespacePrefixResolver namespacePrefixResolver)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,11 +27,12 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.impl.CreateCapability;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.aopalliance.intercept.MethodInvocation;
public class CreatePolicy extends AbstractBasePolicy
{
@@ -49,8 +50,10 @@ public class CreatePolicy extends AbstractBasePolicy
NodeRef destination = getTestNode(invocation, params, cad.getParameters().get(0), cad.isParent());
// get the recordType
for (Object qname : invocation.getArguments()) {
if (qname != null && (qname.equals(RecordsManagementModel.TYPE_RECORD_FOLDER) || qname.equals(RecordsManagementModel.TYPE_RECORD_CATEGORY))) {
for (Object qname : invocation.getArguments())
{
if (qname != null && (qname.equals(RecordsManagementModel.TYPE_RECORD_FOLDER) || qname.equals(RecordsManagementModel.TYPE_RECORD_CATEGORY)))
{
recordType = (QName) qname;
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.alfresco.service.cmr.repository.NodeRef;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.service.cmr.repository.NodeRef;
public class DeclarePolicy extends AbstractBasePolicy
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,10 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.alfresco.service.cmr.repository.NodeRef;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.aopalliance.intercept.MethodInvocation;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.alfresco.service.cmr.repository.NodeRef;
public class DeletePolicy extends AbstractBasePolicy
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,13 +27,13 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.aopalliance.intercept.MethodInvocation;
import net.sf.acegisecurity.vote.AccessDecisionVoter;
public class MovePolicy extends AbstractBasePolicy
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.impl.ViewRecordsCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import org.aopalliance.intercept.MethodInvocation;
/**
* Read method security policy.

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -30,10 +30,11 @@ package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import java.io.Serializable;
import java.util.Map;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.module.org_alfresco_module_rm.capability.impl.UpdateCapability;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.aopalliance.intercept.MethodInvocation;
public class UpdatePolicy extends AbstractBasePolicy
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.alfresco.service.cmr.repository.NodeRef;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.service.cmr.repository.NodeRef;
public class UpdatePropertiesPolicy extends AbstractBasePolicy
{
@SuppressWarnings("rawtypes")

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,9 +27,10 @@
package org.alfresco.module.org_alfresco_module_rm.capability.policy;
import org.alfresco.service.cmr.repository.NodeRef;
import org.aopalliance.intercept.MethodInvocation;
import org.alfresco.service.cmr.repository.NodeRef;
public class WriteContentPolicy extends AbstractBasePolicy
{
@SuppressWarnings("rawtypes")

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -73,8 +73,7 @@ public interface DispositionAction
Date getAsOfDate();
/**
* @return true if the events are complete (ie: enough events have been completed to make the disposition
* action
* @return true if the events are complete (ie: enough events have been completed to make the disposition action
*/
boolean isEventsEligible();
@@ -106,17 +105,18 @@ public interface DispositionAction
/**
* Get the event completion details for a named event.
*
* @param eventName event name
* @param eventName
* event name
* @return {@link EventCompletionDetails} event completion details
* @since 2.2
*/
EventCompletionDetails getEventCompletionDetails(String eventName);
/**
* Add new completion details to the disposition action based on the provided
* event.
* Add new completion details to the disposition action based on the provided event.
*
* @param event records management event
* @param event
* records management event
* @since 2.2
*/
void addEventCompletionDetails(RecordsManagementEvent event);
@@ -124,12 +124,14 @@ public interface DispositionAction
/**
* Complete an event.
* <p>
* If null is provided, the complete at date will be take as 'now' and the completed by user
* as the fully authenticated user.
* If null is provided, the complete at date will be take as 'now' and the completed by user as the fully authenticated user.
*
* @param eventName event name
* @param completedAt completed at 'date', now if null
* @param completedBy completed by user, authenticated user if null
* @param eventName
* event name
* @param completedAt
* completed at 'date', now if null
* @param completedBy
* completed by user, authenticated user if null
* @since 2.2
*/
void completeEvent(String eventName, Date completedAt, String completedBy);
@@ -137,7 +139,8 @@ public interface DispositionAction
/**
* Undo the completion of an event.
*
* @param eventName event name
* @param eventName
* event name
* @since 2.2
*/
void undoEvent(String eventName);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -29,7 +29,6 @@ package org.alfresco.module.org_alfresco_module_rm.disposition;
import java.util.List;
import org.alfresco.api.AlfrescoPublicApi;
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEvent;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.Period;
@@ -107,12 +106,9 @@ public interface DispositionActionDefinition
List<RecordsManagementEvent> getEvents();
/**
* Indicates whether the disposition action is eligible when the earliest
* event is complete, otherwise all events must be complete before
* eligibility.
* Indicates whether the disposition action is eligible when the earliest event is complete, otherwise all events must be complete before eligibility.
*
* @return boolean true if eligible on first action complete, false
* otherwise
* @return boolean true if eligible on first action complete, false otherwise
*/
boolean eligibleOnFirstCompleteEvent();
@@ -126,8 +122,7 @@ public interface DispositionActionDefinition
/**
* Get the ghost on destroy from the disposition
*
* @return boolean the gost on destroy flag (on applicable to destroy
* actions)
* @return boolean the gost on destroy flag (on applicable to destroy actions)
*/
String getGhostOnDestroy();

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -78,11 +78,16 @@ public class DispositionActionDefinitionImpl implements DispositionActionDefinit
/**
* Constructor
*
* @param recordsManagementEventService records management event service
* @param recordsManagementActionService records management action service
* @param nodeService node service
* @param nodeRef disposition action node reference
* @param index index of disposition action
* @param recordsManagementEventService
* records management event service
* @param recordsManagementActionService
* records management action service
* @param nodeService
* node service
* @param nodeRef
* disposition action node reference
* @param index
* index of disposition action
*/
public DispositionActionDefinitionImpl(RecordsManagementEventService recordsManagementEventService, RecordsManagementActionService recordsManagementActionService, NodeService nodeService, NodeRef nodeRef, int index)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -34,6 +34,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry;
@@ -41,15 +44,12 @@ import org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
import org.alfresco.module.org_alfresco_module_rm.event.RecordsManagementEvent;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.module.org_alfresco_module_rm.script.slingshot.RMSearchGet;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Disposition action implementation.
@@ -75,8 +75,10 @@ public class DispositionActionImpl implements DispositionAction,
/**
* Constructor
*
* @param services records management service registry
* @param dispositionActionNodeRef disposition action node reference
* @param services
* records management service registry
* @param dispositionActionNodeRef
* disposition action node reference
*/
public DispositionActionImpl(RecordsManagementServiceRegistry services, NodeRef dispositionActionNodeRef)
{
@@ -221,10 +223,10 @@ public class DispositionActionImpl implements DispositionAction,
}
/**
* Helper method to create object representation of event completed details from
* node reference.
* Helper method to create object representation of event completed details from node reference.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return {@link EventCompletionDetails} event completion details
*/
private EventCompletionDetails getEventCompletionDetailsFromNodeRef(NodeRef nodeRef)
@@ -268,7 +270,8 @@ public class DispositionActionImpl implements DispositionAction,
* <p>
* Returns null if event can not be found.
*
* @param eventName name of the event
* @param eventName
* name of the event
* @return {@link EventCompletionDetails} event completion details for named event, null otherwise
*
* @since 2.2
@@ -301,8 +304,7 @@ public class DispositionActionImpl implements DispositionAction,
final EventCompletionDetails event = getEventCompletionDetails(eventName);
if (event != null && !event.isEventComplete())
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -352,8 +354,7 @@ public class DispositionActionImpl implements DispositionAction,
final EventCompletionDetails event = getEventCompletionDetails(eventName);
if (event != null && event.isEventComplete())
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -381,8 +382,7 @@ public class DispositionActionImpl implements DispositionAction,
@Override
public void refreshEvents()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -468,12 +468,11 @@ public class DispositionActionImpl implements DispositionAction,
eventProps);
}
/**
* Calculates and updates the <code>rma:dispositionEventsEligible</code>
* property for the given next disposition action.
* Calculates and updates the <code>rma:dispositionEventsEligible</code> property for the given next disposition action.
*
* @param nextAction The next disposition action
* @param nextAction
* The next disposition action
* @return The result of calculation
*
* @since 2.2
@@ -528,9 +527,12 @@ public class DispositionActionImpl implements DispositionAction,
/**
* Sets declassification review authority and date on records and record folder
*
* @param eventNodeRef Declassification review event node ref
* @param completedAtValue Declassification review authority
* @param completedByValue Declassification review date
* @param eventNodeRef
* Declassification review event node ref
* @param completedAtValue
* Declassification review authority
* @param completedByValue
* Declassification review date
*/
private void setDeclassificationReview(NodeRef eventNodeRef, Date completedAtValue, String completedByValue)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -77,7 +77,8 @@ public interface DispositionSchedule
/**
* Get the disposition action definition
*
* @param id the action definition id
* @param id
* the action definition id
* @return {@link DispositionActionDefinition} disposition action definition
*/
DispositionActionDefinition getDispositionActionDefinition(String id);
@@ -85,7 +86,8 @@ public interface DispositionSchedule
/**
* Get the disposition action definition by the name of the disposition action
*
* @param name disposition action name
* @param name
* disposition action name
* @return {@link DispositionActionDefinition} disposition action definition, null if none
*/
DispositionActionDefinition getDispositionActionDefinitionByName(String name);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -55,7 +55,6 @@ public class DispositionScheduleImpl implements DispositionSchedule,
/** authentication helper */
private AuthenticationUtil authenticationUtil;
private List<DispositionActionDefinition> actions;
private Map<String, DispositionActionDefinition> actionsById;
@@ -109,8 +108,7 @@ public class DispositionScheduleImpl implements DispositionSchedule,
*/
public boolean isRecordLevelDisposition()
{
return authenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Boolean>()
{
return authenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Boolean>() {
public Boolean doWork() throws Exception
{
Boolean value = (Boolean) nodeService.getProperty(dispositionDefinitionNodeRef, PROP_RECORD_LEVEL_DISPOSITION);
@@ -126,15 +124,15 @@ public class DispositionScheduleImpl implements DispositionSchedule,
/**
* Get disposition action definition
*
* @param id action definition identifier
* @param id
* action definition identifier
* @return DispositionActionDefinition disposition action definition
*/
public DispositionActionDefinition getDispositionActionDefinition(String id)
{
if (this.actions == null)
{
authenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Void>()
{
authenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Void>() {
public Void doWork() throws Exception
{
getDispositionActionsImpl();

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -33,18 +33,16 @@ import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.repository.NodeRef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* This class offers the default implementation of a strategy for selection of
* disposition schedule for a record when there is more than one which is applicable.
* An example of where this strategy might be used would be in the case of a record
* which was multiply filed.
* This class offers the default implementation of a strategy for selection of disposition schedule for a record when there is more than one which is applicable. An example of where this strategy might be used would be in the case of a record which was multiply filed.
*
* @author neilm
*/
@@ -59,7 +57,8 @@ public class DispositionSelectionStrategy implements RecordsManagementModel
/**
* Set the disposition service
*
* @param dispositionService disposition service
* @param dispositionService
* disposition service
*/
public void setDispositionService(DispositionService dispositionService)
{
@@ -117,19 +116,14 @@ public class DispositionSelectionStrategy implements RecordsManagementModel
}
/**
* This class defines a natural comparison order between NodeRefs that have
* the dispositionLifecycle aspect applied.
* This order has the following meaning: NodeRefs with a 'lesser' value are considered
* to have a shorter retention period, although the actual retention period may
* not be straightforwardly determined in all cases.
* This class defines a natural comparison order between NodeRefs that have the dispositionLifecycle aspect applied. This order has the following meaning: NodeRefs with a 'lesser' value are considered to have a shorter retention period, although the actual retention period may not be straightforwardly determined in all cases.
*/
class DispositionableNodeRefComparator implements Comparator<NodeRef>
{
public int compare(final NodeRef f1, final NodeRef f2)
{
// Run as admin user
return AuthenticationUtil.runAs(new RunAsWork<Integer>()
{
return AuthenticationUtil.runAs(new RunAsWork<Integer>() {
public Integer doWork()
{
return compareImpl(f1, f2);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -51,7 +51,8 @@ public interface DispositionService
/**
* Register a disposition property.
*
* @param dispositionProperty disposition property
* @param dispositionProperty
* disposition property
*/
void registerDispositionProperty(DispositionProperty dispositionProperty);
@@ -61,16 +62,16 @@ public interface DispositionService
* @return filtered list of disposition period properties
*/
Collection<DispositionProperty> getDispositionProperties(boolean isRecordLevel, String dispositionAction);
Collection<DispositionProperty> getDispositionProperties();
Collection<DispositionProperty> getDispositionProperties();
/** ========= Disposition Schedule Methods ========= */
/**
* Get the disposition schedule for a given record management node. Traverses the hierarchy to
* find the first disposition schedule in the primary hierarchy.
* Get the disposition schedule for a given record management node. Traverses the hierarchy to find the first disposition schedule in the primary hierarchy.
*
* @param nodeRef node reference to record category, record folder or record
* @param nodeRef
* node reference to record category, record folder or record
* @return {@link DispositionSchedule} disposition schedule
*/
DispositionSchedule getDispositionSchedule(NodeRef nodeRef);
@@ -79,10 +80,10 @@ public interface DispositionService
// TODO List<DispositionSchedule> getAllDispositionSchedules(NodeRef nodeRef);
/**
* Get the disposition schedule directly associated with the node specified. Returns
* null if none.
* Get the disposition schedule directly associated with the node specified. Returns null if none.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return {@link DispositionSchedule} disposition schedule directly associated with the node reference, null if none
*/
DispositionSchedule getAssociatedDispositionSchedule(NodeRef nodeRef);
@@ -90,7 +91,8 @@ public interface DispositionService
/**
* Gets the records management container that is directly associated with the disposition schedule.
*
* @param dispositionSchedule disposition schedule
* @param dispositionSchedule
* disposition schedule
* @return {@link NodeRef} node reference of the associated container
*/
NodeRef getAssociatedRecordsManagementContainer(DispositionSchedule dispositionSchedule);
@@ -98,16 +100,17 @@ public interface DispositionService
/**
* Indicates whether a disposition schedule has any disposable items under its management
*
* @param dispositionSchdule disposition schedule
* @param dispositionSchdule
* disposition schedule
* @return boolean true if there are disposable items being managed by, false otherwise
*/
boolean hasDisposableItems(DispositionSchedule dispositionSchdule);
/**
* Gets a list of all the disposable items (records, record folders) that are under the control of
* the disposition schedule.
* Gets a list of all the disposable items (records, record folders) that are under the control of the disposition schedule.
*
* @param dispositionSchedule disposition schedule
* @param dispositionSchedule
* disposition schedule
* @return {@link List} &lt;{@link NodeRef}&gt; list of disposable items
*/
List<NodeRef> getDisposableItems(DispositionSchedule dispositionSchedule);
@@ -115,7 +118,8 @@ public interface DispositionService
/**
* Indicates whether the node is a disposable item or not (ie is under the control of a disposition schedule)
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if node is a disposable item, false otherwise
*/
boolean isDisposableItem(NodeRef nodeRef);
@@ -138,43 +142,47 @@ public interface DispositionService
/**
* Adds a new disposition action definition to the given disposition schedule.
*
* @param schedule The DispositionSchedule to add to
* @param actionDefinitionParams Map of parameters to use to create the action definition
* @param schedule
* The DispositionSchedule to add to
* @param actionDefinitionParams
* Map of parameters to use to create the action definition
*/
DispositionActionDefinition addDispositionActionDefinition(
DispositionSchedule schedule,
Map<QName, Serializable> actionDefinitionParams);
/**
* Removes the given disposition action definition from the given disposition
* schedule.
* Removes the given disposition action definition from the given disposition schedule.
*
* @param schedule The DispositionSchedule to remove from
* @param actionDefinition The DispositionActionDefinition to remove
* @param schedule
* The DispositionSchedule to remove from
* @param actionDefinition
* The DispositionActionDefinition to remove
*/
void removeDispositionActionDefinition(
DispositionSchedule schedule,
DispositionActionDefinition actionDefinition);
/**
* Updates the given disposition action definition belonging to the given disposition
* schedule.
* Updates the given disposition action definition belonging to the given disposition schedule.
*
* @param actionDefinition The DispositionActionDefinition to update
* @param actionDefinitionParams Map of parameters to use to update the action definition
* @param actionDefinition
* The DispositionActionDefinition to update
* @param actionDefinitionParams
* Map of parameters to use to update the action definition
* @return The updated DispositionActionDefinition
*/
DispositionActionDefinition updateDispositionActionDefinition(
DispositionActionDefinition actionDefinition,
Map<QName, Serializable> actionDefinitionParams);
/** ========= Disposition Action Methods ========= */
/**
* Indicates whether the next disposition action is eligible or not.
*
* @param nodeRef node reference to disposable item
* @param nodeRef
* node reference to disposable item
* @return boolean true if next disposition action is eligible, false otherwise
*/
boolean isNextDispositionActionEligible(NodeRef nodeRef);
@@ -182,7 +190,8 @@ public interface DispositionService
/**
* Gets the next disposition action for a given node
*
* @param nodeRef node reference to disposable item
* @param nodeRef
* node reference to disposable item
* @return DispositionAction next disposition action, null if none
*/
DispositionAction getNextDispositionAction(NodeRef nodeRef);
@@ -191,22 +200,22 @@ public interface DispositionService
// TODO void completeNextDispositionAction(NodeRef nodeRef);
/** ========= Disposition Action History Methods ========= */
/**
* Gets a list of all the completed disposition action in the order they occured.
*
* @param nodeRef record/record folder
* @param nodeRef
* record/record folder
* @return List<DispositionAction> list of completed disposition actions
*/
List<DispositionAction> getCompletedDispositionActions(NodeRef nodeRef);
/**
* Helper method to get the last completed disposition action. Returns null
* if there is none.
* Helper method to get the last completed disposition action. Returns null if there is none.
*
* @param nodeRef record/record folder
* @param nodeRef
* record/record folder
* @return DispositionAction last completed disposition action, null if none
*/
DispositionAction getLastCompletedDispostionAction(NodeRef nodeRef);
@@ -214,7 +223,8 @@ public interface DispositionService
/**
* Indicates whether the disposable item (records, record folders) is cutoff or not.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if the disposable item is cutoff, false otherwise
*
* @since 2.0
@@ -224,7 +234,8 @@ public interface DispositionService
/**
* Marks the disposable item (record or record folder) as cut off, calculating the cut off date
*
* @param nodeRef node reference
* @param nodeRef
* node reference
*
* @since 2.2
*/
@@ -233,31 +244,35 @@ public interface DispositionService
/**
* Updates the next disposition action
*
* @param nodeRef node reference
* @param nodeRef
* node reference
*/
void updateNextDispositionAction(NodeRef nodeRef);
/**
* Updates the next disposition action
*
* @param nodeRef node reference
* @param dispositionSchedule the schedule to be applied
* @param nodeRef
* node reference
* @param dispositionSchedule
* the schedule to be applied
*/
void updateNextDispositionAction(NodeRef nodeRef, DispositionSchedule dispositionSchedule);
/**
* Refreshes the disposition action details of the given node.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
*/
void refreshDispositionAction(NodeRef nodeRef);
/**
* Gets date of the disposition action for the given
* disposition schedule with the given action name
* Gets date of the disposition action for the given disposition schedule with the given action name
*
* @param record
* @param dispositionSchedule nodeRef
* @param dispositionSchedule
* nodeRef
* @param dispositionActionName
* @return date
*/
@@ -266,24 +281,25 @@ public interface DispositionService
/**
* Compute the "disposition as of" date (if necessary) for a disposition action and a node.
*
* @param nodeRef The node which the schedule applies to.
* @param dispositionActionDefinition The definition of the disposition action.
* @param nodeRef
* The node which the schedule applies to.
* @param dispositionActionDefinition
* The definition of the disposition action.
* @return The new "disposition as of" date.
*/
Date calculateAsOfDate(NodeRef nodeRef, DispositionActionDefinition dispositionActionDefinition);
/**
* Gets the origin disposition schedule for the record, not the calculated one
* in case of multiple dispositions applied to record
* Gets the origin disposition schedule for the record, not the calculated one in case of multiple dispositions applied to record
*
* @param nodeRef record
* @param nodeRef
* record
* @return the initial disposition
*/
DispositionSchedule getOriginDispositionSchedule(NodeRef nodeRef);
/**
* Updates disposition action step when linking or unlinking
* the given record to/from a record folder
* Updates disposition action step when linking or unlinking the given record to/from a record folder
*
* @param record
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -37,6 +37,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies;
@@ -72,8 +75,6 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ParameterCheck;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Disposition service implementation.
@@ -97,8 +98,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/** Only set the "disposition as of" date. */
DATE_ONLY,
/**
* Set the "disposition as of" date and the name of the next action. This only happens during the creation of a
* disposition schedule impl node under a record or folder.
* Set the "disposition as of" date and the name of the next action. This only happens during the creation of a disposition schedule impl node under a record or folder.
*/
DATE_AND_NAME
}
@@ -127,7 +127,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Set node service
*
* @param nodeService the node service
* @param nodeService
* the node service
*/
@Override
public void setNodeService(NodeService nodeService)
@@ -138,7 +139,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Set the dictionary service
*
* @param dictionaryService the dictionary service
* @param dictionaryService
* the dictionary service
*/
@Override
public void setDictionaryService(DictionaryService dictionaryService)
@@ -149,7 +151,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Set the behaviour filter.
*
* @param behaviourFilter the behaviour filter
* @param behaviourFilter
* the behaviour filter
*/
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
{
@@ -159,7 +162,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Set the records management service registry
*
* @param serviceRegistry records management registry service
* @param serviceRegistry
* records management registry service
*/
public void setRecordsManagementServiceRegistry(RecordsManagementServiceRegistry serviceRegistry)
{
@@ -167,7 +171,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* @param filePlanService file plan service
* @param filePlanService
* file plan service
*/
public void setFilePlanService(FilePlanService filePlanService)
{
@@ -175,7 +180,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* @param recordFolderService record folder service
* @param recordFolderService
* record folder service
*/
public void setRecordFolderService(RecordFolderService recordFolderService)
{
@@ -183,7 +189,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* @param recordService record service
* @param recordService
* record service
*/
public void setRecordService(RecordService recordService)
{
@@ -191,7 +198,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* @param transactionService transaction service
* @param transactionService
* transaction service
*/
public void setTransactionService(TransactionService transactionService)
{
@@ -293,8 +301,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
if (isRecord(nodeRef))
{
// calculate disposition schedule without taking into account the user
DispositionSchedule originDispositionSchedule = AuthenticationUtil.runAsSystem(new RunAsWork<DispositionSchedule>()
{
DispositionSchedule originDispositionSchedule = AuthenticationUtil.runAsSystem(new RunAsWork<DispositionSchedule>() {
@Override
public DispositionSchedule doWork()
{
@@ -361,8 +368,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* This method returns a NodeRef
* Gets the disposition instructions
* This method returns a NodeRef Gets the disposition instructions
*
* @param nodeRef
* @return
@@ -432,7 +438,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Gets the node reference of the disposition schedule associated with the container.
*
* @param nodeRef node reference of the container
* @param nodeRef
* node reference of the container
* @return {@link NodeRef} node reference of the disposition schedule, null if none
*/
private NodeRef getAssociatedDispositionScheduleImpl(NodeRef nodeRef)
@@ -506,10 +513,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* Method that provides a boolean if given Records Management Container has disposable items.
* This method is similar to getDisposableItemsImpl(boolean isRecordLevelDisposition, NodeRef rmContainer) but with improved performance:
* For RecordLevelDisposition it will limit Record retrieval to 1.
* Early returns once the first occurrence is found.
* Method that provides a boolean if given Records Management Container has disposable items. This method is similar to getDisposableItemsImpl(boolean isRecordLevelDisposition, NodeRef rmContainer) but with improved performance: For RecordLevelDisposition it will limit Record retrieval to 1. Early returns once the first occurrence is found.
*
* @param isRecordLevelDisposition
* @param rmContainer
* @return
@@ -718,11 +723,12 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* Updates the given disposition action definition belonging to the given disposition
* schedule.
* Updates the given disposition action definition belonging to the given disposition schedule.
*
* @param actionDefinition The DispositionActionDefinition to update
* @param actionDefinitionParams Map of parameters to use to update the action definition
* @param actionDefinition
* The DispositionActionDefinition to update
* @param actionDefinitionParams
* Map of parameters to use to update the action definition
* @return The updated DispositionActionDefinition
*/
@Override
@@ -742,11 +748,12 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/** ========= Disposition Action Methods ========= */
/**
* Initialises the details of the next disposition action based on the details of a disposition
* action definition.
* Initialises the details of the next disposition action based on the details of a disposition action definition.
*
* @param nodeRef node reference
* @param dispositionActionDefinition disposition action definition
* @param nodeRef
* node reference
* @param dispositionActionDefinition
* disposition action definition
*/
private DispositionAction initialiseDispositionAction(final NodeRef nodeRef, DispositionActionDefinition dispositionActionDefinition)
{
@@ -771,12 +778,12 @@ public class DispositionServiceImpl extends ServiceBaseImpl
DispositionAction da;
// check if current transaction is a READ ONLY one and if true create the node in a READ WRITE transaction
if (AlfrescoTransactionSupport.getTransactionReadState().equals(TxnReadState.TXN_READ_ONLY)) {
if (AlfrescoTransactionSupport.getTransactionReadState().equals(TxnReadState.TXN_READ_ONLY))
{
da = transactionService.getRetryingTransactionHelper().doInTransaction(
() -> createDispositionAction(nodeRef, props),
false,
true
);
true);
}
else
{
@@ -793,10 +800,13 @@ public class DispositionServiceImpl extends ServiceBaseImpl
return da;
}
/** Creates a new disposition action object
/**
* Creates a new disposition action object
*
* @param nodeRef node reference
* @param props properties of the disposition action to be created
* @param nodeRef
* node reference
* @param props
* properties of the disposition action to be created
* @return the disposition action object
*/
private DispositionAction createDispositionAction(final NodeRef nodeRef, Map<QName, Serializable> props)
@@ -814,8 +824,10 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Compute the "disposition as of" date (if necessary) for a disposition action and a node.
*
* @param nodeRef The node which the schedule applies to.
* @param dispositionActionDefinition The definition of the disposition action.
* @param nodeRef
* The node which the schedule applies to.
* @param dispositionActionDefinition
* The definition of the disposition action.
* @return The new "disposition as of" date.
*/
@Override
@@ -962,7 +974,8 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Get the next disposition action node. Null if none present.
*
* @param nodeRef the disposable node reference
* @param nodeRef
* the disposable node reference
* @return NodeRef the next disposition action, null if none
*/
private NodeRef getNextDispositionActionNodeRef(NodeRef nodeRef)
@@ -992,7 +1005,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
return result;
}
/** ========= Disposition Action History Methods ========= */
/**
@@ -1045,8 +1057,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
{
ParameterCheck.mandatory("nodeRef", nodeRef);
RunAsWork<Void> runAsWork = new RunAsWork<Void>()
{
RunAsWork<Void> runAsWork = new RunAsWork<Void>() {
/**
* @see RunAsWork#doWork()
*/
@@ -1073,9 +1084,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
public void updateNextDispositionAction(final NodeRef nodeRef, final DispositionSchedule dispositionSchedule)
{
RunAsWork<Void> runAsWork = new RunAsWork<Void>()
{
RunAsWork<Void> runAsWork = new RunAsWork<Void>() {
/**
* @see RunAsWork#doWork()
*/
@@ -1190,8 +1199,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
!recordFolderService.isRecordFolderClosed(nodeRef))
{
// runAs system so that we can close a record that has already been cutoff
authenticationUtil.runAsSystem(new RunAsWork<Void>()
{
authenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception
{
@@ -1247,8 +1255,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
{
final NodeRef action = dsNextAction.getNextActionNodeRef();
final Date dispositionActionDate = dsNextAction.getNextActionDateAsOf();
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -1263,12 +1270,12 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Helper method to apply the cut off
*
* @param nodeRef node to cut off
* @param nodeRef
* node to cut off
*/
private void applyCutoff(final NodeRef nodeRef)
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -1282,8 +1289,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
});
}
/**
* Calculate next disposition action for a record
*
@@ -1315,6 +1320,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Calculate next disposition action when the record already has one
*
* @param recordFolders
* @param nextDispositionAction
* @return next disposition action and the associated disposition schedule
@@ -1358,12 +1364,12 @@ public class DispositionServiceImpl extends ServiceBaseImpl
}
/**
* Determine what should be updated for an existing disposition schedule impl. We only update the date if the
* existing date is earlier than the calculated one.
* Determine what should be updated for an existing disposition schedule impl. We only update the date if the existing date is earlier than the calculated one.
*
* @param recordNextDispositionActionDate The next action date found on the record node (or folder node).
* @param nextDispositionActionDate The next action date calculated from the current disposition schedule(s)
* affecting the node.
* @param recordNextDispositionActionDate
* The next action date found on the record node (or folder node).
* @param nextDispositionActionDate
* The next action date calculated from the current disposition schedule(s) affecting the node.
* @return READ_ONLY if nothing should be updated, or DATE_ONLY if the date needs updating.
*/
private WriteMode determineWriteMode(Date recordNextDispositionActionDate, Date nextDispositionActionDate)
@@ -1379,6 +1385,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl
/**
* Calculate first disposition action when the record doesn't have one
*
* @param recordFolders
* @return next disposition action and the associated disposition schedule
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -81,7 +81,8 @@ public class DispositionProperty extends BaseBehaviourBean
private Set<String> excludedDispositionActions;
/**
* @param namespaceService namespace service
* @param namespaceService
* namespace service
*/
public void setNamespaceService(NamespaceService namespaceService)
{
@@ -89,7 +90,8 @@ public class DispositionProperty extends BaseBehaviourBean
}
/**
* @param dispositionService disposition service
* @param dispositionService
* disposition service
*/
public void setDispositionService(DispositionService dispositionService)
{
@@ -97,7 +99,8 @@ public class DispositionProperty extends BaseBehaviourBean
}
/**
* @param propertyName property name (as string)
* @param propertyName
* property name (as string)
*/
public void setName(String propertyName)
{
@@ -121,7 +124,8 @@ public class DispositionProperty extends BaseBehaviourBean
}
/**
* @param excludedDispositionActions list of excluded disposition actions
* @param excludedDispositionActions
* list of excluded disposition actions
*/
public void setExcludedDispositionActions(Set<String> excludedDispositionActions)
{
@@ -156,8 +160,10 @@ public class DispositionProperty extends BaseBehaviourBean
/**
* Indicates whether the disposition property applies given the context.
*
* @param isRecordLevel true if record level disposition schedule, false otherwise
* @param dispositionAction disposition action name
* @param isRecordLevel
* true if record level disposition schedule, false otherwise
* @param dispositionAction
* disposition action name
* @return boolean true if applies, false otherwise
*/
public boolean applies(boolean isRecordLevel, String dispositionAction)
@@ -187,12 +193,10 @@ public class DispositionProperty extends BaseBehaviourBean
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
*/
@Override
@Behaviour
(
@Behaviour(
kind = BehaviourKind.CLASS,
type = "rma:dispositionLifecycle",
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT
)
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
public void onUpdateProperties(
final NodeRef nodeRef,
final Map<QName, Serializable> before,
@@ -203,8 +207,7 @@ public class DispositionProperty extends BaseBehaviourBean
// has the property we care about changed?
if (isPropertyUpdated(before, after))
{
AuthenticationUtil.runAs(new RunAsWork<Void>()
{
AuthenticationUtil.runAs(new RunAsWork<Void>() {
@Override
public Void doWork()
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -43,13 +43,16 @@ public interface IdentifierGenerator
{
/**
* The content type this generator is applicible to.
*
* @return QName the type
*/
QName getType();
/**
* Generates the next id based on the provided context.
* @param context map of context values
*
* @param context
* map of context values
* @return String the next id
*/
String generateId(Map<String, Serializable> context);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -55,7 +55,8 @@ public abstract class IdentifierGeneratorBase implements IdentifierGenerator
/**
* Set identifier service.
*
* @param identifierService identifier service
* @param identifierService
* identifier service
*/
public void setIdentifierService(IdentifierService identifierService)
{
@@ -65,7 +66,8 @@ public abstract class IdentifierGeneratorBase implements IdentifierGenerator
/**
* Set the node service
*
* @param nodeService node service
* @param nodeService
* node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -75,7 +77,8 @@ public abstract class IdentifierGeneratorBase implements IdentifierGenerator
/**
* Set type.
*
* @param type content type
* @param type
* content type
*/
public void setTypeAsString(String type)
{
@@ -94,8 +97,10 @@ public abstract class IdentifierGeneratorBase implements IdentifierGenerator
/**
* Function to pad a string with zero '0' characters to the required length
*
* @param s String to pad with leading zero '0' characters
* @param len Length to pad to
* @param s
* String to pad with leading zero '0' characters
* @param len
* Length to pad to
* @return padded string or the original if already at &gt;=len characters
*/
protected String padString(String s, int len)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,15 +47,18 @@ public interface IdentifierService
/**
* Register an identifier generator implementation with the service.
*
* @param identifierGenerator identifier generator implementation
* @param identifierGenerator
* identifier generator implementation
*/
void register(IdentifierGenerator identifierGenerator);
/**
* Generate an identifier for a node with the given type and parent.
*
* @param type type of the node
* @param parent parent of the ndoe
* @param type
* type of the node
* @param parent
* parent of the ndoe
* @return String generated identifier
*/
String generateIdentifier(QName type, NodeRef parent);
@@ -63,7 +66,8 @@ public interface IdentifierService
/**
* Generate an identifier for the given node.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return String generated identifier
*/
String generateIdentifier(NodeRef nodeRef);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -31,6 +31,9 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -39,8 +42,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author Roy Wetherall
@@ -62,7 +63,8 @@ public class IdentifierServiceImpl implements IdentifierService
/**
* Set the node service
*
* @param nodeService node service
* @param nodeService
* node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -72,7 +74,8 @@ public class IdentifierServiceImpl implements IdentifierService
/**
* Set the dictionary service
*
* @param dictionaryService dictionary service
* @param dictionaryService
* dictionary service
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
@@ -131,8 +134,10 @@ public class IdentifierServiceImpl implements IdentifierService
/**
* Generate an identifier for a given type of object with the accompanying context.
*
* @param type content type
* @param context context
* @param type
* content type
* @param context
* context
* @return String identifier
*/
private String generateIdentifier(QName type, Map<String, Serializable> context)
@@ -165,7 +170,8 @@ public class IdentifierServiceImpl implements IdentifierService
/**
*
* @param type content type (could be aspect or type)
* @param type
* content type (could be aspect or type)
* @return
*/
private IdentifierGenerator lookupGenerator(QName type)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -34,6 +34,11 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
@@ -58,14 +63,9 @@ import org.alfresco.service.cmr.site.SiteInfo;
import org.alfresco.service.cmr.site.SiteService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.util.ParameterCheck;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Helper bean containing methods useful when sending records
* management notifications via the {@link NotificationService}
* Helper bean containing methods useful when sending records management notifications via the {@link NotificationService}
*
* @author Roy Wetherall
*/
@@ -101,7 +101,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
private NodeRef rejectedTemplate = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, "record_rejected_template");
/**
* @param notificationService notification service
* @param notificationService
* notification service
*/
public void setNotificationService(NotificationService notificationService)
{
@@ -109,7 +110,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param filePlanService file plan service
* @param filePlanService
* file plan service
*/
public void setFilePlanService(FilePlanService filePlanService)
{
@@ -117,7 +119,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param filePlanRoleService file plan role service
* @param filePlanRoleService
* file plan role service
*/
public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService)
{
@@ -125,7 +128,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param notificationRole rm notification role
* @param notificationRole
* rm notification role
*/
public void setNotificationRole(String notificationRole)
{
@@ -133,7 +137,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param searchService search service
* @param searchService
* search service
*/
public void setSearchService(SearchService searchService)
{
@@ -141,7 +146,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param namespaceService namespace service
* @param namespaceService
* namespace service
*/
public void setNamespaceService(NamespaceService namespaceService)
{
@@ -149,7 +155,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param siteService site service
* @param siteService
* site service
*/
public void setSiteService(SiteService siteService)
{
@@ -157,7 +164,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param authorityService authority service
* @param authorityService
* authority service
*/
public void setAuthorityService(AuthorityService authorityService)
{
@@ -165,7 +173,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param nodeService node service
* @param nodeService
* node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -173,7 +182,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
}
/**
* @param tenantAdminService tenant admin service
* @param tenantAdminService
* tenant admin service
*/
public void setTenantAdminService(TenantAdminService tenantAdminService)
{
@@ -203,8 +213,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
{
if (dueForReviewTemplate == null)
{
List<NodeRef> nodeRefs =
searchService.selectNodes(
List<NodeRef> nodeRefs = searchService.selectNodes(
getRootNode(),
"app:company_home/app:dictionary/cm:records_management/cm:records_management_email_templates/cm:notify-records-due-for-review-email.ftl", null,
namespaceService,
@@ -225,8 +234,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
private NodeRef getRootNode()
{
String tenantDomain = tenantAdminService.getCurrentUserDomain();
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<NodeRef>()
{
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<NodeRef>() {
public NodeRef doWork()
{
return nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
@@ -237,7 +245,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Sends records due for review email notification.
*
* @param records records due for review
* @param records
* records due for review
*/
public void recordsDueForReviewEmailNotification(final List<NodeRef> records)
{
@@ -283,7 +292,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Sends record superseded email notification.
*
* @param record superseded record
* @param record
* superseded record
*/
public void recordSupersededEmailNotification(final NodeRef record)
{
@@ -321,7 +331,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Sends record rejected email notification.
*
* @param record rejected record
* @param record
* rejected record
*/
public void recordRejectedEmailNotification(NodeRef record, String recordId, String recordCreator)
{
@@ -360,7 +371,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Helper method to check if the mandatory properties are set
*
* @param record rejected record
* @param record
* rejected record
*/
private boolean canSendRejectEmail(NodeRef record, String recordCreator)
{
@@ -401,13 +413,13 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Gets the rm root given a context node.
*
* @param context context node reference
* @param context
* context node reference
* @return {@link NodeRef} rm root node reference
*/
private NodeRef getRMRoot(final NodeRef context)
{
return AuthenticationUtil.runAs(new RunAsWork<NodeRef>()
{
return AuthenticationUtil.runAs(new RunAsWork<NodeRef>() {
@Override
public NodeRef doWork()
{
@@ -421,13 +433,13 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Gets the group name for the notification role.
*
* @param root rm root node
* @param root
* rm root node
* @return String notification role's group name
*/
private String getGroupName(final NodeRef root)
{
return AuthenticationUtil.runAs(new RunAsWork<String>()
{
return AuthenticationUtil.runAs(new RunAsWork<String>() {
@Override
public String doWork()
{
@@ -440,8 +452,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
private boolean doesGroupContainUsers(final String groupName)
{
return AuthenticationUtil.runAs(new RunAsWork<Boolean>()
{
return AuthenticationUtil.runAs(new RunAsWork<Boolean>() {
@Override
public Boolean doWork() throws Exception
{
@@ -454,13 +465,13 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
/**
* Get the site name, default if none/undetermined.
*
* @param root rm root
* @param root
* rm root
* @return String site name
*/
private String getSiteName(final NodeRef root)
{
return AuthenticationUtil.runAs(new RunAsWork<String>()
{
return AuthenticationUtil.runAs(new RunAsWork<String>() {
@Override
public String doWork()
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -49,15 +49,27 @@ public class RecordsManagementPermissionPostProcessor extends PermissionPostProc
{
/** node service */
private NodeService nodeService;
public void setNodeService(NodeService nodeService) {this.nodeService=nodeService;}
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/** permission service */
private PermissionService permissionService;
public void setPermissionService(PermissionService permissionService) {this.permissionService=permissionService;}
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
/** The permission model DAO. */
private PermissionModel permissionModel;
public void setPermissionModel(PermissionModel permissionModel) {this.permissionModel=permissionModel;}
public void setPermissionModel(PermissionModel permissionModel)
{
this.permissionModel = permissionModel;
}
/**
* @see org.alfresco.repo.security.permissions.processor.PermissionPostProcessor#process(AccessStatus, NodeRef, String, List, List)
@@ -91,8 +103,10 @@ public class RecordsManagementPermissionPostProcessor extends PermissionPostProc
/**
* Check if a given permission is implied by a list of permission groups.
*
* @param perm The name of the permission in question.
* @param configuredPermissions The list of permission group names.
* @param perm
* The name of the permission in question.
* @param configuredPermissions
* The list of permission group names.
* @return true if the permission is contained or implied by the list of permissions.
*/
private boolean isPermissionContained(String perm, List<String> configuredPermissions)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -45,7 +45,8 @@ public interface RecordableVersionConfigService
/**
* Gets the recordable versions
*
* @param nodeRef The node reference for which the recordable versions should be retrieved
* @param nodeRef
* The node reference for which the recordable versions should be retrieved
* @return The list of recordable versions
*/
List<Version> getVersions(NodeRef nodeRef);
@@ -53,8 +54,10 @@ public interface RecordableVersionConfigService
/**
* Sets the recordable version for the given node
*
* @param nodeRef The node reference for which the recorable version should be set
* @param version The version to be set
* @param nodeRef
* The node reference for which the recorable version should be set
* @param version
* The version to be set
*/
void setVersion(NodeRef nodeRef, String version);
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,10 +27,11 @@
package org.alfresco.module.org_alfresco_module_rm.recordableversion;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy.NONE;
import static org.alfresco.util.ParameterCheck.mandatory;
import static org.alfresco.util.ParameterCheck.mandatoryString;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.util.ArrayList;
import java.util.List;
@@ -65,7 +66,8 @@ public class RecordableVersionConfigServiceImpl implements RecordableVersionConf
/**
* Sets the node service
*
* @param nodeService The node service
* @param nodeService
* The node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -109,8 +111,10 @@ public class RecordableVersionConfigServiceImpl implements RecordableVersionConf
/**
* Checks if the specified recordable version policy has been selected for the document
*
* @param recordableVersionPolicy The recordable version policy
* @param nodeRef Node reference of the document
* @param recordableVersionPolicy
* The recordable version policy
* @param nodeRef
* Node reference of the document
* @return <code>true</code> if the specified recordable version policy has been selected for the document, <code>false</code> otherwise
*/
private boolean isVersionPolicySelected(RecordableVersionPolicy recordableVersionPolicy, NodeRef nodeRef)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,7 +47,8 @@ public interface RecordFolderService
/**
* Sets up the a record folder from a standard folder.
*
* @param nodeRef node reference of the folder to setup
* @param nodeRef
* node reference of the folder to setup
*
* @since 2.2
*/
@@ -56,7 +57,8 @@ public interface RecordFolderService
/**
* Indicates whether the given node is a record folder or not.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if record folder, false otherwise
*
* @since 2.2
@@ -66,7 +68,8 @@ public interface RecordFolderService
/**
* Indicates whether the contents of a record folder are all declared.
*
* @param nodeRef node reference (record folder)
* @param nodeRef
* node reference (record folder)
* @return boolean true if record folder contents are declared, false otherwise
*
* @since 2.2
@@ -76,7 +79,8 @@ public interface RecordFolderService
/**
* Indicates whether a record folder is closed or not.
*
* @param nodeRef node reference (record folder)
* @param nodeRef
* node reference (record folder)
* @return boolean true if record folder is closed, false otherwise
*
* @since 2.2
@@ -84,12 +88,14 @@ public interface RecordFolderService
boolean isRecordFolderClosed(NodeRef nodeRef);
/**
* Create a record folder in the rm container. The record folder will take the name and type
* provided.
* Create a record folder in the rm container. The record folder will take the name and type provided.
*
* @param rmContainer records management container
* @param name name
* @param type type
* @param rmContainer
* records management container
* @param name
* name
* @param type
* type
* @return NodeRef node reference of record folder
*
* @since 2.2
@@ -97,13 +103,16 @@ public interface RecordFolderService
NodeRef createRecordFolder(NodeRef rmContainer, String name, QName type);
/**
* Create a record folder in the rm container. The record folder will take the name, type and
* properties provided.
* Create a record folder in the rm container. The record folder will take the name, type and properties provided.
*
* @param rmContainer records management container
* @param name name
* @param type type
* @param properties properties
* @param rmContainer
* records management container
* @param name
* name
* @param type
* type
* @param properties
* properties
* @return NodeRef node reference of record folder
*
* @since 2.2
@@ -111,11 +120,12 @@ public interface RecordFolderService
NodeRef createRecordFolder(NodeRef rmContainer, String name, QName type, Map<QName, Serializable> properties);
/**
* Create a record folder in the rm container. The record folder will take the name provided.
* Type defaults to rm:recordFolder.
* Create a record folder in the rm container. The record folder will take the name provided. Type defaults to rm:recordFolder.
*
* @param rmContainer records management container
* @param name name
* @param rmContainer
* records management container
* @param name
* name
* @return NodeRef node reference of record folder
*
* @since 2.2
@@ -123,12 +133,14 @@ public interface RecordFolderService
NodeRef createRecordFolder(NodeRef rmContainer, String name);
/**
* Create a record folder in the rm container. The record folder will take the name and
* properties provided. Type defaults to rm:recordFolder.
* Create a record folder in the rm container. The record folder will take the name and properties provided. Type defaults to rm:recordFolder.
*
* @param rmContainer records management container
* @param name name
* @param properties properties
* @param rmContainer
* records management container
* @param name
* name
* @param properties
* properties
* @return NodeRef node reference of record folder
*
* @since 2.2
@@ -138,7 +150,8 @@ public interface RecordFolderService
/**
* Get all the record folders that a record is filed into.
*
* @param record the record node reference
* @param record
* the record node reference
* @return List list of folder record node references
*
* @since 2.2
@@ -161,7 +174,8 @@ public interface RecordFolderService
/**
* Closes the record folder. If the given node reference is a record the parent will be retrieved and processed.
*
* @param nodeRef the record folder node reference
* @param nodeRef
* the record folder node reference
*
* @since 2.2
*/

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -33,6 +33,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
@@ -49,9 +53,6 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Record Folder Service Implementation
@@ -83,7 +84,8 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
private FilePlanService filePlanService;
/**
* @param dispositionService disposition service
* @param dispositionService
* disposition service
*/
public void setDispositionService(DispositionService dispositionService)
{
@@ -91,7 +93,8 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
}
/**
* @param recordService record service
* @param recordService
* record service
*/
public void setRecordService(RecordService recordService)
{
@@ -99,7 +102,8 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
}
/**
* @param filePlanService file plan service
* @param filePlanService
* file plan service
*/
public void setFilePlanService(FilePlanService filePlanService)
{
@@ -167,8 +171,7 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_RECORD_FOLDER_EXPECTED));
}
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
{
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>() {
public Boolean doWork() throws Exception
{
return ((Boolean) nodeService.getProperty(nodeRef, PROP_IS_CLOSED));

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -50,9 +50,12 @@ public class RelationshipDefinitionImpl implements RelationshipDefinition
/**
* Constructor for creating a relationship definition
*
* @param uniqueName The unique name of the relationship definition
* @param type The type of the relationship definition
* @param displayName The display name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @param type
* The type of the relationship definition
* @param displayName
* The display name of the relationship definition
*/
public RelationshipDefinitionImpl(String uniqueName, RelationshipType type, RelationshipDisplayName displayName)
{
@@ -77,7 +80,8 @@ public class RelationshipDefinitionImpl implements RelationshipDefinition
/**
* Sets the name of the relationship definition
*
* @param uniqueName The name of the relationship definition
* @param uniqueName
* The name of the relationship definition
*/
private void setUniqueName(String uniqueName)
{
@@ -96,7 +100,8 @@ public class RelationshipDefinitionImpl implements RelationshipDefinition
/**
* Sets the type of the relationship definition
*
* @param type The type of the relationship definition
* @param type
* The type of the relationship definition
*/
private void setType(RelationshipType type)
{
@@ -115,7 +120,8 @@ public class RelationshipDefinitionImpl implements RelationshipDefinition
/**
* Sets the display name of the relationship definition
*
* @param displayName The display name of the relationship definition
* @param displayName
* The display name of the relationship definition
*/
private void setDisplayName(RelationshipDisplayName displayName)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,12 +47,12 @@ public class RelationshipDisplayName
private String targetText;
/**
* Constructor for creating the relationship display name.
* In case of a bidirectional relationship the source
* text and target text will be the same.
* Constructor for creating the relationship display name. In case of a bidirectional relationship the source text and target text will be the same.
*
* @param sourceText The source text of the relationship
* @param targetText The target text of the relationship
* @param sourceText
* The source text of the relationship
* @param targetText
* The target text of the relationship
*/
public RelationshipDisplayName(String sourceText, String targetText)
{
@@ -76,7 +76,8 @@ public class RelationshipDisplayName
/**
* Sets the source text of the relationship
*
* @param sourceText The source text of the relationship
* @param sourceText
* The source text of the relationship
*/
private void setSourceText(String sourceText)
{
@@ -96,7 +97,8 @@ public class RelationshipDisplayName
/**
* Sets the target text of the relationship
*
* @param targetText The target text of the relationship
* @param targetText
* The target text of the relationship
*/
private void setTargetText(String targetText)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -57,9 +57,12 @@ public class RelationshipImpl implements Relationship, Serializable
/**
* Constructor for creating a relationship
*
* @param uniqueName The unique name of the relationship
* @param source The source of the relationship
* @param target The target of the relationship
* @param uniqueName
* The unique name of the relationship
* @param source
* The source of the relationship
* @param target
* The target of the relationship
*/
public RelationshipImpl(String uniqueName, NodeRef source, NodeRef target)
{
@@ -84,7 +87,8 @@ public class RelationshipImpl implements Relationship, Serializable
/**
* Sets the unique name of the relationship
*
* @param uniqueName The unique name of the relationship
* @param uniqueName
* The unique name of the relationship
*/
private void setUniqueName(String uniqueName)
{
@@ -103,7 +107,8 @@ public class RelationshipImpl implements Relationship, Serializable
/**
* Sets the source of the relationship
*
* @param source The source of the relationship
* @param source
* The source of the relationship
*/
private void setSource(NodeRef source)
{
@@ -122,7 +127,8 @@ public class RelationshipImpl implements Relationship, Serializable
/**
* Sets the target of the relationship
*
* @param target The target of the relationship
* @param target
* The target of the relationship
*/
private void setTarget(NodeRef target)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -54,7 +54,8 @@ public interface RelationshipService
/**
* Gets the relationship definition for the given unique name
*
* @param uniqueName The unique name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @return The relationship definition for the given unique name if it exist, <code>null</code> otherwise
*/
RelationshipDefinition getRelationshipDefinition(String uniqueName);
@@ -62,7 +63,8 @@ public interface RelationshipService
/**
* Creates a relationship definition using the display name
*
* @param displayName The display name of the relationship definition
* @param displayName
* The display name of the relationship definition
* @return The new relationship definition
*/
RelationshipDefinition createRelationshipDefinition(RelationshipDisplayName displayName);
@@ -70,8 +72,10 @@ public interface RelationshipService
/**
* Updates an existing relationship definition
*
* @param uniqueName The unique name of the relationship definition
* @param displayName The display name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @param displayName
* The display name of the relationship definition
* @return The updated relationship definition
*/
RelationshipDefinition updateRelationshipDefinition(String uniqueName, RelationshipDisplayName displayName);
@@ -79,7 +83,8 @@ public interface RelationshipService
/**
* Removes a relationship definition
*
* @param uniqueName The unique name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @return <code>true</code> if the relationship definition was removed successfully, <code>false</code> otherwise
*/
boolean removeRelationshipDefinition(String uniqueName);
@@ -87,7 +92,8 @@ public interface RelationshipService
/**
* Checks if a relationship exists or not
*
* @param uniqueName The unique name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @return <code>true</code> if the relationship definition exists, <code>false</code> otherwise
*/
boolean existsRelationshipDefinition(String uniqueName);
@@ -95,19 +101,21 @@ public interface RelationshipService
/**
* Gets all the relationships that come out from the given node reference
*
* @param nodeRef The node reference
* @param nodeRef
* The node reference
* @return All relationships that come out from the given node reference
*/
Set<Relationship> getRelationshipsFrom(NodeRef nodeRef);
/**
* Gets all the relationships that come out from the given node reference
* that match the a given name filter.
* Gets all the relationships that come out from the given node reference that match the a given name filter.
* <p>
* Exact match only.
*
* @param nodeRef The node reference
* @param nameFilter Name filter for results
* @param nodeRef
* The node reference
* @param nameFilter
* Name filter for results
* @return All relationships that come out from the given node reference
*
* @since 2.3.1
@@ -117,19 +125,21 @@ public interface RelationshipService
/**
* Gets all the relationships that go into the given node reference
*
* @param nodeRef The node reference
* @param nodeRef
* The node reference
* @return All relationships that go into the given node reference
*/
Set<Relationship> getRelationshipsTo(NodeRef nodeRef);
/**
* Gets all the relationships that go into the given node reference
* that match the a given name filter.
* Gets all the relationships that go into the given node reference that match the a given name filter.
* <p>
* Exact match only.
*
* @param nodeRef The node reference
* @param nameFilter Name filter for results
* @param nodeRef
* The node reference
* @param nameFilter
* Name filter for results
* @return All relationships that go into the given node reference
*
* @since 2.3.1
@@ -137,22 +147,26 @@ public interface RelationshipService
Set<Relationship> getRelationshipsTo(NodeRef nodeRef, String nameFilter);
/**
* Adds a relationship from the given node <code>source</code>
* to the give node <code>target</code> with the given unique name
* Adds a relationship from the given node <code>source</code> to the give node <code>target</code> with the given unique name
*
* @param uniqueName The unique name of the relationship
* @param source The node reference which the relationship come from
* @param target The node reference which the relationship go to
* @param uniqueName
* The unique name of the relationship
* @param source
* The node reference which the relationship come from
* @param target
* The node reference which the relationship go to
*/
void addRelationship(String uniqueName, NodeRef source, NodeRef target);
/**
* Removes the relationship from the given node <code>source</code>
* to the given node <code>target</code> with the given unique name
* Removes the relationship from the given node <code>source</code> to the given node <code>target</code> with the given unique name
*
* @param uniqueName The unique name of the relationship
* @param source The node reference which the relationship come from
* @param target The node reference which the relationship go to
* @param uniqueName
* The unique name of the relationship
* @param source
* The node reference which the relationship come from
* @param target
* The node reference which the relationship go to
*/
void removeRelationship(String uniqueName, NodeRef source, NodeRef target);
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -27,10 +27,11 @@
package org.alfresco.module.org_alfresco_module_rm.relationship;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.ASPECT_FROZEN;
import static org.alfresco.util.ParameterCheck.mandatory;
import static org.alfresco.util.ParameterCheck.mandatoryString;
import static org.apache.commons.lang3.StringUtils.isBlank;
import java.util.HashSet;
import java.util.List;
@@ -87,7 +88,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Sets the policy component instance
*
* @param policyComponent The policy component instance
* @param policyComponent
* The policy component instance
*/
public void setPolicyComponent(PolicyComponent policyComponent)
{
@@ -461,9 +463,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (getNodeService().hasAspect(target, ASPECT_FROZEN))
{
StringBuilder sb = new StringBuilder();
sb.append("Relationship cannot be created as the target '").
append(getNodeService().getProperty(target, ContentModel.PROP_NAME)).
append("' is in a hold.");
sb.append("Relationship cannot be created as the target '").append(getNodeService().getProperty(target, ContentModel.PROP_NAME)).append("' is in a hold.");
throw new AlfrescoRuntimeException(sb.toString());
}
@@ -472,9 +472,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (associationDefinition == null)
{
StringBuilder sb = new StringBuilder();
sb.append("No association definition found for '").
append(uniqueName).
append("'.");
sb.append("No association definition found for '").append(uniqueName).append("'.");
throw new IllegalArgumentException(sb.toString());
}
@@ -487,13 +485,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (associationAlreadyExists)
{
StringBuilder sb = new StringBuilder();
sb.append("Association '").
append(associationDefinitionName.getLocalName()).
append("' already exists from '").
append(source).
append("' to '").
append(target).
append("'.");
sb.append("Association '").append(associationDefinitionName.getLocalName()).append("' already exists from '").append(source).append("' to '").append(target).append("'.");
throw new AlfrescoRuntimeException(sb.toString());
}
@@ -528,9 +520,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (associationDefinition == null)
{
StringBuilder sb = new StringBuilder();
sb.append("No association definition found for '").
append(uniqueName).
append("'.");
sb.append("No association definition found for '").append(uniqueName).append("'.");
throw new IllegalArgumentException(sb.toString());
}
@@ -543,8 +533,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (associationDefinition.isChild())
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork()
{
@@ -572,7 +561,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Creates the relationship definition from the association definition
*
* @param associationDefinition The association definition
* @param associationDefinition
* The association definition
* @return The relationship definition if <code>associationDefinition</code> exists, <code>null</code> otherwise
*/
private RelationshipDefinition createRelationshipDefinition(AssociationDefinition associationDefinition)
@@ -597,7 +587,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Gets the relationship type from the association definition
*
* @param associationDefinition The association definition
* @param associationDefinition
* The association definition
* @return The type of the relationship definition
*/
private RelationshipType getRelationshipType(AssociationDefinition associationDefinition)
@@ -619,8 +610,10 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Gets the relationship display name of the relationship definition
*
* @param type The type of the relationship definition
* @param title The title of the association definition
* @param type
* The type of the relationship definition
* @param title
* The title of the association definition
* @return The relationship display name of the relationship definition
*/
private RelationshipDisplayName getRelationshipDisplayName(RelationshipType type, String title)
@@ -658,7 +651,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Generates relationships from the given association references
*
* @param associationRefs Association references
* @param associationRefs
* Association references
* @return Relationships generated from the given association references
*/
private Set<Relationship> generateRelationshipFromAssociationRef(List<AssociationRef> associationRefs, String nameFilter)
@@ -683,7 +677,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Generates relationships from the given child association references
*
* @param childAssociationRefs Child association references
* @param childAssociationRefs
* Child association references
* @return Relationships generated from the given child association references
*/
private Set<Relationship> generateRelationshipFromParentChildAssociationRef(List<ChildAssociationRef> childAssociationRefs, String nameFilter)
@@ -708,7 +703,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Determines the relationship type from the display name
*
* @param displayName The display name of the relationship
* @param displayName
* The display name of the relationship
* @return The relationship type from the display name
*/
private RelationshipType determineRelationshipTypeFromDisplayName(RelationshipDisplayName displayName)
@@ -740,9 +736,12 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Invoke before create reference policy
*
* @param source The source node reference
* @param target The target node reference
* @param associationDefinitionName The association definition name
* @param source
* The source node reference
* @param target
* The target node reference
* @param associationDefinitionName
* The association definition name
*/
private void invokeBeforeCreateReference(NodeRef source, NodeRef target, QName associationDefinitionName)
{
@@ -756,9 +755,12 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Invoke on create reference policy
*
* @param source The source node reference
* @param target The target node reference
* @param associationDefinitionName The association definition name
* @param source
* The source node reference
* @param target
* The target node reference
* @param associationDefinitionName
* The association definition name
*/
private void invokeOnCreateReference(NodeRef source, NodeRef target, QName associationDefinitionName)
{
@@ -772,9 +774,12 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Invoke before remove reference policy
*
* @param source The source node reference
* @param target The target node reference
* @param associationDefinitionName The association definition name
* @param source
* The source node reference
* @param target
* The target node reference
* @param associationDefinitionName
* The association definition name
*/
private void invokeBeforeRemoveReference(NodeRef source, NodeRef target, QName associationDefinitionName)
{
@@ -788,9 +793,12 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Invoke on remove reference policy
*
* @param source The source node reference
* @param target The target node reference
* @param associationDefinitionName The association definition name
* @param source
* The source node reference
* @param target
* The target node reference
* @param associationDefinitionName
* The association definition name
*/
private void invokeOnRemoveReference(NodeRef source, NodeRef target, QName associationDefinitionName)
{
@@ -802,12 +810,14 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
}
/**
* Check if an instance of the association already exists from the given
* source node reference to the given target node reference
* Check if an instance of the association already exists from the given source node reference to the given target node reference
*
* @param associationDefinition The association definition
* @param source The source node reference
* @param target The target node reference
* @param associationDefinition
* The association definition
* @param source
* The source node reference
* @param target
* The target node reference
* @return <code>true</code> if an association already exists, <code>false</code> otherwise
*/
private boolean associationExists(AssociationDefinition associationDefinition, NodeRef source, NodeRef target)
@@ -844,7 +854,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Gets the association definition for the given unique name
*
* @param uniqueName The unique name
* @param uniqueName
* The unique name
* @return The association definition for the given unique name if exists, <code>null</code> otherwise
*/
private AssociationDefinition getAssociationDefinition(String uniqueName)
@@ -868,7 +879,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Gets the qualified name of the association definition for the given unique name
*
* @param uniqueName The unique name
* @param uniqueName
* The unique name
* @return The qualified name of the association definition for the given unique name
*/
private QName getAssociationDefinitionName(String uniqueName)
@@ -888,12 +900,14 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
}
/**
* This method writes the specified String into the association's title property.
* For RM custom properties and references, Title is used to store the identifier.
* This method writes the specified String into the association's title property. For RM custom properties and references, Title is used to store the identifier.
*
* NOTE: Currently RMC custom associations only
* @param associationDefinitionQName Qualified name for the association definition
* @param newTitle The new title
*
* @param associationDefinitionQName
* Qualified name for the association definition
* @param newTitle
* The new title
* @return Qualified name for the association definition
*/
private QName persistUpdatedAssocTitle(QName associationDefinitionQName, String newTitle)
@@ -904,9 +918,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (assocDefn == null)
{
StringBuilder sb = new StringBuilder();
sb.append("Cannot find the association definiton for '").
append(associationDefinitionQName.getLocalName()).
append("'.");
sb.append("Cannot find the association definiton for '").append(associationDefinitionQName.getLocalName()).append("'.");
throw new AlfrescoRuntimeException(sb.toString());
}
@@ -937,7 +949,8 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
/**
* Generates a qualified name for the given relationship definition unique name
*
* @param uniqueName The unique name of the relationship definition
* @param uniqueName
* The unique name of the relationship definition
* @return The qualified name of relationship definition
*/
private QName generateRelationshipDefinitionQNameFor(String uniqueName)
@@ -958,9 +971,7 @@ public class RelationshipServiceImpl extends RecordsManagementAdminBase implemen
if (existingQName != null)
{
StringBuilder sb = new StringBuilder();
sb.append("Cannot create qualified name for given unique name '").
append(uniqueName).
append("' as it already exists.");
sb.append("Cannot create qualified name for given unique name '").append(uniqueName).append("' as it already exists.");
throw new AlfrescoRuntimeException(sb.toString());
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -38,6 +38,5 @@ import org.alfresco.api.AlfrescoPublicApi;
@AlfrescoPublicApi
public enum RelationshipType
{
BIDIRECTIONAL,
PARENTCHILD
BIDIRECTIONAL, PARENTCHILD
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -31,6 +31,8 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.util.AlfrescoTransactionSupport;
import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil;
@@ -46,11 +48,9 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.namespace.QName;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Extend versionable aspect auto-version behaviour to allow versions to be
* created when the content type is changed.
* Extend versionable aspect auto-version behaviour to allow versions to be created when the content type is changed.
*
* Note: this behaviour should be merged into core asap
*
@@ -85,7 +85,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
private boolean isAutoVersionOnTypeChange = false;
/**
* @param nodeService node service
* @param nodeService
* node service
*/
public void setNodeService(NodeService nodeService)
{
@@ -93,7 +94,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
}
/**
* @param versionService version service
* @param versionService
* version service
*/
public void setVersionService(VersionService versionService)
{
@@ -101,7 +103,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
}
/**
* @param lockService lock service
* @param lockService
* lock service
*/
public void setLockService(LockService lockService)
{
@@ -109,7 +112,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
}
/**
* @param alfrescoTransactionSupport alfresco transaction support
* @param alfrescoTransactionSupport
* alfresco transaction support
*/
public void setAlfrescoTransactionSupport(AlfrescoTransactionSupport alfrescoTransactionSupport)
{
@@ -117,7 +121,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
}
/**
* @param authenticationUtil authentication util
* @param authenticationUtil
* authentication util
*/
public void setAuthenticationUtil(AuthenticationUtil authenticationUtil)
{
@@ -125,7 +130,8 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
}
/**
* @param isAutoVersionOnTypeChange true if auto version on type change, false otherwise
* @param isAutoVersionOnTypeChange
* true if auto version on type change, false otherwise
*/
public void setAutoVersionOnTypeChange(boolean isAutoVersionOnTypeChange)
{
@@ -135,18 +141,19 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
/**
* On set node type behaviour
*
* @param nodeRef node reference
* @param oldType old type
* @param newType new type
* @param nodeRef
* node reference
* @param oldType
* old type
* @param newType
* new type
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
@Behaviour
(
@Behaviour(
type = "cm:versionable",
kind = BehaviourKind.CLASS,
notificationFrequency=NotificationFrequency.TRANSACTION_COMMIT
)
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)
public void onSetNodeType(NodeRef nodeRef, QName oldType, QName newType)
{
if (isAutoVersionOnTypeChange &&
@@ -186,13 +193,14 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
/**
* On create version implementation method.
*
* @param nodeRef node reference
* @param versionProperties version properties
* @param nodeRef
* node reference
* @param versionProperties
* version properties
*/
private void createVersionImpl(final NodeRef nodeRef, final Map<String, Serializable> versionProperties)
{
authenticationUtil.runAsSystem(new RunAsWork<Void>()
{
authenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception
{
@@ -206,8 +214,10 @@ public class ExtendedVersionableAspect implements NodeServicePolicies.OnSetNodeT
/**
* Record that the new version has been created
*
* @param versionableNode versionable node reference
* @param version version
* @param versionableNode
* versionable node reference
* @param version
* version
*/
@SuppressWarnings("unchecked")
private void recordCreateVersion(NodeRef versionableNode, Version version)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -47,8 +47,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
/**
* Extended version node service implementation that supports the retrieval of
* recorded version state.
* Extended version node service implementation that supports the retrieval of recorded version state.
*
* @author Roy Wetherall
* @since 2.3
@@ -63,7 +62,8 @@ public class RecordableVersionNodeServiceImpl extends Node2ServiceImpl
private List<String> recordModelURIs;
/**
* @param recordModelURIs namespaces specific to records
* @param recordModelURIs
* namespaces specific to records
*/
public void setRecordModelURIs(List<String> recordModelURIs)
{
@@ -71,7 +71,8 @@ public class RecordableVersionNodeServiceImpl extends Node2ServiceImpl
}
/**
* @param recordService record service
* @param recordService
* record service
*/
public void setRecordService(RecordService recordService)
{
@@ -110,7 +111,8 @@ public class RecordableVersionNodeServiceImpl extends Node2ServiceImpl
/**
* Process properties map before returning as frozen state.
*
* @param properties properties map
* @param properties
* properties map
* @return {@link Map}&lt;{@link QName}, {@link Serializable}&gt; processed property map
*/
protected Map<QName, Serializable> processProperties(NodeRef version, Map<QName, Serializable> properties)
@@ -141,8 +143,10 @@ public class RecordableVersionNodeServiceImpl extends Node2ServiceImpl
/**
* Process version properties.
*
* @param version version node reference
* @param properties properties map
* @param version
* version node reference
* @param properties
* properties map
*/
protected void processVersionProperties(NodeRef version, Map<QName, Serializable> properties) throws InvalidNodeRefException
{
@@ -239,7 +243,8 @@ public class RecordableVersionNodeServiceImpl extends Node2ServiceImpl
/**
* Process frozen aspects.
*
* @param aspects aspect set
* @param aspects
* aspect set
* @return {@link Set}&lt;{@link QName}&gt; processed aspect set
*/
protected Set<QName> processAspects(Set<QName> aspects)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -45,7 +45,8 @@ public interface RecordableVersionService
* <p>
* Returns false if not versionable or no version.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return boolean true if latest version recorded, false otherwise
*/
boolean isCurrentVersionRecorded(NodeRef nodeRef);
@@ -53,7 +54,8 @@ public interface RecordableVersionService
/**
* Indicates whether a version is recorded or not.
*
* @param version version
* @param version
* version
* @return boolean true if recorded version, false otherwise
*/
boolean isRecordedVersion(Version version);
@@ -61,7 +63,8 @@ public interface RecordableVersionService
/**
* If the version is a recorded version, gets the related version record.
*
* @param version version
* @param version
* version
* @return NodeRef node reference of version record
*/
NodeRef getVersionRecord(Version version);
@@ -69,7 +72,8 @@ public interface RecordableVersionService
/**
* Gets the version that relates to the version record
*
* @param record version record node reference
* @param record
* version record node reference
* @return Version version or null if not found
*/
Version getRecordedVersion(NodeRef record);
@@ -79,7 +83,8 @@ public interface RecordableVersionService
* <p>
* Does not create a record if the node is not versionable or the latest version is already recorded.
*
* @param nodeRef node reference
* @param nodeRef
* node reference
* @return NodeRef node reference to the created record.
*/
NodeRef createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef);
@@ -89,9 +94,12 @@ public interface RecordableVersionService
* <p>
* Does not create a record if the node is not versionable or the latest version is already recorded.
*
* @param filePlan parent node reference
* @param nodeRef node reference
* @param autoVersion true, create new record version from latest version, false creates a record from the latest frozen version
* @param filePlan
* parent node reference
* @param nodeRef
* node reference
* @param autoVersion
* true, create new record version from latest version, false creates a record from the latest frozen version
* @return NodeRef node reference to the created record.
*/
NodeRef createRecordFromLatestVersion(NodeRef filePlan, NodeRef nodeRef, boolean autoVersion);
@@ -99,7 +107,8 @@ public interface RecordableVersionService
/**
* Indicates whether a record version is destroyed or not.
*
* @param version version
* @param version
* version
* @return boolean true if destroyed, false otherwise
*/
boolean isRecordedVersionDestroyed(Version version);
@@ -109,7 +118,8 @@ public interface RecordableVersionService
* <p>
* Note this method does not destroy the associated record, instead it marks the version as destroyed.
*
* @param version version
* @param version
* version
*/
void destroyRecordedVersion(Version version);
@@ -123,7 +133,8 @@ public interface RecordableVersionService
/**
* Create a snapshot version of current node
*
* @param nodeRef node reference
* @param nodeRef
* node reference
*/
void createSnapshotVersion(NodeRef nodeRef);
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -33,18 +33,16 @@ import java.util.Map;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.workflow.activiti.ActivitiScriptNode;
import org.alfresco.repo.workflow.activiti.ActivitiScriptNodeList;
import org.alfresco.util.ParameterCheck;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* An assignment handler for the request info workflow.
* An RM manager/admin can select one or more user(s) and/or
* one or more group(s) when starting the request info workflow.
* This assignment handler assigns for everyone a task (it is a pooled task).
* An assignment handler for the request info workflow. An RM manager/admin can select one or more user(s) and/or one or more group(s) when starting the request info workflow. This assignment handler assigns for everyone a task (it is a pooled task).
*
* @author Tuna Aksoy
* @since 2.1
@@ -124,7 +122,8 @@ public class RequestInfoAssignmentHandler implements TaskListener
/**
* Helper method for building the workflow description
*
* @param recordName The name of the record
* @param recordName
* The name of the record
* @return Returns the workflow description
*/
private String getWorkflowDescription(String recordName)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -29,13 +29,12 @@ package org.alfresco.workflow.requestInfo;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.alfresco.util.ParameterCheck;
import org.springframework.extensions.surf.util.I18NUtil;
import org.alfresco.util.ParameterCheck;
/**
* Request info workflow notifier.
* After the pooled task has been finished the initiator of the workflow will
* get a task to verify the information. The initiator will also receive an email.
* Request info workflow notifier. After the pooled task has been finished the initiator of the workflow will get a task to verify the information. The initiator will also receive an email.
*
* @author Tuna Aksoy
* @since 2.1
@@ -66,7 +65,8 @@ public class RequestInfoNotifier implements TaskListener
/**
* Helper method for building the workflow description
*
* @param recordName The name of the record
* @param recordName
* The name of the record
* @return Returns the workflow description
*/
private String getWorkflowDescription(String recordName)

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -32,6 +32,8 @@ import java.util.List;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.engine.impl.context.Context;
import org.apache.commons.lang3.StringUtils;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -42,7 +44,6 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.util.ParameterCheck;
import org.apache.commons.lang3.StringUtils;
/**
* Util class for the request info workflow
@@ -83,9 +84,9 @@ public final class RequestInfoUtils
/**
* Helper method to extract the record name from the task
*
* @param delegateTask The delegate task
* @return Returns the name of the record or an empty string if the record name could not be found
(may be because the record has been deleted in the mean time)
* @param delegateTask
* The delegate task
* @return Returns the name of the record or an empty string if the record name could not be found (may be because the record has been deleted in the mean time)
*/
public static String getRecordName(DelegateTask delegateTask)
{
@@ -109,12 +110,9 @@ public final class RequestInfoUtils
/**
* Helper method to extract the initiator from the task
*
* @param delegateTask The delegate task
* @return Returns the initiator of the workflow. First it will be checked if
* a rule creator exists, which means the the workflow was started via rule.
* In this case the creator of the rule will receive the review task.
* If a rule creator cannot be found the code will try to find the initiator
* of the workflow. If also this is not the case the admin user will be returned.
* @param delegateTask
* The delegate task
* @return Returns the initiator of the workflow. First it will be checked if a rule creator exists, which means the the workflow was started via rule. In this case the creator of the rule will receive the review task. If a rule creator cannot be found the code will try to find the initiator of the workflow. If also this is not the case the admin user will be returned.
*/
public static String getInitiator(DelegateTask delegateTask)
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Records Management Module
* %%
* Copyright (C) 2005 - 2024 Alfresco Software Limited
* Copyright (C) 2005 - 2025 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -30,12 +30,11 @@ package org.alfresco.workflow.requestInfo;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.alfresco.util.ParameterCheck;
/**
* A variable handler for saving the task variables to the execution context.
* Some of the information will be needed in other tasks (e.g. "rmwf_message").
* This variable handler saves the local task variable to the execution context.
* A variable handler for saving the task variables to the execution context. Some of the information will be needed in other tasks (e.g. "rmwf_message"). This variable handler saves the local task variable to the execution context.
*
* @author Tuna Aksoy
* @since 2.1