1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.services.cms.link;
18
19 import java.io.InputStream;
20 import java.util.Calendar;
21
22 import javax.jcr.Node;
23 import javax.jcr.Property;
24 import javax.jcr.RepositoryException;
25 import javax.jcr.Value;
26 import javax.jcr.ValueFormatException;
27 import javax.jcr.lock.LockException;
28 import javax.jcr.nodetype.ConstraintViolationException;
29 import javax.jcr.nodetype.PropertyDefinition;
30 import javax.jcr.version.VersionException;
31
32 import org.exoplatform.services.wcm.core.PropertyLocation;
33
34
35
36
37
38
39
40 public class PropertyLinkAware extends ItemLinkAware implements Property {
41
42 private final PropertyLocation propertyLocation;
43
44 public PropertyLinkAware(String originalWorkspace, String virtualPath, Property property) {
45 super(originalWorkspace, virtualPath, property);
46 this.propertyLocation = PropertyLocation.getPropertyLocationByProperty(property);
47 }
48
49 public Property getRealProperty() {
50 return PropertyLocation.getPropertyByLocation(propertyLocation);
51 }
52
53
54
55
56 public boolean getBoolean() throws ValueFormatException, RepositoryException {
57 return getRealProperty().getBoolean();
58 }
59
60
61
62
63 public Calendar getDate() throws ValueFormatException, RepositoryException {
64 return getRealProperty().getDate();
65 }
66
67
68
69
70 public PropertyDefinition getDefinition() throws RepositoryException {
71 return getRealProperty().getDefinition();
72 }
73
74
75
76
77 public double getDouble() throws ValueFormatException, RepositoryException {
78 return getRealProperty().getDouble();
79 }
80
81
82
83
84 public long getLength() throws ValueFormatException, RepositoryException {
85 return getRealProperty().getLength();
86 }
87
88
89
90
91 public long[] getLengths() throws ValueFormatException, RepositoryException {
92 return getRealProperty().getLengths();
93 }
94
95
96
97
98 public long getLong() throws ValueFormatException, RepositoryException {
99 return getRealProperty().getLong();
100 }
101
102
103
104
105 public Node getNode() throws ValueFormatException, RepositoryException {
106 return getRealProperty().getNode();
107 }
108
109
110
111
112 public InputStream getStream() throws ValueFormatException, RepositoryException {
113 return getRealProperty().getStream();
114 }
115
116
117
118
119 public String getString() throws ValueFormatException, RepositoryException {
120 return getRealProperty().getString();
121 }
122
123
124
125
126 public int getType() throws RepositoryException {
127 return getRealProperty().getType();
128 }
129
130
131
132
133 public Value getValue() throws ValueFormatException, RepositoryException {
134 return getRealProperty().getValue();
135 }
136
137
138
139
140 public Value[] getValues() throws ValueFormatException, RepositoryException {
141 return getRealProperty().getValues();
142 }
143
144
145
146
147 public void setValue(Value value) throws ValueFormatException,
148 VersionException,
149 LockException,
150 ConstraintViolationException,
151 RepositoryException {
152 getRealProperty().setValue(value);
153 }
154
155
156
157
158 public void setValue(Value[] values) throws ValueFormatException,
159 VersionException,
160 LockException,
161 ConstraintViolationException,
162 RepositoryException {
163 getRealProperty().setValue(values);
164 }
165
166
167
168
169 public void setValue(String value) throws ValueFormatException,
170 VersionException,
171 LockException,
172 ConstraintViolationException,
173 RepositoryException {
174 getRealProperty().setValue(value);
175 }
176
177
178
179
180 public void setValue(String[] values) throws ValueFormatException,
181 VersionException,
182 LockException,
183 ConstraintViolationException,
184 RepositoryException {
185 getRealProperty().setValue(values);
186 }
187
188
189
190
191 public void setValue(InputStream value) throws ValueFormatException,
192 VersionException,
193 LockException,
194 ConstraintViolationException,
195 RepositoryException {
196 getRealProperty().setValue(value);
197 }
198
199
200
201
202 public void setValue(long value) throws ValueFormatException,
203 VersionException,
204 LockException,
205 ConstraintViolationException,
206 RepositoryException {
207 getRealProperty().setValue(value);
208 }
209
210
211
212
213 public void setValue(double value) throws ValueFormatException,
214 VersionException,
215 LockException,
216 ConstraintViolationException,
217 RepositoryException {
218 getRealProperty().setValue(value);
219 }
220
221
222
223
224 public void setValue(Calendar value) throws ValueFormatException,
225 VersionException,
226 LockException,
227 ConstraintViolationException,
228 RepositoryException {
229 getRealProperty().setValue(value);
230 }
231
232
233
234
235 public void setValue(boolean value) throws ValueFormatException,
236 VersionException,
237 LockException,
238 ConstraintViolationException,
239 RepositoryException {
240 getRealProperty().setValue(value);
241 }
242
243
244
245
246 public void setValue(Node value) throws ValueFormatException,
247 VersionException,
248 LockException,
249 ConstraintViolationException,
250 RepositoryException {
251 getRealProperty().setValue(value);
252 }
253 }