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.

Version:
$Id$

Constructor Summary
MetaDataBasedTemplateDefinitionAssignment(TemplateDefinitionRegistry templateDefinitionRegistry)
           
 
Method Summary
 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

getAssignedTemplateDefinition

public TemplateDefinition getAssignedTemplateDefinition(javax.jcr.Node content)
                                                 throws RegistrationException
Specified by:
getAssignedTemplateDefinition in interface TemplateDefinitionAssignment
Throws:
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-2012 Magnolia International Ltd.. All Rights Reserved.