Nervatura Data Representation

Ver.No: {{=response.verNo}}

Function Overview

Name Return type Parameters in encoding Parameters
getAppl Any type No appl
getHelp text/html No appl, page, lang, title, subtitle
getResource Any type No file_name, lang, file_type, content
exportToExcel application/vnd.ms-excel Optional: amf or base64 code, sheet, view
exportToICalendar text/ics Optional: no or base64 code, database, username, password, calnumber, alldata
exportToReport Optional Optional: no or base64 code, database, username, password, reportcode, filters, output, orientation, size, printername, copies
createDataBackup Optional Optional: no or base64 code, database, username, password, btype, bformat, lst_nom, filename
restoreDataBackup text/html Optional: no or base64 code, database, username, password, filename, bfile

Function Details

getAppl(appl::String) ::Any type

Redirect to the static/resources/application/appl file.

The result is the redirected file.

getHelp(appl::String, page::String, lang::String=en, title::String='', subtitle::String='') ::text/html

Returns the views/help/appl/ lang/page.html file.
If page does not exist, the views/help/appl/ lang/index.html
or views/help/appl/index.html
or views/help/index.html is returned.
The title and subtitle variables are passed to the file.

The result is an html file.

getResource(file_name::String, lang::String='', file_type::String='html', content::String='') ::Any type

Returns the static/resources/file_name_ lang.file_type file.
The file path is limited to the [resources/download/...] or [resources/docs/...] or [resources/report/...] directories.
lang: optional, else file_name.file_type
file_type: optional. Default value: html.
content: optional. Valid value: view or a html Content-Type. In this case, if the file_type are set, the result Content-Disposition = 'attachment;filename='.

Example:

http://localhost:8000/nerva2py/ndr/getResource?file_name=docs/nom/nom&content=view&lang=auto

The result is the requested file.

exportToExcel(code::String, sheet::Object, view::Object)::application/vnd.ms-excel

Is not supported. Only compatibility.

Use the getData function of NDI (output=excel)!

exportToICalendar(code::String, database::String, username::String, password::String, calnumber::String, alldata::String='') ::text/ics

code: base64 or none or missing. If the value is "base64", all other parameters are encoded in base64.
database: an NAS alias set for a database
username: valid username for the database
password: MD5 encoded user password (or an empty string if not set)
calnumber: an valid Event No.
alldata: Optional. All additional data will be exported. Default: no export (missing).

Only to be used if the database (and the user) NDI or NPI access enabled!

Example:

http://localhost:8000/nerva2py/ndr/exportToICalendar?code=none&database=demo&username=demo&password=&calnumber=DMEVT/00001

The result is an iCalendar file.

exportToReport(code::String, database::String, username::String, password::String, reportcode::String, filters::String, output::String='html', orientation::String='P', size::String='A4', printername::String='', copies::Integer=1) ::Optional

code: base64 or none or missing. If the value is "base64", all other parameters are encoded in base64.
database: an NAS alias set for a database
username: valid username for the database
password: MD5 encoded user password (or an empty string if not set)
reportcode: an valid reportkey from ui_report table
filters: report parameter fieldname = value pairs, the pairs | separated. The fields are defined in the ui_reportfields table.
For example: fieldname1=value1|fieldname2=value2|fieldname3=value3

Additional parameters (Nervatura Report):
output: optional. Valid values: html,xml,pdf,printer. Default value: html.
orientation: optional. Valid values: P (Portrait) or L (Landscape). Default value: P.
size: optional. Valid values: A3,A4,A5,Letter,Legal. Default value: A4.
printername: optional. Required for the "printer" output. Valid values: server side local or network printer, or a Cloud Printer
copies: optional. Default value: 1.

Only to be used if the database (and the user) NDI or NPI access enabled!

Example:

HTML Preview:
http://localhost:8000/nerva2py/ndr/exportToReport?code=none&database=demo&username=demo&password=&reportcode=ntr_customer_en&filters=@id=2

Server-side printing:
http://localhost:8000/nerva2py/ndr/exportToReport?code=none&database=demo&username=demo&password=&reportcode=ntr_customer_en&filters=@id=2&output=printer&printername=HP-Deskjet&copies=2

The result is a

  • HTML Report
  • PDF file
  • XLS file
  • XML file
  • server-side printing

createDataBackup(code::String, database::String, username::String, password::String, bformat::String='backup', filename::String='') ::Optional

Creates a customer data backup, and returns a process report or the backup file. Independent of the database type and version of the NAS server..

Nervatura backup type:
NOM objects: address, barcode, contact, currency, customer, deffield, employee, event, fieldvalue, groups, item, link, log, movement, numberdef, pattern, payment, place, price, product, project, rate, tax, tool, trans
Settings objects: ui_audit, ui_language, ui_menu, ui_menufields, ui_message, ui_report, ui_reportfields, ui_reportsources, ui_userconfig
Not included: ui_printqueue

code: base64 or none or missing. If the value is "base64", all other parameters are encoded in base64.
database: an NAS alias set for a database
username: valid username for the database
password: MD5 encoded user password (or an empty string if not set)
bformat: optional. Valid values: backup,xml. Default value: backup.
filename: optional. Valid values: empty (database name), download (direct result) or a custom filename. Default value: database name.

Only to be used if the database (and the user) NDI or NPI access enabled!

Example:

http://localhost:8000/nerva2py/ndr/createDataBackup?code=none&database=demo&username=demo&password=&bformat=&filename=

The result is a process report or the backup (XML) file.

restoreDataBackup(code::String, database::String, username::String, password::String, filename::String='', bfile::file='') ::text/html

Restores a backup or xml file.
code: base64 or none or missing. If the value is "base64", all other parameters are encoded in base64.
database: an NAS alias set for a database
username: valid username for the database
password: MD5 encoded user password (or an empty string if not set)
filename: optional. A backup or XML filename (with extension) in the server backup directory.
bfile: optional. An upload backup or XML file.

Only to be used if the database (and the user) NDI or NPI access enabled!

Example:

http://localhost:8000/nerva2py/ndr/restoreDataBackup?code=none&database=demo&username=demo&password=&filename=demo_customer.backup

The result is a process report.