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.CalendarStoreException;
010: import com.sun.comclient.calendar.CalendarStore;
011:
012: import com.sun.ssoadapter.SSOAdapter;
013:
014: import java.io.BufferedReader;
015: import java.io.InputStreamReader;
016: import java.io.IOException;
017:
018: import java.net.URLConnection;
019: import java.net.MalformedURLException;
020: import java.net.URL;
021: import com.sun.comclient.calendar.DateTime;
022:
023: public class NotesCalURLBuilder extends URLBuilder implements CalURL {
024:
025: private String calid = null;
026:
027: /**
028: * Call prior init functions and set the path to the notes operation
029: *
030: * @param SSOAdapter ssoadapter used to init everything
031: */
032: public void init(SSOAdapter ssoAdapter) {
033: super .init(ssoAdapter);
034:
035: StringBuffer pathBuf = new StringBuffer("/");
036: String mailFileName = ((CalendarStore) ssoAdapter
037: .getConnection()).getSession().getProperty(
038: "lotus.mailFileName");
039: if (mailFileName == null || mailFileName.length() == 0) {
040: pathBuf.append("mail/");
041: String idFileName = ((CalendarStore) ssoAdapter
042: .getConnection()).getSession().getProperty(
043: "lotus.sso.user");
044: if (idFileName == null || idFileName.length() == 0) {
045: idFileName = adapterProperties.getProperty("uid");
046: }
047: pathBuf.append(idFileName);
048: } else {
049: pathBuf.append(mailFileName);
050: }
051: pathBuf.append(".nsf");
052: setPath(pathBuf.toString());
053: }
054:
055: /**
056: * Sets the calendar id
057: *
058: * @param String Calendar ID
059: */
060: public void setCalid(String calid) {
061: this .calid = calid;
062: }
063:
064: /**
065: * Return the calendar id
066: *
067: * @return String Calendar ID
068: */
069: public String getCalid() {
070: return calid;
071: }
072:
073: /**
074: * Lets invoking classes know if multiple view urls are available
075: * in this URLBuilder.
076: *
077: * @return boolean Are view URLs available
078: */
079: public boolean allowsViewURL() {
080: return false;
081: }
082:
083: /**
084: * Return URL string for specific view to be opened in cal client.
085: *
086: * @param String View
087: * @param String Date
088: * @return String View URL string
089: */
090: public String getViewURL(String view, String date) {
091: return getStartURL();
092: }
093:
094: /**
095: * Lets invoking classes know if task URLs are available
096: * in this URLBuilder.
097: *
098: * @return boolean Are task URLs available
099: */
100: public boolean allowsTaskURL() {
101: return false;
102: }
103:
104: /**
105: * Return URL string for specific task to be opened in cal client.
106: *
107: * @param Object Task Object
108: * @return String Task URL string
109: */
110: public String getTaskURL(Object task) {
111: return getStartURL();
112: }
113:
114: /**
115: * Lets invoking classes know if event URLs are available
116: * in this URLBuilder.
117: *
118: * @return boolean Are event URLs available
119: */
120: public boolean allowsEventURL() {
121: return false;
122: }
123:
124: /**
125: * Return URL string for specific event to be opened in cal client.
126: *
127: * @param Object Event Object
128: * @return String Event URL string
129: */
130: public String getEventURL(Object event) {
131: return getStartURL();
132: }
133:
134: /**
135: * Lets invoking clasess know is composeEvent is available
136: * in this URLBuilder
137: * @return boolean , is composeEvent available
138: */
139: public boolean allowsComposeEventURL() {
140: return false;
141: }
142:
143: /**
144: * Lets invoking clasess know is composeTask is available
145: * in this URLBuilder
146: * @return boolean , is composeTask available
147: */
148: public boolean allowsComposeTaskURL() {
149: return false;
150: }
151:
152: /**
153: * Return URL string to open the client's composeEvent window.
154: *
155: * @param String Subject of the event
156: * @param DateTime the DateTimeat which event should be created
157: * @return String Composition URL string
158: */
159: public String getComposeEventURL(DateTime datetime) {
160: return getStartURL();
161: }
162:
163: /**
164: * Return URL string to open the client's composeTask window.
165: *
166: * @param String Subject of the task
167: * @param DateTime the DateTimeat which event should be created
168: * @return String Composition URL string
169: */
170: public String getComposeTaskURL(DateTime datetime) {
171: return getStartURL();
172:
173: }
174:
175: }
|