Package com.groiss.office
Class DocumentManager
java.lang.Object
com.groiss.office.DocumentManager
Utility class for handling office-documents and templates
following variables are accessible, in the mixin(..) methods
- ai: the current activity instance (
WfEngine.getContext()
) - pi: the process-instance of $ai
- user:
ThreadContext.getThreadPrincipal()
- form_{formid}: the process-form with the given id
- configuration: the system configuration
- configuration_applid: the application configuration
- all other properties specified with the respective methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
convert
(DMSDocForm document, String targetExtension) converts a document between different formatsstatic byte[]
convert
(InputStream document, String sourceExtension, String targetExtension) converts a document between different formatsstatic byte[]
mixin
(DMSDocForm template, DMSForm form) fill in the given templatestatic byte[]
mixin
(DMSDocForm template, ActivityInstance pi) fill in the given templatestatic byte[]
mixin
(DMSDocForm template, Map<String, ?> context) fill in the given templatestatic byte[]
mixin
(InputStream template, DMSForm form) fill in the given templatestatic byte[]
mixin
(InputStream template, ActivityInstance ai) fill in the given templatestatic byte[]
mixin
(InputStream template, Map<String, ?> context) fill in the given templatestatic byte[]
mixin
(InputStream template, org.jaxen.VariableContext ctx) performs the substitutions using the givenVariableContext
-
Method Details
-
convert
converts a document between different formats- Parameters:
document
- the document to converttargetExtension
- the target-extension- Returns:
- the converted document
-
convert
converts a document between different formats- Parameters:
document
- the document to convertsourceExtension
- the input-document's extension (e.g.: odt, doc)targetExtension
- the target document'ts extension (e.g.: pdf, doc)- Returns:
- the converted document
-
mixin
fill in the given template- Parameters:
template
- the template. has to be an odt filepi
- the process-context for the xpath evaluations- Returns:
- the filled template
-
mixin
fill in the given template- Parameters:
template
- the template. has to be an odt fileform
- the form context for the xpath evaluations. the form may be accessed using the$form
variable in xpath- Returns:
- the filled template
-
mixin
fill in the given template- Parameters:
template
- the template. has to be an odt filecontext
- see:mixin(InputStream, Map)
- Returns:
- the filled template
-
mixin
fill in the given template- Parameters:
template
- the template. has to be an odt fileai
- the workflow-context used for xpath evaluation. seeWfVariableContext
for a list of available xpath-variables- Returns:
- the filled template
-
mixin
fill in the given template- Parameters:
template
- the template. has to be an odt fileform
- the form-context for xpath evaluation. the form may be accessed using the$form
variable in xpath- Returns:
- the filled template
-
mixin
fill in the given template- Parameters:
template
- the templatecontext
- the context for the xpath evaluations.
the values may be:- Persistens - you may navigate inside the persisten's fields using xpath
- collections - you may use them for repeat statements
- collections of persistents - you may use them for repeat statements and you are able to navigate in the persistent's fields
- any other java type - you may use them in your custom way. navigation using xpath is not possible
- Returns:
- the filled template
-
mixin
performs the substitutions using the givenVariableContext
- Parameters:
template
-ctx
-- Returns:
-