Fileexport Action Documentation
Not included in official Wikka versionSee also:
Development: FileexportActionDocumentation
Short description
Exports a selection of wiki pages to an HTML or XML file.Parameters
name | type | required? | default | description |
---|---|---|---|---|
type | string | optional | html | Allowed values are 'html', 'rawhtml' and 'xml' |
scope | string | optional | m | Scope of export, i.e. set of pages to be exported. Allowed values are 'm' (mine=all pages owned by current user), 'o' (others=include pages owned by me+others), 'p' (public=include mine, others' and public -i.e. system- pages) and a valid page tag (export only this page) |
sort | string | optional | tag | Sort order of selected pages. Allowed values are 'tag' (sort on page tag), 'title' (sort on page title) and 'time' (sort on timestamp of last update) |
opts | string | optional | Options: any combination of 'e' (embed the CSS stylesheet) and 'r' (remove external hyperlinks) | |
cats | string | optional | Select only pages belonging to any of the specified categories, passed as a list of Cat1, Cat2... |
Long description
This action displays on the page an hyperlink for downloading a one-file collection of selected wiki pages. The format and the content of the exported file can be controlled as follows:- file format: it can be either of:
- HTML: all selected wiki pages are merged into a single web page including a table of contents. This is a convenient way to extract from a wiki a self-contained HTML file to carry around.
- CSS stylesheet: it is embedded in the page if the 'e' option is selected.
- external hyperlinks (i.e intra-wiki hyperlinks to non-exported pages, hyperlinks to other web sites, links to files on a shared disk): they are kept "as is" by default. They can be removed by selecting the 'r' option.
- RAWHTML: the selected wiki pages are merged into a single HTML file with no wrapping tags (<!DOCTYPE>, <html>, <head> and <body>) nor stylesheet (in other words, the 'e' option has no effect). This export format is a convenient way of using the wiki as an HTML editor.
- XML: all selected wiki pages are folded into a structured XML file. Each page is included in both a "raw" (wiki mark-up as displayed by the page editor) and in a "rendered" (as displayed by the WikkaWiki engine) version. This can be a powerful way to extract wiki content in a structured fashion, e.g. for further processing.
- for the "rendered" version of each page, the 'r' option can be used as described above.
- pages included: they are specified by combining the 'scope' parameter with a (possibly empty) list of categories. Note that user access to each page is checked against its read ACL, so no unallowed content can be exported.
- pages sort order: it is controlled by the 'sort' parameter.
The XML file format complies with the following DTD:
<!ELEMENT wikka (page*)>
<!ELEMENT page (owner, category*, title, raw_content, rendered_content, structdataitem*)>
<!ATTLIST page tag ID #REQUIRED>
<!ATTLIST page lastchange CDATA #REQUIRED>
<!-- ISO-8601 YYYY-MM-DDThh:mm:ss format-->
<!ELEMENT owner (#PCDATA)>
<!ELEMENT category (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT raw_content (#PCDATA)>
<!ELEMENT rendered_content (#PCDATA)>
<!ELEMENT structdataitem (#PCDATA)>
<!ATTLIST structdataitem type CDATA #REQUIRED>
<!ELEMENT page (owner, category*, title, raw_content, rendered_content, structdataitem*)>
<!ATTLIST page tag ID #REQUIRED>
<!ATTLIST page lastchange CDATA #REQUIRED>
<!-- ISO-8601 YYYY-MM-DDThh:mm:ss format-->
<!ELEMENT owner (#PCDATA)>
<!ELEMENT category (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT raw_content (#PCDATA)>
<!ELEMENT rendered_content (#PCDATA)>
<!ELEMENT structdataitem (#PCDATA)>
<!ATTLIST structdataitem type CDATA #REQUIRED>
Usage
{{fileexport [type="html"] [sort="tag"] [scope="o"] [opts="e"] [cats="CategoryWiki, CategoryUsers"]}}
To-do, bugs and limitations
~- To-do: include structured data items in the XML export formatAuthor
DomBonjCategoryDocumentation