cogExposes the Filter Stream API to Scripts
TypeJAR
Developed by

XWiki Development Team

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise

Compatibility

Introduced in 6.2

Installable with the Extension Manager

Description

The entry point for using Filter module from scripts is the filter script service.

Examples

Import a XAR from attachment

{{velocity}}
#set($inputProperties = {
'source' : $doc.getAttachment('myattached.xar').getContentInputStream()
})
#set($outputProperties = {})
#set($job = $services.filter.convert('xwiki+xar/1.2', $inputProperties, 'xwiki+instance', $outputProperties))
{{/velocity}}

Note that you can also get some logs displayed with:

{{template name="job_macros.vm"/}}

{{velocity}}
#set($inputProperties = {
'source' : $doc.getAttachment('myattached.xar').getContentInputStream()
})
#set($outputProperties = {})
#set($job = $services.filter.convert('xwiki+xar/1.2', $inputProperties, 'xwiki+instance', $outputProperties))

{{html}}
#printStatusLog($job.status)
{{/html}}
{{/velocity}}

Example result:

jobimport.png

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Dependencies

Dependencies for this extension (org.xwiki.platform:xwiki-platform-filter-script 11.4):

Tags:
Created by Thomas Mortagne on 2016/02/26 09:14
    

Get Connected