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.module.templating;
35
36 import javax.jcr.RepositoryException;
37
38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory;
40
41 import info.magnolia.cms.beans.config.ContentRepository;
42 import info.magnolia.cms.core.Content;
43 import info.magnolia.cms.util.DeprecationUtil;
44 import info.magnolia.cms.util.NodeDataUtil;
45 import info.magnolia.context.MgnlContext;
46
47
48
49
50 public class Paragraph extends AbstractRenderable {
51
52 private final static Logger log = LoggerFactory.getLogger(Paragraph.class);
53
54
55
56
57 public String getTemplateType(){
58 DeprecationUtil.isDeprecated("The property templateType in paragraph definitions has changed to type" );
59 return getType();
60 }
61
62
63
64
65 public void setTemplateType(String type){
66 DeprecationUtil.isDeprecated("The property templateType in paragraph definitions has changed to type" );
67 setType(type);
68 }
69
70
71
72
73 public String getDialogPath(String path){
74 String msg = "The property dialogPath in paragraph definitions has been deprecated, use the dialog property instead";
75 DeprecationUtil.isDeprecated(msg);
76 throw new UnsupportedOperationException(msg);
77 }
78
79
80
81
82 public void setDialogPath(String path){
83 DeprecationUtil.isDeprecated("The property dialogPath in paragraph definitions has been deprecated, use the dialog property instead");
84 Content node;
85 try {
86 node = MgnlContext.getSystemContext().getHierarchyManager(ContentRepository.CONFIG).getContent(path);
87 String name = NodeDataUtil.getString(node, "name", node.getName());
88 setDialog(name);
89 }
90 catch (RepositoryException e) {
91 log.error("Can't determine dialog name using the path [" + path + "]", e);
92 }
93 }
94
95 }