Class ScriptRenditionService2

All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, Scopeable

public class ScriptRenditionService2 extends BaseScopableProcessorExtension
The ScriptRenditionService2 class provides a scripting interface for working with Rendition Service 2. It allows rendering source nodes with specified rendition definitions and retrieving renditions associated with a node.
  • Constructor Details

    • ScriptRenditionService2

      public ScriptRenditionService2()
  • Method Details

    • setServiceRegistry

      public void setServiceRegistry(ServiceRegistry serviceRegistry)
      Sets the ServiceRegistry to be used by this script object.
      Parameters:
      serviceRegistry - The ServiceRegistry to be set.
    • render

      public void render(ScriptNode sourceNode, String renditionName)
      Renders the specified source node with the given rendition definition. Since renditionService2 is designed to asynchronous, no result is returned.
      Parameters:
      sourceNode - The source node to be rendered.
      renditionName - The name of the rendition definition, like "pdf".
    • getRenditions

      public ScriptNode[] getRenditions(ScriptNode node)
      Retrieves an array of ScriptNode objects representing renditions associated with the specified node.
      Parameters:
      node - The node for which to retrieve renditions.
      Returns:
      An array of ScriptNode objects representing renditions.
    • getRenditionByName

      public ScriptNode getRenditionByName(ScriptNode node, String renditionName)
      Retrieves a ScriptNode object representing the rendition with the specified name associated with the given node.
      Parameters:
      node - The node for which to retrieve the rendition.
      renditionName - The name of the rendition.
      Returns:
      A ScriptNode object representing the specified rendition, or null if not found.