01: /*
02: *
03: * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
04: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
05: */
06:
07: package com.sun.portal.comm.url;
08:
09: import com.sun.ssoadapter.SSOAdapter;
10:
11: import javax.mail.Address;
12: import javax.mail.Message;
13:
14: import java.io.BufferedReader;
15: import java.io.InputStreamReader;
16:
17: import java.net.HttpURLConnection;
18: import java.net.MalformedURLException;
19: import java.net.URL;
20:
21: public class NotesMailURLBuilder extends URLBuilder implements MailURL {
22:
23: /**
24: * Call prior init functions and set the path to the notes operation
25: *
26: * @param SSOAdapter ssoadapter used to init everything
27: */
28: public void init(SSOAdapter ssoAdapter) {
29: super .init(ssoAdapter);
30:
31: StringBuffer pathBuf = new StringBuffer("/mail/");
32: pathBuf.append(encode(adapterProperties.getProperty("uid")));
33: pathBuf.append(".nsf");
34: setPath(pathBuf.toString());
35: }
36:
37: /**
38: * Lets invoking classes know if per-message urls are available
39: * in this URLBuilder.
40: *
41: * @return boolean Are message URLs available
42: */
43: public boolean allowsMessageURL() {
44: return false;
45: }
46:
47: /**
48: * Return URL string for specific message to be opened in mail client.
49: * On error return the start URL
50: *
51: * @param javax.mail.Message The message to open
52: * @return String Message URL string
53: */
54: public String getMessageURL(Message message) {
55: return getStartURL();
56: }
57:
58: /**
59: * Lets invoking classes know if composing URLs are available
60: * in this URLBuilder.
61: *
62: * @return boolean Are compisition URLs available
63: */
64: public boolean allowsComposeURL() {
65: return false;
66: }
67:
68: /**
69: * Return URL string to open the client's compose window.
70: *
71: * @param String Subject of the message
72: * @param javax.mail.Address[] Array of to: addresses
73: * @param javax.mail.Address[] Array of cc: addresses
74: * @param javax.mail.Address[] Array of bcc: addresses
75: * @return String Composition URL string
76: */
77: public String getComposeURL(String subject, Address[] to,
78: Address[] cc, Address[] bcc) {
79: return getStartURL();
80: }
81:
82: }
|