001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/integration/helper/ifc/AgentHelper.java $
003: * $Id: AgentHelper.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.integration.helper.ifc;
021:
022: import java.io.Serializable;
023: import java.util.Collection;
024: import java.util.Map;
025:
026: import javax.servlet.http.HttpServletRequest;
027: import javax.servlet.http.HttpServletResponse;
028:
029: import org.sakaiproject.tool.assessment.osid.shared.impl.AgentImpl;
030: import org.sakaiproject.tool.assessment.facade.AgentFacade;
031:
032: /**
033: *
034: * <p>Description:
035: * This is a context implementation helper delegate interface for
036: * the AgentFacade class. Using Spring injection via the integrationContext.xml
037: * selected by the build process to find the implementation.
038: * </p>
039: * <p>Sakai Project Copyright (c) 2005</p>
040: * <p> </p>
041: * @author Ed Smiley <esmiley@stanford.edu>
042: */
043:
044: public interface AgentHelper extends Serializable {
045:
046: public static final String UNASSIGNED_AGENT_STRING = "UNASSIGNED";
047:
048: public AgentImpl getAgent();
049:
050: public String getAgentString(String agentString);
051:
052: public String createAnonymous(AgentFacade agent);
053:
054: public String getAnonymousId(String agentString);
055:
056: public String getDisplayName(String agentString);
057:
058: public String getFirstName(String agentString);
059:
060: public String getLastName(String agentString);
061:
062: public String getEmail(String agentString);
063:
064: public String getRole(String agentString); // for static call
065:
066: public String getRoleForCurrentAgent(String agentString); // for instance call
067:
068: public String getCurrentSiteId(boolean accessViaUrl);
069:
070: public String getCurrentSiteName(boolean accessViaUrl);
071:
072: public String getSiteName(String siteId);
073:
074: public String getDisplayNameByAgentId(String agentId);
075:
076: public boolean isStandaloneEnvironment();
077:
078: public boolean isIntegratedEnvironment();
079:
080: public Map getUserRolesFromContextRealm(Collection inUsers);
081:
082: //cwen
083: public String getRoleForAgentAndSite(String agentString,
084: String siteId);
085:
086: public String getEid(String agentString);
087:
088: public String getEidById(String agentString);
089:
090: /**
091: * This is a kludge to work around a JSF scriptlet dependency introduced by cwen
092: * on org.sakaiproject.service.component.cover.ServerConfigurationService.
093: * @todo for 2.2 remove method when done with refactor.
094: * @deprecated
095: *
096: * @return true unless it is turned off
097: */
098: public boolean isFileUploadAvailable();
099:
100: }
|