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.io.IOException;
20 import java.util.Collection;
21
22 import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
23 import org.apache.jetspeed.om.page.ContentFragment;
24 import org.apache.jetspeed.om.page.Fragment;
25 import org.apache.pluto.om.common.ObjectID;
26 import org.apache.pluto.om.common.PreferenceSet;
27 import org.apache.pluto.om.entity.PortletEntity;
28 import org.apache.pluto.om.portlet.PortletDefinition;
29
30 /***
31 * <p>
32 * PortletEntityAccessComponent
33 * </p>
34 *
35 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
36 * @version $Id: PortletEntityAccessComponent.java,v 1.8 2005/04/29 13:59:46 weaver Exp $
37 *
38 */
39 public interface PortletEntityAccessComponent
40 {
41 /***
42 *
43 * <p>
44 * getPortletEntity
45 * </p>
46 *
47 * @param id
48 * @return
49 */
50 MutablePortletEntity getPortletEntity(ObjectID id);
51
52 MutablePortletEntity getPortletEntity(String id);
53
54 /***
55 *
56 * <p>
57 * generateEntityFromFragment
58 * </p>
59 *
60 * @param fragment
61 * @param principal
62 * @return
63 * @throws PortletEntityNotGeneratedException
64 */
65 MutablePortletEntity generateEntityFromFragment(ContentFragment fragment, String principal) throws PortletEntityNotGeneratedException;
66
67 /***
68 *
69 * <p>
70 * generateEntityFromFragment
71 * </p>
72 *
73 * @param fragment
74 * @return
75 * @throws PortletEntityNotGeneratedException
76 */
77 MutablePortletEntity generateEntityFromFragment(ContentFragment fragment) throws PortletEntityNotGeneratedException;
78
79 /***
80 *
81 * <p>
82 * generateEntityKey
83 * </p>
84 *
85 * @param fragment
86 * @param principal
87 * @return
88 */
89 ObjectID generateEntityKey(Fragment fragment, String principal);
90
91 /***
92 *
93 * <p>
94 * newPortletEntityInstance
95 * </p>
96 *
97 * @param portletDefinition
98 * @return
99 */
100 MutablePortletEntity newPortletEntityInstance(PortletDefinition portletDefinition);
101 MutablePortletEntity newPortletEntityInstance(PortletDefinition portletDefinition, String id);
102
103 /***
104 *
105 * <p>
106 * getPortletEntityForFragment
107 * </p>
108 *
109 * @param fragment
110 * @param principal
111 * @return
112 * @throws PortletEntityNotStoredException
113 */
114 MutablePortletEntity getPortletEntityForFragment(ContentFragment fragment, String principal) throws PortletEntityNotStoredException;
115
116 /***
117 *
118 * <p>
119 * getPortletEntityForFragment
120 * </p>
121 *
122 * @param fragment
123 * @return
124 * @throws PortletEntityNotStoredException
125 */
126 MutablePortletEntity getPortletEntityForFragment(ContentFragment fragment) throws PortletEntityNotStoredException;
127
128 /***
129 *
130 * <p>
131 * removePortletEntity
132 * </p>
133 *
134 * @param portletEntity
135 * @throws PortletEntityNotDeletedException
136 */
137 void removePortletEntity(PortletEntity portletEntity) throws PortletEntityNotDeletedException;
138
139 /***
140 *
141 * <p>
142 * removeFromCache
143 * </p>
144 * Removes a PortletEntity from the cache.
145 * @param entity
146 */
147 void removeFromCache(PortletEntity entity);
148
149 /***
150 * <p>
151 * updatePortletEntity
152 * </p>
153 *
154 * Updates portlet definition associated with the portlet
155 * entity to match the fragment configuration
156 *
157 * @param portletEntity
158 * @param fragment
159 * @throws PortletEntityNotStoredException
160 */
161 void updatePortletEntity(PortletEntity portletEntity, ContentFragment fragment) throws PortletEntityNotStoredException;
162
163 /***
164 *
165 * <p>
166 * storePortletEntity
167 * </p>
168 *
169 * @param portletEntity
170 * @throws PortletEntityNotStoredException
171 */
172 void storePortletEntity(PortletEntity portletEntity) throws PortletEntityNotStoredException;
173
174 /***
175 *
176 * <p>
177 * getPortletEntities
178 * </p>
179 *
180 * @param portletDefinition
181 * @return
182 */
183 Collection getPortletEntities(PortletDefinition portletDefinition);
184
185 Collection getPortletEntities( String portletUniqueName );
186
187 /***
188 *
189 * <p>
190 * removePortletEntities
191 * </p>
192 *
193 * @param portletDefinition
194 * @throws PortletEntityNotDeletedException
195 */
196 void removePortletEntities(PortletDefinition portletDefinition) throws PortletEntityNotDeletedException;
197
198
199 void storePreferenceSet(PreferenceSet prefSet, PortletEntity entity) throws IOException;
200
201 /***
202 * All preferences were shared. With JS2-449, preferences are now
203 * stored 'per user'. The username is stored in the preferences FULL_PATH
204 * To turn on mergeSharedPreferences configure this property to true
205 * in your Spring configuration. This will NOT turn off per user prefs,
206 * but instead merge with them, where user prefs override.
207 */
208 boolean isMergeSharedPreferences();
209 }