本文整理汇总了Java中org.alfresco.service.cmr.dictionary.PropertyDefinition.getIndexTokenisationMode方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyDefinition.getIndexTokenisationMode方法的具体用法?Java PropertyDefinition.getIndexTokenisationMode怎么用?Java PropertyDefinition.getIndexTokenisationMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.PropertyDefinition
的用法示例。
在下文中一共展示了PropertyDefinition.getIndexTokenisationMode方法的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: getLuceneSortField
import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E
{
// Score is special
if (propertyName.equalsIgnoreCase("Score"))
{
return "Score";
}
String field = getLuceneFieldName(propertyName);
// need to find the real field to use
if (field.startsWith(QueryConstants.PROPERTY_FIELD_PREFIX))
{
PropertyDefinition propertyDef = dictionaryService.getProperty(QName.createQName(field.substring(1)));
// Handle .size and .mimetype
if(propertyDef == null)
{
if(field.endsWith(QueryConstants.FIELD_SIZE_SUFFIX))
{
propertyDef = dictionaryService.getProperty(QName.createQName(field.substring(1, field.length()-QueryConstants.FIELD_SIZE_SUFFIX.length())));
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
{
throw new FTSQueryException("Order for "+QueryConstants.FIELD_SIZE_SUFFIX+" only supported on content properties");
}
else
{
return field;
}
}
else if (field.endsWith(QueryConstants.FIELD_MIMETYPE_SUFFIX))
{
propertyDef = dictionaryService.getProperty(QName.createQName(field.substring(1, field.length()-QueryConstants.FIELD_MIMETYPE_SUFFIX.length())));
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
{
throw new FTSQueryException("Order for .mimetype only supported on content properties");
}
else
{
return field;
}
}
else
{
return field;
}
}
else
{
if (propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
{
throw new FTSQueryException("Order on content properties is not curently supported");
}
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.TEXT))
{
if(propertyDef.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
{
return field;
}
String noLocalField = field+".no_locale";
if(lqpa.sortFieldExists(noLocalField))
{
return noLocalField;
}
field = findSortField(lqpa, field);
}
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.MLTEXT))
{
field = findSortField(lqpa, field);
}
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
{
field = lqpa.getDatetimeSortField(field, propertyDef);
}
}
}
return field;
}