org.activemath.webapp.tutor.cgWebService.ServiceController
Class CourseGeneratorService

java.lang.Object
  extended by org.activemath.webapp.tutor.cgWebService.ServiceController.CourseGeneratorService

public class CourseGeneratorService
extends Object

This class provide the necessary interface for the CourseGeneratorWebService and performs validation and transactions.


Field Summary
static String CONNECTOR
          The CONNECTOR will be used to combine the identifiers of learnermodel and the learner.
 
Method Summary
 OJDocument generateCourse(String task, List contentIDs, Map learnerKnowledge)
          Call the course generator and returns the resulting course as an OJDocument.
 OJDocument generateCourse(String task, String learnerModelURL, String userID, List contentIDs)
          Calls the course generator and returns the resulting course as an OJDocument.
 String getDocumentManifestStream(OJDocument doc)
          Parse the given OJDocument and return a manifest in SCORM.
 String getDocumentString(OJDocument doc)
          Tries to parse the OJDocument and return a string of its content.
static CourseGeneratorService getInstance()
           
 String getTaskDefinitionDTDFile()
          Calls the TaskUtil to get URI of the DTD file for the XML file defining the task.
 String getTaskDefinitionXMLFile()
          Calls the TaskUtil to get the URI of the task definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTOR

public static final String CONNECTOR
The CONNECTOR will be used to combine the identifiers of learnermodel and the learner. For locating the learner in case of multiple learnermodel, we need first identify the learnermodel and then locate the learner in that learnermodel. Therefore we combine the two identifiers (of the learnermodel and of the learner) to a "combined learnerId". This combined learnerId will be treated as normal learnerId by generating the course. When the course generator asks the learnermodel interface for the learner information, the combined learnerId will be analysed by LearnerModelUtil. Thus, we need to define a CONNECTOR, which can be understood in this class, which handle the request for generating the course and combine identifiers of the learnermodel and the learner. The CONNECTOR which must be also understood by the LearnerModelUtil for spliting the combined learnerId.

See Also:
Constant Field Values
Method Detail

getInstance

public static CourseGeneratorService getInstance()

generateCourse

public OJDocument generateCourse(String task,
                                 String learnerModelURL,
                                 String userID,
                                 List contentIDs)
                          throws Exception
Calls the course generator and returns the resulting course as an OJDocument.

Parameters:
task -
learnerModelURL -
userID -
contentIDs -
Returns:
null or OJDocument containing the course
Throws:
Exception

generateCourse

public OJDocument generateCourse(String task,
                                 List contentIDs,
                                 Map learnerKnowledge)
                          throws Exception
Call the course generator and returns the resulting course as an OJDocument.

Parameters:
task -
contentIDs -
learnerKnowledge - a HashMap which contains contentId->mastery[1..4] pairs.
Returns:
null or OJDocuemnt contains the course
Throws:
Exception

getTaskDefinitionXMLFile

public String getTaskDefinitionXMLFile()
Calls the TaskUtil to get the URI of the task definitions.

Returns:
the URI of the XML file containing the task definitions.

getTaskDefinitionDTDFile

public String getTaskDefinitionDTDFile()
Calls the TaskUtil to get URI of the DTD file for the XML file defining the task.

Returns:
the URI of the DTD file distributing the XML file for definition of the task.

getDocumentString

public String getDocumentString(OJDocument doc)
Tries to parse the OJDocument and return a string of its content.

Parameters:
doc -
Returns:
XML String output of the OJDocument.

getDocumentManifestStream

public String getDocumentManifestStream(OJDocument doc)
Parse the given OJDocument and return a manifest in SCORM.

Parameters:
doc -
Returns:
manifest