info.magnolia.module.blossom.annotation
Annotation Type Template


@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Template

Used on a Spring Web MVC controller to expose it as a template. A template in Magnolia is identified using a unique name. It is optional to specify the name explicitly using this annotation. By default the name will be generated using the path to which the controller is mapped to with all slashes removed.

The class will be scanned for methods annotated with DialogFactory. This makes it possible to declare dialogs in the same template that they're used for.

It is possible to restrict on which pages a template can be used by using the Available annotation.

You can use I18nBasename to specify which resource bundle should be used for localization of the templates title and description. For example this template will be exposed with the name "mainTemplate":

 @Controller
 @Template("Main")
 public class MainTemplate {
   @RequestMapping("/mainTemplate")
   public String render() {
     return "mainTemplate.jsp";
   }
 }
 

Since:
1.0
See Also:
Available, I18nBasename, DialogFactory

Required Element Summary
 String value
          Title of the template.
 
Optional Element Summary
 String description
          Description of the template.
 String name
          Name of the template, defaults to the handlerPath of the handler with all slashes removed.
 boolean visible
          Defines the visibility of the template.
 

Element Detail

value

public abstract String value
Title of the template.

description

public abstract String description
Description of the template.

Default:
""

name

public abstract String name
Name of the template, defaults to the handlerPath of the handler with all slashes removed. For example a controller mapped to '/sectiontemplate' will have the name 'sectiontemplate'.

Default:
""

visible

public abstract boolean visible
Defines the visibility of the template. When set to false the template is never presented in the user interface. This is useful for templates that are only used for pages that are created by scheduled jobs rather than by editors.

Default:
true


Copyright © 2009-2011 Magnolia International Ltd.. All Rights Reserved.