本文整理汇总了Java中org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper类的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinitionWrapper类的具体用法?Java PropertyDefinitionWrapper怎么用?Java PropertyDefinitionWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyDefinitionWrapper类属于org.alfresco.opencmis.dictionary包,在下文中一共展示了PropertyDefinitionWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBasicDefaultMetaData
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的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();
}
示例2: checkChildObjectType
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的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!");
}
}
示例3: getNodeProperties
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public Properties getNodeProperties(CMISNodeInfo info, String filter)
{
PropertiesImpl result = new PropertiesImpl();
Set<String> filterSet = splitFilter(filter);
for (PropertyDefinitionWrapper propDef : info.getType().getProperties())
{
if (!propDef.getPropertyId().equals(PropertyIds.OBJECT_ID))
{
// don't filter the object id
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));
}
addAspectProperties(info, filter, result);
return result;
}
示例4: getAssocProperties
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public Properties getAssocProperties(CMISNodeInfo info, String filter)
{
PropertiesImpl result = new PropertiesImpl();
Set<String> filterSet = splitFilter(filter);
for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties())
{
PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition();
if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName())))
{
// skip properties that are not in the filter
continue;
}
CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor();
Serializable value = cmisPropertyAccessor.getValue(info);
PropertyType propType = propDef.getPropertyType();
PropertyData<?> propertyData = getProperty(propType, propDefWrap, value);
result.addProperty(propertyData);
}
return result;
}
示例5: checkChildObjectType
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的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!");
}
}
示例6: CMISResultSetColumn
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
CMISResultSetColumn(String name, PropertyDefinitionWrapper propertyDefinition, PropertyType dataType,
QName alfrescoPropertyQName, QName alfrescoDataTypeQName)
{
this.name = name;
this.propertyDefinition = propertyDefinition;
this.dataType = dataType;
this.alfrescoPropertyQName = alfrescoPropertyQName;
this.alfrescoDataTypeQName = alfrescoDataTypeQName;
}
示例7: getSortProperty
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public Pair<QName, Boolean> getSortProperty(String cmisPropertyName, String direction)
{
QName sortPropName = null;
Pair<QName, Boolean> sortProp = null;
PropertyDefinitionWrapper propDef = getOpenCMISDictionaryService().findPropertyByQueryName(cmisPropertyName);
if (propDef != null)
{
if (propDef.getPropertyId().equals(PropertyIds.BASE_TYPE_ID))
{
// special-case (see also ALF-13968) - for getChildren, using "cmis:baseTypeId" allows sorting of folders first and vice-versa (cmis:folder <-> cmis:document)
sortPropName = GetChildrenCannedQuery.SORT_QNAME_NODE_IS_FOLDER;
}
else
{
sortPropName = propDef.getPropertyAccessor().getMappedProperty();
}
if (sortPropName == null)
{
// ok to map these properties because we are always getting current versions of nodes
sortPropName = SORT_PROPERTY_MAPPINGS.get(cmisPropertyName);
}
}
if (sortPropName != null)
{
boolean sortAsc = (direction == null ? true : direction.equalsIgnoreCase("asc"));
sortProp = new Pair<QName, Boolean>(sortPropName, sortAsc);
}
else
{
if (logger.isDebugEnabled())
{
logger.debug("Ignore sort property '" + cmisPropertyName + " - mapping not found");
}
}
return sortProp;
}
示例8: addAspectProperties
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的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());
}
}
}
}
示例9: checkPredicateConditionsForLike
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
private void checkPredicateConditionsForLike(Map<String, Argument> functionArguments,
FunctionEvaluationContext functionEvaluationContext, Map<String, Column> columnMap)
{
if (options.getQueryMode() == CMISQueryMode.CMS_STRICT)
{
PropertyArgument propertyArgument = (PropertyArgument) functionArguments.get(Like.ARG_PROPERTY);
boolean isMultiValued = functionEvaluationContext.isMultiValued(propertyArgument.getPropertyName());
if (isMultiValued)
{
throw new QueryModelException("Like is not supported for multi-valued properties");
}
String cmisPropertyName = propertyArgument.getPropertyName();
Column column = columnMap.get(cmisPropertyName);
if (column != null)
{
// check for function type
if (column.getFunction().getName().equals(PropertyAccessor.NAME))
{
PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(
PropertyAccessor.ARG_PROPERTY);
cmisPropertyName = arg.getPropertyName();
} else
{
throw new CmisInvalidArgumentException("Complex column reference not supoprted in LIKE "
+ cmisPropertyName);
}
}
PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(cmisPropertyName);
if (propDef.getPropertyDefinition().getPropertyType() != PropertyType.STRING)
{
throw new CmisInvalidArgumentException("LIKE is only supported against String types" + cmisPropertyName);
}
}
}
示例10: getProperty
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public Serializable getProperty(NodeRef nodeRef, String propertyName)
{
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
CMISNodeInfo nodeInfo = nodeInfos.get(nodeRef);
if (nodeInfo == null)
{
nodeInfo = propertyDef.getPropertyAccessor().createNodeInfo(nodeRef);
nodeInfos.put(nodeRef, nodeInfo);
}
return propertyDef.getPropertyAccessor().getValue(nodeInfo);
}
示例11: isOrderable
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public boolean isOrderable(String fieldName)
{
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(fieldName);
if (propertyDef == null)
{
return false;
} else
{
return propertyDef.getPropertyDefinition().isOrderable();
}
}
示例12: isQueryable
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public boolean isQueryable(String fieldName)
{
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(fieldName);
if (propertyDef == null)
{
return true;
} else
{
return propertyDef.getPropertyDefinition().isQueryable();
}
}
示例13: getLuceneFieldName
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public String getLuceneFieldName(String propertyName)
{
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
if (propertyDef != null)
{
return propertyDef.getPropertyLuceneBuilder().getLuceneFieldName();
} else
{
// TODO: restrict to supported "special" fields
return propertyName;
}
}
示例14: checkFieldApplies
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public void checkFieldApplies(Selector selector, String propertyName)
{
PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(propertyName);
if (propDef == null)
{
if (EXPOSED_FIELDS.contains(propertyName))
{
return;
}
else
{
throw new CmisInvalidArgumentException("Unknown column/property " + propertyName);
}
}
TypeDefinitionWrapper typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
if (typeDef == null)
{
throw new CmisInvalidArgumentException("Type unsupported in CMIS queries: " + selector.getAlias());
}
// Check column/property applies to selector/type
if (typeDef.getPropertyById(propDef.getPropertyId()) == null)
{
throw new CmisInvalidArgumentException("Invalid column for "
+ typeDef.getTypeDefinition(false).getQueryName() + "." + propertyName);
}
}
示例15: isMultiValued
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper; //导入依赖的package包/类
public boolean isMultiValued(String propertyName)
{
PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(propertyName);
if (propDef == null)
{
throw new CmisInvalidArgumentException("Unknown column/property " + propertyName);
}
return propDef.getPropertyDefinition().getCardinality() == Cardinality.MULTI;
}