001: /*
002: *
003: * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
004: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
005: */
006:
007: package com.sun.portal.comm.url;
008:
009: import com.sun.comclient.calendar.DateTime;
010:
011: public class FullURLBuilderTest extends URLBuilder implements MailURL,
012: CalURL, ABURL {
013:
014: private String calid = null;
015:
016: /**
017: * Lets invoking classes know if per-message urls are available
018: * in this URLBuilder.
019: *
020: * @return boolean Are message URLs available
021: */
022: public boolean allowsMessageURL() {
023: return true;
024: }
025:
026: /**
027: * Return URL string for specific message to be opened in mail client.
028: *
029: * @param javax.mail.Message The message to open
030: * @return String Message URL string
031: */
032: public String getMessageURL(javax.mail.Message msg) {
033: return "getMessageURL(" + msg + ")";
034: }
035:
036: /**
037: * Lets invoking classes know if composing URLs are available
038: * in this URLBuilder.
039: *
040: * @return boolean Are compisition URLs available
041: */
042: public boolean allowsComposeURL() {
043: return true;
044: }
045:
046: /**
047: * Return URL string to open the client's compose window.
048: *
049: * @param String Subject of the message
050: * @param javax.mail.Address[] Array of to: addresses
051: * @param javax.mail.Address[] Array of cc: addresses
052: * @param javax.mail.Address[] Array of bcc: addresses
053: * @return String Composition URL string
054: */
055: public String getComposeURL(String subject,
056: javax.mail.Address[] to, javax.mail.Address[] cc,
057: javax.mail.Address[] bcc) {
058: return "getComposeURL(" + subject + "," + to + "," + cc + ","
059: + bcc + ")";
060: }
061:
062: /**
063: * Lets invoking classes know if multiple view urls are available
064: * in this URLBuilder.
065: *
066: * @return boolean Are view URLs available
067: */
068: public boolean allowsViewURL() {
069: return true;
070: }
071:
072: /**
073: * Return URL string for specific view to be opened in cal client.
074: *
075: * @param String View
076: * @param String Date
077: * @return String View URL string
078: */
079: public String getViewURL(String view, String date) {
080: return "getViewURL(" + view + "," + date + ")";
081: }
082:
083: /**
084: * Lets invoking classes know if task URLs are available
085: * in this URLBuilder.
086: *
087: * @return boolean Are task URLs available
088: */
089: public boolean allowsTaskURL() {
090: return true;
091: }
092:
093: /**
094: * Return URL string for specific task to be opened in cal client.
095: *
096: * @param Object Task Object
097: * @return String Task URL string
098: */
099: public String getTaskURL(Object task) {
100: return "getTaskURL(" + task + ")";
101: }
102:
103: /**
104: * Lets invoking classes know if event URLs are available
105: * in this URLBuilder.
106: *
107: * @return boolean Are event URLs available
108: */
109: public boolean allowsEventURL() {
110: return true;
111: }
112:
113: /**
114: * Return URL string for specific event to be opened in cal client.
115: *
116: * @param Object Event Object
117: * @return String Event URL string
118: */
119: public String getEventURL(Object event) {
120: return "getEventURL(" + event + ")";
121: }
122:
123: /**
124: * Sets the calendar id
125: *
126: * @param String Calendar ID
127: */
128: public void setCalid(String calid) {
129: calid = this .calid;
130: }
131:
132: /**
133: * Return the calendar id
134: *
135: * @return String Calendar ID
136: */
137: public String getCalid() {
138: return "getCalid(): " + calid;
139: }
140:
141: /**
142: * Lets invoking classes know if contact urls are available
143: * in this URLBuilder.
144: *
145: * @return boolean Are contact URLs available
146: */
147: public boolean allowsContactURL() {
148: return true;
149: }
150:
151: /**
152: * Return URL string for specific contact to be opened in ab client.
153: *
154: * @param Object contact
155: * @return String View URL string
156: */
157: public String getContactURL(Object contact) {
158: return "getContactURL(" + contact + ")";
159: }
160:
161: /**
162: * Lets invoking clasess know is composeEvent is available
163: * in this URLBuilder
164: * @return boolean , is composeEvent available
165: */
166: public boolean allowsComposeEventURL() {
167: return true;
168: }
169:
170: /**
171: * Lets invoking clasess know is composeTask is available
172: * in this URLBuilder
173: * @return boolean , is composeTask available
174: */
175: public boolean allowsComposeTaskURL() {
176: return true;
177: }
178:
179: /**
180: * Return URL string to open the client's composeEvent window.
181: *
182: * @param String Subject of the event
183: * @param DateTime the DateTimeat which event should be created
184: * @return String Composition URL string
185: */
186: public String getComposeEventURL(DateTime datetime) {
187: return getStartURL();
188: }
189:
190: /**
191: * Return URL string to open the client's composeTask window.
192: *
193: * @param String Subject of the task
194: * @param DateTime the DateTimeat which event should be created
195: * @return String Composition URL string
196: */
197: public String getComposeTaskURL(DateTime datetime) {
198: return getStartURL();
199:
200: }
201:
202: }
|