invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Presets

A preset is a file in the Templates folder that pre-defines a number of settings for an interaction. The format resembles the following XML structure:

<?xml version="1.0" encoding="utf-8" ?>
<PresetInfo>
  <Code>ENTRIES</Code>
  <SqlFile>file.sql</SqlFile>
  <Format>Xlsx</Format>
  <Action>Results</Action>
  <LogRequestProgress>true</LogRequestProgress>
  <ConnectionName>GROUP\MAIN</ConnectionName>
  <ParameterValues>
    <Parameter>
      <Name>par</Name>
      <DotnetDataType>int32</DotnetDataType>
      <ForceValue>true</ForceValue>
      <Value>25</Value>
    </Parameter>
    <Parameter>
      <Name>upload_file</Name>
      <DotnetDataType>ByteArray</DotnetDataType>
    </Parameter>
  </ParameterValues>
</PresetInfo>

Diagram

All possible elements are depicted in the diagram:

classDiagram
direction TB

class PresetInfo {
  +string Code
  +string SqlStatement
  +string SqlFile
  +SerializableParameters ParameterValues
  +ExportFormatType Format
  +PresetActionType Action
  +boolean IncludeHeaders
  +string HeaderFormat
  +boolean PrintParameters
  +string ConnectionName
  +string ContentType
  +string DispositionType
  +string ContentFileName
  +AccessControl AccessControl
  +boolean LogRequestProgress
}

class SerializableParameters {
  +SerializableParameter[*] Parameter
}

class SerializableParameter {
  +string Name
  +string DotnetDataType
  +boolean ForceValue
  +string Value
}

class AccessControl {
  +boolean DefaultAllow
  +AccessControlElement[*] AccessControlList
}

class AccessControlElement {
  +string Description
  +string Context
  +string Url
  +string ErrorCode
  +string ErrorMessage
  +boolean Allow
  +dateTime ValidFromUtc
  +dateTime ValidToUtc
  +string LogOnCode
  +string DataContainerId
  +string IpAddressClientCidr
}

PresetInfo --> SerializableParameters : ParameterValues
SerializableParameters --> "0..*" SerializableParameter : Parameter
PresetInfo --> AccessControl : AccessControl
AccessControl --> "0..*" AccessControlElement : AccessControlList

Preset Elements

The meaning of elements on PresetInfo is:

  • The optional module code is registered as Code.
  • SQL file (SqlFile) is preferably located also in the Templates and the contents of this file will be used as a pre-set for the request parameter query.
  • As an alternative you can provide a SQL statement in the preset, using SqlStatement.
  • Format has the same meaning as the request parameter format, chosen from list in Export Format Types.
  • Action has the same meaning as the Endpoints.
  • IncludeHeaders specifies whether to add headers to the output where applicable. The associated request parameter is includeheaders.
  • HeaderFormat specifies what type of headers to include and can be {name} for a technical name and {labelsingularcomposed} for a user friendly name. The related request parameter is usetechnicalheaders which can be true or false.
  • PrintParameters specifies whether to print parameters in the output and can be true or false. The associated request parameter is printparameters.
  • ContentType specifies a deviating desired MIME Content-Type. The associated request parameter is contenttype.
  • DispositionType specifies a deviating desired disposition type. The associated request parameter is dispositiontype.
  • ContentFileName specifies a deviating desired file name and download as attachment. The associated request parameter is contentfilename.
  • AccessControl follows definition on all Invantive Web projects for access control, but specifically for the preset on which it is provided.
  • LogRequestProgress is a boolean value whether for the specific preset request logging is required.
  • Connection name ConnectionName has the same meaning as the request parameter connection.

Many elements have a counterparty as shown in HTTP Request Parameters.

Preset Action Types

The following preset action type is available:

  • Results

The action Transform and the elements Xsl and XslOutputTranslate were removed in release 28.0. A preset with the action Transform is refused with itgendap235, one naming an XSL file with itgendap236 and one with XslOutputTranslate set to true with itgendap237; an empty Xsl element and XslOutputTranslate set to false are accepted and ignored.

Parameter Values

Values to bind to SQL parameters can be specified using ParameterValues. Parameter values specified in a preset overrule identically named request parameters. Parameter values consist of a list of parameters and their values, where each parameter has three elements:

  • Name (Name) of the parameter.
  • Data type (DotnetDataType) of the parameter.
  • String representation (Value) of the parameter value.
  • Whether for force the use of the parameter value specified or only use it as a default (ForceValue).

Parameter Data Types

The following parameter data types are available:

  • bool
  • byte
  • ByteArray: to process files presented as POST parameters.
  • char
  • datetime
  • datetimeoffset
  • decimal
  • double
  • float
  • guid
  • int16
  • int32
  • int64
  • uint16
  • uint32
  • uint64
  • object
  • sbyte
  • string: text.
  • timespan
  • null

Examples

The preset for importing exchange rates in the Netherlands is:

<?xml version="1.0" encoding="utf-8" ?>
<PresetInfo>
  <SqlFile>any-currency-import-query.sql</SqlFile>
  <Format>json</Format>
  <Action>Results</Action>
  <ConnectionName>DEFAULT\ecbeolnl</ConnectionName>
  <LogRequestProgress>true</LogRequestProgress>
  <ParameterValues>
    <Parameter>
      <Name>country</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
    <Parameter>
      <Name>divisions</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
    <Parameter>
      <Name>number_of_days</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
    <Parameter>
      <Name>currencies</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
    <Parameter>
      <Name>testrun</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
    <Parameter>
      <Name>reference_date</Name>
      <DotnetDataType>string</DotnetDataType>
    </Parameter>
  </ParameterValues>
</PresetInfo>

Release Notes