本文整理汇总了Java中org.alfresco.service.cmr.dictionary.PropertyDefinition.getFacetable方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinition.getFacetable方法的具体用法?Java PropertyDefinition.getFacetable怎么用?Java PropertyDefinition.getFacetable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.PropertyDefinition
的用法示例。
在下文中一共展示了PropertyDefinition.getFacetable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomModelProperty
import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
public CustomModelProperty(PropertyDefinition propertyDefinition, MessageLookup messageLookup)
{
this.name = propertyDefinition.getName().getLocalName();
this.prefixedName = propertyDefinition.getName().toPrefixString();
this.title = propertyDefinition.getTitle(messageLookup);
this.dataType = propertyDefinition.getDataType().getName().toPrefixString();
this.description = propertyDefinition.getDescription(messageLookup);
this.isMandatory = propertyDefinition.isMandatory();
this.isMandatoryEnforced = propertyDefinition.isMandatoryEnforced();
this.isMultiValued = propertyDefinition.isMultiValued();
this.defaultValue = propertyDefinition.getDefaultValue();
this.isIndexed = propertyDefinition.isIndexed();
this.facetable = propertyDefinition.getFacetable();
this.indexTokenisationMode = propertyDefinition.getIndexTokenisationMode();
List<ConstraintDefinition> constraintDefs = propertyDefinition.getConstraints();
if (constraintDefs.size() > 0)
{
this.constraintRefs = new ArrayList<>();
this.constraints = new ArrayList<>();
for (ConstraintDefinition cd : constraintDefs)
{
if (cd.getRef() != null)
{
constraintRefs.add(cd.getRef().toPrefixString());
}
else
{
constraints.add(new CustomModelConstraint(cd, messageLookup));
}
}
}
}
示例2: getFacetableProperties
import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
@Override public List<PropertyDefinition> getFacetableProperties(QName contentClass)
{
final List<PropertyDefinition> result = new ArrayList<>();
final Map<QName, PropertyDefinition> propertyDefs = dictionaryService.getPropertyDefs(contentClass);
if (propertyDefs != null)
{
for (final Map.Entry<QName, PropertyDefinition> prop : propertyDefs.entrySet())
{
final PropertyDefinition propDef = prop.getValue();
if (propDef.isIndexed()) //SHA-1308
{
final Facetable propIsFacetable = propDef.getFacetable();
switch (propIsFacetable)
{
case TRUE:
result.add(propDef);
break;
case FALSE:
// The value is not facetable. Do nothing.
break;
case UNSET:
// These values may be facetable.
final DataTypeDefinition datatype = propDef.getDataType();
if (isNumeric(datatype) || isDateLike(datatype) || isFacetableText(datatype))
{
result.add(propDef);
break;
}
break;
default:
// This should never happen. If it does, it's a programming error.
throw new IllegalStateException("Failed to handle " + Facetable.class.getSimpleName() + " type: " + propIsFacetable);
}
}
}
}
return result;
}