org.activemath.content.items
Class DynamicItemExerciseSequencer

java.lang.Object
  extended by org.activemath.content.items.Item
      extended by org.activemath.content.items.DynamicItem
          extended by org.activemath.content.items.DynamicItemLearningService
              extended by org.activemath.content.items.DynamicItemExerciseSequencer
All Implemented Interfaces:
Serializable

public class DynamicItemExerciseSequencer
extends DynamicItemLearningService

See Also:
Serialized Form

Field Summary
protected static Category log
           
protected static String ServiceName
           
 
Fields inherited from class org.activemath.content.items.DynamicItemLearningService
TYPE
 
Fields inherited from class org.activemath.content.items.DynamicItem
queryName, queryParameters, references, serializedNumber, serviceName, type, userId
 
Fields inherited from class org.activemath.content.items.Item
copyrights, dependsOn, factory, flavorSet, forId, forIds, id, mbaseId, metadata, omdocTag, omdocType, relatedTo, relationsIn, relationsOut, shouldUseTitleFromID, theoryId, title, titles
 
Constructor Summary
DynamicItemExerciseSequencer(OJDynamicItem ojitem, String id, String bookId)
           
 
Method Summary
 OJElement getTextualDOM()
          Construct the DOM tree for the textual representation of this item.
 void initTitles(String userId)
           
 List instanciateDynamicItem(String userId)
          This is a stratergie method for all kind of DynamicItem.
 void setLink(String url)
          We build up the hyperlink for the item here.
 
Methods inherited from class org.activemath.content.items.DynamicItem
getCopyrightData, getCopyrightElement, getForId, getForIds, getIncomingRelations, getMetadata, getMetadataElement, getOutgoingRelations, getQueryName, getQueryParameters, getReferences, getSerializedNumber, getServiceName, getTitles, getType, hasFlavors, initQueryParameters, isLazyTask, isNLGText, isServiceCall, isText, setLink, toOJDynamicItem, toString
 
Methods inherited from class org.activemath.content.items.Item
equals, getDependsOn, getDifficulty, getFlavorSet, getFullDOM, getId, getMBaseId, getNumWords, getOmdocTag, getOmdocType, getRelatedTo, getSystemId, getTheoryId, getTitle, getTitle, getTitle, getTitles, hashCode, setUseTitleFromID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static Category log

ServiceName

protected static final String ServiceName
See Also:
Constant Field Values
Constructor Detail

DynamicItemExerciseSequencer

public DynamicItemExerciseSequencer(OJDynamicItem ojitem,
                                    String id,
                                    String bookId)
Method Detail

instanciateDynamicItem

public List instanciateDynamicItem(String userId)
Description copied from class: DynamicItem
This is a stratergie method for all kind of DynamicItem. It generally use the userId to look up the relevant information from User Model and call the apporpriate Services and Methods to ask for a List as result. The Services or Methods should put the result as a List, e.g. by LazyTask it is a list of mbase Ids; or they can put the result as the first element of the list, if the service returns only one data object. The concret implement is in seperate subclass descripted.

Specified by:
instanciateDynamicItem in class DynamicItem
Parameters:
userId - - may be null
Returns:
an empty List if the caller don't expect any result, a list of mbase Ids for dynamicItemLazyTask as result, null if there's something wrong with executing.

setLink

public void setLink(String url)
We build up the hyperlink for the item here. The pupup window shown to the user will be set with given size and given type.

Parameters:
url -
width -
height -
type -

getTextualDOM

public OJElement getTextualDOM()
Description copied from class: Item
Construct the DOM tree for the textual representation of this item.

metadataand CMP children are fetched from MBase and put inside a theory element.

Overrides:
getTextualDOM in class Item
Returns:
this item in its textual DOM representation, or null if there is a problem.

initTitles

public void initTitles(String userId)
Specified by:
initTitles in class DynamicItem