1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.page;
18
19 import java.util.List;
20
21 import org.apache.jetspeed.aggregator.PortletContent;
22 import org.apache.jetspeed.decoration.Decoration;
23
24
25 /***
26 *
27 * ContentFragment provides a volatile wrapper interface for
28 * actual {@link org.apache.jetspeed.om.page.Fragment} metadata
29 * objects. Since Fragments are cached and are not request specific
30 * they cannot be used to store request-level content. This is where
31 * we use the <code>ContentFragment</code> to solve this problem.
32 *
33 * @author weaver@apache.org
34 *
35 */
36 public interface ContentFragment extends Fragment
37 {
38 /***
39 * Provides a list of of child ContentFragments that wrap
40 * the actual Fragment metadata objects.
41 * @return
42 */
43 List getContentFragments();
44
45 /***
46 * Overridden to make it clear to the implemetor the {@link List}
47 * returned <strong>MUST</strong> ContentFragments and not
48 * just regular {@link org.apache.jetspeed.om.page.Fragment}s
49 *
50 * @return a collection containing ContentFragment objects
51 */
52 public List getFragments();
53
54 /***
55 *
56 * <p>
57 * getRenderedContent
58 * </p>
59 * <p>
60 * Returns the raw,undecorated content of this fragment. If
61 * overridenContent has been set and portlet content has not,
62 * overridden content should be returned.
63 * </p>
64 *
65 * @return The raw,undecorated content of this fragment.
66 * @throws java.lang.IllegalStateException if the content has not yet been set.
67 */
68 public String getRenderedContent() throws IllegalStateException;
69
70 /***
71 *
72 * <p>
73 * overrideRenderedContent
74 * </p>
75 * <p>
76 * Can be used to store errors that may have occurred during the
77 * rendering process.
78 * </p>
79 *
80 * @param contnent
81 */
82 public void overrideRenderedContent(String contnent);
83
84 /***
85 * @return the overridden content set by overrideRenderedContent
86 */
87 public String getOverriddenContent();
88 /***
89 *
90 * <p>
91 * setPortletContent
92 * </p>
93 *
94 * @param portletContent
95 */
96 public void setPortletContent(PortletContent portletContent);
97
98 /***
99 * Retrieves the actual <code>org.apache.jetspeed.decoration.decorator</code>
100 * object for this content fragment.
101 *
102 * TODO: Re-evaluate the naming as this is somewhat confusing
103 * due to the existence of Fragment.getDecorator()
104 * @return
105 */
106 Decoration getDecoration();
107
108 /***
109 *
110 * @param decoration
111 */
112 void setDecoration(Decoration decoration);
113
114 /***
115 * Checks if the content is instantly rendered from JPT.
116 */
117 public boolean isInstantlyRendered();
118
119 }