org.alfresco.web.forms
Class RenderingEngineTemplateImpl

java.lang.Object
  extended by org.alfresco.web.forms.RenderingEngineTemplateImpl
All Implemented Interfaces:
java.io.Serializable, RenderingEngineTemplate

public class RenderingEngineTemplateImpl
extends java.lang.Object
implements RenderingEngineTemplate

Implementation of a rendering engine template

See Also:
Serialized Form

Constructor Summary
protected RenderingEngineTemplateImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef renditionPropertiesNodeRef, FormsService formsService)
           
 
Method Summary
protected  java.util.Map buildModel(FormInstanceData formInstanceData, Rendition rendition)
          Builds the model to pass to the rendering engine.
 java.lang.String getDescription()
          the description of the rendering engine template
protected static FormDataFunctions getFormDataFunctions()
           
 java.io.InputStream getInputStream()
          Provides an input stream to the rendering engine template.
 java.lang.String getMimetypeForRendition()
          Returns the mimetype to use when generating content for this output method.
 java.lang.String getName()
          the name of the rendering engine template
 org.alfresco.service.cmr.repository.NodeRef getNodeRef()
           
 java.lang.String getOutputPathForRendition(FormInstanceData formInstanceData, java.lang.String currentAVMPath, java.lang.String name)
          Generates an output path for the rendition by compiling the output path pattern as a freemarker template.
 java.lang.String getOutputPathPattern()
          the output path pattern for renditions
 RenderingEngine getRenderingEngine()
          Provides the rendering engine to use when processing this template.
 org.alfresco.service.cmr.repository.NodeRef getRenditionPropertiesNodeRef()
           
 java.lang.String getTitle()
          the title of the rendering engine template
 int hashCode()
           
 boolean isExists()
           
 void render(FormInstanceData formInstanceData, Rendition rendition)
          Produces a rendition of the provided formInstanceData to an existing rendition.
 Rendition render(FormInstanceData formInstanceData, java.lang.String renditionAvmPath)
          Produces a rendition of the provided formInstanceData.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderingEngineTemplateImpl

protected RenderingEngineTemplateImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                      org.alfresco.service.cmr.repository.NodeRef renditionPropertiesNodeRef,
                                      FormsService formsService)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: RenderingEngineTemplate
the name of the rendering engine template

Specified by:
getName in interface RenderingEngineTemplate

getTitle

public java.lang.String getTitle()
Description copied from interface: RenderingEngineTemplate
the title of the rendering engine template

Specified by:
getTitle in interface RenderingEngineTemplate

getDescription

public java.lang.String getDescription()
Description copied from interface: RenderingEngineTemplate
the description of the rendering engine template

Specified by:
getDescription in interface RenderingEngineTemplate

getOutputPathPattern

public java.lang.String getOutputPathPattern()
Description copied from interface: RenderingEngineTemplate
the output path pattern for renditions

Specified by:
getOutputPathPattern in interface RenderingEngineTemplate

getNodeRef

public org.alfresco.service.cmr.repository.NodeRef getNodeRef()

getRenditionPropertiesNodeRef

public org.alfresco.service.cmr.repository.NodeRef getRenditionPropertiesNodeRef()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: RenderingEngineTemplate
Provides an input stream to the rendering engine template.

Specified by:
getInputStream in interface RenderingEngineTemplate
Returns:
the input stream to the rendering engine template.
Throws:
java.io.IOException

getRenderingEngine

public RenderingEngine getRenderingEngine()
Provides the rendering engine to use when processing this template.

Specified by:
getRenderingEngine in interface RenderingEngineTemplate
Returns:
the rendering engine to use when processing this template.

getOutputPathForRendition

public java.lang.String getOutputPathForRendition(FormInstanceData formInstanceData,
                                                  java.lang.String currentAVMPath,
                                                  java.lang.String name)
Generates an output path for the rendition by compiling the output path pattern as a freemarker template.

Specified by:
getOutputPathForRendition in interface RenderingEngineTemplate
Parameters:
formInstanceData - the form instance data to use for the rendition path.
currentAVMPath - the current path in which the form is being created.
name - the name which is used in a pattern
Returns:
the output path to use for renditions.

getMimetypeForRendition

public java.lang.String getMimetypeForRendition()
Description copied from interface: RenderingEngineTemplate
Returns the mimetype to use when generating content for this output method.

Specified by:
getMimetypeForRendition in interface RenderingEngineTemplate
Returns:
the mimetype to use when generating content for this output method, such as text/html, text/xml, application/pdf.

render

public Rendition render(FormInstanceData formInstanceData,
                        java.lang.String renditionAvmPath)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        RenderingEngine.RenderingException
Description copied from interface: RenderingEngineTemplate
Produces a rendition of the provided formInstanceData.

Specified by:
render in interface RenderingEngineTemplate
Parameters:
formInstanceData - the form instance data for which to produce the rendition.
renditionAvmPath - the path to use for the rendition.
Throws:
java.io.IOException
org.xml.sax.SAXException
RenderingEngine.RenderingException

render

public void render(FormInstanceData formInstanceData,
                   Rendition rendition)
            throws java.io.IOException,
                   org.xml.sax.SAXException,
                   RenderingEngine.RenderingException
Description copied from interface: RenderingEngineTemplate
Produces a rendition of the provided formInstanceData to an existing rendition.

Specified by:
render in interface RenderingEngineTemplate
Parameters:
formInstanceData - the form instance data for which to produce the rendition.
rendition - the rendition to rerender
Throws:
java.io.IOException
org.xml.sax.SAXException
RenderingEngine.RenderingException

buildModel

protected java.util.Map buildModel(FormInstanceData formInstanceData,
                                   Rendition rendition)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException
Builds the model to pass to the rendering engine.

Throws:
java.io.IOException
org.xml.sax.SAXException

getFormDataFunctions

protected static FormDataFunctions getFormDataFunctions()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isExists

public boolean isExists()


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