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


Java TypeDefinitionWrapper.getProperties方法代码示例

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


在下文中一共展示了TypeDefinitionWrapper.getProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addAspectProperties

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入方法依赖的package包/类
private void addAspectProperties(CMISNodeInfo info, String filter, PropertiesImpl result)
{
    if (getRequestCmisVersion().equals(CmisVersion.CMIS_1_1))
    {
        Set<String> propertyIds = new HashSet<>();
        Set<String> filterSet = splitFilter(filter);

        Set<QName> aspects = info.getNodeAspects();
        for (QName aspect : aspects)
        {
            TypeDefinitionWrapper aspectType = getOpenCMISDictionaryService().findNodeType(aspect);
            if (aspectType == null)
            {
                continue;
            }

            for (PropertyDefinitionWrapper propDef : aspectType.getProperties())
            {
                if (propertyIds.contains(propDef.getPropertyId()))
                {
                    // skip properties that have already been added
                    continue;
                }

                if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName())))
                {
                    // skip properties that are not in the filter
                    continue;
                }

                Serializable value = propDef.getPropertyAccessor().getValue(info);
                result.addProperty(getProperty(propDef.getPropertyDefinition().getPropertyType(), propDef, value));

                // mark property as 'added'
                propertyIds.add(propDef.getPropertyId());
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:40,代码来源:CMISConnector.java

示例3: getAspectExtensions

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入方法依赖的package包/类
/**
 * Builds aspect extension.
 */
public List<CmisExtensionElement> getAspectExtensions(CMISNodeInfo info, String filter, Set<String> alreadySetProperties)
{
    List<CmisExtensionElement> extensions = new ArrayList<CmisExtensionElement>();
    Set<String> propertyIds = new HashSet<String>(alreadySetProperties);
    List<CmisExtensionElement> propertyExtensionList = new ArrayList<CmisExtensionElement>();
    Set<String> filterSet = splitFilter(filter);

    Set<QName> aspects = info.getNodeAspects();
    for (QName aspect : aspects)
    {
        TypeDefinitionWrapper aspectType = getOpenCMISDictionaryService().findNodeType(aspect);
        if (aspectType == null)
        {
            continue;
        }

        AspectDefinition aspectDefinition = dictionaryService.getAspect(aspect);
        Map<QName, org.alfresco.service.cmr.dictionary.PropertyDefinition> aspectProperties = aspectDefinition.getProperties();

        extensions.add(new CmisExtensionElementImpl(ALFRESCO_EXTENSION_NAMESPACE, APPLIED_ASPECTS, null, aspectType
                .getTypeId()));

        for (PropertyDefinitionWrapper propDef : aspectType.getProperties())
        {
            boolean addPropertyToExtensionList = getRequestCmisVersion().equals(CmisVersion.CMIS_1_1) && aspectProperties.keySet().contains(propDef.getAlfrescoName());
            // MNT-11876 : add property to extension even if it has been returned (CMIS 1.1)
            if (propertyIds.contains(propDef.getPropertyId()) && !addPropertyToExtensionList)
            {
                // skip properties that have already been added
                continue;
            }

            if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName())))
            {
                // skip properties that are not in the filter
                continue;
            }

            Serializable value = propDef.getPropertyAccessor().getValue(info);
            propertyExtensionList.add(createAspectPropertyExtension(propDef.getPropertyDefinition(), value));

            // mark property as 'added'
            propertyIds.add(propDef.getPropertyId());
        }
    }

    if (!propertyExtensionList.isEmpty())
    {
        CmisExtensionElementImpl propertiesExtension = new CmisExtensionElementImpl(
                ALFRESCO_EXTENSION_NAMESPACE, "properties", null, propertyExtensionList);
        extensions.addAll(Collections.singletonList(propertiesExtension));
    }

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

示例4: testACE3322

import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper; //导入方法依赖的package包/类
/**
 * ACE-3322
 */
@Test
public void testACE3322()
{
    final String[] types = { "cmis:document", "cmis:relationship", "cmis:folder", "cmis:item" };
    
    CmisServiceCallback<String> callback = new CmisServiceCallback<String>()
    {
        @Override
        public String execute(CmisService cmisService)
        {
            for (int i = 0; i < types.length; i++)
            {
                
                List<TypeDefinitionWrapper> baseTypes = cmisDictionaryService.getBaseTypes();
                assertNotNull(baseTypes);
                checkDefs(baseTypes);
                
                List<TypeDefinitionWrapper> children = cmisDictionaryService.getChildren(types[i]);
                assertNotNull(children);

                // Check that children were updated
                checkDefs(children);
            }
            return "";
        };
        
        private void checkDefs(List<TypeDefinitionWrapper> defs)
        {
            for (TypeDefinitionWrapper def : defs)
            {
                assertNotNull("Type definition was not updated. Please refer to ACE-3322", def.getTypeDefinition(false).getDisplayName());
                assertNotNull("Type definition was not updated. Please refer to ACE-3322", def.getTypeDefinition(false).getDescription());

                // Check that property's display name and description were updated
                for (PropertyDefinitionWrapper property : def.getProperties())
                {
                    assertNotNull("Display name is null", property.getPropertyDefinition().getDisplayName());
                    assertNotNull("Description is null", property.getPropertyDefinition().getDescription());
                }
            }
        }
    };

    withCmisService(callback, CmisVersion.CMIS_1_1);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:49,代码来源:CMISTest.java


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