Class DocumentManager

java.lang.Object
com.groiss.office.DocumentManager

public final class DocumentManager extends Object
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 Details

    • convert

      public static byte[] convert(DMSDocForm document, String targetExtension)
      converts a document between different formats
      Parameters:
      document - the document to convert
      targetExtension - the target-extension
      Returns:
      the converted document
    • convert

      public static byte[] convert(InputStream document, String sourceExtension, String targetExtension)
      converts a document between different formats
      Parameters:
      document - the document to convert
      sourceExtension - the input-document's extension (e.g.: odt, doc)
      targetExtension - the target document'ts extension (e.g.: pdf, doc)
      Returns:
      the converted document
    • mixin

      public static byte[] mixin(DMSDocForm template, ActivityInstance pi)
      fill in the given template
      Parameters:
      template - the template. has to be an odt file
      pi - the process-context for the xpath evaluations
      Returns:
      the filled template
    • mixin

      public static byte[] mixin(DMSDocForm template, DMSForm form)
      fill in the given template
      Parameters:
      template - the template. has to be an odt file
      form - the form context for the xpath evaluations. the form may be accessed using the $form variable in xpath
      Returns:
      the filled template
    • mixin

      public static byte[] mixin(DMSDocForm template, Map<String,?> context)
      fill in the given template
      Parameters:
      template - the template. has to be an odt file
      context - see: mixin(InputStream, Map)
      Returns:
      the filled template
    • mixin

      public static byte[] mixin(InputStream template, ActivityInstance ai)
      fill in the given template
      Parameters:
      template - the template. has to be an odt file
      ai - the workflow-context used for xpath evaluation. see WfVariableContext for a list of available xpath-variables
      Returns:
      the filled template
    • mixin

      public static byte[] mixin(InputStream template, DMSForm form)
      fill in the given template
      Parameters:
      template - the template. has to be an odt file
      form - the form-context for xpath evaluation. the form may be accessed using the $form variable in xpath
      Returns:
      the filled template
    • mixin

      public static byte[] mixin(InputStream template, Map<String,?> context)
      fill in the given template
      Parameters:
      template - the template
      context - 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

      public static byte[] mixin(InputStream template, org.jaxen.VariableContext ctx)
      performs the substitutions using the given VariableContext
      Parameters:
      template -
      ctx -
      Returns: