本文整理汇总了Java中org.alfresco.service.cmr.action.ParameterDefinition类的典型用法代码示例。如果您正苦于以下问题:Java ParameterDefinition类的具体用法?Java ParameterDefinition怎么用?Java ParameterDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterDefinition类属于org.alfresco.service.cmr.action包,在下文中一共展示了ParameterDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateDefaultFields
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
protected List<Field> generateDefaultFields(FormCreationData data, List<String> fieldsToIgnore)
{
List<Field> fields = new ArrayList<Field>();
ActionItemData itemData = (ActionItemData)data.getItemData();
// generate a field for each action parameter
for (ParameterDefinition paramDef : itemData.getActionDefinition().getParameterDefinitions())
{
if (!fieldsToIgnore.contains(paramDef.getName()))
{
ActionParameterField actionParameterField = new ActionParameterField(paramDef, actionService);
fields.add(actionParameterField);
}
}
// And also generate the special case of "execute asynchronously", which is not defined
// as an ActionParameter within the ActionExecuter, but is instead available for all actions.
fields.add(new ActionNonParameterField(EXECUTE_ASYNCHRONOUSLY, DataTypeDefinition.BOOLEAN));
return fields;
}
示例2: getParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
protected Collection<ParameterDefinition> getParameterDefinitions()
{
Collection<ParameterDefinition> paramList = super.getParameterDefinitions();
paramList.add(new ParameterDefinitionImpl(PARAM_TIMEOUT_MS, DataTypeDefinition.LONG, false,
getParamDisplayLabel(PARAM_TIMEOUT_MS)));
paramList.add(new ParameterDefinitionImpl(PARAM_READ_LIMIT_TIME_MS, DataTypeDefinition.LONG, false,
getParamDisplayLabel(PARAM_READ_LIMIT_TIME_MS)));
paramList.add(new ParameterDefinitionImpl(PARAM_MAX_SOURCE_SIZE_K_BYTES, DataTypeDefinition.LONG, false,
getParamDisplayLabel(PARAM_MAX_SOURCE_SIZE_K_BYTES)));
paramList.add(new ParameterDefinitionImpl(PARAM_READ_LIMIT_K_BYTES, DataTypeDefinition.LONG, false,
getParamDisplayLabel(PARAM_READ_LIMIT_K_BYTES)));
paramList.add(new ParameterDefinitionImpl(PARAM_MAX_PAGES, DataTypeDefinition.INT, false,
getParamDisplayLabel(PARAM_MAX_PAGES)));
paramList.add(new ParameterDefinitionImpl(PARAM_PAGE_LIMIT, DataTypeDefinition.INT, false,
getParamDisplayLabel(PARAM_PAGE_LIMIT)));
paramList.add(new ParameterDefinitionImpl(PARAM_USE, DataTypeDefinition.TEXT, false,
getParamDisplayLabel(PARAM_USE)));
return paramList;
}
示例3: getActionDefinition
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
private ActionDefinition getActionDefinition(
org.alfresco.service.cmr.action.ActionDefinition actionDefinitionId)
{
List<ActionDefinition.ParameterDefinition> paramDefs =
actionDefinitionId.
getParameterDefinitions().
stream().
map(this::toModel).
collect(Collectors.toList());
return new ActionDefinition(
actionDefinitionId.getName(), // ID is a synonym for name.
actionDefinitionId.getName(),
actionDefinitionId.getTitle(),
actionDefinitionId.getDescription(),
toShortQNames(actionDefinitionId.getApplicableTypes()),
actionDefinitionId.getAdhocPropertiesAllowed(),
actionDefinitionId.getTrackStatus(),
paramDefs);
}
示例4: createParamDefinitionsByName
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* Create a map of the definitions to use for subsequent calls
*/
private void createParamDefinitionsByName()
{
this.paramDefinitionsByName = new HashMap<Locale, Map<String, ParameterDefinition>>();
for (Locale locale : this.parameterDefinitions.keySet())
{
Map<String, ParameterDefinition> namedDefinitions = new HashMap<String, ParameterDefinition>();
this.paramDefinitionsByName.put(locale, namedDefinitions);
List<ParameterDefinition> localizedDefinitions = this.parameterDefinitions.get(locale);
if (localizedDefinitions!= null && localizedDefinitions.size()>0)
{
for (ParameterDefinition definition : localizedDefinitions)
{
namedDefinitions.put(definition.getName(), definition);
}
}
}
}
示例5: hasDuplicateNames
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* Determines whether the list of parameter definitions contains duplicate
* names of not.
*
* @param parameterDefinitions a list of parameter definitions
* @return true if there are name duplications, false
* otherwise
*/
private boolean hasDuplicateNames(Map<Locale, List<ParameterDefinition>> parameterDefinitions)
{
boolean result = false;
if (parameterDefinitions != null)
{
for (List<ParameterDefinition> localizedDefinitions : parameterDefinitions.values())
{
result = hasDuplicateNames(localizedDefinitions);
if (result)
{
break;
}
}
}
return result;
}
示例6: getParameterDefintion
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* @see org.alfresco.service.cmr.action.ParameterizedItemDefinition#getParameterDefintion(java.lang.String)
*/
public ParameterDefinition getParameterDefintion(String name)
{
ParameterDefinition result = null;
if (null != paramDefinitionsByName)
{
Set<Locale> locales = paramDefinitionsByName.keySet();
Locale match = I18NUtil.getNearestLocale(I18NUtil.getLocale(), locales);
Map<String, ParameterDefinition> localizedDefinitionsByName = paramDefinitionsByName.get(match);
if (null == localizedDefinitionsByName)
{
localizedDefinitionsByName = paramDefinitionsByName.get(Locale.ROOT);
}
result = (null == localizedDefinitionsByName) ? (null) : (localizedDefinitionsByName.get(name));
}
return result;
}
示例7: checkMandatoryProperties
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* Checked whether all the mandatory parameters for the rule item have been assigned.
*
* @param ruleItem the rule item
* @param ruleItemDefinition the rule item definition
*/
protected void checkMandatoryProperties(ParameterizedItem ruleItem, ParameterizedItemDefinition ruleItemDefinition)
{
List<ParameterDefinition> definitions = ruleItemDefinition.getParameterDefinitions();
if (definitions!= null && definitions.size()>0)
{
for (ParameterDefinition definition : definitions)
{
if (definition.isMandatory() == true)
{
// Check that a value has been set for the mandatory parameter
if (ruleItem.getParameterValue(definition.getName()) == null)
{
// Error since a mandatory parameter has a null value
throw new RuleServiceException(
MessageFormat.format(ERR_MAND_PROP, new Object[]{definition.getName(), ruleItemDefinition.getName()}));
}
}
}
}
}
示例8: addParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
*/
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_PACKAGE_NAME, DataTypeDefinition.TEXT, true,
getParamDisplayLabel(PARAM_PACKAGE_NAME)));
paramList.add(new ParameterDefinitionImpl(PARAM_ENCODING, DataTypeDefinition.TEXT, true,
getParamDisplayLabel(PARAM_ENCODING)));
paramList.add(new ParameterDefinitionImpl(PARAM_STORE, DataTypeDefinition.TEXT, true,
getParamDisplayLabel(PARAM_STORE)));
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, true,
getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
paramList.add(new ParameterDefinitionImpl(PARAM_INCLUDE_CHILDREN, DataTypeDefinition.BOOLEAN, false,
getParamDisplayLabel(PARAM_INCLUDE_CHILDREN)));
paramList.add(new ParameterDefinitionImpl(PARAM_INCLUDE_SELF, DataTypeDefinition.BOOLEAN, false,
getParamDisplayLabel(PARAM_INCLUDE_SELF)));
}
示例9: addParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* Add parameter definitions
*/
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_THUMBNAIL_DEFINITION_NAME, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_THUMBNAIL_DEFINITION_NAME)));
paramList.add(new ParameterDefinitionImpl(PARAM_RETRY_PERIOD, DataTypeDefinition.LONG, true, getParamDisplayLabel(PARAM_RETRY_PERIOD)));
paramList.add(new ParameterDefinitionImpl(PARAM_RETRY_COUNT, DataTypeDefinition.INT, true, getParamDisplayLabel(PARAM_RETRY_COUNT)));
paramList.add(new ParameterDefinitionImpl(PARAM_QUIET_PERIOD, DataTypeDefinition.LONG, true, getParamDisplayLabel(PARAM_QUIET_PERIOD)));
paramList.add(new ParameterDefinitionImpl(PARAM_QUIET_PERIOD_RETRIES_ENABLED, DataTypeDefinition.BOOLEAN, true, getParamDisplayLabel(PARAM_QUIET_PERIOD_RETRIES_ENABLED)));
}
示例10: addParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
*/
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_CONTENT_PROPERTY)));
paramList.add(new ParameterDefinitionImpl(PARAM_THUMBNAIL_NODE, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_THUMBNAIL_NODE)));
}
示例11: addParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
*/
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_THUMBNAIL_DEFINITION_NAME, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_THUMBNAIL_DEFINITION_NAME), false));
paramList.add(new ParameterDefinitionImpl(PARAM_FAILURE_DATETIME, DataTypeDefinition.DATETIME, true, getParamDisplayLabel(PARAM_FAILURE_DATETIME), false));
}
示例12: processActionConstraints
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* This method creates a list of {@link FieldConstraint field constraints}, if there are any.
*
* @return a List<FieldConstraint> if there are any, else Collections.emptyList()
*/
private List<FieldConstraint> processActionConstraints(ParameterDefinition parameterDef,
ActionService actionService)
{
List<FieldConstraint> fieldConstraints = Collections.emptyList();
String paramConstraintName = parameterDef.getParameterConstraintName();
if (paramConstraintName != null)
{
ParameterConstraint paramConstraint = actionService.getParameterConstraint(paramConstraintName);
if (paramConstraint == null)
{
throw new FormException("ParameterConstraint name '" + paramConstraintName + "' not recognised.");
}
else
{
// This map is of allowedValue : display label for that value.
Map<String, String> allowableValuesMap = paramConstraint.getAllowableValues();
// We need to concatenate each key-value entry into a String like "value|displaylabel"
// Then the FormService can display the labels but deal with the values as the underlying data.
List<String> pipeSeparatedAllowedValues = new ArrayList<String>(allowableValuesMap.size());
for (Map.Entry<String, String> entry : allowableValuesMap.entrySet())
{
pipeSeparatedAllowedValues.add(entry.getKey() + "|" + entry.getValue());
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("allowedValues", pipeSeparatedAllowedValues);
// Finally wrap it up in a parameter map.
fieldConstraints = new ArrayList<FieldConstraint>(allowableValuesMap.size());
fieldConstraints.add(new FieldConstraint("LIST", params));
}
}
return fieldConstraints;
}
示例13: addParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* Add the parameter definitions
*/
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
paramList.add(new ParameterDefinitionImpl(PARAM_FAILING_PERSON_NODEREF, DataTypeDefinition.NODE_REF, true, "Failing Person NodeRef"));
paramList.add(new ParameterDefinitionImpl(PARAM_PERSON_NODEREF, DataTypeDefinition.NODE_REF, true, "Person NodeRef"));
paramList.add(new ParameterDefinitionImpl(PARAM_USERNAME, DataTypeDefinition.TEXT, true, "Username"));
}
示例14: getParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<ParameterDefinition> getParameterDefinitions()
{
List<ParameterDefinition> paramDefs = new ArrayList<ParameterDefinition>(2);
paramDefs.add(new ParameterDefinitionImpl(QUERY_KEY, DataTypeDefinition.TEXT, true, "Query"));
paramDefs.add(new ParameterDefinitionImpl(STORE_TYPE_KEY, DataTypeDefinition.TEXT, false, "Store Type"));
paramDefs.add(new ParameterDefinitionImpl(STORE_ID_KEY, DataTypeDefinition.TEXT, false, "Store Id"));
return paramDefs;
}
示例15: getParameterDefinitions
import org.alfresco.service.cmr.action.ParameterDefinition; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<ParameterDefinition> getParameterDefinitions()
{
List<ParameterDefinition> paramDefs = new ArrayList<ParameterDefinition>(2);
paramDefs.add(new ParameterDefinitionImpl(TYPE_KEY, DataTypeDefinition.QNAME, false, "Type"));
paramDefs.add(new ParameterDefinitionImpl(ASPECT_KEY, DataTypeDefinition.QNAME, false, "Aspect"));
return paramDefs;
}