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


Java ClassDefinition.getName方法代码示例

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


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

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

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

示例3: validateDeleteClass

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
private void validateDeleteClass(final Tenant tenant, final ClassDefinition classDef)
{
    final String classType = "TYPE";
    final QName className = classDef.getName();

    String tenantDomain = "for tenant ["
            + (tenant == null ? TenantService.DEFAULT_DOMAIN : tenant.getTenantDomain()) + "]";

    // We need a separate transaction to do the qname delete "check"
    transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
    {
        @Override
        public Void execute() throws Throwable
        {
            try
            {
                // The class QName may not have been created in the database if no
                // properties have been created that use it, so check first and then
                // try to delete it.
                if(qnameDAO.getQName(className) != null)
                {
                    qnameDAO.deleteQName(className);
                }
                throw new ModelNotInUseException("Class " + className + " not in use");
            }
            catch(DataIntegrityViolationException e)
            {
                // catch data integrity violation e.g. foreign key constraint exception
                logger.debug(e);
                throw new ModelInUseException("Cannot delete model, class "
                        + className + " is in use");
            }
        }
    }, false, true);


    // check against workflow task usage
    for (WorkflowDefinition workflowDef : workflowService.getDefinitions())
    {
        for (WorkflowTaskDefinition workflowTaskDef : workflowService.getTaskDefinitions(workflowDef.getId()))
        {
            TypeDefinition workflowTypeDef = workflowTaskDef.metadata;
            if (workflowTypeDef.getName().equals(className))
            {
                throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomain + " - found task definition in workflow " 
                        + workflowDef.getName() + " with " + classType + " '" + className + "'");
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:51,代码来源:ModelValidatorImpl.java

示例4: DocumentTypeDefinitionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public DocumentTypeDefinitionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping accessorMapping, 
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new DocumentTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_DOCUMENT);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    if (BaseTypeId.CMIS_DOCUMENT.value().equals(typeId))
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
    } else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
        if (cmisMapping.isValidCmisDocument(parentQName))
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(BaseTypeId.CMIS_DOCUMENT, parentQName));
        }
    }

    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    typeDef.setIsCreatable(true);
    typeDef.setIsQueryable(true);
    typeDef.setIsFulltextIndexed(true);
    typeDef.setIsControllablePolicy(false);
    typeDef.setIsControllableAcl(true);
    typeDef.setIsIncludedInSupertypeQuery(cmisClassDef.getIncludedInSuperTypeQuery());
    typeDef.setIsFileable(true);
    typeDef.setContentStreamAllowed(ContentStreamAllowed.ALLOWED);
    typeDef.setIsVersionable(true);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, accessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(accessorMapping, BaseTypeId.CMIS_DOCUMENT);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:48,代码来源:DocumentTypeDefinitionWrapper.java

示例5: SecondaryTypeDefinitionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public SecondaryTypeDefinitionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping propertyAccessorMapping, 
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new SecondaryTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_SECONDARY);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    if (BaseTypeId.CMIS_SECONDARY.value().equals(typeId))
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
    }
    else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
        if (parentQName == null)
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(CMISMapping.SECONDARY_TYPES_QNAME));
        } else if (cmisMapping.isValidCmisSecondaryType(parentQName))
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(BaseTypeId.CMIS_SECONDARY, parentQName));
        } else
        {
            throw new IllegalStateException("The CMIS type model should ignore aspects that inherit from excluded aspects");
        }
    }

    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    typeDef.setIsCreatable(false);
    typeDef.setIsQueryable(true);
    typeDef.setIsFulltextIndexed(true);
    typeDef.setIsControllablePolicy(false);
    typeDef.setIsControllableAcl(false);
    typeDef.setIsIncludedInSupertypeQuery(cmisClassDef.getIncludedInSuperTypeQuery());
    typeDef.setIsFileable(false);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, propertyAccessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(propertyAccessorMapping, BaseTypeId.CMIS_SECONDARY);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:53,代码来源:SecondaryTypeDefinitionWrapper.java

示例6: FolderTypeDefintionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public FolderTypeDefintionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping accessorMapping, 
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new FolderTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_FOLDER);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    boolean isSystemFolder = false;
    if (BaseTypeId.CMIS_FOLDER.value().equals(typeId))
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
    } else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
        if (cmisMapping.isValidCmisFolder(parentQName))
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(BaseTypeId.CMIS_FOLDER, parentQName));
        }

        if (alfrescoName.equals(ContentModel.TYPE_SYSTEM_FOLDER)
                || cmisMapping.getDictionaryService().isSubClass(alfrescoName, ContentModel.TYPE_SYSTEM_FOLDER))
        {
            isSystemFolder = true;
        }
    }

    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    typeDef.setIsCreatable(!isSystemFolder);
    typeDef.setIsQueryable(true);
    typeDef.setIsFulltextIndexed(true);
    typeDef.setIsControllablePolicy(false);
    typeDef.setIsControllableAcl(true);
    typeDef.setIsIncludedInSupertypeQuery(cmisClassDef.getIncludedInSuperTypeQuery());
    typeDef.setIsFileable(true);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, accessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(accessorMapping, BaseTypeId.CMIS_FOLDER);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:53,代码来源:FolderTypeDefintionWrapper.java

