org.alfresco.repo.rendition
Class RenditionServiceImpl

java.lang.Object
  extended by org.alfresco.repo.rendition.RenditionServiceImpl
All Implemented Interfaces:
RenditionDefinitionPersister, RenditionService

public class RenditionServiceImpl
extends java.lang.Object
implements RenditionService, RenditionDefinitionPersister


Field Summary
 
Fields inherited from interface org.alfresco.service.cmr.rendition.RenditionService
PARAM_DESTINATION_NODE, PARAM_DESTINATION_PATH_TEMPLATE, PARAM_IS_COMPONENT_RENDITION, PARAM_ORPHAN_EXISTING_RENDITION, PARAM_RENDITION_NODETYPE
 
Constructor Summary
RenditionServiceImpl()
           
 
Method Summary
 CompositeRenditionDefinition createCompositeRenditionDefinition(org.alfresco.service.namespace.QName renditionName)
          Creates a new CompositeRenditionDefinition and sets the rendition name and the rendering engine name to the specified values.
 RenditionDefinition createRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName, java.lang.String renderingEngineName)
          Creates a new RenditionDefinition and sets the rendition name and the rendering engine name to the specified values.
 RenderingEngineDefinition getRenderingEngineDefinition(java.lang.String name)
          Returns the RenderingEngineDefinition associated with the specified rendering engine name.
 java.util.List getRenderingEngineDefinitions()
           
 org.alfresco.service.cmr.repository.ChildAssociationRef getRenditionByName(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName renditionName)
          This method gets the rendition of the specified node identified by the provided rendition name.
 java.util.List getRenditions(org.alfresco.service.cmr.repository.NodeRef node)
          This method gets all the renditions of the specified node.
 java.util.List getRenditions(org.alfresco.service.cmr.repository.NodeRef node, java.lang.String mimeTypePrefix)
          This method gets all the renditions of the specified node filtered by MIME-type prefix.
 org.alfresco.service.cmr.repository.ChildAssociationRef getSourceNode(org.alfresco.service.cmr.repository.NodeRef renditionNode)
          This method gets the source node for the specified rendition node.
 boolean isRendition(org.alfresco.service.cmr.repository.NodeRef node)
          This method returns true if the specified NodeRef is a valid rendition node, else false.
 RenditionDefinition loadRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName)
          This method retrieves a RenditionDefinition that has been stored in the repository using the save() method.
 java.util.List loadRenditionDefinitions()
          This method retrieves the RenditionDefinitions that have been stored in the repository using the save() method.
 java.util.List loadRenditionDefinitions(java.lang.String renditionEngineName)
          This method retrieves the stored RenditionDefinitions that have been registered for the specified rendering engine name.
 org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.namespace.QName renditionDefinitionQName)
          This method synchronously renders content as specified by the given rendition name.
 void render(org.alfresco.service.cmr.repository.NodeRef sourceNode, org.alfresco.service.namespace.QName renditionDefinitionQName, RenderCallback callback)
          This method asynchronously renders content as specified by the given rendition definition name.
 org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode, RenditionDefinition definition)
          This method synchronously renders content as specified by the given RenditionDefinition.
 void render(org.alfresco.service.cmr.repository.NodeRef sourceNode, RenditionDefinition definition, RenderCallback callback)
          This method asynchronously renders content as specified by the given RenditionDefinition.
 void saveRenditionDefinition(RenditionDefinition renderingAction)
          This method serializes the RenditionDefinition and stores it in the repository.
 void setActionService(ActionService actionService)
          Injects the ActionService bean.
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
          Injects the DictionaryService bean.
 void setRenditionDefinitionPersister(RenditionDefinitionPersisterImpl renditionDefinitionPersister)
          Injects the RenditionDefinitionPersister bean.
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Injects the ServiceRegistry bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenditionServiceImpl

public RenditionServiceImpl()
Method Detail

setRenditionDefinitionPersister

public void setRenditionDefinitionPersister(RenditionDefinitionPersisterImpl renditionDefinitionPersister)
Injects the RenditionDefinitionPersister bean.

Parameters:
renditionDefinitionPersister -

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Injects the ServiceRegistry bean.

