@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Template
TemplateDescription
.
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
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(UiConfig cfg, TabBuilder tab) { tab.fields(cfg.fields.richText("body").label("Text")); } }
TemplateDescription
,
Area
,
TabOrder
,
TabFactory
,
Available
,
I18nBasename
,
DialogFactory
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
Copyright © 2009–2015 Magnolia International Ltd.. All rights reserved.