示例7: ItemTypeDefinitionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public ItemTypeDefinitionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping accessorMapping, 
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new ItemTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_ITEM);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    if (BaseTypeId.CMIS_ITEM.value().equals(typeId) )
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
    }  
    else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
        if(parentQName != null)
        {         
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(BaseTypeId.CMIS_ITEM, parentQName));
        }
    }

    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    if (BaseTypeId.CMIS_ITEM.value().equals(typeId) )
    {
    	typeDef.setIsCreatable(false);   // cmis:item is abstract
    	 // TEMP work around for select * from cmis:item which lists folders and files
    	typeDef.setIsQueryable(false);
    }
    else
    {
    	typeDef.setIsCreatable(true);
    	typeDef.setIsQueryable(true);
    }
  
    typeDef.setIsFulltextIndexed(true);
    typeDef.setIsControllablePolicy(true);
    typeDef.setIsControllableAcl(true);
    typeDef.setIsIncludedInSupertypeQuery(cmisClassDef.getIncludedInSuperTypeQuery());
    typeDef.setIsFileable(false);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, accessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(accessorMapping, BaseTypeId.CMIS_ITEM);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:57,代码来源:ItemTypeDefinitionWrapper.java

示例8: PolicyTypeDefintionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public PolicyTypeDefintionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping propertyAccessorMapping, 
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new PolicyTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_POLICY);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    if (BaseTypeId.CMIS_POLICY.value().equals(typeId))
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
    } else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
        if (parentQName == null)
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(CMISMapping.ASPECTS_QNAME));
        } else if (cmisMapping.isValidCmisPolicy(parentQName))
        {
            typeDef.setParentTypeId(cmisMapping.getCmisTypeId(BaseTypeId.CMIS_POLICY, parentQName));
        } else
        {
            throw new IllegalStateException("The CMIS type model should ignore aspects that inherit from excluded aspects");
        }
    }

    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    typeDef.setIsCreatable(false);
    typeDef.setIsQueryable(true);
    typeDef.setIsFulltextIndexed(true);
    typeDef.setIsControllablePolicy(false);
    typeDef.setIsControllableAcl(false);
    typeDef.setIsIncludedInSupertypeQuery(cmisClassDef.getIncludedInSuperTypeQuery());
    typeDef.setIsFileable(false);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, propertyAccessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(propertyAccessorMapping, BaseTypeId.CMIS_POLICY);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:52,代码来源:PolicyTypeDefintionWrapper.java

示例9: RelationshipTypeDefintionWrapper

import org.alfresco.service.cmr.dictionary.ClassDefinition; //导入方法依赖的package包/类
public RelationshipTypeDefintionWrapper(CMISMapping cmisMapping, PropertyAccessorMapping accessorMapping,
        PropertyLuceneBuilderMapping luceneBuilderMapping, String typeId, DictionaryService dictionaryService, ClassDefinition cmisClassDef)
{
    this.dictionaryService = dictionaryService;
    alfrescoName = cmisClassDef.getName();
    alfrescoClass = cmisMapping.getAlfrescoClass(alfrescoName);

    typeDef = new RelationshipTypeDefinitionImpl();

    typeDef.setBaseTypeId(BaseTypeId.CMIS_RELATIONSHIP);
    typeDef.setId(typeId);
    typeDef.setLocalName(alfrescoName.getLocalName());
    typeDef.setLocalNamespace(alfrescoName.getNamespaceURI());

    if (BaseTypeId.CMIS_RELATIONSHIP.value().equals(typeId))
    {
        typeDef.setQueryName(ISO9075.encodeSQL(typeId));
        typeDef.setParentTypeId(null);
        typeDef.setIsCreatable(false);
    } else
    {
        typeDef.setQueryName(ISO9075.encodeSQL(cmisMapping.buildPrefixEncodedString(alfrescoName)));
        typeDef.setParentTypeId(BaseTypeId.CMIS_RELATIONSHIP.value());
        typeDef.setIsCreatable(true);
    }
    
    typeDef.setDisplayName(null);
    typeDef.setDescription(null);

    typeDef.setIsQueryable(false);
    typeDef.setIsFulltextIndexed(false);
    typeDef.setIsControllablePolicy(false);
    typeDef.setIsControllableAcl(false);
    typeDef.setIsIncludedInSupertypeQuery(true);
    typeDef.setIsFileable(false);

    typeDefInclProperties = CMISUtils.copy(typeDef);
    setTypeDefinition(typeDef, typeDefInclProperties);

    createOwningPropertyDefinitions(cmisMapping, accessorMapping, luceneBuilderMapping, dictionaryService, cmisClassDef);
    createActionEvaluators(accessorMapping, BaseTypeId.CMIS_RELATIONSHIP);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:43,代码来源:RelationshipTypeDefintionWrapper.java


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