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


Java PropertyDefinition.getTitle方法代码示例

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


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

示例1: getCustomProperties

import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
/**
 * Get a map of the sites custom properties
 * 
 * @return map of names and values
 */
public ScriptableQNameMap<String, CustomProperty> getCustomProperties()
{
    if (this.customProperties == null)
    {
        // create the custom properties map
        ScriptNode siteNode = new ScriptNode(this.siteInfo.getNodeRef(), this.serviceRegistry);
        // set the scope, for use when converting props to javascript objects
        siteNode.setScope(scope);
        this.customProperties = new ContentAwareScriptableQNameMap<String, CustomProperty>(siteNode, this.serviceRegistry);
        
        Map<QName, Serializable> props = siteInfo.getCustomProperties();
        for (QName qname : props.keySet())
        {
            // get the property value
            Serializable propValue = props.get(qname);
            
            // convert the value
            NodeValueConverter valueConverter = siteNode.new NodeValueConverter();
            Serializable value = valueConverter.convertValueForScript(qname, propValue);
            
            // get the type and label information from the dictionary
            String title = null;
            String type = null;
            PropertyDefinition propDef = this.serviceRegistry.getDictionaryService().getProperty(qname);
            if (propDef != null)
            {
                type = propDef.getDataType().getName().toString();
                title = propDef.getTitle(this.serviceRegistry.getDictionaryService());
            }
            
            // create the custom property and add to the map
            CustomProperty customProp = new CustomProperty(qname.toString(), value, type, title);
            this.customProperties.put(qname.toString(), customProp);
        }
    }
    return this.customProperties;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:43,代码来源:Site.java

示例2: getAllowableValuesImpl

import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
/**
 * @see org.alfresco.service.cmr.action.ParameterConstraint#getAllowableValues()
 */
protected Map<String, String> getAllowableValuesImpl()
{   
    Collection<QName> properties = dictionaryService.getAllProperties(null);
    Map<String, String> result = new LinkedHashMap<String, String>(properties.size());
    for (QName property : properties)
    {
        PropertyDefinition propertyDef = dictionaryService.getProperty(property);
        if (propertyDef != null && propertyDef.getTitle(dictionaryService) != null)
        {
            result.put(property.toPrefixString(), propertyDef.getTitle(dictionaryService));
        }
    }        
    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:PropertyParameterConstraint.java

示例3: compare

import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
public int compare(PropertyDefinition arg0, PropertyDefinition arg1)
{
    int result = 0;
    
    String title0 = arg0.getTitle(messageLookup);
    if (title0 == null)
    {
        title0 = arg0.getName().toPrefixString();
    }
    String title1 = arg1.getTitle(messageLookup);
    if (title1 == null)
    {
        title1 = arg1.getName().getPrefixString();
    }
    
    if (title0 == null && title1 != null)
    {
        result = 1;
    }
    else if (title0 != null && title1 == null)
    {
        result = -1;
    }
    else if (title0 != null && title1 != null)
    {
        result = String.CASE_INSENSITIVE_ORDER.compare(title0, title1);
    }
    
    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:31,代码来源:DictionaryComparators.java

示例4: 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));
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:33,代码来源:CustomModelProperty.java

示例5: toFacetablePropertyModel

import org.alfresco.service.cmr.dictionary.PropertyDefinition; //导入方法依赖的package包/类
/** This method returns a {@link FacetablePropertyFTL} for the specified {@link PropertyDefinition}. */
private FacetablePropertyFTL<?> toFacetablePropertyModel(PropertyDefinition propDef, Locale locale)
{
    String title = propDef.getTitle(messageLookup, locale);
    return new StandardFacetablePropertyFTL(propDef, title);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:7,代码来源:FacetablePropertiesGet.java


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