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.context;
35
36 import info.magnolia.cms.core.search.QueryManager;
37 import info.magnolia.cms.core.HierarchyManager;
38 import info.magnolia.cms.security.AccessManager;
39 import info.magnolia.cms.security.User;
40
41 import java.util.Map;
42
43
44
45
46
47
48
49 public class ContextDecorator extends AbstractContext {
50
51 protected Context ctx;
52
53
54
55
56 public ContextDecorator(Context ctx) {
57 this.ctx = ctx;
58 }
59
60
61
62
63 public AccessManager getAccessManager(String repositoryId, String workspaceId) {
64 return this.ctx.getAccessManager(repositoryId, workspaceId);
65 }
66
67
68
69
70 public Object getAttribute(String name, int scope) {
71 return this.ctx.getAttribute(name, scope);
72 }
73
74
75
76
77 public Map<String, Object> getAttributes(int scope) {
78 return this.ctx.getAttributes(scope);
79 }
80
81
82
83
84 public HierarchyManager getHierarchyManager(String repositoryId, String workspaceId) {
85 return this.ctx.getHierarchyManager(repositoryId, workspaceId);
86 }
87
88
89
90
91 public User getUser() {
92 return this.ctx.getUser();
93 }
94
95
96
97
98 public void setAttribute(String name, Object value, int scope) {
99 this.ctx.setAttribute(name, value, scope);
100 }
101
102
103
104
105 public QueryManager getQueryManager(String repositoryId, String workspaceId) {
106 return this.ctx.getQueryManager(repositoryId, workspaceId);
107 }
108
109
110
111
112 public void removeAttribute(String name, int scope) {
113 this.ctx.removeAttribute(name, scope);
114 }
115
116
117
118
119
120 public Context getWrappedContext() {
121 return this.ctx;
122 }
123
124 public void release() {
125 this.ctx.release();
126 }
127
128 }