org.activemath.webapp.clip
Class ClipsStorage
java.lang.Object
org.activemath.webapp.clip.ClipsStorage
public class ClipsStorage
- extends Object
Singleton to archive the contents of clips.
log
protected static org.apache.commons.logging.Log log
DEBUG
protected static final boolean DEBUG
DEFAULT_OMOBJ
public static final String DEFAULT_OMOBJ
- See Also:
- Constant Field Values
getInstance
public static ClipsStorage getInstance()
deleteAllClips
public void deleteAllClips(List<String> coords)
createClipCoordinate
public String createClipCoordinate(String omobj)
- Deprecated. please provide an appsession
createClipCoordinate
public String createClipCoordinate(AppSession session,
String omobj)
createClipCoordinate
public String createClipCoordinate(String exerciseId,
AppSession session,
String omobj)
- Allocates a coordinate that can be referenced for copy-and-paste to work.
- Parameters:
omobj - the OpenMath object to be stored, should be an XML documentsession - the AppSession to bind this to, so that the clip is at least
destroyed when the session goes downexerciseId - the ID of the currently running exercise, could be null; having it non-null
ensures that the clips allocated for this exercise are erased when the exercise is finished.
- Returns:
- a string coordinate clipCoord so that the content is accessible using simple GET from
/ActiveMath2/clip/clip.cmd?coordinate=clipCoord
putOmobjAtClip
public void putOmobjAtClip(String clipCoordinate,
String omobj)
getClipOpenMathFromStorage
public String getClipOpenMathFromStorage(String clipCoordinate)
removeClip
public void removeClip(String clipCoordinate)
getLastModified
public long getLastModified(String coord)
getLastRead
public long getLastRead(String coord)
finalize
protected void finalize()
- Overrides:
finalize in class Object
extractOpenMathClip
public static OJElement extractOpenMathClip(MBaseRef mbaseRef,
String coord)
seedCoordinatesIntoOmobjs
public void seedCoordinatesIntoOmobjs(org.jdom.Element elt,
AppSession appSession,
String exerciseId)
main
public static void main(String[] args)
throws Exception
- Throws:
Exception