|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
Generic base implementation for concrete ArchiveIO-classes. This makes implementing an ArchiveIOHandler
easier.
Field Summary | |
protected java.util.Map |
config
|
protected WikiEngine |
engine
|
Fields inherited from interface de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandler |
EXPORT, IMPORT |
Constructor Summary | |
ArchiveHandlerAbstract()
|
Method Summary | |
abstract java.lang.Object |
createData()
Creates an empty data source to be filled for export. |
protected abstract void |
createEntry(java.lang.Object data,
ArchiveEntry entry)
Creates a new archive entry in the data source handled by this ArchiveIOHandler. |
java.lang.String |
dataToString(java.lang.Object data)
Converts the handled data source to string for export. |
protected boolean |
equalEntries(ArchiveEntry a,
ArchiveEntry b)
Tests whether all data carried by two entries is the same. |
abstract java.lang.String |
getContentSuffix()
Content type for export via HTTP. |
abstract java.lang.String |
getContentType()
Content type for export via HTTP. |
WikiEngine |
getEngine()
|
void |
init(WikiEngine engine,
java.util.Map config)
Initialize this ArchiveHandler. |
protected abstract 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 abstract 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 abstract 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. |
protected abstract java.util.Map |
parseAll(java.lang.Object data)
Retrieves all archive entries from the data source. |
java.lang.String |
performIO(boolean io,
Archive archive,
java.lang.Object data,
int mode,
java.util.Collection exceptions)
Perform either input from the Archive model interface
into the data source handled by this ArchiveIOHandler. |
protected abstract void |
replaceEntry(java.lang.Object data,
ArchiveEntry newEntry,
ArchiveEntry oldEntry)
Replaces an archive entry in the data source handled by this ArchiveIOHandler. |
void |
setEngine(WikiEngine wikiEngine)
|
void |
stringToData(java.lang.String s,
java.lang.Object data)
Converts a string to a handled data source for import. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected WikiEngine engine
protected java.util.Map config
Constructor Detail |
public ArchiveHandlerAbstract()
Method Detail |
public void init(WikiEngine engine, java.util.Map config)
init
in interface ArchiveHandler
engine
- config
- public java.lang.String performIO(boolean io, Archive archive, java.lang.Object data, int mode, java.util.Collection exceptions) throws java.io.IOException
Archive
model interface
into the data source handled by this ArchiveIOHandler.
performIO
in interface ArchiveHandler
io
- Switch between input or output mode, Archive
model interface.archive
- The Archive
model interface.data
- The data source handled by this ArchiveIOHandler.mode
- The processing mode. This is a bit mask with:exceptions
- Collection of entry names that should be treated as exceptions to the behaviour specified by mode
. (Not used.)
java.io.IOException
- if an i/o error occurspublic abstract java.lang.Object createData() throws java.io.IOException
createData
in interface ArchiveHandler
java.io.IOException
public java.lang.String dataToString(java.lang.Object data) throws java.io.IOException
dataToString
in interface ArchiveHandler
data
-
java.io.IOException
public void stringToData(java.lang.String s, java.lang.Object data) throws java.io.IOException
stringToData
in interface ArchiveHandler
s
- data
-
java.io.IOException
public abstract java.lang.String getContentSuffix()
getContentSuffix
in interface ArchiveHandler
public abstract java.lang.String getContentType()
getContentType
in interface ArchiveHandler
protected abstract java.util.Map parseAll(java.lang.Object data) throws java.io.IOException
data
- The data source handled by this ArchiveIOHandler.
java.io.IOException
- if an i/o error occursprotected abstract void createEntry(java.lang.Object data, ArchiveEntry entry) throws java.io.IOException
data
- The data source handled by this ArchiveIOHandler.entry
- The entry.
java.io.IOException
- if an i/o error occursprotected abstract void replaceEntry(java.lang.Object data, ArchiveEntry newEntry, ArchiveEntry oldEntry) throws java.io.IOException
data
- The data source handled by this ArchiveIOHandler.newEntry
- The new entry.oldEntry
- The old entry.
java.io.IOException
- if an i/o error occursprotected boolean equalEntries(ArchiveEntry a, ArchiveEntry b)
a
- One archive entry.b
- Another archive entry.
protected abstract java.lang.String msgToDo(ArchiveEntry inEntry, ArchiveEntry outEntry, int mode)
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().
protected abstract java.lang.String msgDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
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().
protected abstract java.lang.String msgNotDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
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().
public WikiEngine getEngine()
public void setEngine(WikiEngine wikiEngine)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |