org.olat.modules.scorm.server.servermodels
Class SequencerModel

java.lang.Object
  extended by uk.ac.reload.jdom.XMLDocument
      extended by org.olat.modules.scorm.server.servermodels.SequencerModel

public class SequencerModel
extends uk.ac.reload.jdom.XMLDocument

This class is responsible for creating the xml file which persists the current state of the package

Author:
Paul Sharples

Field Summary
static java.lang.String ITEM_COMPLETED
          Comment for ITEM_COMPLETED
static java.lang.String ITEM_NOT_ATTEMPTED
          Comment for ITEM_NOT_ATTEMPTED
static java.lang.String ITEM_PASSED
          Comment for ITEM_PASSED
 
Constructor Summary
SequencerModel(java.io.File file, ISettingsHandler settings)
          Constructor takes a file (the nav xml file ref) and will try to load it either as new file or an existing file
 
Method Summary
 void addTrackedItem(java.lang.String itemId, java.lang.String orgId, java.lang.String value)
          Method to add a new item (or update an existing item) to the navigation file - used to persist package status
 java.lang.String getDefaultOrg()
           
 java.util.Hashtable getItemsAsHash(java.lang.String org)
          Method to get all item identifiers under a given organization
 java.lang.String getManifestModifiedDate()
           
 void saveDocument()
          Overide super method so we can decide if we want to cleanup the JDOM tree first - default - no cleanup
 void saveDocument(boolean cleanUp)
           
 void setDefaultOrg(java.lang.String orgName)
           
 void setManifestModifiedDate(long lastModified)
           
 void updateDiskModel(java.lang.String sco, java.lang.String status)
          Method to commit the navigation xml file to disk
 
Methods inherited from class uk.ac.reload.jdom.XMLDocument
destroy, getDocument, getElement, getElement, getElements, getFile, getNextSibling, getNextSiblingSameType, getPreviousSibling, getPreviousSiblingSameType, getRootElement, getRootNamespace, indexOfElement, isDirty, isDocumentNamespace, loadDocument, saveAsDocument, setDirty, setDocument, setFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEM_NOT_ATTEMPTED

public static final java.lang.String ITEM_NOT_ATTEMPTED
Comment for ITEM_NOT_ATTEMPTED

See Also:
Constant Field Values

ITEM_COMPLETED

public static final java.lang.String ITEM_COMPLETED
Comment for ITEM_COMPLETED

See Also:
Constant Field Values

ITEM_PASSED

public static final java.lang.String ITEM_PASSED
Comment for ITEM_PASSED

See Also:
Constant Field Values
Constructor Detail

SequencerModel

public SequencerModel(java.io.File file,
                      ISettingsHandler settings)
Constructor takes a file (the nav xml file ref) and will try to load it either as new file or an existing file

Parameters:
file -
Method Detail

setDefaultOrg

public void setDefaultOrg(java.lang.String orgName)
Parameters:
orgName -

getDefaultOrg

public java.lang.String getDefaultOrg()
Returns:
the default organisation

setManifestModifiedDate

public void setManifestModifiedDate(long lastModified)
Parameters:
lastModified -

getManifestModifiedDate

public java.lang.String getManifestModifiedDate()
Returns:
the modification date

updateDiskModel

public void updateDiskModel(java.lang.String sco,
                            java.lang.String status)
Method to commit the navigation xml file to disk

Parameters:
sco -
status -

getItemsAsHash

public java.util.Hashtable getItemsAsHash(java.lang.String org)
Method to get all item identifiers under a given organization

Parameters:
org -
Returns:
- has table with idenitifer and current status

addTrackedItem

public void addTrackedItem(java.lang.String itemId,
                           java.lang.String orgId,
                           java.lang.String value)
Method to add a new item (or update an existing item) to the navigation file - used to persist package status

Parameters:
itemId -
orgId -
value -

saveDocument

public void saveDocument()
                  throws java.io.IOException
Overide super method so we can decide if we want to cleanup the JDOM tree first - default - no cleanup

Overrides:
saveDocument in class uk.ac.reload.jdom.XMLDocument
Throws:
java.io.IOException

saveDocument

public void saveDocument(boolean cleanUp)
                  throws java.io.IOException
Parameters:
cleanUp - - a boolean to decide if the JDOM tree needs to be validated
Throws:
java.io.IOException