001: /**
002: * Copyright 2002 Sun Microsystems, Inc. All
003: * rights reserved. Use of this product is subject
004: * to license terms. Federal Acquisitions:
005: * Commercial Software -- Government Users
006: * Subject to Standard License Terms and
007: * Conditions.
008: *
009: * Sun, Sun Microsystems, the Sun logo, and iPlanet
010: * are trademarks or registered trademarks of Sun Microsystems,
011: * Inc. in the United States and other countries.
012: */package com.sun.portal.app.calendarcommon.common;
013:
014: import java.util.Set;
015: import javax.faces.context.FacesContext;
016: import javax.portlet.PortletRequest;
017:
018: /**
019: * Utility methods relevant to the Shared services / portlets.
020: *
021: * @author Nigel Jacobs
022: * @created May 19, 2005
023: *
024: */
025: public interface SharedServicesUtils {
026:
027: /**
028: * The name of the servlet context attribute holding the SharedServicesUtils singleton
029: */
030: public static final String SHARED_SVCS_UTILS_CONTEXT_ATTR = "community.services.utils";
031:
032: /**
033: * The searchserverurl
034: */
035: public static final String SEARCH_SERVER_URL_ATTR = "ps.searchserverurl";
036: /**
037: * The searchdb
038: */
039: public static final String SEARCH_DB_ATTR = "ps.searchdb";
040:
041: /**
042: *
043: */
044: public static final String SSO_TOKEN_CONTEXT_ATTR = "javax.portlet.portletc.ssotoken";
045:
046: //public static final String COMMUNITY_ID_PREFS_ATTR = "community.id";
047:
048: /**
049: * Get the community id.
050: *
051: * @param request
052: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
053: * @return community id.
054: */
055: public String getCommunityID(PortletRequest request)
056: throws SharedServicesException;
057:
058: /**
059: * Get the community id.
060: *
061: * @param context
062: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
063: * @return community id.
064: */
065: public String getCommunityID(FacesContext context)
066: throws SharedServicesException;
067:
068: /**
069: * Get the current users community member id.
070: *
071: * @param request
072: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
073: * @return member id.
074: */
075: public String getCurrentMemberID(PortletRequest request)
076: throws SharedServicesException;
077:
078: /**
079: * Get the current users community member id.
080: *
081: * @param request
082: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
083: * @return member id.
084: */
085: public String getCurrentMemberID(FacesContext context)
086: throws SharedServicesException;
087:
088: /**
089: * Get the ids of all the members of the community, as a set of Strings.
090: *
091: * @param request
092: * @return member id Strings.
093: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
094: */
095: public Set getMemberIDs(PortletRequest request)
096: throws SharedServicesException;
097:
098: /**
099: * Get the ids of all the members of the community, as a set of Strings.
100: *
101: * @param context
102: * @return member id Strings.
103: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
104: */
105: public Set getMemberIDs(FacesContext context)
106: throws SharedServicesException;
107:
108: /**
109: * Get the URL of the community search server.
110: *
111: * @param request
112: * @return url String
113: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
114: */
115: public String getSearchServerURL(PortletRequest request)
116: throws SharedServicesException;
117:
118: /**
119: * Get the URL of the community search server.
120: *
121: * @param context
122: * @return url String
123: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
124: */
125: public String getSearchServerURL(FacesContext context)
126: throws SharedServicesException;
127:
128: /**
129: * Get the community search database.
130: *
131: * @param request
132: * @return database name
133: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
134: */
135: public String getSearchDatabase(PortletRequest request)
136: throws SharedServicesException;
137:
138: /**
139: * Get the community search database.
140: *
141: * @param context
142: * @return database name
143: * @throws com.sun.portal.app.SharedServices.common.SharedServicesException
144: */
145: public String getSearchDatabase(FacesContext context)
146: throws SharedServicesException;
147:
148: /**
149: * Clean up the resources.
150: */
151: public void destroy();
152:
153: }
|