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


Java ScriptThumbnail类代码示例

本文整理汇总了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()]);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ScriptNode.java

示例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;
}
 
开发者ID:AFaust,项目名称:alfresco-enhanced-script-environment,代码行数:21,代码来源:ScriptNodeConverter.java

示例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;
}
 
开发者ID:AFaust,项目名称:alfresco-enhanced-script-environment,代码行数:37,代码来源:ScriptNodeConverter.java

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


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