本文整理汇总了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()]);
}
示例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);
}
示例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;
}