001: /*
002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005: package com.sun.portal.desktop.context;
006:
007: import com.sun.portal.desktop.dp.DPRoot;
008: import com.sun.portal.desktop.template.ParsedTagArray;
009: import com.sun.portal.providers.Provider;
010: import com.sun.portal.providers.ProviderException;
011: import com.sun.portal.providers.context.ContainerProviderContext;
012:
013: import javax.servlet.http.HttpServletRequest;
014: import javax.servlet.http.HttpServletResponse;
015: import javax.servlet.http.Cookie;
016: import java.io.File;
017: import java.util.Hashtable;
018: import java.util.List;
019: import java.util.Locale;
020: import java.util.Map;
021: import java.util.Set;
022:
023: public interface DesktopContext {
024: public void init(HttpServletRequest req);
025:
026: // BEGIN CR6344207
027: public boolean isInitDone();
028:
029: // END CR6344207
030:
031: /**
032: * Write out any modified data to the persistent store, if necessary.
033: */
034: public void store();
035:
036: public void refresh();
037:
038: public long getLastAccess();
039:
040: public void setLastAccess(long ms);
041:
042: public DPRoot getDPRoot();
043:
044: public void setDPRootCustomized(boolean state);
045:
046: public boolean isDPRootCustomized();
047:
048: public boolean getIsStale();
049:
050: public void setIsStale(boolean isStale);
051:
052: public Set getAncestors(HttpServletRequest req, String name);
053:
054: //
055: // service
056: //
057:
058: public String getLocaleString();
059:
060: public Locale getLocale();
061:
062: public String getDesktopType();
063:
064: public String getDesktopURL(HttpServletRequest req);
065:
066: public String getDesktopURL(HttpServletRequest req, Map query,
067: Map pathInfo);
068:
069: public String getDesktopURL(HttpServletRequest req, String query);
070:
071: public String getLogoutURL();
072:
073: public String getLoginURL();
074:
075: public String getDefaultChannelName();
076:
077: public void setDefaultChannelName(String channel);
078:
079: public String getEditProviderContainerName();
080:
081: public String getContainerProviderContextClassName();
082:
083: public String getPropertiesContextClassName();
084:
085: public Set getRoles();
086:
087: public String getTopChannelName(HttpServletRequest req);
088:
089: public void setTopChannelName(HttpServletRequest req, String channel);
090:
091: /**
092: * Gets the attribute. 'Attributes' are settings that are not
093: * channel-related (i.e. not stored in display profile)
094: *
095: * @param name The attribute name.
096: * @return The attribute value in String format. If property is
097: * not not found, return null.
098: */
099: public String getStringAttribute(String name);
100:
101: /**
102: * Gets the attribute. 'Attributes' are settings that are not
103: * channel-related (i.e. not stored in display profile). This API will
104: * for localized attribute. If the localized attribute is not present
105: * this API will return same result as getStringAttribute (name). Example
106: * getStringAttribute("cn" , Locale.JAPANESE) will look for attribute cn;lang-ja
107: * and if the attribute is not present it will return attribute value of cn.Since
108: * API performs a lookup, application should not assume that value returned is localised. ie
109: * if this API returns NULL, the value of attribute "cn" is NULL instead of cn;lang-ja
110: *
111: * @param name The attribute name.
112: * @param locale the user locale
113: * @return The attribute value in String format. If property is
114: * not not found, return null.
115: */
116: public String getStringAttribute(String name, Locale locale);
117:
118: /**
119: * Sets the attribute value. New data is persisted immediately.
120: *
121: * @param name The attribute name.
122: * @param name The attribute value.
123: */
124: public void setStringAttribute(String name, String val);
125:
126: //
127: // servlet request
128: //
129:
130: public StringBuffer getRequestServer(HttpServletRequest req);
131:
132: //
133: // client
134: //
135:
136: public String getContentType();
137:
138: public String getCharset();
139:
140: public String getClientType();
141:
142: public String getDefaultClientType();
143:
144: public String getClientPath();
145:
146: public String getClientTypeProperty(String key);
147:
148: public String getClientTypeProperty(String clientType, String key);
149:
150: public Set getClientTypeProperties(String clientType, String key);
151:
152: public String getEncoderClassName();
153:
154: //
155: // session
156: //
157:
158: /**
159: * Gets the property stored in this session.
160: *
161: * @param name The property name.
162: * @return The property value. If property is
163: * not not found, return null.
164: */
165: public Object getSessionProperty(String name);
166:
167: /**
168: * Sets a property for this session.
169: *
170: * @param name The property name
171: * @param val The property value
172: */
173: public void setSessionProperty(String name, Object val);
174:
175: public String getSessionID();
176:
177: public boolean isAuthless(HttpServletRequest req);
178:
179: public boolean isWSRP(HttpServletRequest req);
180:
181: public String getUserID();
182:
183: public void addUserListener(UserListener sl);
184:
185: public void addSessionListener(SessionListener sl);
186:
187: public String encodeURL(String url);
188:
189: public String getAuthenticationType();
190:
191: //
192: // client properties
193: //
194: public Cookie getClientProperties();
195:
196: public String getClientProperty(String name);
197:
198: public void setClientProperty(String name, String value);
199:
200: //
201: // container
202: //
203:
204: public Provider getProvider(HttpServletRequest req, String name);
205:
206: public ContainerProviderContext getContainerProviderContext();
207:
208: public StringBuffer getContent(HttpServletRequest req,
209: HttpServletResponse res, String name)
210: throws ContextException, ProviderException;
211:
212: public Map getContent(HttpServletRequest req,
213: HttpServletResponse res, List providers, int timeout)
214: throws ContextException, ProviderException;
215:
216: //
217: // template
218: //
219:
220: public ParsedTagArray getTemplate(String app, String provider,
221: String file);
222:
223: public ParsedTagArray getTemplate(String desktopType,
224: String locale, String app, String provider,
225: String clientType, String file, String baseDir);
226:
227: public StringBuffer getTemplate(String app, String provider,
228: String file, Hashtable table);
229:
230: public StringBuffer getTemplate(String desktopType, String locale,
231: String app, String provider, String clientType,
232: String file, Hashtable table, String baseDir);
233:
234: public File getTemplatePath(String app, String provider, String file);
235:
236: public File getTemplatePath(String desktopType, String locale,
237: String app, String provider, String clientType,
238: String file, String baseDir);
239:
240: public File getTemplateMostSpecificPath(String app,
241: String provider, String file);
242:
243: public File getTemplateMostSpecificPath(String desktopType,
244: String locale, String app, String provider,
245: String clientType, String file, String baseDir);
246:
247: //
248: // config
249: //
250: public String getTemplateBaseDir();
251:
252: public String getProviderClassBaseDir();
253:
254: public String getJSPScratchDir();
255:
256: public String getJSPCompilerWARClassPath();
257:
258: public String getStaticContentPath();
259:
260: public String getConfigProperty(String key);
261:
262: }
|