de.tuberlin.cs.flp.jspwiki.plugin


Class WikiArchive

de.tuberlin.cs.flp.jspwiki.plugin.Category
    inheritde.tuberlin.cs.flp.jspwiki.plugin.WikiArchive

public class WikiArchive
Namespace: plugin


[{WikiArchive
(all parameters from the 'Category'-plugin, plus:)
[import=type1,type2,...]
[export=type1,type2,...]
[io=type1,type2,...] (sets both import and export, usual usage)
[categoryMarker='text with link to category-page'] (page-footer for import/exportm marking the page as a member of its category)
[usePageLinks] (use outgoing links from page, instead of category member. Useful e.g. for exporting from legacy-pseudo-categories and later create a new category)
[zipAttachments] (enable zip file import/export which may include attachments) }]

See also configuration parameters: ...enableDelete ...enableZipAttachments

Authors:
Jens Gulden


Attribute Summary
public static String  ATTRIBUTE_EXPORT_CONTENTDISPOSITION
Constant ATTRIBUTE_EXPORT_CONTENTDISPOSITION.  
public static String  ATTRIBUTE_EXPORT_CONTENTTYPE
Constant ATTRIBUTE_EXPORT_CONTENTTYPE.  
public static String  ATTRIBUTE_EXPORT_RESULT
Constant ATTRIBUTE_EXPORT_RESULT.  
public static int  BOTH
Constant BOTH.  
public static String  CHARACTER_ENCODING
Character encoding used by uploaded files and used for generating download data.  
public static String  DEFAULT_TEMP_DIR
Temporary directory used if not otherwise configured via parameter "jspwiki.plugin_name.uploadTempDir" in WEB-INF/jspwiki.properties.  
public static int  EXPORT
Constant EXPORT.  
public static int  IMPORT
Constant IMPORT.  
public static int  MODE_BOTH
Constant MODE_BOTH.  
public static int  MODE_INSERT
Constant MODE_INSERT.  
public static int  MODE_NONE
Constant MODE_NONE.  
public static int  MODE_SINGLE
Constant MODE_SINGLE.  
public static int  MODE_UPDATE
Constant MODE_UPDATE.  
public static String  PARAM_CATEGORY_MARKER
 
public static String  PARAM_EXPORT
 
public static String  PARAM_IMPORT
 
public static String  PARAM_IO
 
public static String  PARAM_MENU_POSITION
 
public static String  PARAM_USE_OUTGOING_LINKS
 
public static String  PARAM_ZIP_ATTACHMENTS
 

Method Summary
public static String   createZip(WikiEngine engine, String dataString, String filename, Collection pages)
 
protected void  deletePages(WikiEngine engine, Collection pageNames)
Removes a collection of pages from the Wiki. Files get deleted in the filesystem. This should have no disturbing effect on the running Wiki, but to be sure use this operation only when the Wiki can be manually restarted afterwards.  
protected String   deriveFullTitle(String name, WikiPage wikipage, WikiEngine engine)
 
protected static String   error(String s)
Formats a string as HTML-error message.  
public String   execute(WikiContext context, Map params)
Executes the plugin.  
public String   getProperty(WikiEngine engine, String propname)
Returns a property entry from the JSPWiki configuration file.  
public String   getProperty(WikiEngine engine, String propname, String defaultValue)
Returns a property entry from the JSPWiki configuration file.  
public String   getPropertyName(String propname)
Returns the property name for the specified sub-property. This means that "jspwiki.archivename." will be preprended to the propname.  
protected static String   hiddenfield(String name, String value)
Outputs an HTML-form-element for a hidden-field.  
public static void  pageEnd(HttpServletRequest request, HttpServletResponse response, JspWriter out)
Handles file downloads to the client. To be invoked by a Servlet/JSP after any other part of the page has been generated. If a download is to be performed, any previously generated page content will be removed. (See end of ViewTemplate.jsp.)  
public static String   resolveZip(WikiEngine engine, String dataString, Map attachmentsToBeFilled)
 
protected static String   selectbox(String name, Collection keys, Map labelsByKey, String value)
Outputs an HTML-form-element for a select-box.  
private static String   stackTrace(Throwable th)
 
protected static void  updateAttachment(WikiEngine engine, String path, byte[] data)
 
protected static void  updateAttachments(WikiEngine engine, Map attachments)
 
protected static String   warning(String s)
Formats a string as HTML-warning message.  

Tagged Values
static false
documentation#author Jens Gulden

Attribute Detail

ATTRIBUTE_EXPORT_CONTENTDISPOSITION

public static final String ATTRIBUTE_EXPORT_CONTENTDISPOSITION

Multiplicity: 1..1
Ordering: unspecified


Constant ATTRIBUTE_EXPORT_CONTENTDISPOSITION.


ATTRIBUTE_EXPORT_CONTENTTYPE

public static final String ATTRIBUTE_EXPORT_CONTENTTYPE

Multiplicity: 1..1
Ordering: unspecified


Constant ATTRIBUTE_EXPORT_CONTENTTYPE.


ATTRIBUTE_EXPORT_RESULT

public static final String ATTRIBUTE_EXPORT_RESULT

Multiplicity: 1..1
Ordering: unspecified


Constant ATTRIBUTE_EXPORT_RESULT.


BOTH

public static final int BOTH

Multiplicity: 1..1
Ordering: unspecified


Constant BOTH.


CHARACTER_ENCODING

public static final String CHARACTER_ENCODING

Multiplicity: 1..1
Ordering: unspecified


Character encoding used by uploaded files and used for generating download data.


DEFAULT_TEMP_DIR

public static final String DEFAULT_TEMP_DIR

Multiplicity: 1..1
Ordering: unspecified


Temporary directory used if not otherwise configured via parameter "jspwiki.plugin_name.uploadTempDir" in WEB-INF/jspwiki.properties.


EXPORT

public static final int EXPORT

Multiplicity: 1..1
Ordering: unspecified


Constant EXPORT.


IMPORT

public static final int IMPORT

Multiplicity: 1..1
Ordering: unspecified


Constant IMPORT.


MODE_BOTH

public static final int MODE_BOTH

Multiplicity: 1..1
Ordering: unspecified


Constant MODE_BOTH.


MODE_INSERT

public static final int MODE_INSERT

Multiplicity: 1..1
Ordering: unspecified


Constant MODE_INSERT.


MODE_NONE

public static final int MODE_NONE

Multiplicity: 1..1
Ordering: unspecified


Constant MODE_NONE.


MODE_SINGLE

public static final int MODE_SINGLE

Multiplicity: 1..1
Ordering: unspecified


Constant MODE_SINGLE.


MODE_UPDATE

public static final int MODE_UPDATE

Multiplicity: 1..1
Ordering: unspecified


Constant MODE_UPDATE.


PARAM_CATEGORY_MARKER

public static final String PARAM_CATEGORY_MARKER

Multiplicity: 1..1
Ordering: unspecified



PARAM_EXPORT

public static final String PARAM_EXPORT

Multiplicity: 1..1
Ordering: unspecified



PARAM_IMPORT

public static final String PARAM_IMPORT

Multiplicity: 1..1
Ordering: unspecified



PARAM_IO

public static final String PARAM_IO

Multiplicity: 1..1
Ordering: unspecified



PARAM_MENU_POSITION

public static final String PARAM_MENU_POSITION

Multiplicity: 1..1
Ordering: unspecified



PARAM_USE_OUTGOING_LINKS

public static final String PARAM_USE_OUTGOING_LINKS

Multiplicity: 1..1
Ordering: unspecified



PARAM_ZIP_ATTACHMENTS

public static final String PARAM_ZIP_ATTACHMENTS

Multiplicity: 1..1
Ordering: unspecified

Method Detail

createZip

public static String createZip(WikiEngine engine, String dataString, String filename, Collection pages)

Parameters:
engine -
dataString -
filename -
pages -
Returns:


deletePages

protected void deletePages(WikiEngine engine, Collection pageNames)


Removes a collection of pages from the Wiki. Files get deleted in the filesystem. This should have no disturbing effect on the running Wiki, but to be sure use this operation only when the Wiki can be manually restarted afterwards.
Parameters:
engine - The WikiEngine.
pageNames - The names of pages to be deleted.


deriveFullTitle

protected String deriveFullTitle(String name, WikiPage wikipage, WikiEngine engine)

Parameters:
name -
wikipage -
engine -
Returns:


error

protected static String error(String s)


Formats a string as HTML-error message.
Parameters:
s - The string to be formatted.
Returns:
The formatted HTML string.


execute

public String execute(WikiContext context, Map params)


Executes the plugin.
Method Tagged Values
documentation#throws PluginException if an error occurs

Parameters:
context - The WikiContext.
params - Parameters specified at plugin inclusion.
Returns:
HTML to be inserted into page
Exceptions:
PluginException if an error occurs


getProperty

public String getProperty(WikiEngine engine, String propname)


Returns a property entry from the JSPWiki configuration file.
Parameters:
engine - The WikiEngine.
propname - The propertyname, without leading "jspwiki..".
Returns:
The property value, or null if it does not exists.


getProperty

public String getProperty(WikiEngine engine, String propname, String defaultValue)


Returns a property entry from the JSPWiki configuration file.
Parameters:
engine - The WikiEngine.
propname - The propertyname, without leading "jspwiki..".
defaultValue -
Returns:
The property value, or null if it does not exists.


getPropertyName

public String getPropertyName(String propname)


Returns the property name for the specified sub-property. This means that "jspwiki.archivename." will be preprended to the propname.
Method Tagged Values
documentation#see #name

Parameters:
propname - The sub-property name.
Returns:
The full property name for reading from jspwiki.properties.
See also:
#name


hiddenfield

protected static String hiddenfield(String name, String value)


Outputs an HTML-form-element for a hidden-field.
Parameters:
name - The name of the field.
value - The value of the field.
Returns:


pageEnd

public static void pageEnd(HttpServletRequest request, HttpServletResponse response, JspWriter out)


Handles file downloads to the client. To be invoked by a Servlet/JSP after any other part of the page has been generated. If a download is to be performed, any previously generated page content will be removed. (See end of ViewTemplate.jsp.)
Method Tagged Values
documentation#throws IOException if an i/o error occurs

Parameters:
request - The http-request.
response - The http-response.
out - The page output writer.
Exceptions:
IOException if an i/o error occurs


resolveZip

public static String resolveZip(WikiEngine engine, String dataString, Map attachmentsToBeFilled)

Parameters:
engine -
dataString -
attachmentsToBeFilled -
Returns:


selectbox

protected static String selectbox(String name, Collection keys, Map labelsByKey, String value)


Outputs an HTML-form-element for a select-box.
Parameters:
name - The name of the select-box element.
keys - The value keys that are selectable by the select-box.
labelsByKey - A map assigning displayable labels bto each value key. The are the option texts presented to the user.
value - The current value to be pre-selected.
Returns:


stackTrace

private static String stackTrace(Throwable th)

Parameters:
th -
Returns:


updateAttachment

protected static void updateAttachment(WikiEngine engine, String path, byte[] data)

Parameters:
engine -
path -
data -


updateAttachments

protected static void updateAttachments(WikiEngine engine, Map attachments)

Parameters:
engine -
attachments -


warning

protected static String warning(String s)


Formats a string as HTML-warning message.
Parameters:
s - The string to be formatted.
Returns:
The formatted HTML string.

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.