Parameters:
serviceRegistry -

setActionService

public void setActionService(ActionService actionService)
Injects the ActionService bean.

Parameters:
actionService -

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Injects the DictionaryService bean.

Parameters:
dictionaryService -

getRenderingEngineDefinition

public RenderingEngineDefinition getRenderingEngineDefinition(java.lang.String name)
Description copied from interface: RenditionService
Returns the RenderingEngineDefinition associated with the specified rendering engine name.

Specified by:
getRenderingEngineDefinition in interface RenditionService
Parameters:
name - The rendering engine name.
Returns:
The RenderingEngineDefinition or null.

getRenderingEngineDefinitions

public java.util.List getRenderingEngineDefinitions()
Specified by:
getRenderingEngineDefinitions in interface RenditionService
Returns:
A List of all available RenderingEngineDefinition s.

createRenditionDefinition

public RenditionDefinition createRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName,
                                                     java.lang.String renderingEngineName)
Description copied from interface: RenditionService
Creates a new RenditionDefinition and sets the rendition name and the rendering engine name to the specified values.

Specified by:
createRenditionDefinition in interface RenditionService
Parameters:
renditionDefinitionName - A unique identifier used to specify the created RenditionDefinition.
renderingEngineName - The name of the rendering engine associated with this RenditionDefinition.
Returns:
the created RenditionDefinition.

createCompositeRenditionDefinition

public CompositeRenditionDefinition createCompositeRenditionDefinition(org.alfresco.service.namespace.QName renditionName)
Description copied from interface: RenditionService
Creates a new CompositeRenditionDefinition and sets the rendition name and the rendering engine name to the specified values.

Specified by:
createCompositeRenditionDefinition in interface RenditionService
Parameters:
renditionName - A unique identifier used to specify the created RenditionDefinition.
Returns:
the created CompositeRenditionDefinition.

render

public org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
                                                                      RenditionDefinition definition)
Description copied from interface: RenditionService
This method synchronously renders content as specified by the given RenditionDefinition. The content to be rendered is provided by the specified source node.

Specified by:
render in interface RenditionService
Parameters:
sourceNode - the node from which the content is retrieved.
definition - this fully specifies the rendition which is to be performed.
Returns:
a child association reference which is the link from the source node to the newly rendered content.

render

public void render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
                   RenditionDefinition definition,
                   RenderCallback callback)
Description copied from interface: RenditionService
This method asynchronously renders content as specified by the given RenditionDefinition. The content to be rendered is provided by the specified source node.

Specified by:
render in interface RenditionService
Parameters:
sourceNode - the node from which the content is retrieved.
definition - this fully specifies the rendition which is to be performed.
callback - a callback object to handle the ultimate result of the rendition.

render

public org.alfresco.service.cmr.repository.ChildAssociationRef render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
                                                                      org.alfresco.service.namespace.QName renditionDefinitionQName)
Description copied from interface: RenditionService
This method synchronously renders content as specified by the given rendition name. The content to be rendered is provided by the specified source node.

The Rendition Definition will be loaded from the standard location as system thus allowing rendition definitions to be used even when the Data Dictionary has restricted read access.

Specified by:
render in interface RenditionService
Parameters:
sourceNode - the node from which the content is retrieved.
renditionDefinitionQName - the rendition definition which is to be performed.
Returns:
a child association reference which is the link from the source node to the newly rendered content.

render

public void render(org.alfresco.service.cmr.repository.NodeRef sourceNode,
                   org.alfresco.service.namespace.QName renditionDefinitionQName,
                   RenderCallback callback)
Description copied from interface: RenditionService
This method asynchronously renders content as specified by the given rendition definition name. The content to be rendered is provided by the specified source node.

The Rendition Definition will be loaded from the standard location as system thus allowing rendition definitions to be used even when the Data Dictionary has restricted read access.

Specified by:
render in interface RenditionService
Parameters:
sourceNode - the node from which the content is retrieved.
renditionDefinitionQName - the rendition definition which is to be performed.
callback - a callback object to handle the ultimate result of the rendition.

saveRenditionDefinition

