|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Template
Used on a Spring Web MVC controller to expose it as a template. A template is either used to render a page or a component.
The title of the template is set with this annotation while the description is set usingTemplateDescription
.
A component is added to a page using a dialog. A controller that uses this annotation automatically becomes a factory
for its dialog. This dialog is automatically assigned an id and you do not need to add the
DialogFactory
annotation. The functionality for creating the dialog
is identical to the functionality of classes that use DialogFactory
.
More specifically you can use TabFactory
, TabValidator
, DialogValidator
and TabOrder
.
If you prefer using a dialog created by a DialogFactory
or one configured in Magnolia you can override this
behaviour by setting the 'dialog' field.
The class will also 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 template's title and description.
For example this template will be exposed with the id "mainTemplate":
@Controller @Template(title = "Main", id = "moduleName:pages/main") public class MainTemplate { @RequestMapping("/mainTemplate") public String render() { return "mainTemplate.jsp"; } @TabFactory("Content") public void contentTab(TabBuilder tab) { tab.addFckEditor("body", "Text", "Text"); tab.addFile("image", "Image", "Image"); } }
TemplateDescription
,
Area
,
TabOrder
,
TabFactory
,
TabValidator
,
DialogValidator
,
Available
,
I18nBasename
,
DialogFactory
Required Element Summary | |
---|---|
String |
id
Id of the template. |
String |
title
Title of the template. |
Optional Element Summary | |
---|---|
String |
dialog
Id of a dialog to be used for this template. |
boolean |
visible
Defines the visibility of the template. |
Element Detail |
---|
public abstract String id
<moduleName>:pages/*
or if it's intended to be a component
<moduleName>:components/*
. For example: myModule:pages/mainTemplate
and
myModule:components/textAndImage
.
public abstract String title
public abstract String dialog
public abstract boolean visible
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |