Merged 5.1-MC1 (5.1.0) to HEAD (5.1)

119558 gcornwell: Merged code coverage improvements to 5.1-MC1 (5.1.0)
      r117774 gjames: RA-567: Increase /workflow/processes API code coverage
      r117773 gjames: RA-567: /workflow/processes coverage, removed unused ActivitiTypeConverter
      r116883 gjames: RA-531: reapplied change after merge, for MultiTServiceImpl test coverage
      r116629 gjames: RA-568 Increase /workflow/process-definitions API code coverage
      r116574 gjames: RA-569 Increase /workflow/tasks API code coverage
      r116286 gjames: RA-567: Increase /workflow/processes API code coverage
      r115853 gjames: RA-566: Increasing /people api coverage (description field)
      r115811 gjames: RA-566: Increasing /people api coverage
      r113007 gjames: Adding additional test coverage for DictionaryNamespaceComponent and DynamicNamespacePrefixResolver RA-521
      r113006 gjames: Adding additional test coverage for DictionaryNamespaceComponent and DictionaryComponent RA-514
      r112969 gjames: Adding additional test coverage for TemplateServiceImpl RA-530
      r112960 gjames: Alternative test approach for ModuleServiceImpl RA-520
      r112703 gjames: Adding additional test coverage for NodeLocatorService RA-522
      r112702 gjames: Adding additional test coverage for JobLockServiceImpl RA-516
      r112699 gjames: Adding additional test coverage for ModuleServiceImpl RA-520
      r112508 gjames: Adding additional test coverage for RenditionServiceImpl RA-526
      r112476 gjames: Adding additional test coverage for ContentServiceImpl RA-513
      r112475 gjames: Adding additional test coverage for MimetypeMap RA-519
      r112238 gjames: Adding additional test coverage for MimetypeMap RA-519
      r112237 gjames: Adding additional test coverage for TaggingService RA-529
      r112236 gjames: Adding additional test coverage for MultiTServiceImpl RA-531
      r112206 gjames: Adding additional test coverage for ContentServiceImpl RA-513
      r112167 gcornwell: RA-523: Increase NodeService code coverage (removed redundant code that was testing a version store we no longer use)
      r112102 gjames: Reverted changes to PermissionServiceImpl for RA-524
      r112048 gjames: Temporarily removed some PermissionServiceImpl code. I need to put it back.
      r111620 gjames: Adding additional test coverage for PermissionService RA-524
      r111619 gjames: Added some @Override to make Sonar happier
      r111456 gjames: Adding additional test coverage for AuthenticationService RA-509
      r111427 gjames: Adding additional test coverage for AttributeService RA-509
      r111317 gjames: Adding additional test coverage for WorkflowService RA-533


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@119945 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jean-Pierre Huynh
2015-12-10 10:35:05 +00:00
parent e0ff2eacee
commit f8fa061ba3
14 changed files with 297 additions and 223 deletions

View File

@@ -35,5 +35,5 @@ public interface People
* @throws NoSuchPersonException if personId does not exist
*/
Person getPerson(final String personId);
Person updatePerson(String personId, Person person);
//Person updatePerson(String personId, Person person);
}

View File

@@ -285,7 +285,7 @@ public class PeopleImpl implements People
return person;
}
/**
private void addToMap(Map<QName, Serializable> properties, QName name, Serializable value)
{
// if(name != null && value != null)
@@ -355,4 +355,5 @@ public class PeopleImpl implements People
return getPerson(personId);
}
*/
}

View File

@@ -62,7 +62,6 @@ import org.alfresco.repo.workflow.WorkflowPropertyHandlerRegistry;
import org.alfresco.repo.workflow.WorkflowQNameConverter;
import org.alfresco.repo.workflow.activiti.ActivitiConstants;
import org.alfresco.repo.workflow.activiti.ActivitiNodeConverter;
import org.alfresco.repo.workflow.activiti.ActivitiTypeConverter;
import org.alfresco.repo.workflow.activiti.ActivitiUtil;
import org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter;
import org.alfresco.rest.antlr.WhereClauseParser;
@@ -141,7 +140,6 @@ public class ProcessesImpl extends WorkflowRestImpl implements Processes
protected WorkflowPropertyHandlerRegistry handlerRegistry;
protected WorkflowAuthorityManager authorityManager;
protected ActivitiPropertyConverter propertyConverter;
protected ActivitiTypeConverter typeConverter;
public void setAuthorityDAO(AuthorityDAO authorityDAO)
{
@@ -256,15 +254,6 @@ public class ProcessesImpl extends WorkflowRestImpl implements Processes
}
return propertyConverter;
}
protected ActivitiTypeConverter getTypeConverter()
{
if (typeConverter == null)
{
typeConverter = new ActivitiTypeConverter(activitiProcessEngine, getWorkflowFactory(), getPropertyConverter(), deployWorkflowsInTenant);
}
return typeConverter;
}
@Override
public CollectionWithPagingInfo<ProcessInfo> getProcesses(Parameters parameters)

