Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. * Used on a Spring Web MVC controller to expose it as a template. A template is either used to render a page or a
  2. * component.
  3. * <p/>
  4. * The title of the template is set with this annotation while the description is set using
  5. * {@link info.magnolia.module.blossom.annotation.TemplateDescription}.
  6. * <p/>
  7. * A component is added to a page using a dialog. A controller that uses this annotation automatically becomes a factory
  8. * for its dialog. This dialog is automatically assigned an id and you do not need to add the
  9. * {@link info.magnolia.module.blossom.annotation.DialogFactory} annotation. The functionality for creating the dialog
  10. * is identical to the functionality of classes that use {@link info.magnolia.module.blossom.annotation.DialogFactory}.
  11. * More specifically you can use {@link TabFactory}, {@link TabValidator}, {@link DialogValidator} and {@link TabOrder}.
  12. * <p/>
  13. * If you prefer using a dialog created by a {@link DialogFactory} or one configured in Magnolia you can override this
  14. * behaviour by setting the 'dialog' field.
  15. * <p/>
  16. * The class will also be scanned for methods annotated with {@link DialogFactory}. This makes it possible to declare
  17. * dialogs in the same template that they're used for.
  18. * <p/>
  19. * It is possible to restrict on which pages a template can be used by using the
  20. * {@link info.magnolia.module.blossom.annotation.Available} annotation.
  21. * <p/>
  22. * You can use {@link info.magnolia.module.blossom.annotation.I18nBasename} to specify which resource bundle should be
  23. * used for localization of the template's title and description.
  24. * <p/>
  25. * For example this template will be exposed with the id "mainTemplate":
  26. * <pre>
  27. * &#64;Controller
  28. * &#64;Template(title = "Main", id = "moduleName:pages/main")
  29. * public class MainTemplate {
  30. * &#64;RequestMapping("/mainTemplate")
  31. * public String render() {
  32. * return "mainTemplate.jsp";
  33. * }
  34. * &#64;TabFactory("Content")
  35. * public void contentTab(TabBuilder tab) {
  36. * tab.addFckEditor("body", "Text", "Text");
  37. * tab.addFile("image", "Image", "Image");
  38. * }
  39. * }
  40. * </pre>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement