1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.templating.jsp.cms;
35
36 import info.magnolia.templating.elements.ComponentElement;
37
38 import java.util.Map;
39
40 import javax.servlet.jsp.JspException;
41
42 import org.tldgen.annotations.Attribute;
43 import org.tldgen.annotations.BodyContent;
44 import org.tldgen.annotations.Tag;
45
46
47
48
49
50
51
52
53 @Tag(name="component", bodyContent=BodyContent.EMPTY)
54
55 public class ComponentTag extends AbstractTag<ComponentElement> {
56
57
58 private String dialog;
59 private Object contextAttributes;
60 private Boolean editable;
61
62 @Attribute(required=false, rtexprvalue=true)
63 public void setEditable(Boolean editable) {
64 this.editable = editable;
65 }
66
67
68 @Attribute(required=false, rtexprvalue=true)
69 public void setDialog(String dialog) {
70 this.dialog = dialog;
71 }
72
73
74 @Attribute(required=false, rtexprvalue=true)
75 public void setContextAttributes(Object contextAttributes) {
76 this.contextAttributes = contextAttributes;
77 }
78
79 @Override
80 protected void prepareTemplatingElement(ComponentElement templatingElement) throws JspException{
81 initContentElement(templatingElement);
82
83 Map<String,Object> contextAttributes = mapConvertor(this.contextAttributes, "contextAttributes",false);
84 templatingElement.setDialog(dialog);
85 templatingElement.setEditable(editable);
86 templatingElement.setContextAttributes(contextAttributes);
87 }
88
89 }