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


Class ArchiveHandlerAbstract

All known Subclassifier:
ArchiveHandlerExternalFormatAbstract , ArchiveHandlerWiki

All known implemented Interfaces:
ArchiveHandler


public abstract class ArchiveHandlerAbstract
Namespace: wikiarchive


Generic base implementation for concrete ArchiveIO-classes. This makes implementing an ArchiveIOHandler easier.
Authors:
Jens Gulden
Version:
0.2.0


Attribute Summary
protected Map  config
 

Method Summary
public Object   createData()
Creates an empty data source to be filled for export.  
protected void  createEntry(Object data, ArchiveEntry entry)
Creates a new archive entry in the data source handled by this ArchiveIOHandler. @param plugin The WikiArcive plugin. 
public String   dataToString(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. Note that this is different from using Comparators on ArchiveEntry objects, because Comparators only look at entry-names, while this method compares all entry-data.  
public String   getContentSuffix()
Content type for export via HTTP.  
public String   getContentType()
Content type for export via HTTP.  
public void  init(WikiEngine engine, Map config)
Initialize this ArchiveHandler.  
protected String   msgDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
Outputs a message informing about the action that has been taken for an entry.  
protected String   msgNotDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)
Outputs a message informing that an action has not been taken for an entry.  
protected 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.  
protected Map   parseAll(Object data)
Retrieves all archive entries from the data source.  
public String   performIO(boolean io, Archive archive, Object data, int mode, Collection exceptions)
Perform either input from the Archive model interface into the data source handled by this ArchiveIOHandler. @param plugin The WikiArchive plugin. 
protected void  replaceEntry(Object data, ArchiveEntry newEntry, ArchiveEntry oldEntry)
Replaces an archive entry in the data source handled by this ArchiveIOHandler. @param plugin The WikiArcive plugin. 
public void  stringToData(String s, Object data)
Converts a string to a handled data source for import.  

Association Summary

Own Association End Summary

Opposite Association End Summary

Tagged Values
static false
documentation#author Jens Gulden
documentation#version 0.2.0

Attribute Detail

config

protected Map config

Multiplicity: 1..1
Ordering: unspecified

Method Detail

createData

public Object createData()


Creates an empty data source to be filled for export.
Returns:


createEntry

protected void createEntry(Object data, ArchiveEntry entry)


Creates a new archive entry in the data source handled by this ArchiveIOHandler. @param plugin The WikiArcive plugin.
Method Tagged Values
documentation#throws IOException if an i/o error occurs

Parameters:
data - The data source handled by this ArchiveIOHandler.
entry - The entry.
Exceptions:
IOException if an i/o error occurs


dataToString

public String dataToString(Object data)


Converts the handled data source to string for export.
Parameters:
data -
Returns:


equalEntries

protected boolean equalEntries(ArchiveEntry a, ArchiveEntry b)


Tests whether all data carried by two entries is the same. Note that this is different from using Comparators on ArchiveEntry objects, because Comparators only look at entry-names, while this method compares all entry-data.
Parameters:
a - One archive entry.
b - Another archive entry.
Returns:
true if both entries have equals content, false otherwise.


getContentSuffix

public String getContentSuffix()


Content type for export via HTTP.
Returns:


getContentType

public String getContentType()


Content type for export via HTTP.
Returns:


init

public void init(WikiEngine engine, Map config)


Initialize this ArchiveHandler.
Parameters:
engine -
config -


msgDone

protected String msgDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)


Outputs a message informing about the action that has been taken for an entry.
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 String msgNotDone(ArchiveEntry entry, ArchiveEntry outEntry, int mode)


Outputs a message informing that an action has not been taken for an entry.
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 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.
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.)


parseAll

protected Map parseAll(Object data)


Retrieves all archive entries from the data source.
Method Tagged Values
documentation#throws IOException if an i/o error occurs

Parameters:
data - The data source handled by this ArchiveIOHandler.
Returns:
Exceptions:
IOException if an i/o error occurs


performIO

public String performIO(boolean io, Archive archive, Object data, int mode, Collection exceptions)


Perform either input from the Archive model interface into the data source handled by this ArchiveIOHandler. @param plugin The WikiArchive plugin.
Method Tagged Values
documentation#throws IOException if an i/o error occurs

Parameters:
io - Switch between input or output mode, true for input into data source, false for output into 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:
bit #0 set: update exisiting entries with new values, if new data is different
bit #1 set: insert new entries
bit #2 set: ask individually for each entry (generate HTML checkbox-form first)
exceptions - Collection of entry names that should be treated as exceptions to the behaviour specified by mode. (Not used.)
Returns:
Exceptions:
IOException if an i/o error occurs


replaceEntry

protected void replaceEntry(Object data, ArchiveEntry newEntry, ArchiveEntry oldEntry)


Replaces an archive entry in the data source handled by this ArchiveIOHandler. @param plugin The WikiArcive plugin.
Method Tagged Values
documentation#throws IOException if an i/o error occurs

Parameters:
data - The data source handled by this ArchiveIOHandler.
newEntry - The new entry.
oldEntry - The old entry.
Exceptions:
IOException if an i/o error occurs


stringToData

public void stringToData(String s, Object data)


Converts a string to a handled data source for import.
Parameters:
s -
data -
Association Detail

Own Association End ArchiveHandlerAbstract

public ArchiveHandlerAbstract ArchiveHandlerAbstract [1..1]



Opposite Association End engine

protected WikiEngine engine [1..1] navigable

Association Tagged Values
gentleware-initialValue


previous   TOC   next

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in the USA and other countries. Copyright 2003-2006 Gentleware AG, Ludwigstr. 12, 20357 Hamburg, Germany. All Rights Reserved.
UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.