org.activemath.tutor.coursegen.jshop2
Class JShopUtil

java.lang.Object
  extended by org.activemath.tutor.coursegen.jshop2.JShopUtil

public class JShopUtil
extends Object

This class contains utilities for converting a JShop2 plan into an OJDocument.


Field Summary
static String DYNAMIC_TASK_OPERATOR
          Insert a dynamic task.
static String END_SEC_OPERATOR
          End a section(Omgroup).
static String INSERT_ELE_OPERATOR
          Insert a referent to learning Object.
static String INSERT_SERVICE_OPERATOR
          Insert a learning service
static String START_SEC_OPERATOR
          Beginn a new section(Omgroup).
static String TEXT_OPERATOR
          Insert a text
 
Constructor Summary
JShopUtil()
           
 
Method Summary
static List convertToStringList(List course)
          convert the Predicate Objects in the List to Strings for more efficient parsing
static String getCurrentDate()
          This method return the current date of the system's computer in following format: "yyyy-MM-dd'T'HH:mm:ss"
static String getDocumentString(OJDocument omdoc)
          print out the DOM Object as XML string
static OJDocument plan2OmdocJDom(List course)
          This method is used to generate a OmdocJDom document from a JShop2 plan.
static List removeEmptySections(List course)
          Filter the list of String, remove such empty sections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_SEC_OPERATOR

public static final String START_SEC_OPERATOR
Beginn a new section(Omgroup).

See Also:
Constant Field Values

END_SEC_OPERATOR

public static final String END_SEC_OPERATOR
End a section(Omgroup).

See Also:
Constant Field Values

INSERT_ELE_OPERATOR

public static final String INSERT_ELE_OPERATOR
Insert a referent to learning Object. (e.g. mbase Reference)

See Also:
Constant Field Values

INSERT_SERVICE_OPERATOR

public static final String INSERT_SERVICE_OPERATOR
Insert a learning service

See Also:
Constant Field Values

TEXT_OPERATOR

public static final String TEXT_OPERATOR
Insert a text

See Also:
Constant Field Values

DYNAMIC_TASK_OPERATOR

public static final String DYNAMIC_TASK_OPERATOR
Insert a dynamic task. The semantic of dynamic task, see DynamicItemDynamicTask

See Also:
Constant Field Values
Constructor Detail

JShopUtil

public JShopUtil()
Method Detail

plan2OmdocJDom

public static OJDocument plan2OmdocJDom(List course)
This method is used to generate a OmdocJDom document from a JShop2 plan. The plan contains a list of predicate,which will be handled here to create the OJDocument. In this method, the list of predicate will be read recursively, and for each predicate there's an appropriate 'handler'. Here we just call a strategy methode 'parsePredicate()' to analyse the content of predicate and use the appropriate handler. As the concrete predicates are generated by JShop2, we have to transform the predicates to string.

Parameters:
course -
Returns:
OJDocument doc if the parameter 'course' is not null, null if the course is null

convertToStringList

public static List convertToStringList(List course)
convert the Predicate Objects in the List to Strings for more efficient parsing

Parameters:
course - (List of Predicate
Returns:
new list of Strings

removeEmptySections

public static List removeEmptySections(List course)
Filter the list of String, remove such empty sections. Empty section, which only have start section and endsection but no content.

Parameters:
course -
Returns:
the new list of String

getDocumentString

public static String getDocumentString(OJDocument omdoc)
print out the DOM Object as XML string

Returns:
the output String

getCurrentDate

public static String getCurrentDate()
This method return the current date of the system's computer in following format: "yyyy-MM-dd'T'HH:mm:ss"

Returns:
see above