001: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal;
007:
008: import java.util.Date;
009:
010: import org.jasig.portal.security.IPerson;
011:
012: /**
013: * Interface defining how the portal reads and writes its channel types,
014: * definitions, and categories.
015: * @author Ken Weiner, kweiner@unicon.net
016: * @version $Revision: 36683 $
017: */
018: public interface IChannelRegistryStore {
019:
020: /**
021: * Creates a new channel type.
022: * @return the new channel type
023: * @throws java.lang.Exception
024: */
025: public ChannelType newChannelType() throws Exception;
026:
027: /**
028: * Get the channel type associated with a particular identifier.
029: * @param channelTypeId the channel type identifier
030: * @return channelType the channel type
031: * @throws java.lang.Exception
032: */
033: public ChannelType getChannelType(int channelTypeId)
034: throws Exception;
035:
036: /**
037: * Returns an array of ChannelTypes.
038: * @return the list of publishable channel types
039: * @throws java.lang.Exception
040: */
041: public ChannelType[] getChannelTypes() throws Exception;
042:
043: /**
044: * Persists a channel type.
045: * @param chanType a channel type
046: * @throws java.lang.Exception
047: */
048: public void saveChannelType(ChannelType chanType) throws Exception;
049:
050: /**
051: * Deletes a channel type. The deletion will only succeed if no existing
052: * channels reference the channel type.
053: * @param chanType a channel type
054: * @throws java.lang.Exception
055: */
056: public void deleteChannelType(ChannelType chanType)
057: throws Exception;
058:
059: /**
060: * Create a new ChannelDefinition object.
061: * @return the new channel definition
062: * @throws java.lang.Exception
063: */
064: public ChannelDefinition newChannelDefinition() throws Exception;
065:
066: /**
067: * Create a new ChannelDefinition object.
068: * @param id channel id
069: * @return the new channel definition
070: * @throws java.lang.Exception
071: */
072: public ChannelDefinition newChannelDefinition(int id)
073: throws Exception;
074:
075: /**
076: * Get a channel definition.
077: * @param channelPublishId a channel publish ID
078: * @return a definition of the channel or <code>null</code> if no matching channel definition can be found
079: * @throws java.lang.Exception
080: */
081: public ChannelDefinition getChannelDefinition(int channelPublishId)
082: throws Exception;
083:
084: /**
085: * Get a channel definition. If there is more than one channel definition
086: * with the given functional name, then the first one will be returned.
087: * @param channelFunctionalName a channel functional name
088: * @return a definition of the channel or <code>null</code> if no matching channel definition can be found
089: * @throws java.lang.Exception
090: */
091: public ChannelDefinition getChannelDefinition(
092: String channelFunctionalName) throws Exception;
093:
094: /**
095: * Get all channel definitions including ones that haven't been approved.
096: * @return channelDefs, the channel definitions
097: * @throws java.lang.Exception
098: */
099: public ChannelDefinition[] getChannelDefinitions() throws Exception;
100:
101: /**
102: * Persists a channel definition.
103: * @param channelDef the channel definition
104: * @throws java.lang.Exception
105: */
106: public void saveChannelDefinition(ChannelDefinition channelDef)
107: throws Exception;
108:
109: /**
110: * Permanently deletes a channel definition from the store.
111: * @param channelDef the channel definition
112: * @throws java.lang.Exception
113: */
114: public void deleteChannelDefinition(ChannelDefinition channelDef)
115: throws Exception;
116:
117: /**
118: * Sets a channel definition as "approved". This effectively makes a
119: * channel definition available in the channel registry, making the channel
120: * available for subscription.
121: * @param channelDef the channel definition
122: * @param approver the user that approves this channel definition
123: * @param approveDate the date when the channel definition should be approved (can be future dated)
124: * @throws java.lang.Exception
125: */
126: public void approveChannelDefinition(ChannelDefinition channelDef,
127: IPerson approver, Date approveDate) throws Exception;
128:
129: /**
130: * Sets a channel definition as "unapproved". This effectively removes a
131: * channel definition from the channel registry, making the channel
132: * unavailable for subscription.
133: * @param channelDef the channel definition
134: * @throws java.lang.Exception
135: */
136: public void disapproveChannelDefinition(ChannelDefinition channelDef)
137: throws Exception;
138:
139: /**
140: * Creates a new channel category.
141: * @return the new channel category
142: * @throws java.lang.Exception
143: */
144: public ChannelCategory newChannelCategory() throws Exception;
145:
146: /**
147: * Creates a new channel category with the specified values.
148: * @param name the name of the category
149: * @param description the name of the description
150: * @param creatorId the id of the creator or system
151: * @return channelCategory the new channel category
152: * @throws java.lang.Exception
153: */
154: public ChannelCategory newChannelCategory(String name,
155: String description, String creatorId) throws Exception;
156:
157: /**
158: * Gets an existing channel category.
159: * @param channelCategoryId the id of the category to get
160: * @return the channel category
161: * @throws java.lang.Exception
162: */
163: public ChannelCategory getChannelCategory(String channelCategoryId)
164: throws Exception;
165:
166: /**
167: * Gets top level channel category
168: * @return the new channel category
169: * @throws java.lang.Exception
170: */
171: public ChannelCategory getTopLevelChannelCategory()
172: throws Exception;
173:
174: /**
175: * Gets all child channel categories for a parent category.
176: * @return channelCategories the children categories
177: * @throws java.lang.Exception
178: */
179: public ChannelCategory[] getChildCategories(ChannelCategory parent)
180: throws Exception;
181:
182: /**
183: * Gets all child channel definitions for a parent category.
184: * @return channelDefinitions the children channel definitions
185: * @throws java.lang.Exception
186: */
187: public ChannelDefinition[] getChildChannels(ChannelCategory parent)
188: throws Exception;
189:
190: /**
191: * Gets the immediate parent categories of this category.
192: * @return parents, the parent categories.
193: * @throws java.lang.Exception
194: */
195: public ChannelCategory[] getParentCategories(ChannelCategory child)
196: throws Exception;
197:
198: /**
199: * Gets the immediate parent categories of this channel definition.
200: * @return the parent categories.
201: * @throws java.lang.Exception
202: */
203: public ChannelCategory[] getParentCategories(ChannelDefinition child)
204: throws Exception;
205:
206: /**
207: * Persists a channel category.
208: * @param category the channel category to persist
209: * @throws java.lang.Exception
210: */
211: public void saveChannelCategory(ChannelCategory category)
212: throws Exception;
213:
214: /**
215: * Deletes a channel category.
216: * @param category the channel category to delete
217: * @throws java.lang.Exception
218: */
219: public void deleteChannelCategory(ChannelCategory category)
220: throws Exception;
221:
222: /**
223: * Makes one category a child of another.
224: * @param source the source category
225: * @param destination the destination category
226: * @throws java.lang.Exception
227: */
228: public void addCategoryToCategory(ChannelCategory source,
229: ChannelCategory destination) throws Exception;
230:
231: /**
232: * Makes one category a child of another.
233: * @param child the category to remove
234: * @param parent the category to remove from
235: * @throws java.lang.Exception
236: */
237: public void removeCategoryFromCategory(ChannelCategory child,
238: ChannelCategory parent) throws Exception;
239:
240: /**
241: * Associates a channel definition with a category.
242: * @param channelDef the channel definition
243: * @param category the channel category to which to associate the channel definition
244: * @throws java.lang.Exception
245: */
246: public void addChannelToCategory(ChannelDefinition channelDef,
247: ChannelCategory category) throws Exception;
248:
249: /**
250: * Disassociates a channel definition from a category.
251: * @param channelDef the channel definition
252: * @param category the channel category from which to disassociate the channel definition
253: * @throws java.lang.Exception
254: */
255: public void removeChannelFromCategory(ChannelDefinition channelDef,
256: ChannelCategory category) throws Exception;
257:
258: }
|