001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.components.portletentity;
018:
019: import java.io.IOException;
020: import java.util.Collection;
021:
022: import org.apache.jetspeed.om.common.portlet.MutablePortletEntity;
023: import org.apache.jetspeed.om.page.ContentFragment;
024: import org.apache.jetspeed.om.page.Fragment;
025: import org.apache.pluto.om.common.ObjectID;
026: import org.apache.pluto.om.common.PreferenceSet;
027: import org.apache.pluto.om.entity.PortletEntity;
028: import org.apache.pluto.om.portlet.PortletDefinition;
029:
030: /**
031: * <p>
032: * PortletEntityAccessComponent
033: * </p>
034: *
035: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
036: * @version $Id: PortletEntityAccessComponent.java,v 1.8 2005/04/29 13:59:46 weaver Exp $
037: *
038: */
039: public interface PortletEntityAccessComponent {
040: /**
041: *
042: * <p>
043: * getPortletEntity
044: * </p>
045: *
046: * @param id
047: * @return
048: */
049: MutablePortletEntity getPortletEntity(ObjectID id);
050:
051: MutablePortletEntity getPortletEntity(String id);
052:
053: /**
054: *
055: * <p>
056: * generateEntityFromFragment
057: * </p>
058: *
059: * @param fragment
060: * @param principal
061: * @return
062: * @throws PortletEntityNotGeneratedException
063: */
064: MutablePortletEntity generateEntityFromFragment(
065: ContentFragment fragment, String principal)
066: throws PortletEntityNotGeneratedException;
067:
068: /**
069: *
070: * <p>
071: * generateEntityFromFragment
072: * </p>
073: *
074: * @param fragment
075: * @return
076: * @throws PortletEntityNotGeneratedException
077: */
078: MutablePortletEntity generateEntityFromFragment(
079: ContentFragment fragment)
080: throws PortletEntityNotGeneratedException;
081:
082: /**
083: *
084: * <p>
085: * generateEntityKey
086: * </p>
087: *
088: * @param fragment
089: * @param principal
090: * @return
091: */
092: ObjectID generateEntityKey(Fragment fragment, String principal);
093:
094: /**
095: *
096: * <p>
097: * newPortletEntityInstance
098: * </p>
099: *
100: * @param portletDefinition
101: * @return
102: */
103: MutablePortletEntity newPortletEntityInstance(
104: PortletDefinition portletDefinition);
105:
106: MutablePortletEntity newPortletEntityInstance(
107: PortletDefinition portletDefinition, String id);
108:
109: /**
110: *
111: * <p>
112: * getPortletEntityForFragment
113: * </p>
114: *
115: * @param fragment
116: * @param principal
117: * @return
118: * @throws PortletEntityNotStoredException
119: */
120: MutablePortletEntity getPortletEntityForFragment(
121: ContentFragment fragment, String principal)
122: throws PortletEntityNotStoredException;
123:
124: /**
125: *
126: * <p>
127: * getPortletEntityForFragment
128: * </p>
129: *
130: * @param fragment
131: * @return
132: * @throws PortletEntityNotStoredException
133: */
134: MutablePortletEntity getPortletEntityForFragment(
135: ContentFragment fragment)
136: throws PortletEntityNotStoredException;
137:
138: /**
139: *
140: * <p>
141: * removePortletEntity
142: * </p>
143: *
144: * @param portletEntity
145: * @throws PortletEntityNotDeletedException
146: */
147: void removePortletEntity(PortletEntity portletEntity)
148: throws PortletEntityNotDeletedException;
149:
150: /**
151: *
152: * <p>
153: * removeFromCache
154: * </p>
155: * Removes a PortletEntity from the cache.
156: * @param entity
157: */
158: void removeFromCache(PortletEntity entity);
159:
160: /**
161: * <p>
162: * updatePortletEntity
163: * </p>
164: *
165: * Updates portlet definition associated with the portlet
166: * entity to match the fragment configuration
167: *
168: * @param portletEntity
169: * @param fragment
170: * @throws PortletEntityNotStoredException
171: */
172: void updatePortletEntity(PortletEntity portletEntity,
173: ContentFragment fragment)
174: throws PortletEntityNotStoredException;
175:
176: /**
177: *
178: * <p>
179: * storePortletEntity
180: * </p>
181: *
182: * @param portletEntity
183: * @throws PortletEntityNotStoredException
184: */
185: void storePortletEntity(PortletEntity portletEntity)
186: throws PortletEntityNotStoredException;
187:
188: /**
189: *
190: * <p>
191: * getPortletEntities
192: * </p>
193: *
194: * @param portletDefinition
195: * @return
196: */
197: Collection getPortletEntities(PortletDefinition portletDefinition);
198:
199: Collection getPortletEntities(String portletUniqueName);
200:
201: /**
202: *
203: * <p>
204: * removePortletEntities
205: * </p>
206: *
207: * @param portletDefinition
208: * @throws PortletEntityNotDeletedException
209: */
210: void removePortletEntities(PortletDefinition portletDefinition)
211: throws PortletEntityNotDeletedException;
212:
213: void storePreferenceSet(PreferenceSet prefSet, PortletEntity entity)
214: throws IOException;
215:
216: /**
217: * All preferences were shared. With JS2-449, preferences are now
218: * stored 'per user'. The username is stored in the preferences FULL_PATH
219: * To turn on mergeSharedPreferences configure this property to true
220: * in your Spring configuration. This will NOT turn off per user prefs,
221: * but instead merge with them, where user prefs override.
222: */
223: boolean isMergeSharedPreferences();
224: }
|