org.sakaiproject.tool.assessment.facade
Class AgentFacade

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.facade.AgentFacade
All Implemented Interfaces:
AgentDataIfc, Serializable

public class AgentFacade
extends Object
implements Serializable, AgentDataIfc

Description: Facade for agent. Uses helper to determine integration context implementation.

Sakai Project Copyright (c) 2005

Author:
Ed Smiley
See Also:
Serialized Form

Constructor Summary
AgentFacade()
          Create AgentFacade and have it look up its own agentString (id).
AgentFacade(String agentId)
          Create AgentFacade for agent Id
 
Method Summary
static String createAnonymous()
          Create anonymous user and return the anonymous user id.
static AgentImpl getAgent()
          Get an osid Agent implementation class instance.
 String getAgentInstanceString()
          Get the agent string.
static String getAgentString()
          Get the agent string.
static String getAnonymousId()
          Get the anonymous user id.
static String getCurrentSiteId()
          Get the current site id.
static String getCurrentSiteName()
          Get the current site name.
 String getDisplayName()
          Get the Agent display name for this agent.
static String getDisplayName(String agentS)
          Get the Agent display name.
static String getDisplayNameByAgentId(String agentId)
          Get the display name for a specific agent id string.
 String getFirstName()
          Get the Agent first name.
 String getIdString()
           
 String getLastName()
          Get the Agent last name.
 String getRole()
          Get role for this agent.
static String getRole(String agentString)
          Get role for agent.
static String getRoleForAgentAndSite(String agentString, String siteId)
           
static String getSiteName(String siteId)
          Get the site name.
static Map getUserRolesFromContextRealm(Collection inUsers)
          Get the anonymous user id.
 boolean isAccessViaUrl()
           
static boolean isFileUploadAvailable()
          Deprecated.  
static boolean isIntegratedEnvironment()
          Is this an integrated environment?
static boolean isStandaloneEnvironment()
          Is this a standlaone environment?
 void setAccessViaUrl(boolean accessViaUrl)
           
 void setAgentInstanceString(String agentInstanceString)
           
 void setIdString(String idString)
          Change the agent string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentFacade

public AgentFacade(String agentId)
Create AgentFacade for agent Id

Parameters:
agentId - the agent Id

AgentFacade

public AgentFacade()
Create AgentFacade and have it look up its own agentString (id).

Method Detail

getAgent

public static AgentImpl getAgent()
Get an osid Agent implementation class instance.

Returns:
an AgentImpl: osid Agent implementation class.

getAgentString

public static String getAgentString()
Get the agent string. Static convenience method.

Returns:
the agent string.

getAgentInstanceString

public String getAgentInstanceString()
Get the agent string. Preferred approach: instantiate and then call this.

Returns:
the agent string.

getDisplayName

public static String getDisplayName(String agentS)
Get the Agent display name.

Parameters:
agentS - the Agent string.
Returns:
the Agent display name.

getDisplayName

public String getDisplayName()
Get the Agent display name for this agent.

Returns:
the Agent display name.

getFirstName

public String getFirstName()
Get the Agent first name.

Specified by:
getFirstName in interface AgentDataIfc
Returns:
the Agent first name.

getLastName

public String getLastName()
Get the Agent last name.

Specified by:
getLastName in interface AgentDataIfc
Returns:
the Agent last name.

getRole

public String getRole()
Get role for this agent.

Specified by:
getRole in interface AgentDataIfc
Returns:
role string

getRole

public static String getRole(String agentString)
Get role for agent.

Parameters:
agentString - the agent string.
Returns:
role string

getCurrentSiteId

public static String getCurrentSiteId()
Get the current site id.

Returns:
the site id.

getCurrentSiteName

public static String getCurrentSiteName()
Get the current site name.

Returns:
the site name.

getSiteName

public static String getSiteName(String siteId)
Get the site name.

Parameters:
siteId - site id
Returns:
the site name.

getIdString

public String getIdString()
Specified by:
getIdString in interface AgentDataIfc

getDisplayNameByAgentId

public static String getDisplayNameByAgentId(String agentId)
Get the display name for a specific agent id string.

Parameters:
agentId - the agent id string.
Returns:
the display name.

createAnonymous

public static String createAnonymous()
Create anonymous user and return the anonymous user id.

Returns:
the anonymous user id.

isStandaloneEnvironment

public static boolean isStandaloneEnvironment()
Is this a standlaone environment?

Returns:
false, in this implementation

isIntegratedEnvironment

public static boolean isIntegratedEnvironment()
Is this an integrated environment?

Returns:
true, in this implementation

getAnonymousId

public static String getAnonymousId()
Get the anonymous user id.

Returns:
the anonymous user id.

setIdString

public void setIdString(String idString)
Change the agent string

Specified by:
setIdString in interface AgentDataIfc
Parameters:
idString - the id string.

getUserRolesFromContextRealm

public static Map getUserRolesFromContextRealm(Collection inUsers)
Get the anonymous user id.

Returns:
the anonymous user id.

getRoleForAgentAndSite

public static String getRoleForAgentAndSite(String agentString,
                                            String siteId)

isAccessViaUrl

public boolean isAccessViaUrl()

setAccessViaUrl

public void setAccessViaUrl(boolean accessViaUrl)

setAgentInstanceString

public void setAgentInstanceString(String agentInstanceString)

isFileUploadAvailable

public static boolean isFileUploadAvailable()
Deprecated.  

This is a kludge to work around a JSF scriptlet dependency introduced by cwen on org.sakaiproject.service.framework.config.cover.ServerConfigurationService.

Returns:
true unless it is turned off