de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive
Class ArchiveHandlerExternalFormatAbstract

java.lang.Object
  extended byde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
      extended byde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerExternalFormatAbstract
All Implemented Interfaces:
ArchiveHandler
Direct Known Subclasses:
ArchiveHandlerBibTeX, ArchiveHandlerPlaintext, ArchiveHandlerXML

public abstract class ArchiveHandlerExternalFormatAbstract
extends ArchiveHandlerAbstract

Common superclass for archive handlers that interface to an external data format.


Field Summary
 
Fields inherited from class de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
config, engine
 
Fields inherited from interface de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandler
EXPORT, IMPORT
 
Constructor Summary
ArchiveHandlerExternalFormatAbstract()
           
 
Method Summary
 java.lang.Object createData()
          Creates an empty data source to be filled for export.
 java.lang.String dataToString(java.lang.Object data)
          Converts data source to string for export.
protected  java.lang.String msgDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
          Outputs a message informing about the action that has been taken for an entry.
protected  java.lang.String msgNotDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
          Outputs a message informing that an action has not been taken for an entry.
protected  java.lang.String msgToDo(ArchiveEntry inEntry, ArchiveEntry outEntry, int mode)
          Outputs a message informing about the possible action to be taken for an input entry, e.g.
 void stringToData(java.lang.String s, java.lang.Object data)
          Converts a string to a handled data source for import.
 
Methods inherited from class de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
createEntry, equalEntries, getContentSuffix, getContentType, getEngine, init, parseAll, performIO, replaceEntry, setEngine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveHandlerExternalFormatAbstract

public ArchiveHandlerExternalFormatAbstract()
Method Detail

createData

public java.lang.Object createData()
                            throws java.io.IOException
Creates an empty data source to be filled for export.

Specified by:
createData in interface ArchiveHandler
Specified by:
createData in class ArchiveHandlerAbstract
Returns:
Throws:
java.io.IOException

dataToString

public java.lang.String dataToString(java.lang.Object data)
                              throws java.io.IOException
Converts data source to string for export.

Specified by:
dataToString in interface ArchiveHandler
Overrides:
dataToString in class ArchiveHandlerAbstract
Parameters:
data -
Returns:
Throws:
java.io.IOException

stringToData

public void stringToData(java.lang.String s,
                         java.lang.Object data)
                  throws java.io.IOException
Converts a string to a handled data source for import.

Specified by:
stringToData in interface ArchiveHandler
Overrides:
stringToData in class ArchiveHandlerAbstract
Parameters:
s -
data -
Throws:
java.io.IOException

msgDone

protected java.lang.String msgDone(ArchiveEntry entry,
                                   ArchiveEntry outEntry,
                                   int mode)
Outputs a message informing about the action that has been taken for an entry.

Specified by:
msgDone in class ArchiveHandlerAbstract
Parameters:
entry - The entry processed.
outEntry - The currently existing possible output entry, or null if such does not exist yet.
mode - The action mode, like the mode parameter of performIO().
Returns:
The message string. (Actually used to build a part of an HTML-form user interface.)

msgNotDone

protected java.lang.String msgNotDone(ArchiveEntry entry,
                                      ArchiveEntry outEntry,
                                      int mode)
Outputs a message informing that an action has not been taken for an entry.

Specified by:
msgNotDone in class ArchiveHandlerAbstract
Parameters:
entry - The entry not processed.
outEntry - The currently existing possible output entry, or null if such does not exist yet.
mode - The action mode, like the mode parameter of performIO().
Returns:
The message string. (Actually used to build a part of an HTML-form user interface.)

msgToDo

protected java.lang.String msgToDo(ArchiveEntry inEntry,
                                   ArchiveEntry outEntry,
                                   int mode)
Outputs a message informing about the possible action to be taken for an input entry, e.g. whether it would be added as a new entry, or an existing one would be updated.

Specified by:
msgToDo in class ArchiveHandlerAbstract
Parameters:
inEntry - The input entry.
outEntry - The currently existing possible output entry, or null if such does not exist yet.
mode - The action mode, like the mode parameter of performIO().
Returns:
The message string. (Actually used to build a part of an HTML-form user interface.)