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


Java ContentData.hasContent方法代码示例

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


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

示例1: getThumbnailDefinitions

import org.alfresco.service.cmr.repository.ContentData; //导入方法依赖的package包/类
/**
 * Returns the names of the thumbnail defintions that can be applied to the content property of
 * this node.
 * <p>
 * Thumbanil defintions only appear in this list if they can produce a thumbnail for the content
 * found in the content property.  This will be determined by looking at the mimetype of the content
 * and the destinatino mimetype of the thumbnail.
 * 
 * @return  String[]    array of thumbnail names that are valid for the current content type
 */
public String[] getThumbnailDefinitions()
{
    ThumbnailService thumbnailService = this.services.getThumbnailService();
    
    List<String> result = new ArrayList<String>(7);
    
    Serializable value = this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
    ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
    
    if (ContentData.hasContent(contentData))
    {
        String mimetype = contentData.getMimetype();
        List<ThumbnailDefinition> thumbnailDefinitions = thumbnailService.getThumbnailRegistry().getThumbnailDefinitions(mimetype, contentData.getSize());
        for (ThumbnailDefinition thumbnailDefinition : thumbnailDefinitions)
        {
            result.add(thumbnailDefinition.getName());
        }
    }
    
    return (String[])result.toArray(new String[result.size()]);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:ScriptNode.java

示例2: ScriptContentData

import org.alfresco.service.cmr.repository.ContentData; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param contentData      The ContentData object this object wraps
 * @param property         The property the ContentData is attached too
 */
public ScriptContentData(ContentData contentData, QName property)
{
    this.contentData = contentData;
    this.property = property;
    this.isDirty = ContentData.hasContent(contentData);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:ScriptNode.java

示例3: getContentData

import org.alfresco.service.cmr.repository.ContentData; //导入方法依赖的package包/类
private ContentData getContentData(NodeRef nodeRef, boolean validate)
{
    ContentData contentData = (ContentData) nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
    if (validate && !ContentData.hasContent(contentData))
    {
        throw new InvalidArgumentException("Node id '" + nodeRef.getId() + "' has no content.");
    }
    return contentData;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:10,代码来源:RenditionsImpl.java


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