1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.components.portletentity;
18
19 import java.util.HashMap;
20 import java.util.List;
21 import java.util.Map;
22
23 import org.apache.jetspeed.aggregator.PortletContent;
24 import org.apache.jetspeed.decoration.Decoration;
25 import org.apache.jetspeed.om.common.SecurityConstraint;
26 import org.apache.jetspeed.om.common.SecurityConstraints;
27 import org.apache.jetspeed.om.page.ContentFragment;
28 import org.apache.jetspeed.om.page.Fragment;
29
30 /***
31 * <p>
32 * ContentFramgentTestImpl
33 * </p>
34 *
35 * Dummy ContentFragment wrapper around Fragment as using the real ContentFragmentImpl would introduce a circular
36 * dependency between the registry and page-manager components. Probably should be replaced by a Mock but I don't
37 * know how to setup that quickly and the whole ContentFragment construction is bound to be replaced soon anyway...
38 *
39 * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
40 * @version $Id$
41 */
42 class ContentFragmentTestImpl implements Fragment, ContentFragment
43 {
44 private Fragment f;
45 private boolean instantlyRendered;
46
47 /***
48 * @param f
49 * @param list
50 */
51 public ContentFragmentTestImpl(Fragment f, HashMap list)
52 {
53 this(f, list, false);
54 }
55
56 public ContentFragmentTestImpl(Fragment f, HashMap list, boolean instantlyRendered)
57 {
58 this.f = f;
59 this.instantlyRendered = instantlyRendered;
60 }
61
62 /***
63 * @param actions
64 * @throws SecurityException
65 */
66 public void checkAccess(String actions) throws SecurityException
67 {
68 f.checkAccess(actions);
69 }
70
71 /***
72 * @param actions
73 * @throws SecurityException
74 */
75 public void checkConstraints(String actions) throws SecurityException
76 {
77 f.checkConstraints(actions);
78 }
79
80 /***
81 * @param mask
82 * @throws SecurityException
83 */
84 public void checkPermissions(int mask) throws SecurityException
85 {
86 f.checkPermissions(mask);
87 }
88
89 public SecurityConstraint newSecurityConstraint()
90 {
91 return f.newSecurityConstraint();
92 }
93
94 public SecurityConstraints newSecurityConstraints()
95 {
96 return f.newSecurityConstraints();
97 }
98
99 /***
100 * @see java.lang.Object#equals(java.lang.Object)
101 */
102 public boolean equals(Object obj)
103 {
104 return f.equals(obj);
105 }
106
107 /***
108 * @return contraints enabled
109 */
110 public boolean getConstraintsEnabled()
111 {
112 return f.getConstraintsEnabled();
113 }
114
115 /***
116 * @return decorator name
117 */
118 public String getDecorator()
119 {
120 return f.getDecorator();
121 }
122
123 /***
124 * @return list of fragments
125 */
126 public List getFragments()
127 {
128 return f.getFragments();
129 }
130
131 /***
132 * @return id
133 */
134 public String getId()
135 {
136 return f.getId();
137 }
138
139 /***
140 * @return name
141 */
142 public String getName()
143 {
144 return f.getName();
145 }
146
147 /***
148 * @return permissions enabled
149 */
150 public boolean getPermissionsEnabled()
151 {
152 return f.getPermissionsEnabled();
153 }
154
155
156 /***
157 * @return security constraints
158 */
159 public SecurityConstraints getSecurityConstraints()
160 {
161 return f.getSecurityConstraints();
162 }
163
164 /***
165 * @return short title
166 */
167 public String getShortTitle()
168 {
169 return f.getShortTitle();
170 }
171
172 /***
173 * @return skin name
174 */
175 public String getSkin()
176 {
177 return f.getSkin();
178 }
179
180 /***
181 * @return state string
182 */
183 public String getState()
184 {
185 return f.getState();
186 }
187
188 /***
189 * @return state string
190 */
191 public String getMode()
192 {
193 return f.getMode();
194 }
195
196 /***
197 * @return title
198 */
199 public String getTitle()
200 {
201 return f.getTitle();
202 }
203
204 /***
205 * @return type string
206 */
207 public String getType()
208 {
209 return f.getType();
210 }
211
212 /***
213 * @see java.lang.Object#hashCode()
214 */
215 public int hashCode()
216 {
217 return f.hashCode();
218 }
219
220 /***
221 * @return if its a reference
222 */
223 public boolean isReference()
224 {
225 return f.isReference();
226 }
227
228 /***
229 * @param decoratorName
230 */
231 public void setDecorator(String decoratorName)
232 {
233 f.setDecorator(decoratorName);
234 }
235
236 /***
237 * @param name
238 */
239 public void setName(String name)
240 {
241 f.setName(name);
242 }
243
244 /***
245 * @param constraints
246 */
247 public void setSecurityConstraints(SecurityConstraints constraints)
248 {
249 f.setSecurityConstraints(constraints);
250 }
251
252 /***
253 * @param title
254 */
255 public void setShortTitle(String title)
256 {
257 f.setShortTitle(title);
258 }
259
260 /***
261 * @param skinName
262 */
263 public void setSkin(String skinName)
264 {
265 f.setSkin(skinName);
266 }
267
268 /***
269 * @param state
270 */
271 public void setState(String state)
272 {
273 f.setState(state);
274 }
275
276 /***
277 * @param mode
278 */
279 public void setMode(String mode)
280 {
281 f.setMode(mode);
282 }
283
284 /***
285 * @param title
286 */
287 public void setTitle(String title)
288 {
289 f.setTitle(title);
290 }
291
292 /***
293 * @param type
294 */
295 public void setType(String type)
296 {
297 f.setType(type);
298 }
299
300 /***
301 * @see java.lang.Object#toString()
302 */
303 public String toString()
304 {
305 return f.toString();
306 }
307
308 /***
309 * @see org.apache.jetspeed.om.page.ContentFragment#getContentFragments()
310 */
311 public List getContentFragments()
312 {
313 return null;
314 }
315
316 /***
317 * @see org.apache.jetspeed.om.page.ContentFragment#getRenderedContent()
318 */
319 public String getRenderedContent() throws IllegalStateException
320 {
321 return null;
322 }
323
324 /***
325 * @see org.apache.jetspeed.om.page.ContentFragment#overrideRenderedContent(java.lang.String)
326 */
327 public void overrideRenderedContent(String contnent)
328 {
329 }
330
331
332
333
334 public String getOverriddenContent()
335 {
336 return null;
337 }
338
339 /***
340 * @see org.apache.jetspeed.om.page.ContentFragment#setPortletContent(org.apache.jetspeed.aggregator.PortletContent)
341 */
342 public void setPortletContent(PortletContent portletContent)
343 {
344 }
345
346 /***
347 * @see org.apache.jetspeed.om.page.Fragment#getLayoutRow()
348 */
349 public int getLayoutRow()
350 {
351 return -1;
352 }
353
354 /***
355 * @see org.apache.jetspeed.om.page.Fragment#getLayoutColumn()
356 */
357 public int getLayoutColumn()
358 {
359 return -1;
360 }
361
362 /***
363 * @see org.apache.jetspeed.om.page.Fragment#getLayoutSizes()
364 */
365 public String getLayoutSizes()
366 {
367 return null;
368 }
369
370 /***
371 * @see org.apache.jetspeed.om.page.Fragment#getLayoutX()
372 */
373 public float getLayoutX()
374 {
375 return -1.0F;
376 }
377
378 /***
379 * @see org.apache.jetspeed.om.page.Fragment#getLayoutY()
380 */
381 public float getLayoutY()
382 {
383 return -1.0F;
384 }
385
386 /***
387 * @see org.apache.jetspeed.om.page.Fragment#getLayoutZ()
388 */
389 public float getLayoutZ()
390 {
391 return -1.0F;
392 }
393
394 /***
395 * @see org.apache.jetspeed.om.page.Fragment#getLayoutWidth()
396 */
397 public float getLayoutWidth()
398 {
399 return -1.0F;
400 }
401
402 /***
403 * @see org.apache.jetspeed.om.page.Fragment#getLayoutHeight()
404 */
405 public float getLayoutHeight()
406 {
407 return -1.0F;
408 }
409
410 /***
411 * @see org.apache.jetspeed.om.page.Fragment#setLayoutRow(int)
412 */
413 public void setLayoutRow(int row)
414 {
415 }
416
417 /***
418 * @see org.apache.jetspeed.om.page.Fragment#setLayoutColumn(int)
419 */
420 public void setLayoutColumn(int column)
421 {
422 }
423
424 /***
425 * @see org.apache.jetspeed.om.page.Fragment#setLayoutSizes(java.lang.String)
426 */
427 public void setLayoutSizes(String sizes)
428 {
429 }
430
431 /***
432 * @see org.apache.jetspeed.om.page.Fragment#setLayoutX(float)
433 */
434 public void setLayoutX(float x)
435 {
436 }
437
438 /***
439 * @see org.apache.jetspeed.om.page.Fragment#setLayoutY(float)
440 */
441 public void setLayoutY(float y)
442 {
443 }
444
445 /***
446 * @see org.apache.jetspeed.om.page.Fragment#setLayoutZ(float)
447 */
448 public void setLayoutZ(float z)
449 {
450 }
451
452 /***
453 * @see org.apache.jetspeed.om.page.Fragment#setLayoutWidth(float)
454 */
455 public void setLayoutWidth(float width)
456 {
457 }
458
459 /***
460 * @see org.apache.jetspeed.om.page.Fragment#setLayoutHeight(float)
461 */
462 public void setLayoutHeight(float height)
463 {
464 }
465
466 /***
467 * @see org.apache.jetspeed.om.page.Fragment#getIntProperty(java.lang.String)
468 */
469 public int getIntProperty(String propName)
470 {
471 return -1;
472 }
473
474 /***
475 * @see org.apache.jetspeed.om.page.Fragment#getFloatProperty(java.lang.String)
476 */
477 public float getFloatProperty(String propName)
478 {
479 return -1.0F;
480 }
481
482 /***
483 * @see org.apache.jetspeed.om.page.Fragment#getPreferences()
484 */
485 public List getPreferences()
486 {
487 return null;
488 }
489
490 /***
491 * @see org.apache.jetspeed.om.page.Fragment#setPreferences(java.util.List)
492 */
493 public void setPreferences(List preferences)
494 {
495 }
496
497 /***
498 * @see org.apache.jetspeed.om.page.Fragment#getProperties()
499 */
500 public Map getProperties()
501 {
502 return null;
503 }
504
505 /***
506 * @see org.apache.jetspeed.om.page.Fragment#getProperty(java.lang.String)
507 */
508 public String getProperty(String propName)
509 {
510 return null;
511 }
512
513 public Decoration getDecoration()
514 {
515
516 return null;
517 }
518
519 public void setDecoration(Decoration decoration)
520 {
521
522
523 }
524
525
526
527
528 public boolean isInstantlyRendered()
529 {
530 return this.instantlyRendered;
531 }
532 }