org.alfresco.repo.rendition.script
Class ScriptRenditionService

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.jscript.BaseScopableProcessorExtension
          extended by org.alfresco.repo.rendition.script.ScriptRenditionService
All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, Scopeable

public class ScriptRenditionService
extends BaseScopableProcessorExtension

Script object representing the rendition service.


Constructor Summary
ScriptRenditionService()
           
 
Method Summary
 ScriptRenditionDefinition createRenditionDefinition(java.lang.String renditionName, java.lang.String renderingEngineName)
          Creates a new ScriptRenditionDefinition and sets the rendition name and the rendering engine name to the specified values.
 ScriptNode getRenditionByName(ScriptNode node, java.lang.String renditionName)
          This method gets the rendition of the specified node identified by the provided rendition name.
 ScriptNode[] getRenditions(ScriptNode node)
          This method gets all the renditions of the specified node.
 ScriptNode[] getRenditions(ScriptNode node, java.lang.String mimeTypePrefix)
          This method gets all the renditions of the specified node filtered by MIME-type prefix.
 ScriptNode render(ScriptNode sourceNode, ScriptRenditionDefinition scriptRenditionDef)
           
 ScriptNode render(ScriptNode sourceNode, java.lang.String renditionDefQName)
          This method renders the specified source node using the specified saved rendition definition.
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Set the service registry
 
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptRenditionService

public ScriptRenditionService()
Method Detail

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Set the service registry

Parameters:
serviceRegistry - the service registry.

createRenditionDefinition

public ScriptRenditionDefinition createRenditionDefinition(java.lang.String renditionName,
                                                           java.lang.String renderingEngineName)
Creates a new ScriptRenditionDefinition and sets the rendition name and the rendering engine name to the specified values.

Parameters:
renditionName - A unique identifier used to specify the created ScriptRenditionDefinition.
renderingEngineName - The name of the rendering engine associated with this ScriptRenditionDefinition.
Returns:
the created ScriptRenditionDefinition.
See Also:
RenditionService.createRenditionDefinition(QName, String)

render

public ScriptNode render(ScriptNode sourceNode,
                         java.lang.String renditionDefQName)
This method renders the specified source node using the specified saved rendition definition.

Parameters:
sourceNode - the source node to be rendered.
renditionDefQName - the rendition definition to be used e.g. "cm:doclib" or "{http://www.alfresco.org/model/content/1.0}imgpreview"
Returns:
the rendition scriptnode.
See Also:
RenditionService.render(org.alfresco.service.cmr.repository.NodeRef, RenditionDefinition)

render

public ScriptNode render(ScriptNode sourceNode,
                         ScriptRenditionDefinition scriptRenditionDef)

getRenditions

public ScriptNode[] getRenditions(ScriptNode node)
This method gets all the renditions of the specified node.

Parameters:
node - the source node
Returns:
an array of the renditions.
See Also:
RenditionService.getRenditions(org.alfresco.service.cmr.repository.NodeRef)

getRenditions

public ScriptNode[] getRenditions(ScriptNode node,
                                  java.lang.String mimeTypePrefix)
This method gets all the renditions of the specified node filtered by MIME-type prefix. Renditions whose MIME-type string startsWith the prefix will be returned.

Parameters:
node - the source node for the renditions
mimeTypePrefix - a prefix to check against the rendition MIME-types. This must not be null and must not be an empty String
Returns:
an array of the filtered renditions.
See Also:
RenditionService.getRenditions(org.alfresco.service.cmr.repository.NodeRef)

getRenditionByName

public ScriptNode getRenditionByName(ScriptNode node,
                                     java.lang.String renditionName)
This method gets the rendition of the specified node identified by the provided rendition name.

Parameters:
node - the source node for the renditions
renditionName - the renditionName used to identify a rendition. e.g. cm:doclib or "{http://www.alfresco.org/model/content/1.0}imgpreview"
Returns:
the parent association for the rendition or null if there is no such rendition.
See Also:
RenditionService.getRenditionByName(org.alfresco.service.cmr.repository.NodeRef, QName)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.