Class DocCreator

java.lang.Object
com.groiss.office.DocCreator

public class DocCreator extends Object
Create a document from an open office template. The class contains two create methods, one can be used as task-function, one as system step.
  • Constructor Details

    • DocCreator

      public DocCreator()
  • Method Details

    • create

      public void create(HttpServletRequest req, HttpServletResponse res) throws Exception
      Task function for creating an office document. You may use the function in a form, the worklist and the DMS. The process context is taken either from the request parameter functionTask, containing the oid of the current activity instance (when called from form toolbar or worklist) or from the folder parameter, containing the classname:oid of the process instance (for DMS function) Define a task-function object with the following method: com.groiss.office.DocCreator.create?format=ftm&docname=name&template=temp See the method below for description of the parameters. If the additional parameter show has the value true, the file is sent to the browser. If show is not activated, the target window of the function should be HIDDEN. In the DMS case the table is refreshed, otherwise nothing is done.
      Throws:
      Exception
    • create

      public boolean create(String template, String templatefield, String format, String docname)
      System step or postcondition for creating a document.
      Parameters:
      template - the path to an odt document in the DMS Specify the complete path, for example COMMON/templates/templ1.odt
      templatefield - optionally you can specify a field (formid.fieldid), that contains the template name. The complete path is then built in the following way: template + "/" + formfield-value + ".odt"
      format - pdf, odt or doc
      docname - the name of the resulting document, if it should be attached to the process. The following placeholders (in curly braces) can be used: ou for organizational unit, id for process id, process for process definition name and subject for process instance subject. e.g. Docname-{id}.
      Returns:
      always true