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


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

Used on a Spring Web MVC controller to expose it as a paragraph. The title of the paragraph is set with this annotation while the description is set using ParagraphDescription.

A paragraph is added to a page using a dialog. A controller that uses this annotation automatically becomes a factory for its dialog. This dialog is unnamed and you do not need to add the DialogFactory annotation. The functionality for creating the unnamed 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 named dialog you can override this behaviour by setting the 'dialog' field.

You can use I18nBasename to specify which resource bundle should be used for localization of the paragraphs title, description and its unnamed dialog. For example this paragraph using an unnamed paragraph will be exposed with the name "textAndImage":

 @Controller
 @Paragraph("Text and Image")
 @ParagraphDescription("A simple paragraph for adding a piece of text optionally combined with an image")
 public class TextAndImageParagraph {
   @RequestMapping("/textAndImage")
   public String render() {
     return "text.jsp";
   }
   @TabFactory("Content")
   public void contentTab(TabBuilder tab) {
     tab.addFckEditor("body", "Text", "Text");
     tab.addFile("image", "Image", "Image");
   }
 }
 

Since:
0.5
See Also:
ParagraphDescription, I18nBasename, TabOrder, TabFactory, TabValidator, DialogValidator

Required Element Summary
 String value
          Title of the paragraph.
 
Optional Element Summary
 String dialog
          Name of a dialog to be used for this paragraph.
 String name
          Name of the paragraph, defaults to the handlerPath of the handler with any slashes removed.
 

Element Detail

value

public abstract String value
Title of the paragraph.

name

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

Default:
""

dialog

public abstract String dialog
Name of a dialog to be used for this paragraph. By default the controller itself will be responsible for creating the dialog.

Default:
""


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