mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Support for action parameter constraints added to action service
An action parameter constraint provides a way to list the valid values that an action or action constraint parameter can take. This means more information about the action or action condition is available to the user of the action. Currently there is only an implementation for enum parameter values, but this will be extended as the existing action implementations are reviewed and value constraints are added as required. The REST API can now be extended to provide this additional information. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18489 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,7 @@ package org.alfresco.repo.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.service.cmr.action.ParameterConstraint;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
@@ -61,6 +62,9 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
*/
|
||||
private String displayLabel;
|
||||
|
||||
/** Parameter constraint name */
|
||||
private String parameterConstraintName;
|
||||
|
||||
/**
|
||||
* Indicates whether it is mandatory for the parameter to be set
|
||||
*/
|
||||
@@ -106,6 +110,28 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
this.isMandatory = isMandatory;
|
||||
this.isMultiValued = isMultiValued;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param name
|
||||
* @param type
|
||||
* @param isMandatory
|
||||
* @param displayLabel
|
||||
* @param isMultiValued
|
||||
* @param parameterConstraintName
|
||||
*/
|
||||
public ParameterDefinitionImpl(
|
||||
String name,
|
||||
QName type,
|
||||
boolean isMandatory,
|
||||
String displayLabel,
|
||||
boolean isMultiValued,
|
||||
String parameterConstraintName)
|
||||
{
|
||||
this(name, type, isMandatory, displayLabel, isMultiValued);
|
||||
this.parameterConstraintName = parameterConstraintName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterDefinition#getName()
|
||||
@@ -146,4 +172,12 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
{
|
||||
return this.displayLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterDefinition#getParameterConstraintName()
|
||||
*/
|
||||
public String getParameterConstraintName()
|
||||
{
|
||||
return this.parameterConstraintName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user