View File

@@ -36,6 +36,8 @@ import org.activiti.engine.history.HistoricVariableInstance;
import org.activiti.engine.task.DelegationState;
import org.activiti.engine.task.IdentityLink;
import org.activiti.engine.task.IdentityLinkType;
import org.activiti.engine.task.TaskInfo;
import org.activiti.engine.task.TaskInfoQuery;
import org.activiti.engine.task.TaskQuery;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.i18n.MessageService;
@@ -285,100 +287,8 @@ public class TasksImpl extends WorkflowRestImpl implements Tasks
}
List<QueryVariableHolder> variableProperties = propertyWalker.getVariableProperties();
if (variableProperties != null)
{
for (QueryVariableHolder queryVariableHolder : variableProperties)
{
if (queryVariableHolder.getOperator() == WhereClauseParser.EQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.MATCHES)
{
if (queryVariableHolder.getPropertyValue() instanceof String == false)
{
throw new InvalidArgumentException("the matches operator can only be used with a String value for property " + queryVariableHolder.getPropertyName());
}
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.NEGATION)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else
{
throw new InvalidArgumentException("variable " + queryVariableHolder.getPropertyName() +
" can only be used with an =, not comparison type");
}
}
}
setQueryUsingVariables(query, variableProperties);
// Add tenant-filtering
if(tenantService.isEnabled()) {
query.processVariableValueEquals(ActivitiConstants.VAR_TENANT_DOMAIN, TenantUtil.getCurrentDomain());
@@ -467,100 +377,8 @@ public class TasksImpl extends WorkflowRestImpl implements Tasks
}
List<QueryVariableHolder> variableProperties = propertyWalker.getVariableProperties();
if (variableProperties != null)
{
for (QueryVariableHolder queryVariableHolder : variableProperties)
{
if (queryVariableHolder.getOperator() == WhereClauseParser.EQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.MATCHES)
{
if (queryVariableHolder.getPropertyValue() instanceof String == false)
{
throw new InvalidArgumentException("the matches operator can only be used with a String value for property " + queryVariableHolder.getPropertyName());
}
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.NEGATION)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else
{
throw new InvalidArgumentException("variable " + queryVariableHolder.getPropertyName() +
" can only be used with an =, not comparison type");
}
}
}
setQueryUsingVariables(query, variableProperties);
// Add tenant filtering
if (tenantService.isEnabled())
{
@@ -598,7 +416,104 @@ public class TasksImpl extends WorkflowRestImpl implements Tasks
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
}
private void setQueryUsingVariables(TaskInfoQuery<?, ? extends TaskInfo> query, List<QueryVariableHolder> variableProperties)
{
if (variableProperties != null)
{
for (QueryVariableHolder queryVariableHolder : variableProperties)
{
if (queryVariableHolder.getOperator() == WhereClauseParser.EQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.GREATERTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueGreaterThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHAN)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThan(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.LESSTHANOREQUALS)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLessThanOrEqual(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.MATCHES)
{
if (queryVariableHolder.getPropertyValue() instanceof String == false)
{
throw new InvalidArgumentException("the matches operator can only be used with a String value for property " + queryVariableHolder.getPropertyName());
}
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueLike(queryVariableHolder.getPropertyName(), (String) queryVariableHolder.getPropertyValue());
}
}
else if (queryVariableHolder.getOperator() == WhereClauseParser.NEGATION)
{
if (queryVariableHolder.isGlobalScope())
{
query.processVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
else
{
query.taskVariableValueNotEquals(queryVariableHolder.getPropertyName(), queryVariableHolder.getPropertyValue());
}
}
else
{
throw new InvalidArgumentException("variable " + queryVariableHolder.getPropertyName() +
" can only be used with an =, not comparison type");
}
}
}
}
protected void addVariables(Task task, Boolean includeProcessVariables, Boolean includeTaskVariables,
Map<String, Object> processVariables, Map<String, Object> taskVariables, Map<String, TypeDefinition> definitionTypeMap)
{