public void saveRenditionDefinition(RenditionDefinition renderingAction)
Description copied from interface: RenditionDefinitionPersister
This method serializes the RenditionDefinition and stores it in the repository. RenditionDefinitions saved in this way may be retrieved using the load() method.

Specified by:
saveRenditionDefinition in interface RenditionDefinitionPersister
Parameters:
renderingAction - The RenditionDefinition to be persisted.

loadRenditionDefinition

public RenditionDefinition loadRenditionDefinition(org.alfresco.service.namespace.QName renditionDefinitionName)
Description copied from interface: RenditionDefinitionPersister
This method retrieves a RenditionDefinition that has been stored in the repository using the save() method. If no RenditionDefinition exists in the repository with the specified rendition name then this method returns null.

Specified by:
loadRenditionDefinition in interface RenditionDefinitionPersister
Parameters:
renditionDefinitionName - The unique identifier used to specify the RenditionDefinition to retrieve.
Returns:
The specified RenditionDefinition or null.

loadRenditionDefinitions

public java.util.List loadRenditionDefinitions()
Description copied from interface: RenditionDefinitionPersister
This method retrieves the RenditionDefinitions that have been stored in the repository using the save() method.

If there are no such RenditionDefinitions, an empty list is returned.

Specified by:
loadRenditionDefinitions in interface RenditionDefinitionPersister
Returns:
The RenditionDefinitions.

loadRenditionDefinitions

public java.util.List loadRenditionDefinitions(java.lang.String renditionEngineName)
Description copied from interface: RenditionDefinitionPersister
This method retrieves the stored RenditionDefinitions that have been registered for the specified rendering engine name.

If there are no such rendering RenditionDefinitions, an empty list is returned.

Specified by:
loadRenditionDefinitions in interface RenditionDefinitionPersister
Parameters:
renditionEngineName - the name of a rendering engine. This is usually the spring bean name.
Returns:
The RenditionDefinitions.
See Also:
RenditionDefinitionPersister.saveRenditionDefinition(RenditionDefinition)

getRenditions

public java.util.List getRenditions(org.alfresco.service.cmr.repository.NodeRef node)
Description copied from interface: RenditionService
This method gets all the renditions of the specified node.

Specified by:
getRenditions in interface RenditionService
Returns:
a list of ChildAssociationRefs which link the source node to the renditions.

getRenditions

public java.util.List getRenditions(org.alfresco.service.cmr.repository.NodeRef node,
                                    java.lang.String mimeTypePrefix)
Description copied from interface: RenditionService
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.

Specified by:
getRenditions in interface RenditionService
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:
a list of ChildAssociationRefs which link the source node to the filtered renditions.

getRenditionByName

public org.alfresco.service.cmr.repository.ChildAssociationRef getRenditionByName(org.alfresco.service.cmr.repository.NodeRef node,
                                                                                  org.alfresco.service.namespace.QName renditionName)
Description copied from interface: RenditionService
This method gets the rendition of the specified node identified by the provided rendition name.

Specified by:
getRenditionByName in interface RenditionService
Parameters:
node - the source node for the renditions
renditionName - the renditionName used to identify a rendition.
Returns:
the ChildAssociationRef which links the source node to the rendition or null if there is no such rendition.

isRendition

public boolean isRendition(org.alfresco.service.cmr.repository.NodeRef node)
Description copied from interface: RenditionService
This method returns true if the specified NodeRef is a valid rendition node, else false. A nodeRef is a rendition node if it has the rn:rendition aspect (or sub-aspect) applied.

Specified by:
isRendition in interface RenditionService
Returns:
true if a rendition, else false

getSourceNode

public org.alfresco.service.cmr.repository.ChildAssociationRef getSourceNode(org.alfresco.service.cmr.repository.NodeRef renditionNode)
Description copied from interface: RenditionService
This method gets the source node for the specified rendition node. There should only be one source node for any given rendition node.

Specified by:
getSourceNode in interface RenditionService
Parameters:
renditionNode - the nodeRef holding the rendition.
Returns:
the ChildAssociationRef whose parentNodeRef is the source node, or null if there is no source node.
See Also:
RenditionService.isRendition(NodeRef)


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