本文整理汇总了Java中org.alfresco.service.cmr.dictionary.TypeDefinition.getDefaultAspects方法的典型用法代码示例。如果您正苦于以下问题:Java TypeDefinition.getDefaultAspects方法的具体用法?Java TypeDefinition.getDefaultAspects怎么用?Java TypeDefinition.getDefaultAspects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.getDefaultAspects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTypePermissions
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
/**
* Support to add permissions for types
*
* @param type QName
* @param permissions Set<PermissionReference>
* @param exposedOnly boolean
*/
private void addTypePermissions(QName type, Set<PermissionReference> permissions, boolean exposedOnly)
{
TypeDefinition typeDef = dictionaryService.getType(type);
if (typeDef == null)
{
// the type definition is no longer in the dictionary - ignore
return;
}
if (typeDef.getParentName() != null)
{
PermissionSet permissionSet = permissionSets.get(type);
if (!exposedOnly || (permissionSet == null) || permissionSet.exposeAll())
{
addTypePermissions(typeDef.getParentName(), permissions, exposedOnly);
}
}
for (AspectDefinition ad : typeDef.getDefaultAspects())
{
addAspectPermissions(ad.getName(), permissions, exposedOnly);
}
mergePermissions(permissions, type, exposedOnly, true);
}
示例2: setupStartTaskParameters
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
private void setupStartTaskParameters(TypeDefinition typeDef, Map<QName, Serializable> params)
{
// build a complete anonymous type for the start task
List<AspectDefinition> aspects = typeDef.getDefaultAspects();
List<QName> aspectNames = new ArrayList<QName>(aspects.size());
getMandatoryAspects(typeDef, aspectNames);
ClassDefinition startTaskDef = dictionaryService.getAnonymousType(typeDef.getName(), aspectNames);
// apply default values
Map<QName, PropertyDefinition> propertyDefs = startTaskDef.getProperties();
for (Map.Entry<QName, PropertyDefinition> entry : propertyDefs.entrySet())
{
String defaultValue = entry.getValue().getDefaultValue();
if (params.get(entry.getKey()) == null)
{
if (defaultValue != null)
{
params.put(entry.getKey(), (Serializable)DefaultTypeConverter.INSTANCE.convert(entry.getValue().getDataType(), defaultValue));
}
}
else
{
params.put(entry.getKey(), (Serializable)DefaultTypeConverter.INSTANCE.convert(entry.getValue().getDataType(), params.get(entry.getKey())));
}
}
if (params.containsKey(WorkflowModel.ASSOC_ASSIGNEE))
{
String value = (String)params.get(WorkflowModel.ASSOC_ASSIGNEE);
ArrayList<NodeRef> assignees = new ArrayList<NodeRef>();
assignees.add(personService.getPerson(value));
params.put(WorkflowModel.ASSOC_ASSIGNEE, assignees);
}
params.put(WorkflowModel.ASSOC_PACKAGE, workflowService.createPackage(null));
}
示例3: getDefaultAspects
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
private Set<QName> getDefaultAspects(QName sourceNodeTypeQName)
{
TypeDefinition sourceNodeTypeDef = dictionaryService.getType(sourceNodeTypeQName);
if (sourceNodeTypeDef == null)
{
return Collections.emptySet();
}
Set<QName> defaultAspectQNames = new HashSet<QName>(7);
for (AspectDefinition aspectDef : sourceNodeTypeDef.getDefaultAspects())
{
defaultAspectQNames.add(aspectDef.getName());
}
// Done
return defaultAspectQNames;
}
示例4: getAnonymousType
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
/**
*
* {@inheritDoc}
*/
public TypeDefinition getAnonymousType(QName name)
{
TypeDefinition typeDef = getType(name);
List<AspectDefinition> aspects = typeDef.getDefaultAspects(true);
List<QName> aspectNames = new ArrayList<QName>(aspects.size());
getMandatoryAspects(typeDef, aspectNames);
return getAnonymousType(typeDef.getName(), aspectNames);
}