org.olat.ims.qti.editor
Class QTIEditorPackage

java.lang.Object
  extended by org.olat.ims.qti.editor.QTIEditorPackage

public class QTIEditorPackage
extends java.lang.Object

Initial Date: 27.08.2003

Author:
Mike Stock

Field Summary
static java.lang.String FOLDERNAMEFOR_CHANGELOG
           
 
Constructor Summary
QTIEditorPackage(Identity identity, FileResource fileResource, Translator translator)
           
QTIEditorPackage(java.lang.String title, java.lang.String type, java.util.Locale locale)
          Create a new qtipackage.
 
Method Summary
 void cleanupTmpPackageDir()
          Cleanup any temporary directory for this qti file only.
 void commitChangelog(QTIChangeLogMessage clm)
          save the change log in the changelog folder, must be called before savePackageToRepository.
 VFSContainer getBaseDir()
           
 java.io.File getChangelogBaseDir()
          Returns the package's change log directory
 java.io.File getMediaBaseDir()
          Returns the package's media directory.
 java.lang.String getMediaBaseURL()
          Return the media base URL for delivering media of this package.
 QTIDocument getQTIDocument()
           
 OLATResourceable getRepresentingResourceable()
          Return the underlying resourceable.
static java.io.File getTmpBaseDir()
          Get the temporary root dir where all packages are located.
 boolean hasSerializedChangelog()
          check if a serialized change log exists
 boolean isResumed()
           
 java.util.Map loadChangelog()
          resume the change log from the temporary file
 void removeMediaFiles(java.util.Set<java.lang.String> removable)
          Remove the media files specified in the input set (removable contains filenames)
 boolean savePackageTo(java.io.File fOut)
          Package the package to the given file.
 boolean savePackageToRepository()
           
 void serializeChangelog(java.util.Map history)
          save a temporary file with the change history
 void serializeQTIDocument()
          Saves a serialized versionof the underlying QTIDocument.
 void setResumed(boolean b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLDERNAMEFOR_CHANGELOG

public static final java.lang.String FOLDERNAMEFOR_CHANGELOG
See Also:
Constant Field Values
Constructor Detail

QTIEditorPackage

public QTIEditorPackage(Identity identity,
                        FileResource fileResource,
                        Translator translator)
Parameters:
identity -
fileResource -

QTIEditorPackage

public QTIEditorPackage(java.lang.String title,
                        java.lang.String type,
                        java.util.Locale locale)
Create a new qtipackage.

Parameters:
title -
type -
locale -
Method Detail

getRepresentingResourceable

public OLATResourceable getRepresentingResourceable()
Return the underlying resourceable.

Returns:
OLATResourceable

getTmpBaseDir

public static java.io.File getTmpBaseDir()
Get the temporary root dir where all packages are located.

Returns:
The editor's package temp base directory.

getMediaBaseURL

public java.lang.String getMediaBaseURL()
Return the media base URL for delivering media of this package.

Returns:
Complete media base URL.

getMediaBaseDir

public java.io.File getMediaBaseDir()
Returns the package's media directory.

Returns:
the media directory

getBaseDir

public VFSContainer getBaseDir()

getChangelogBaseDir

public java.io.File getChangelogBaseDir()
Returns the package's change log directory

Returns:
change log directory

getQTIDocument

public QTIDocument getQTIDocument()
Returns:
Reutrns the QTIDocument structure

savePackageToRepository

public boolean savePackageToRepository()
Returns:
True upon success, false otherwise.

commitChangelog

public void commitChangelog(QTIChangeLogMessage clm)
save the change log in the changelog folder, must be called before savePackageToRepository.

Parameters:
changelog -

savePackageTo

public boolean savePackageTo(java.io.File fOut)
Package the package to the given file.

Parameters:
fOut -
Returns:
True upon success.

removeMediaFiles

public void removeMediaFiles(java.util.Set<java.lang.String> removable)
Remove the media files specified in the input set (removable contains filenames)

Parameters:
removable -

serializeQTIDocument

public void serializeQTIDocument()
Saves a serialized versionof the underlying QTIDocument.


serializeChangelog

public void serializeChangelog(java.util.Map history)
save a temporary file with the change history

Parameters:
history -

hasSerializedChangelog

public boolean hasSerializedChangelog()
check if a serialized change log exists

Returns:

loadChangelog

public java.util.Map loadChangelog()
resume the change log from the temporary file

Returns:

cleanupTmpPackageDir

public void cleanupTmpPackageDir()
Cleanup any temporary directory for this qti file only.


isResumed

public boolean isResumed()
Returns:
True if package has been resumed.

setResumed

public void setResumed(boolean b)
Parameters:
b -