org.activemath.webapp.ws.delegation
Class DelegationGuide
java.lang.Object
org.activemath.webapp.ws.delegation.DelegationGuide
- Direct Known Subclasses:
- SietteDelegation
public class DelegationGuide
- extends Object
A simple class to play the role of guide-server in a browser-delegation process.
TODO: have a constructor "by-name" which refers to a sub-configuration where the needed URLs
are encoded (seems to bring in only the activity URL...)
TODO: consider: a velocity macro that expresses a link to such a named delegation... (and checks it before)
TODO: probably have ways to let such guides die after some time-out...
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.commons.logging.Log log
activityServerUrl
protected URL activityServerUrl
resourceActivityId
protected String resourceActivityId
userName
protected String userName
pathToComeBack
protected String pathToComeBack
guideServiceUrl
protected URL guideServiceUrl
guideService
protected DelegationGuide.GuideService guideService
activityServiceClient
protected org.apache.xmlrpc.XmlRpcClient activityServiceClient
currentStatus
protected String currentStatus
activityFinished
protected boolean activityFinished
score
protected double score
lastModified
protected long lastModified
DelegationGuide
protected DelegationGuide()
DelegationGuide
public DelegationGuide(Subconfiguration config,
String activityId,
String userName,
String pathToComeBack)
throws Exception
- Throws:
Exception
DelegationGuide
public DelegationGuide(URL activityServerUrl,
String activityId,
String userName,
String pathToComeBack)
- Constructs a delegation-guide which stores params and registers itself.
- Parameters:
activityServerUrl - the URL to the activity serveractivityId - the ID of the activity to be starteduserName - the user-name with which ity will happenpathToComeBack - the relative url-to-come-back if already known (relative to the service-URL)
(??)
createGuideService
protected DelegationGuide.GuideService createGuideService()
checkAvailability
public void checkAvailability()
throws org.apache.xmlrpc.XmlRpcException
- Throws:
org.apache.xmlrpc.XmlRpcException
sendWishToStart
public URL sendWishToStart()
- Invokes the start for delegation and returns the URL to send the learner to as well.
- Returns:
cancelActivity
public URL cancelActivity()
setPathToComeBack
public void setPathToComeBack(String path)
getUrlToComeBack
protected URL getUrlToComeBack()
removeGuideService
protected void removeGuideService()
activityFinished
protected Map activityFinished(Hashtable args)
- Called by the activity server through xml-rpc
- Parameters:
args - should contain: user
resourceId
score
- Returns:
- a map with at least
urlToComeBack (to be resolved along the URL
to call the service here)
isActivityFinished
public boolean isActivityFinished()
getScore
public double getScore()
updateStatus
protected void updateStatus(String status)
getCurrentStatus
public String getCurrentStatus()
getLastModified
public long getLastModified()