01: /*
02: * %W% %G% Sun Microsystems
03: *
04: * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
05: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
06: */
07:
08: package com.sun.portal.wireless.taglibs.commprefs;
09:
10: import com.sun.portal.wireless.taglibs.base.CollectionTag;
11:
12: import javax.servlet.jsp.JspException;
13: import java.util.Collection;
14:
15: public class PresetMsgsTag extends CollectionTag {
16:
17: /**
18: * Retrieve the Preset messages from the user profile and return them
19: * as a collection
20: *
21: * @return the collection
22: */
23: public Collection findCollection() throws JspException {
24:
25: // try to retrieve mail context from pagecontext ..
26: MailPrefsContext mailPrefsContext = null;
27: try {
28: mailPrefsContext = MailPrefsContext
29: .getPrefsContext(pageContext);
30: } catch (Exception e) {
31: throw new JspException(this .getClass().getName()
32: + ".findCollection() failed: " + e.getMessage());
33: }
34:
35: if (mailPrefsContext == null) {
36: throw new JspException(this .getClass().getName()
37: + ".findCollection(): Mail context not found");
38: }
39:
40: return mailPrefsContext.getPresetMessages();
41: }
42:
43: }
|