mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed minor issues ("Trailing Comment") reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71947 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1239,7 +1239,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, label));
|
throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, label));
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI
|
// defaults to RM_CUSTOM_URI
|
||||||
|
NodeRef modelRef = getCustomModelRef("");
|
||||||
M2Model deserializedModel = readCustomContentModel(modelRef);
|
M2Model deserializedModel = readCustomContentModel(modelRef);
|
||||||
|
|
||||||
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
|
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
|
||||||
@@ -1309,7 +1310,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
//throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, compoundID));
|
//throw new IllegalArgumentException(I18NUtil.getMessage(MSG_REF_LABEL_IN_USE, compoundID));
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI
|
// defaults to RM_CUSTOM_URI
|
||||||
|
NodeRef modelRef = getCustomModelRef("");
|
||||||
M2Model deserializedModel = readCustomContentModel(modelRef);
|
M2Model deserializedModel = readCustomContentModel(modelRef);
|
||||||
|
|
||||||
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
|
String aspectName = RecordsManagementAdminServiceImpl.RMC_CUSTOM_ASSOCS;
|
||||||
@@ -1390,7 +1392,8 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
|||||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CONNOT_FIND_ASSOC_DEF, refQName));
|
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CONNOT_FIND_ASSOC_DEF, refQName));
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeRef modelRef = getCustomModelRef(""); // defaults to RM_CUSTOM_URI
|
// defaults to RM_CUSTOM_URI
|
||||||
|
NodeRef modelRef = getCustomModelRef("");
|
||||||
M2Model deserializedModel = readCustomContentModel(modelRef);
|
M2Model deserializedModel = readCustomContentModel(modelRef);
|
||||||
|
|
||||||
M2Aspect customAssocsAspect = deserializedModel.getAspect(RMC_CUSTOM_ASSOCS);
|
M2Aspect customAssocsAspect = deserializedModel.getAspect(RMC_CUSTOM_ASSOCS);
|
||||||
|
@@ -870,7 +870,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
if (values.containsKey(RM_AUDIT_DATA_LOGIN_ERROR))
|
if (values.containsKey(RM_AUDIT_DATA_LOGIN_ERROR))
|
||||||
{
|
{
|
||||||
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
|
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
|
||||||
fullName = user; // The user didn't log in
|
// The user didn't log in
|
||||||
|
fullName = user;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -884,7 +885,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
if (values.containsKey(DOD5015_AUDIT_DATA_LOGIN_ERROR))
|
if (values.containsKey(DOD5015_AUDIT_DATA_LOGIN_ERROR))
|
||||||
{
|
{
|
||||||
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
|
eventName = RM_AUDIT_EVENT_LOGIN_FAILURE;
|
||||||
fullName = user; // The user didn't log in
|
// The user didn't log in
|
||||||
|
fullName = user;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -908,7 +910,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
timestamp,
|
timestamp,
|
||||||
user,
|
user,
|
||||||
fullName,
|
fullName,
|
||||||
userRoles, // A concatenated string of roles
|
// A concatenated string of roles
|
||||||
|
userRoles,
|
||||||
nodeRef,
|
nodeRef,
|
||||||
nodeName,
|
nodeName,
|
||||||
nodeType,
|
nodeType,
|
||||||
@@ -979,7 +982,8 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
Long toTime = getToDateTime(params.getDateTo());
|
Long toTime = getToDateTime(params.getDateTo());
|
||||||
NodeRef nodeRef = params.getNodeRef();
|
NodeRef nodeRef = params.getNodeRef();
|
||||||
int maxEntries = params.getMaxEntries();
|
int maxEntries = params.getMaxEntries();
|
||||||
boolean forward = maxEntries > 0 ? false : true; // Reverse order if the results are limited
|
// Reverse order if the results are limited
|
||||||
|
boolean forward = maxEntries > 0 ? false : true;
|
||||||
|
|
||||||
// start the audit trail report
|
// start the audit trail report
|
||||||
writeAuditTrailHeader(writer, params, reportFormat);
|
writeAuditTrailHeader(writer, params, reportFormat);
|
||||||
@@ -1370,7 +1374,7 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
{
|
{
|
||||||
propDataType = propDef.getDataType().getName();
|
propDataType = propDef.getDataType().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DataTypeDefinition.MLTEXT.equals(propDataType))
|
if(DataTypeDefinition.MLTEXT.equals(propDataType))
|
||||||
{
|
{
|
||||||
writer.write(values.getFirst() == null ? "<none>" : StringEscapeUtils.escapeHtml(convertToMlText((Map)values.getFirst()).getDefaultValue()));
|
writer.write(values.getFirst() == null ? "<none>" : StringEscapeUtils.escapeHtml(convertToMlText((Map)values.getFirst()).getDefaultValue()));
|
||||||
@@ -1441,10 +1445,10 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
{
|
{
|
||||||
propDataType = propDef.getDataType().getName();
|
propDataType = propDef.getDataType().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle output of mltext properties
|
// handle output of mltext properties
|
||||||
if(DataTypeDefinition.MLTEXT.equals(propDataType))
|
if(DataTypeDefinition.MLTEXT.equals(propDataType))
|
||||||
{
|
{
|
||||||
changedValue.put("previous", values.getFirst() == null ? "" : convertToMlText((Map)values.getFirst()).getDefaultValue());
|
changedValue.put("previous", values.getFirst() == null ? "" : convertToMlText((Map)values.getFirst()).getDefaultValue());
|
||||||
changedValue.put("new", values.getSecond() == null ? "" : convertToMlText((Map)values.getSecond()).getDefaultValue());
|
changedValue.put("new", values.getSecond() == null ? "" : convertToMlText((Map)values.getSecond()).getDefaultValue());
|
||||||
}
|
}
|
||||||
@@ -1468,10 +1472,10 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to convert value to MLText
|
* Helper method to convert value to MLText
|
||||||
*
|
*
|
||||||
* @param map map of locale's and values
|
* @param map map of locale's and values
|
||||||
* @return {@link MLText} multilingual text value
|
* @return {@link MLText} multilingual text value
|
||||||
*/
|
*/
|
||||||
|
@@ -739,9 +739,11 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
|||||||
logger.debug("\t" + cad.typeString + " test on " + testNodeRef + " from " + nextObject.getClass().getName());
|
logger.debug("\t" + cad.typeString + " test on " + testNodeRef + " from " + nextObject.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUnfiltered(testNodeRef)) // Null allows
|
// Null allows
|
||||||
|
if (isUnfiltered(testNodeRef))
|
||||||
{
|
{
|
||||||
continue; // Continue to next ConfigAttributeDefintion
|
// Continue to next ConfigAttributeDefintion
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowed &&
|
if (allowed &&
|
||||||
@@ -749,7 +751,8 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
|
|||||||
checkRead(testNodeRef) != AccessDecisionVoter.ACCESS_GRANTED)
|
checkRead(testNodeRef) != AccessDecisionVoter.ACCESS_GRANTED)
|
||||||
{
|
{
|
||||||
allowed = false;
|
allowed = false;
|
||||||
break; // No point evaluating more ConfigAttributeDefintions
|
// No point evaluating more ConfigAttributeDefintions
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,8 @@ public class RMSecurityCommon implements ApplicationContextAware
|
|||||||
private static Log logger = LogFactory.getLog(RMSecurityCommon.class);
|
private static Log logger = LogFactory.getLog(RMSecurityCommon.class);
|
||||||
|
|
||||||
/** Services */
|
/** Services */
|
||||||
protected NodeService nodeService; //This is the internal NodeService -- no permission checks
|
//This is the internal NodeService -- no permission checks
|
||||||
|
protected NodeService nodeService;
|
||||||
protected PermissionService permissionService;
|
protected PermissionService permissionService;
|
||||||
protected RMCaveatConfigComponent caveatConfigComponent;
|
protected RMCaveatConfigComponent caveatConfigComponent;
|
||||||
private FilePlanService filePlanService;
|
private FilePlanService filePlanService;
|
||||||
|
@@ -50,12 +50,15 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
|||||||
private static final String LOV_CONSTRAINT_VALUE = "listconstraint";
|
private static final String LOV_CONSTRAINT_VALUE = "listconstraint";
|
||||||
private List<String> allowedValues;
|
private List<String> allowedValues;
|
||||||
private List<String> allowedValuesUpper;
|
private List<String> allowedValuesUpper;
|
||||||
private MatchLogic matchLogic = MatchLogic.AND; // defined match logic used by caveat matching (default = "AND")
|
// defined match logic used by caveat matching (default = "AND")
|
||||||
|
private MatchLogic matchLogic = MatchLogic.AND;
|
||||||
|
|
||||||
public enum MatchLogic
|
public enum MatchLogic
|
||||||
{
|
{
|
||||||
AND, // closed marking - all values must match
|
// closed marking - all values must match
|
||||||
OR; // open marking - at least one value must match
|
AND,
|
||||||
|
// open marking - at least one value must match
|
||||||
|
OR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: alternative to static init could be to use 'registered' constraint
|
// note: alternative to static init could be to use 'registered' constraint
|
||||||
@@ -140,7 +143,8 @@ public class RMListOfValuesConstraint extends ListOfValuesConstraint
|
|||||||
String runAsUser = AuthenticationUtil.getRunAsUser();
|
String runAsUser = AuthenticationUtil.getRunAsUser();
|
||||||
if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
if ((runAsUser != null) && (! runAsUser.equals(AuthenticationUtil.getSystemUserName())) && (caveatConfigService != null))
|
||||||
{
|
{
|
||||||
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getType()); // get allowed values for current user
|
// get allowed values for current user
|
||||||
|
List<String> allowedForUser = caveatConfigService.getRMAllowedValues(getType());
|
||||||
|
|
||||||
List<String> filteredList = new ArrayList<String>(allowedForUser.size());
|
List<String> filteredList = new ArrayList<String>(allowedForUser.size());
|
||||||
for (String allowed : allowedForUser)
|
for (String allowed : allowedForUser)
|
||||||
|
@@ -132,7 +132,8 @@ public class NotifyOfRecordsDueForReviewJobExecuter extends RecordsManagementJob
|
|||||||
/**
|
/**
|
||||||
* Now do the work, one action in each transaction
|
* Now do the work, one action in each transaction
|
||||||
*/
|
*/
|
||||||
retryingTransactionHelper.setMaxRetries(0); // don't retry the send email
|
// don't retry the send email
|
||||||
|
retryingTransactionHelper.setMaxRetries(0);
|
||||||
retryingTransactionHelper.doInTransaction(txCallbackSendEmail);
|
retryingTransactionHelper.doInTransaction(txCallbackSendEmail);
|
||||||
retryingTransactionHelper.setMaxRetries(10);
|
retryingTransactionHelper.setMaxRetries(10);
|
||||||
retryingTransactionHelper.doInTransaction(txUpdateNodesCallback);
|
retryingTransactionHelper.doInTransaction(txUpdateNodesCallback);
|
||||||
|
@@ -173,9 +173,11 @@ public interface RecordsManagementModel extends RecordsManagementCustomModel
|
|||||||
|
|
||||||
// Records management root aspect
|
// Records management root aspect
|
||||||
QName ASPECT_RECORDS_MANAGEMENT_ROOT = QName.createQName(RM_URI, "recordsManagementRoot");
|
QName ASPECT_RECORDS_MANAGEMENT_ROOT = QName.createQName(RM_URI, "recordsManagementRoot");
|
||||||
@Deprecated // since 2.1
|
// since 2.1
|
||||||
|
@Deprecated
|
||||||
QName ASSOC_HOLDS = QName.createQName(RM_URI, "holds");
|
QName ASSOC_HOLDS = QName.createQName(RM_URI, "holds");
|
||||||
@Deprecated // since 2.1
|
// since 2.1
|
||||||
|
@Deprecated
|
||||||
QName ASSOC_TRANSFERS = QName.createQName(RM_URI, "transfers");
|
QName ASSOC_TRANSFERS = QName.createQName(RM_URI, "transfers");
|
||||||
|
|
||||||
// Hold type
|
// Hold type
|
||||||
|
@@ -36,7 +36,8 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
|||||||
*/
|
*/
|
||||||
@BehaviourBean
|
@BehaviourBean
|
||||||
(
|
(
|
||||||
defaultType = "rma:ghosted" // optional
|
// optional
|
||||||
|
defaultType = "rma:ghosted"
|
||||||
)
|
)
|
||||||
public class GhostedAspect extends BaseBehaviourBean
|
public class GhostedAspect extends BaseBehaviourBean
|
||||||
implements ContentServicePolicies.OnContentUpdatePolicy
|
implements ContentServicePolicies.OnContentUpdatePolicy
|
||||||
@@ -52,10 +53,14 @@ public class GhostedAspect extends BaseBehaviourBean
|
|||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS, // required, use ASSOC for association behaviors
|
// required, use ASSOC for association behaviors
|
||||||
notificationFrequency = NotificationFrequency.EVERY_EVENT, // (defaults to EVERY_EVENT)
|
kind = BehaviourKind.CLASS,
|
||||||
policy = "alf:onContentUpdate", // (defaults to alf:<methodname>)
|
// (defaults to EVERY_EVENT)
|
||||||
type = "rma:ghosted" // required, unless defaultType set
|
notificationFrequency = NotificationFrequency.EVERY_EVENT,
|
||||||
|
// (defaults to alf:<methodname>)
|
||||||
|
policy = "alf:onContentUpdate",
|
||||||
|
// required, unless defaultType set
|
||||||
|
type = "rma:ghosted"
|
||||||
|
|
||||||
// isService (default false)
|
// isService (default false)
|
||||||
// name (only needs to specified if associated behvaiour object needs to be accessed)
|
// name (only needs to specified if associated behvaiour object needs to be accessed)
|
||||||
|
@@ -203,7 +203,8 @@ public class ImportPost extends DeclarativeWebScript
|
|||||||
|
|
||||||
// copy contents of uploaded file to temp ACP file
|
// copy contents of uploaded file to temp ACP file
|
||||||
FileOutputStream fos = new FileOutputStream(acpFile);
|
FileOutputStream fos = new FileOutputStream(acpFile);
|
||||||
FileCopyUtils.copy(acpContent.getInputStream(), fos); // NOTE: this method closes both streams
|
// NOTE: this method closes both streams
|
||||||
|
FileCopyUtils.copy(acpContent.getInputStream(), fos);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user