本文整理汇总了Java中org.alfresco.repo.thumbnail.script.ScriptThumbnail类的典型用法代码示例。如果您正苦于以下问题:Java ScriptThumbnail类的具体用法?Java ScriptThumbnail怎么用?Java ScriptThumbnail使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScriptThumbnail类属于org.alfresco.repo.thumbnail.script包,在下文中一共展示了ScriptThumbnail类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getThumbnails
import org.alfresco.repo.thumbnail.script.ScriptThumbnail; //导入依赖的package包/类
/**
* Get the all the thumbnails for a given node's content property.
*
* @return Scriptable list of thumbnails, empty if none available
*/
public ScriptThumbnail[] getThumbnails()
{
List<NodeRef> thumbnails = this.services.getThumbnailService().getThumbnails(
this.nodeRef,
ContentModel.PROP_CONTENT,
null,
null);
List<ScriptThumbnail> result = new ArrayList<ScriptThumbnail>(thumbnails.size());
for (NodeRef thumbnail : thumbnails)
{
ScriptThumbnail scriptThumbnail = new ScriptThumbnail(thumbnail, this.services, this.scope);
result.add(scriptThumbnail);
}
return (ScriptThumbnail[])result.toArray(new ScriptThumbnail[result.size()]);
}
示例2: getForScriptConversionConfidence
import org.alfresco.repo.thumbnail.script.ScriptThumbnail; //导入依赖的package包/类
/**
*
* {@inheritDoc}
*/
@Override
public int getForScriptConversionConfidence(final Class<?> valueInstanceClass, final Class<?> expectedClass)
{
final int confidence;
if (NodeRef.class.isAssignableFrom(valueInstanceClass)
&& (expectedClass.isAssignableFrom(ScriptThumbnail.class) || expectedClass
.isAssignableFrom(CategoryNode.class)))
{
confidence = HIGHEST_CONFIDENCE;
}
else
{
confidence = LOWEST_CONFIDENCE;
}
return confidence;
}
示例3: canConvertValueForScript
import org.alfresco.repo.thumbnail.script.ScriptThumbnail; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public boolean canConvertValueForScript(final Object value, final ValueConverter globalDelegate,
final Class<?> expectedClass)
{
boolean canConvert = value instanceof NodeRef
&& (expectedClass.isAssignableFrom(ScriptThumbnail.class) || expectedClass
.isAssignableFrom(CategoryNode.class));
if (canConvert)
{
if (!this.nodeService.exists((NodeRef) value))
{
canConvert = false;
}
else
{
final QName type = this.nodeService.getType((NodeRef) value);
if (!this.dictionaryService.isSubClass(type, ContentModel.TYPE_CATEGORY)
&& expectedClass.equals(CategoryNode.class))
{
canConvert = false;
}
else if (!(this.dictionaryService.isSubClass(type, ContentModel.TYPE_THUMBNAIL)
|| this.nodeService.hasAspect((NodeRef) value, RenditionModel.ASPECT_RENDITION))
&& expectedClass.equals(ScriptThumbnail.class))
{
canConvert = false;
}
}
}
return canConvert;
}
示例4: createThumbnail
import org.alfresco.repo.thumbnail.script.ScriptThumbnail; //导入依赖的package包/类
/**
* Creates a thumbnail for the content property of the node.
*
* The thumbnail name correspionds to pre-set thumbnail details stored in the
* repository.
*
* @param thumbnailName the name of the thumbnail
* @return ScriptThumbnail the newly create thumbnail node
*/
public ScriptThumbnail createThumbnail(String thumbnailName)
{
return createThumbnail(thumbnailName, false);
}