info.magnolia.rendering.template.assignment
Class MetaDataBasedTemplateDefinitionAssignment

java.lang.Object
  extended by info.magnolia.rendering.template.assignment.MetaDataBasedTemplateDefinitionAssignment
All Implemented Interfaces:
TemplateDefinitionAssignment

@Singleton
public class MetaDataBasedTemplateDefinitionAssignment
extends Object
implements TemplateDefinitionAssignment

Uses the template id stored in the node's meta data.


Constructor Summary
MetaDataBasedTemplateDefinitionAssignment(TemplateDefinitionRegistry templateDefinitionRegistry)
           
 
Method Summary
 String getAssignedTemplate(javax.jcr.Node content)
          Returns the id of the template assigned to a node or null if none has been assigned.
 TemplateDefinition getAssignedTemplateDefinition(javax.jcr.Node content)
           
 Collection<TemplateDefinition> getAvailableTemplates(javax.jcr.Node content)
           
 TemplateDefinition getDefaultTemplate(javax.jcr.Node content)
          Get the Template that could be used for the provided content as a default.
protected  boolean hasReadAccess(javax.jcr.Node content)
           
protected  boolean isAvailable(javax.jcr.Node content, TemplateDefinition templateDefinition)
           
protected  boolean isTemplateAvailable(javax.jcr.Node content, TemplateDefinition templateDefinition)
           
protected  boolean isVisible(TemplateDefinition templateDefinition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaDataBasedTemplateDefinitionAssignment

@Inject
public MetaDataBasedTemplateDefinitionAssignment(TemplateDefinitionRegistry templateDefinitionRegistry)
Method Detail

getAssignedTemplate

public String getAssignedTemplate(javax.jcr.Node content)
                           throws javax.jcr.RepositoryException
Description copied from interface: TemplateDefinitionAssignment
Returns the id of the template assigned to a node or null if none has been assigned.

Specified by:
getAssignedTemplate in interface TemplateDefinitionAssignment
Throws:
javax.jcr.RepositoryException

getAssignedTemplateDefinition

public TemplateDefinition getAssignedTemplateDefinition(javax.jcr.Node content)
                                                 throws info.magnolia.registry.RegistrationException
Specified by:
getAssignedTemplateDefinition in interface TemplateDefinitionAssignment
Throws:
info.magnolia.registry.RegistrationException

getDefaultTemplate

public TemplateDefinition getDefaultTemplate(javax.jcr.Node content)
Get the Template that could be used for the provided content as a default.

Specified by:
getDefaultTemplate in interface TemplateDefinitionAssignment

getAvailableTemplates

public Collection<TemplateDefinition> getAvailableTemplates(javax.jcr.Node content)
Specified by:
getAvailableTemplates in interface TemplateDefinitionAssignment

isTemplateAvailable

protected boolean isTemplateAvailable(javax.jcr.Node content,
                                      TemplateDefinition templateDefinition)

isVisible

protected boolean isVisible(TemplateDefinition templateDefinition)

isAvailable

protected boolean isAvailable(javax.jcr.Node content,
                              TemplateDefinition templateDefinition)

hasReadAccess

protected boolean hasReadAccess(javax.jcr.Node content)


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.