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.cms.util;
35
36 import java.io.InputStream;
37 import java.util.Calendar;
38 import java.util.Collection;
39
40 import javax.jcr.ItemNotFoundException;
41 import javax.jcr.PathNotFoundException;
42 import javax.jcr.Property;
43 import javax.jcr.RepositoryException;
44 import javax.jcr.Value;
45
46 import info.magnolia.cms.core.Content;
47 import info.magnolia.cms.core.HierarchyManager;
48 import info.magnolia.cms.core.NodeData;
49 import info.magnolia.cms.security.AccessDeniedException;
50
51
52
53
54
55
56
57 public abstract class NodeDataWrapper implements NodeData {
58
59 private NodeData wrappedNodeData;
60
61 public NodeDataWrapper() {
62 }
63
64 public NodeDataWrapper(NodeData wrappedNodeData) {
65 this.wrappedNodeData = wrappedNodeData;
66 }
67
68 public NodeData getWrappedNodeData() {
69 return this.wrappedNodeData;
70 }
71
72 public void setWrappedNodeData(NodeData wrappedNodeData) {
73 this.wrappedNodeData = wrappedNodeData;
74 }
75
76 public String toString() {
77 final StringBuilder buffer = new StringBuilder();
78 buffer.append(getClass().getSimpleName());
79 buffer.append(" for ");
80 buffer.append(getWrappedNodeData().toString());
81 return buffer.toString();
82 }
83
84
85 public void delete() throws RepositoryException {
86 getWrappedNodeData().delete();
87 }
88
89 public String getAttribute(String name) {
90 return getWrappedNodeData().getAttribute(name);
91 }
92
93 public Collection getAttributeNames() throws RepositoryException {
94 return getWrappedNodeData().getAttributeNames();
95 }
96
97 public boolean getBoolean() {
98 return getWrappedNodeData().getBoolean();
99 }
100
101 public long getContentLength() {
102 return getWrappedNodeData().getContentLength();
103 }
104
105 public Calendar getDate() {
106 return getWrappedNodeData().getDate();
107 }
108
109 public double getDouble() {
110 return getWrappedNodeData().getDouble();
111 }
112
113 public String getHandle() {
114 return getWrappedNodeData().getHandle();
115 }
116
117 public HierarchyManager getHierarchyManager() {
118 return getWrappedNodeData().getHierarchyManager();
119 }
120
121 public Property getJCRProperty() {
122 return getWrappedNodeData().getJCRProperty();
123 }
124
125 public long getLong() {
126 return getWrappedNodeData().getLong();
127 }
128
129 public String getName() {
130 return getWrappedNodeData().getName();
131 }
132
133 public Content getParent() throws AccessDeniedException, ItemNotFoundException, javax.jcr.AccessDeniedException, RepositoryException {
134 return getWrappedNodeData().getParent();
135 }
136
137 public Content getReferencedContent() throws RepositoryException, PathNotFoundException, RepositoryException {
138 return getWrappedNodeData().getReferencedContent();
139 }
140
141 public Content getReferencedContent(String repositoryId) throws PathNotFoundException, RepositoryException {
142 return getWrappedNodeData().getReferencedContent(repositoryId);
143 }
144
145 public InputStream getStream() {
146 return getWrappedNodeData().getStream();
147 }
148
149 public String getString() {
150 return getWrappedNodeData().getString();
151 }
152
153 public String getString(String lineBreak) {
154 return getWrappedNodeData().getString(lineBreak);
155 }
156
157 public int getType() {
158 return getWrappedNodeData().getType();
159 }
160
161 public Value getValue() {
162 return getWrappedNodeData().getValue();
163 }
164
165 public Value[] getValues() {
166 return getWrappedNodeData().getValues();
167 }
168
169 public boolean isExist() {
170 return getWrappedNodeData().isExist();
171 }
172
173 public boolean isGranted(long permissions) {
174 return getWrappedNodeData().isGranted(permissions);
175 }
176
177 public int isMultiValue() {
178 return getWrappedNodeData().isMultiValue();
179 }
180
181 public void refresh(boolean keepChanges) throws RepositoryException {
182 getWrappedNodeData().refresh(keepChanges);
183 }
184
185 public void save() throws RepositoryException {
186 getWrappedNodeData().save();
187 }
188
189 public void setAttribute(String name, Calendar value) throws RepositoryException, AccessDeniedException, UnsupportedOperationException {
190 getWrappedNodeData().setAttribute(name, value);
191 }
192
193 public void setAttribute(String name, String value) throws RepositoryException, AccessDeniedException, UnsupportedOperationException {
194 getWrappedNodeData().setAttribute(name, value);
195 }
196
197 public void setValue(boolean value) throws RepositoryException, AccessDeniedException {
198 getWrappedNodeData().setValue(value);
199 }
200
201 public void setValue(Calendar value) throws RepositoryException, AccessDeniedException {
202 getWrappedNodeData().setValue(value);
203 }
204
205 public void setValue(double value) throws RepositoryException, AccessDeniedException {
206 getWrappedNodeData().setValue(value);
207 }
208
209 public void setValue(InputStream value) throws RepositoryException, AccessDeniedException {
210 getWrappedNodeData().setValue(value);
211 }
212
213 public void setValue(int value) throws RepositoryException, AccessDeniedException {
214 getWrappedNodeData().setValue(value);
215 }
216
217 public void setValue(long value) throws RepositoryException, AccessDeniedException {
218 getWrappedNodeData().setValue(value);
219 }
220
221 public void setValue(String value) throws RepositoryException, AccessDeniedException {
222 getWrappedNodeData().setValue(value);
223 }
224
225 public void setValue(Content value) throws RepositoryException, AccessDeniedException {
226 getWrappedNodeData().setValue(value);
227 }
228
229 public void setValue(Value value) throws RepositoryException, AccessDeniedException {
230 getWrappedNodeData().setValue(value);
231 }
232
233 public void setValue(Value[] value) throws RepositoryException, AccessDeniedException {
234 getWrappedNodeData().setValue(value);
235 }
236
237 }