Nervatura
Client Additions

Nervatura Report client-side printing and file export/import support.

The program uses the Java runtime environment. The program is part of the Nervatura Framework. For Nervatura Framework License please visit to License Agreement.

Program settings:

Function Details

?cmd=help

Shows this description.

The result value: text/html.

Example:  http://localhost:8080/?cmd=help

?cmd=vernum

Returns the version number.

The result value: text.

Example:  http://localhost:8080/?cmd=vernum

?cmd=list&dir

Returns a list of files in the Document directory, separated by commas.
Additional parameters:
dir: Optional. An existing sub-directory.

The result value: text. (List of files or error messages.)

Example:  http://localhost:8080/?cmd=list&dir=import

?cmd=rename&fdir&filename&ndir&newname

Renames/moves the file.
Additional parameters:
fdir: Optional. The original sub-directory. Default value: empty (the Document directory)
filename: Required. The original filename.
ndir: Optional. The new sub-directory. Default value: empty (the Document directory)
newname: Required. The new filename.

The result value: text. ("OK" or error messages.)

Example:  http://localhost:8080/?cmd=rename&fdir=import&filename=test.pdf&ndir=archive&newname=test.pdf

?cmd=delete&dir&filename

Deletes the file.
Additional parameters:
dir: Optional. An existing sub-directory. Default value: empty (the Document directory)
filename: Required. The original filename.

The result value: text. ("OK" or error messages.)

Example:  http://localhost:8080/?cmd=delete&fdir=import&filename=test.pdf

?cmd=export&filename&file&dir&encode

Exporting a PDF file.
Additional parameters:
filename: Required. A valid filename.
file: Required. A PDF file.
dir: Optional. An existing sub-directory. Default value: export
encode: Optional. Encoding of the file. Default value: empty. Valid values: base64.

The result value: text. ("OK" or error messages.)

Example:

function exportPdf(localHost, filename, pdf) {
  jQuery.ajax({
    type: "POST", url: "http://"+localHost,
    data: {"cmd":"export", "file":pdf, "filename":filename+".pdf", "dir":"export", "encode":"base64"},
    success: function(data) {
      //
    },
    error: function(jqXHR, textStatus, errorThrown ) {
      //
    }
  });
}

?cmd=upload&dir&filename&encode

Upload a file.
Additional parameters:
dir: Optional. An existing sub-directory. Default value: empty (the Document directory)
filename: Required. An existing filename.
encode: Optional. Encoding of the file. Default value: empty. Valid values: base64.

The result value: file.

Example:  http://localhost:8080/?cmd=upload&dir=import&filename=test.pdf

?cmd=printers&copies&size&orientation

Displays a print dialog.
Additional parameters:
copies: Optional. Default value: 1
size: Optional. The paper size. Default value: a4. Valid values: a3,a4,a5,letter,legal.
orientation: Optional. The page orientation. Default value: portrait. Valid values: portrait, landscape.

The result value: text (selected "printername|copies|size|orientation" or empty string or error messages).

Example:  http://localhost:8080/?cmd=printers

?cmd=print&file&printer&filename&copies&size&orientation

Submit a PDF file to the printer.
Additional parameters:
file: Required. A PDF file.
printer: Required. An existing printer.
filename: Optional. A valid printer task name. Default value: Report
copies: Optional. Default value: 1
size: Optional. The paper size. Default value: a4. Valid values: a3,a4,a5,letter,legal.
orientation: Optional. The page orientation. Default value: portrait. Valid values: portrait, landscape.

The result value: text ("OK" or error messages.).

Example:

function printPdf(localHost, filename, pdf, printer, copies, size, orientation) {
  jQuery.ajax({
    type: "POST", url: "http://"+localHost,
    data: {"cmd":"print", "file":pdf, "filename":filename+".pdf",
      "printer":printer, "copies":copies, "size":size, "orientation":orientation, "encode":"base64"},
    success: function(data) {
      //
    },
    error: function(jqXHR, textStatus, errorThrown ) {
      //
    }
  });
}