org.activemath.webapp.tools.data
Class GapManager

java.lang.Object
  extended by org.activemath.webapp.tools.data.GapManager

public class GapManager
extends Object


Field Summary
protected static Logger log
          The logger for this class
 
Method Summary
 List<Gap> allGaps()
          By default, limit the number of entries to 100
 List<Gap> allGaps(Boolean limit)
           
 List<Gap> allGaps(Gap filterGap)
           
 boolean appendDataIfGapExists(Gap gap)
           
 void cleanUp(User user)
          cleans up leftovers from course generation gap detection removes presets to be deleted
 void cleanUp(User user, GapDetectionBook book)
          cleans up leftovers from course generation gap detection
 boolean deleteGapById(int gapId)
           
 Gap getAccessorGap()
          returns a config gap to access the static values in gap
 String getGapClass(Gap gap)
          gets the type of object which the gap contains
static GapManager getInstance()
           
 int getNumGaps()
          A way to determine if there are any gaps available
 int getOperationCount()
           
 void incOperationCount()
           
 boolean resetDatabase()
          resets the database to its initial state
 void resetOperationCount()
           
 Gap retrieveGapById(int gapId)
           
 boolean storeGap(Gap gap)
           
 String transformXMLToHTML(String MBaseId)
          makes xml source of item look good in browser
 String trimMBaseId(String MBaseId)
          removes square brackets
 boolean updateGap(Gap gap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
The logger for this class

Method Detail

getInstance

public static GapManager getInstance()

allGaps

public List<Gap> allGaps(Boolean limit)

allGaps

public List<Gap> allGaps()
By default, limit the number of entries to 100


allGaps

public List<Gap> allGaps(Gap filterGap)

retrieveGapById

public Gap retrieveGapById(int gapId)

storeGap

public boolean storeGap(Gap gap)

appendDataIfGapExists

public boolean appendDataIfGapExists(Gap gap)

resetDatabase

public boolean resetDatabase()
resets the database to its initial state


deleteGapById

public boolean deleteGapById(int gapId)

updateGap

public boolean updateGap(Gap gap)

getNumGaps

public int getNumGaps()
A way to determine if there are any gaps available

Returns:
number of stored gaps

transformXMLToHTML

public String transformXMLToHTML(String MBaseId)
                          throws OMConvertException
makes xml source of item look good in browser

Parameters:
m - the AppModel
Throws:
throws - OMConvertException if the constructor was not able to load the stylesheet
OMConvertException

getGapClass

public String getGapClass(Gap gap)
gets the type of object which the gap contains

Parameters:
gap - The gap for which the

trimMBaseId

public String trimMBaseId(String MBaseId)
removes square brackets

Parameters:
MBaseId - The String which is to be cleaned up
Returns:
a clean MBaseId for use with ContentManager

getOperationCount

public int getOperationCount()

incOperationCount

public void incOperationCount()

resetOperationCount

public void resetOperationCount()

cleanUp

public void cleanUp(User user,
                    GapDetectionBook book)
cleans up leftovers from course generation gap detection

Parameters:
user - the user who created a gap detection run
book - the gap detection book which has been assembled during the process

cleanUp

public void cleanUp(User user)
cleans up leftovers from course generation gap detection removes presets to be deleted

Parameters:
user - the user who created a gap detection run

getAccessorGap

public Gap getAccessorGap()
returns a config gap to access the static values in gap

Parameters:
user - the user who created a gap detection run