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


Class ArchiveHandlerWiki

de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerAbstract
    inheritde.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerWiki

public class ArchiveHandlerWiki
Namespace: wikiarchive


I/O-handler for bidirectional data interchange from/to Wiki pages. This is the 'internal' i/o-handler of the Bibliography Wiki-archive.
Authors:
Jens Gulden
Version:
0.2.0


Inner Classifier Summary
public   WikiDataSource
Inner class.  

Attribute Summary
protected String  categoryMarker
 

Constructor Summary
public   ArchiveHandlerWiki(String categoryMarker)
 

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 static String   entry2wiki(ArchiveEntry entry, String categoryMarker, boolean useOutgoingLinks)
 
public String   getContentSuffix()
Content type for export via HTTP.  
public String   getContentType()
Content type for export via HTTP.  
protected static String   getNormalPageText(String s)
Returns all normal text in a wiki page, i.e. all text that is not part of a table.  
protected String   msgDone(ArchiveEntry inEntry, ArchiveEntry outEntry, int mode)
Outputs a message informing about the action that has been taken for an entry.  
protected String   msgNotDone(ArchiveEntry inEntry, 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. ("Parse" is not the best chosen term in this method's name, although in some cases it may perform parsing if the data source is a string.)  
protected static Map   parseWikiTableAsMap(String s)
Parses entries of a Wiki table as a key/value-map. The specified string gets scanned for Wiki-table markup (using '|' as marker), each first column of a table is considered to contain key values, each second column is taken as source for an entry-value. Other columns are not used.  
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.  
public static ArchiveEntry   wiki2entry(String pagename, String pagedata, String categoryMarker)
Converts Wiki-markup of a bibliography entry page in the Wiki to a ArchiveEntryBibTeX.  

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

Inner Classifier Detail

WikiDataSource

public  WikiDataSource


Inner class.
Inner Tagged Values
static false

Attribute Detail

categoryMarker

protected String categoryMarker

Multiplicity: 1..1
Ordering: unspecified

Constructor Detail

ArchiveHandlerWiki

public de.tuberlin.cs.flp.jspwiki.plugin.wikiarchive.ArchiveHandlerWiki ArchiveHandlerWiki(String categoryMarker)

Has stereotypes: << create >>
Parameters:
categoryMarker -
Returns:
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:


entry2wiki

protected static String entry2wiki(ArchiveEntry entry, String categoryMarker, boolean useOutgoingLinks)

Parameters:
entry -
categoryMarker -
useOutgoingLinks -
Returns:


getContentSuffix

public String getContentSuffix()


Content type for export via HTTP.
Returns:


getContentType

public String getContentType()


Content type for export via HTTP.
Returns:


getNormalPageText

protected static String getNormalPageText(String s)


Returns all normal text in a wiki page, i.e. all text that is not part of a table.
Parameters:
s -
Returns:


msgDone

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


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


Outputs a message informing that an action has not been taken for an entry.
Parameters:
inEntry - 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. ("Parse" is not the best chosen term in this method's name, although in some cases it may perform parsing if the data source is a string.)
Parameters:
data - The data source handled by this ArchiveIOHandler.
Returns:


parseWikiTableAsMap

protected static Map parseWikiTableAsMap(String s)


Parses entries of a Wiki table as a key/value-map. The specified string gets scanned for Wiki-table markup (using '|' as marker), each first column of a table is considered to contain key values, each second column is taken as source for an entry-value. Other columns are not used.
Method Tagged Values
documentation#see #bib2wiki(BibEntry)

Parameters:
s - Wiki-text with table markup.
Returns:
Map wih parsed key/value-pairs.
See also:
#bib2wiki(BibEntry)


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 -


wiki2entry

public static ArchiveEntry wiki2entry(String pagename, String pagedata, String categoryMarker)


Converts Wiki-markup of a bibliography entry page in the Wiki to a ArchiveEntryBibTeX.
Method Tagged Values
documentation#see #bib2wiki(ArchiveEntryBibTeX)

Parameters:
pagename - Name of a Wiki page representing a bibliography entry.
pagedata - The page's Wiki-markup.
categoryMarker -
Returns:
ArchiveEntryBibTeX parsed from the Wiki-page's table entries.
See also:
#bib2wiki(ArchiveEntryBibTeX)

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.