当前位置: 首页>>代码示例>>Java>>正文


Java ClassDefinition.getParentClassDefinition方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.dictionary.ClassDefinition.getParentClassDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDefinition.getParentClassDefinition方法的具体用法?Java ClassDefinition.getParentClassDefinition怎么用?Java ClassDefinition.getParentClassDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.dictionary.ClassDefinition的用法示例。


在下文中一共展示了ClassDefinition.getParentClassDefinition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertToCustomModelProperty

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
private List<CustomModelProperty> convertToCustomModelProperty(ClassDefinition classDefinition, boolean includeInherited)
{
    Collection<PropertyDefinition> ownProperties = null;
    ClassDefinition parentDef = classDefinition.getParentClassDefinition();
    if (!includeInherited && parentDef != null)
    {
        // Remove inherited properties
        ownProperties = removeRightEntries(classDefinition.getProperties(), parentDef.getProperties()).values();
    }
    else
    {
        ownProperties = classDefinition.getProperties().values();
    }

    List<CustomModelProperty> customProperties = new ArrayList<>(ownProperties.size());
    for (PropertyDefinition propDef : ownProperties)
    {
        customProperties.add(new CustomModelProperty(propDef, dictionaryService));
    }

    return customProperties;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:CustomModelsImpl.java

示例2: getTypesToExclude

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
/**
 * @param taskType type of the task
 * @return all types (and aspects) which properties should not be used for form-model elements
 */
protected Set<QName> getTypesToExclude(TypeDefinition taskType)
{
    HashSet<QName> typesToExclude = new HashSet<QName>();
    
    ClassDefinition parentClassDefinition = taskType.getParentClassDefinition();
    boolean contentClassFound = false;
    while(parentClassDefinition != null) 
    {
        if(contentClassFound)
        {
            typesToExclude.add(parentClassDefinition.getName());
        }
        else if(ContentModel.TYPE_CONTENT.equals(parentClassDefinition.getName()))
        {
            // All parents of "cm:content" should be ignored as well for fetching start-properties 
            typesToExclude.add(ContentModel.TYPE_CONTENT);
            typesToExclude.addAll(parentClassDefinition.getDefaultAspectNames());
            contentClassFound = true;
        }
        parentClassDefinition = parentClassDefinition.getParentClassDefinition();
    }
    return typesToExclude;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:28,代码来源:WorkflowRestImpl.java

示例3: Property

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
/**
 * Construct
 * 
 * @param qname property name
 * @param value property values
 */
@SuppressWarnings("unchecked")
public Property(QName qname, Serializable value, NodeRef nodeRef)
{
    this.name = new QNameBean(qname);

    residual = true;

    PropertyDefinition propDef = getDictionaryService().getProperty(qname);
    if (propDef != null)
    {
        QName qn = propDef.getDataType().getName();
        typeName = qn != null ? new QNameBean(propDef.getDataType().getName()) : null;

        // ALF-21950 We need to check if the property belongs to the type of the node or to their ancestors
        if(propDef.getContainerClass().isAspect())
        {
            residual = false;
        }
        else
        {
            ClassDefinition classDef = getDictionaryService().getClass(getNodeService().getType(nodeRef));
            boolean found = false;

            while(classDef != null)
            {
                found = searchInClassDefinition(qname, classDef);
                if(found)
                {
                    break;
                }
                classDef = classDef.getParentClassDefinition();
            }
            residual = !found;
        }
    }

    // handle multi/single values
    final List<Value> values;
    if (value instanceof Collection)
    {
        Collection<Serializable> oldValues = (Collection<Serializable>) value;
        values = new ArrayList<Value>(oldValues.size());
        isCollection = true;
        for (Serializable multiValue : oldValues)
        {
            values.add(new Value(multiValue instanceof QName ? new QNameBean((QName) multiValue) : multiValue));
        }
    }
    else
    {
        values = Collections.singletonList(new Value(value instanceof QName ? new QNameBean((QName) value) : value));
    }
    this.values = values;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:61,代码来源:NodeBrowserPost.java


注:本文中的org.alfresco.service.cmr.dictionary.ClassDefinition.getParentClassDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。