• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassDefinition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ClassDefinition类属于org.alfresco.service.cmr.dictionary包,在下文中一共展示了ClassDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: validateTypeAspectDependency

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
private void validateTypeAspectDependency(Collection<? extends ClassDefinition> parentDefs, Collection<? extends ClassDefinition> childDefs)
{
    for (ClassDefinition parentClassDef : parentDefs)
    {
        for (ClassDefinition childClassDef : childDefs)
        {
            if (parentClassDef.getName().equals(childClassDef.getParentName()))
            {
                Object[] msgParams = new Object[] { parentClassDef.getName().toPrefixString(),
                            childClassDef.getName().toPrefixString(),
                            childClassDef.getModel().getName().getLocalName() };

                if (parentClassDef instanceof TypeDefinition)
                {
                    throw new CustomModelException.CustomModelConstraintException(MSG_FAILED_DEACTIVATION_TYPE_DEPENDENCY, msgParams);
                }
                else
                {
                    throw new CustomModelException.CustomModelConstraintException(MSG_FAILED_DEACTIVATION_ASPECT_DEPENDENCY, msgParams);
                }
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:CustomModelServiceImpl.java


示例2: isExcludedAspectProperty

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * Is the property unexportable?
 */
private boolean isExcludedAspectProperty(QName[] excludeAspects, QName propertyQName)
{
    PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
    if (propDef == null)
    {
        return false;
    }
    
    ClassDefinition classDef = propDef.getContainerClass();
    if (classDef == null || !classDef.isAspect())
    {
        return false;
    }
    
    return isExcludedAspect(excludeAspects, classDef.getName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ExporterComponent.java


示例3: isExcludedAspectAssociation

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * Is the association unexportable?
 */
private boolean isExcludedAspectAssociation(QName[] excludeAspects, QName associationQName)
{
    AssociationDefinition assocDef = dictionaryService.getAssociation(associationQName);
    if (assocDef == null)
    {
        return false;
    }
    
    ClassDefinition classDef = assocDef.getSourceClass();
    if (classDef == null || !classDef.isAspect())
    {
        return false;
    }
    
    return isExcludedAspect(excludeAspects, classDef.getName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ExporterComponent.java


示例4: generaliseBinding

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public BehaviourBinding generaliseBinding()
{
    BehaviourBinding generalisedBinding = null;
    ClassDefinition classDefinition = getDictionary().getClass(getClassQName());
    
    if (classDefinition == null)
    {
        // The class definition doesn't exist so there can be no behaviour bound
        return null;
    }
    
    if (activeFeatureQName.equals(ALL_FEATURES))
    {
        QName parentClassName = classDefinition.getParentName();
        if (parentClassName != null)
        {
            generalisedBinding = new ClassFeatureBehaviourBinding(getDictionary(), getNodeRef(), parentClassName, featureQName, featureQName);
        }
    }
    else
    {
        generalisedBinding = new ClassFeatureBehaviourBinding(getDictionary(), getNodeRef(), getClassQName(), featureQName, ALL_FEATURES);
    }
    
    return generalisedBinding;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ClassFeatureBehaviourBinding.java


示例5: bindClassBehaviour

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public BehaviourDefinition<ClassBehaviourBinding> bindClassBehaviour(QName policy, QName classRef, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", classRef);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    ClassDefinition classDefinition = dictionary.getClass(classRef);
    if (classDefinition == null)
    {
        throw new IllegalArgumentException("Class " + classRef + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassBehaviourBinding binding = new ClassBehaviourBinding(dictionary, classRef);
    BehaviourDefinition<ClassBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Class, policy, binding, behaviour);
    getClassBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for class " + classRef);

    return definition;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:PolicyComponentImpl.java


示例6: bindPropertyBehaviour

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public BehaviourDefinition<ClassFeatureBehaviourBinding> bindPropertyBehaviour(QName policy, QName className, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", className);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    ClassDefinition classDefinition = dictionary.getClass(className);
    if (classDefinition == null)
    {
        throw new IllegalArgumentException("Class " + className + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassFeatureBehaviourBinding binding = new ClassFeatureBehaviourBinding(dictionary, className, FEATURE_WILDCARD);
    BehaviourDefinition<ClassFeatureBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Property, policy, binding, behaviour);
    getPropertyBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for property " + FEATURE_WILDCARD + " of class " + className);

    return definition;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:PolicyComponentImpl.java


示例7: bindAssociationBehaviour

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public BehaviourDefinition<ClassFeatureBehaviourBinding> bindAssociationBehaviour(QName policy, QName className, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", className);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    ClassDefinition classDefinition = dictionary.getClass(className);
    if (classDefinition == null)
    {
        throw new IllegalArgumentException("Class " + className + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassFeatureBehaviourBinding binding = new ClassFeatureBehaviourBinding(dictionary, className, FEATURE_WILDCARD);
    BehaviourDefinition<ClassFeatureBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Association, policy, binding, behaviour);
    getAssociationBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for association " + FEATURE_WILDCARD + " of class " + className);

    return definition;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:PolicyComponentImpl.java


示例8: generaliseBinding

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public BehaviourBinding generaliseBinding()
{
    BehaviourBinding generalisedBinding = null;
    ClassDefinition classDefinition = dictionary.getClass(classQName);
    if (classDefinition == null)
    {
        // The class definition doesn't exist so there can be no behaviour bound
        return null;
    }
    
    QName parentClassName = classDefinition.getParentName();
    if (parentClassName != null)
    {
        generalisedBinding = new ClassBehaviourBinding(dictionary, parentClassName);
    }
    return generalisedBinding;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ClassBehaviourBinding.java


示例9: addPropertyCollection

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * Adds a collection property to the node
 * 
 * @param property QName
 */
public void addPropertyCollection(QName property)
{
    // Do not import properties of sys:referenceable or cm:versionable or cm:copiedfrom
    // TODO: Make this configurable...
    PropertyDefinition propDef = getDictionaryService().getProperty(property);
    ClassDefinition classDef = (propDef == null) ? null : propDef.getContainerClass();
    if (classDef != null)
    {
        if (!isImportableClass(classDef.getName()))
        {
            return;
        }
    }
    
    // create collection and assign to property
    List<Serializable>values = new ArrayList<Serializable>();
    nodeProperties.put(property, (Serializable)values);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:NodeContext.java


示例10: getMissingProperties

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * @param existingProperties    existing node properties
 * @param classQNames           the types or aspects to introspect
 * @return                      Returns any properties that should be added
 */
private Map<QName, Serializable> getMissingProperties(Map<QName, Serializable> existingProperties, Set<QName> classQNames)
{
    Map<QName, Serializable> allDefaultProperties = new HashMap<QName, Serializable>(17);
    for (QName classQName : classQNames)
    {
        ClassDefinition classDefinition = dictionaryService.getClass(classQName);
        if (classDefinition == null)
        {
            continue;
        }
        // Get the default properties for this type/aspect
        Map<QName, Serializable> defaultProperties = getDefaultProperties(classQName);
        if (defaultProperties.size() > 0)
        {
            allDefaultProperties.putAll(defaultProperties);
        }
    }
    // Work out what is missing
    Map<QName, Serializable> missingProperties = new HashMap<QName, Serializable>(allDefaultProperties);
    missingProperties.keySet().removeAll(existingProperties.keySet());
    // Done
    return missingProperties;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:DbNodeServiceImpl.java


示例11: testArchive

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
public void testArchive()
{
    QName testFileQName = QName.createQName(TEST_URL, "file");
    ClassDefinition fileClassDef = service.getClass(testFileQName);
    assertTrue("File type should have the archive flag", fileClassDef.getArchive());

    QName testFileDerivedQName = QName.createQName(TEST_URL, "file-derived");
    ClassDefinition fileDerivedClassDef = service.getClass(testFileDerivedQName);
    assertTrue("Direct derived File type should have the archive flag", fileDerivedClassDef.getArchive());

    QName testFileDerivedNoArchiveQName = QName.createQName(TEST_URL, "file-derived-no-archive");
    ClassDefinition fileDerivedNoArchiveClassDef = service.getClass(testFileDerivedNoArchiveQName);
    assertFalse("Derived File with archive override type should NOT have the archive flag",
            fileDerivedNoArchiveClassDef.getArchive());

    QName testFolderQName = QName.createQName(TEST_URL, "folder");
    ClassDefinition folderClassDef = service.getClass(testFolderQName);
    assertNull("Folder type should not have the archive flag", folderClassDef.getArchive());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:RepoDictionaryDAOTest.java


示例12: getClassImpl

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
protected ClassDefinition getClassImpl(QName className)
{
	ClassDefinition classDef = null;

    List<CompiledModel> models = getModelsForUri(className.getNamespaceURI());
    if(models != null && models.size() > 0)
    {
     for (CompiledModel model : models)
     {
     	classDef = model.getClass(className);
     	if (classDef != null)
     	{
     		break;
     	}
     }
    }

    return classDef;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:20,代码来源:AbstractDictionaryRegistry.java


示例13: testArchive

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
@Test
public void testArchive()
{
    QName testFileQName = QName.createQName(TEST_URL, "file");
    ClassDefinition fileClassDef = service.getClass(testFileQName);
    assertTrue("File type should have the archive flag", fileClassDef.getArchive());

    QName testFileDerivedQName = QName.createQName(TEST_URL, "file-derived");
    ClassDefinition fileDerivedClassDef = service.getClass(testFileDerivedQName);
    assertTrue("Direct derived File type should have the archive flag", fileDerivedClassDef.getArchive());

    QName testFileDerivedNoArchiveQName = QName.createQName(TEST_URL, "file-derived-no-archive");
    ClassDefinition fileDerivedNoArchiveClassDef = service.getClass(testFileDerivedNoArchiveQName);
    assertFalse("Derived File with archive override type should NOT have the archive flag",
            fileDerivedNoArchiveClassDef.getArchive());

    QName testFolderQName = QName.createQName(TEST_URL, "folder");
    ClassDefinition folderClassDef = service.getClass(testFolderQName);
    assertNull("Folder type should not have the archive flag", folderClassDef.getArchive());
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:21,代码来源:DictionaryDAOTest.java


示例14: executeImpl

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * Override method from DeclarativeWebScript
 */
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
{
    Map<String, Object> model = new HashMap<String, Object>(3);
    Map<QName, ClassDefinition> classdef = new HashMap<QName, ClassDefinition>();
    Map<QName, Collection<PropertyDefinition>> propdef = new HashMap<QName, Collection<PropertyDefinition>>();
    Map<QName, Collection<AssociationDefinition>> assocdef = new HashMap<QName, Collection<AssociationDefinition>>();

    QName classQname = getClassQname(req);
    classdef.put(classQname, this.dictionaryservice.getClass(classQname));
    propdef.put(classQname, this.dictionaryservice.getClass(classQname).getProperties().values());
    assocdef.put(classQname, this.dictionaryservice.getClass(classQname).getAssociations().values());

    model.put(MODEL_PROP_KEY_CLASS_DETAILS, classdef.values());
    model.put(MODEL_PROP_KEY_PROPERTY_DETAILS, propdef.values());
    model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, assocdef.values());
    model.put(MODEL_PROP_KEY_MESSAGE_LOOKUP, this.dictionaryservice);

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


示例15: 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


示例16: 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


示例17: afterPropertiesSet_validateSelectors

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
private void afterPropertiesSet_validateSelectors()
{
    PropertyCheck.mandatory(this, "selectorClassName", this.selectorClassName);
    PropertyCheck.mandatory(this, "selectorPropertyName", this.selectorPropertyName);

    this.selectorClassQName = QName.resolveToQName(this.namespaceService, this.selectorClassName);
    this.selectorPropertyQName = QName.resolveToQName(this.namespaceService, this.selectorPropertyName);
    PropertyCheck.mandatory(this, "selectorClassQName", this.selectorClassQName);
    PropertyCheck.mandatory(this, "selectorPropertyQName", this.selectorPropertyQName);

    final ClassDefinition classDefinition = this.dictionaryService.getClass(this.selectorClassQName);
    if (classDefinition == null)
    {
        throw new IllegalStateException(this.selectorClassName + " is not a valid content model class");
    }

    final PropertyDefinition propertyDefinition = this.dictionaryService.getProperty(this.selectorPropertyQName);
    if (propertyDefinition == null || !DataTypeDefinition.TEXT.equals(propertyDefinition.getDataType().getName())
            || propertyDefinition.isMultiValued())
    {
        throw new IllegalStateException(
                this.selectorPropertyName + " is not a valid content model property of type single-valued d:text");
    }
}
 
开发者ID:Acosix,项目名称:alfresco-simple-content-stores,代码行数:25,代码来源:SelectorPropertyContentStore.java


示例18: createIsNotNull

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
protected Query createIsNotNull(String queryText, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws ParseException
{
    PropertyDefinition pd = matchPropertyDefinition(queryText);
    if (pd != null)
    {
        ClassDefinition containerClass = pd.getContainerClass();
        QName container = containerClass.getName();
        BooleanQuery query = new BooleanQuery();
        String classType = containerClass.isAspect() ? FIELD_ASPECT : FIELD_TYPE;
        Query typeQuery = getFieldQuery(classType, container.toString(), analysisMode, luceneFunction);
        Query presenceQuery = getWildcardQuery(PROPERTY_FIELD_PREFIX + pd.getName().toString(), "*");
        if ((typeQuery != null) && (presenceQuery != null))
        {
            // query.add(typeQuery, Occur.MUST);
            query.add(presenceQuery, Occur.MUST);
        }
        return query;
    }
    else
    {
        return getFieldQueryImpl(FIELD_ISNOTNULL, queryText, analysisMode, luceneFunction);
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:24,代码来源:AbstractLuceneQueryParser.java


示例19: createIsUnsetQuery

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
protected Query createIsUnsetQuery(String queryText, AnalysisMode analysisMode, LuceneFunction luceneFunction) throws ParseException
{
    PropertyDefinition pd = matchPropertyDefinition(queryText);
    if (pd != null)
    {
        ClassDefinition containerClass = pd.getContainerClass();
        QName container = containerClass.getName();
        BooleanQuery query = new BooleanQuery();
        String classType = containerClass.isAspect() ? FIELD_ASPECT : FIELD_TYPE;
        Query typeQuery = getFieldQuery(classType, container.toString(), analysisMode, luceneFunction);
        Query presenceQuery = getWildcardQuery(PROPERTY_FIELD_PREFIX + pd.getName().toString(), "*");
        if ((typeQuery != null) && (presenceQuery != null))
        {
            query.add(typeQuery, Occur.MUST);
            query.add(presenceQuery, Occur.MUST_NOT);
        }
        return query;
    }
    else
    {
        return getFieldQueryImpl(FIELD_ISUNSET, queryText, analysisMode, luceneFunction);
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:24,代码来源:AbstractLuceneQueryParser.java


示例20: isRecordMetadataProperty

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入依赖的package包/类
/**
 * @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#isRecordMetadataProperty(org.alfresco.service.namespace.QName)
 */
@Override
public boolean isRecordMetadataProperty(QName property)
{
    boolean result = false;
    PropertyDefinition propertyDefinition = dictionaryService.getProperty(property);
    if (propertyDefinition != null)
    {
        ClassDefinition classDefinition = propertyDefinition.getContainerClass();
        if (classDefinition != null &&
            getRecordMetadataAspectsMap().containsKey(classDefinition.getName()))
        {
            result = true;
        }
    }
    return result;
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:20,代码来源:RecordServiceImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlJavaTypeAdapterWriter类代码示例发布时间:2022-05-22
下一篇:
Java Screenshot类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap