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


Java TypeDefinitionWrapper类代码示例

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


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

示例1: testBasicDefaultMetaData

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
public void testBasicDefaultMetaData()
{
    CMISQueryOptions options = new CMISQueryOptions("SELECT * FROM cmis:document", rootNodeRef.getStoreRef());
    CMISResultSet rs = cmisQueryService.query(options);
    CMISResultSetMetaData md = rs.getMetaData();
    assertNotNull(md.getQueryOptions());
    TypeDefinitionWrapper typeDef = cmisDictionaryService.findType(BaseTypeId.CMIS_DOCUMENT.value());
    int count = 0;
    for (PropertyDefinitionWrapper pdef : typeDef.getProperties())
    {            
        count++;   
    }
    assertEquals(count, md.getColumnNames().length);
    assertNotNull(md.getColumn(PropertyIds.OBJECT_ID));
    assertEquals(1, md.getSelectors().length);
    assertNotNull(md.getSelector(""));
    rs.close();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:OpenCmisQueryTest.java

示例2: isSupported

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * @return Returns <tt>true</tt> if items in the CMIS domain model
 * @see org.alfresco.repo.audit.extractor.DataExtractor#isSupported(java.io.Serializable)
 */
public boolean isSupported(Serializable data)
{
    if (data != null)
    {
        NodeRef nodeRef = getNodeRef(data);
        if (nodeRef != null)
        {
            QName typeQName = nodeService.getType(nodeRef);
            TypeDefinitionWrapper type = cmisDictionaryService.findNodeType(typeQName);

            return (type != null)
                    && (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT || type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER);
        }
    }
    return false;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:CMISChangeLogDataExtractor.java

示例3: createObjectId

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
public String createObjectId(NodeRef nodeRef, boolean dropStoreRef)
{
	QName typeQName = nodeService.getType(nodeRef);
    TypeDefinitionWrapper type = getOpenCMISDictionaryService().findNodeType(typeQName);

	if(type instanceof ItemTypeDefinitionWrapper)
	{
		return constructObjectId(nodeRef, null);
	}

    if(type instanceof FolderTypeDefintionWrapper)
    {
        return constructObjectId(nodeRef, null, dropStoreRef);
    }

    Serializable versionLabel = getNodeService()
            .getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
    if (versionLabel == null)
    {
    	versionLabel = CMISConnector.UNVERSIONED_VERSION_LABEL;
    }

    return constructObjectId(nodeRef, (String)versionLabel, dropStoreRef);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:CMISConnector.java

示例4: checkChildObjectType

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * Checks if a child of a given type can be added to a given folder.
 */
@SuppressWarnings("unchecked")
public void checkChildObjectType(CMISNodeInfo folderInfo, String childType)
{
    TypeDefinitionWrapper targetType = folderInfo.getType();
    PropertyDefinitionWrapper allowableChildObjectTypeProperty = targetType
            .getPropertyById(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS);
    List<String> childTypes = (List<String>) allowableChildObjectTypeProperty.getPropertyAccessor().getValue(
            folderInfo);

    if ((childTypes == null) || childTypes.isEmpty())
    {
        return;
    }

    if (!childTypes.contains(childType))
    {
        throw new CmisConstraintException("Objects of type '" + childType + "' cannot be added to this folder!");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:23,代码来源:CMISConnector.java

示例5: getTypesDescendants

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * Gathers the type descendants tree.
 */
private TypeDefinitionContainer getTypesDescendants(
        int depth, TypeDefinitionWrapper tdw, boolean includePropertyDefinitions)
{
    TypeDefinitionContainerImpl result = new TypeDefinitionContainerImpl();

    result.setTypeDefinition(tdw.getTypeDefinition(includePropertyDefinitions));

    if (depth != 0)
    {
    	String typeId = tdw.getTypeId();
    	List<TypeDefinitionWrapper> children = connector.getOpenCMISDictionaryService().getChildren(typeId);
        if (children != null)
        {
            result.setChildren(new ArrayList<TypeDefinitionContainer>());
            for (TypeDefinitionWrapper tdc : children)
            {
                result.getChildren().add(
                        getTypesDescendants(depth < 0 ? -1 : depth - 1, tdc, includePropertyDefinitions));
            }
        }
    }

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

示例6: applyPolicy

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
@Override
public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // what kind of object is it?
    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    TypeDefinitionWrapper type = info.getType();
    if (type == null)
    {
        throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?");
    }

    connector.applyPolicies(info.getNodeRef(), type, Collections.singletonList(policyId));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:AlfrescoCmisServiceImpl.java

示例7: removePolicy

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
@Override
public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // what kind of object is it?
    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    TypeDefinitionWrapper type = info.getType();
    if (type == null)
    {
        throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?");
    }

    throw new CmisConstraintException("Object is not policy controllable!");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:AlfrescoCmisServiceImpl.java

示例8: applyAcl

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
@Override
public Acl applyAcl(
        String repositoryId, String objectId, final Acl addAces, final Acl removeAces,
        AclPropagation aclPropagation, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // We are spec compliant if we just let it through and the tck will not fail

    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    // relationships don't have ACLs
    if (info.isVariant(CMISObjectVariant.ASSOC))
    {
        throw new CmisConstraintException("Relationships are not ACL controllable!");
    }

    final NodeRef nodeRef = info.getCurrentNodeNodeRef();
    final TypeDefinitionWrapper type = info.getType();

    connector.applyACL(nodeRef, type, addAces, removeAces);

    return connector.getACL(nodeRef, false);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:AlfrescoCmisServiceImpl.java

示例9: getType

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
private String getType(String tableName)
{
    TypeDefinitionWrapper typeDef = dictionaryService.findTypeByQueryName(tableName);
    if (typeDef == null)
    {
        throw new CmisInvalidArgumentException("Unknown type: " + tableName);
    }
    if(!typeDef.isBaseType())
    {
        throw new CmisInvalidArgumentException("Not a base type: " + tableName);
    }
    if(!typeDef.getTypeDefinition(false).isQueryable())
    {
        throw new CmisInvalidArgumentException("Type is not queryable: " + tableName);
    }
    return typeDef.getAlfrescoClass().toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:18,代码来源:BaseTypeIdLuceneBuilder.java

示例10: createObjectId

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
public String createObjectId(NodeRef nodeRef, boolean dropStoreRef)
{
	QName typeQName = nodeService.getType(nodeRef);
    TypeDefinitionWrapper type = getOpenCMISDictionaryService().findNodeType(typeQName);

	if(type instanceof ItemTypeDefinitionWrapper)
	{
		return constructObjectId(nodeRef, null);
	}
	
    if(type instanceof FolderTypeDefintionWrapper)
    {
        return constructObjectId(nodeRef, null, dropStoreRef);
    }
    
    Serializable versionLabel = getNodeService()
            .getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
    if (versionLabel == null)
    {
    	versionLabel = CMISConnector.UNVERSIONED_VERSION_LABEL;
    }

    return constructObjectId(nodeRef, (String)versionLabel, dropStoreRef);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:CMISConnector.java

示例11: checkChildObjectType

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * Checks if a child of a given type can be added to a given folder.
 */
@SuppressWarnings("unchecked")
public void checkChildObjectType(CMISNodeInfo folderInfo, String childType)
{
    TypeDefinitionWrapper targetType = folderInfo.getType();
    PropertyDefinitionWrapper allowableChildObjectTypeProperty = targetType
            .getPropertyById(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS);
    List<String> childTypes = (List<String>) allowableChildObjectTypeProperty.getPropertyAccessor().getValue(
            folderInfo);

    if ((childTypes == null) || childTypes.isEmpty())
    {
        return;
    }
    
    if (!childTypes.contains(childType))
    {
        throw new CmisConstraintException("Objects of type '" + childType + "' cannot be added to this folder!");
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:CMISConnector.java

示例12: getType

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
public TypeDefinitionWrapper getType()
{
    if (type == null)
    {
        determineType(null);
    }

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

示例13: getType

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * Returns the type definition of a node or <code>null</code> if no type
 * definition could be found.
 */
public TypeDefinitionWrapper getType(NodeRef nodeRef)
{
    try
    {
        QName typeQName = nodeService.getType(nodeRef);
        return getOpenCMISDictionaryService().findNodeType(typeQName);
    }
    catch(InvalidNodeRefException inre)
    {
        return null;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:CMISConnector.java

示例14: getTypeForCreate

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
/**
 * Returns the definition after it has checked if the type can be used for
 * object creation.
 */
public TypeDefinitionWrapper getTypeForCreate(String cmisTypeId, BaseTypeId baseTypeId)
{
    TypeDefinitionWrapper type = getType(cmisTypeId);
    if ((type == null) || (type.getBaseTypeId() != baseTypeId))
    {
        switch (baseTypeId)
        {
        case CMIS_DOCUMENT:
            throw new CmisConstraintException("Type is not a document type!");
        case CMIS_FOLDER:
            throw new CmisConstraintException("Type is not a folder type!");
        case CMIS_RELATIONSHIP:
            throw new CmisConstraintException("Type is not a relationship type!");
        case CMIS_POLICY:
            throw new CmisConstraintException("Type is not a policy type!");
        case CMIS_ITEM:
            throw new CmisConstraintException("Type is not an item type!");
        }
    }

    if (!type.getTypeDefinition(false).isCreatable())
    {
        throw new CmisConstraintException("Type is not creatable!");
    }

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

示例15: checkDocumentTypeForContent

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入依赖的package包/类
private void checkDocumentTypeForContent(TypeDefinitionWrapper type)
{
    if (type == null)
    {
        throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?");
    }
    if (!(type instanceof DocumentTypeDefinitionWrapper))
    {
        throw new CmisStreamNotSupportedException("Object is not a document!");
    }
    if (((DocumentTypeDefinition) type.getTypeDefinition(false)).getContentStreamAllowed() == ContentStreamAllowed.NOTALLOWED)
    {
        throw new CmisConstraintException("Document cannot have content!");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:CMISConnector.java


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