XML Import: How to fix failed Entity
This page describes the PocketQuery import/export XML Entity structure. You can use this guide to fix your import file manually. For JSON import, the entities are described in JSON Import: How to fix failed Entity.
Datasource
<Database>
<name>2b92600a-1bf7-431f-bcad-eb6199e0590d</name>
<displayname>REST Countries</displayname>
<type>4</type>
<url>https://restcountries.eu/rest/v2</url>
<user></user>
<password></password>
<driver></driver>
<resourcename>java:comp/env/</resourcename>
<testurl></testurl>
<applicationlinkid></applicationlinkid>
<consumerkey></consumerkey>
<consumersecret></consumersecret>
<token></token>
<tokensecret></tokensecret>
<signaturemethod></signaturemethod>
<requestparameters>param1=123;anotherParam=abc</requestparameters>
<requestheaders>Authentication=Bearer%202913&Content-Type=text/plain</requestheaders>
<authurl></authurl>
<clientid></clientid>
<clientsecret></clientsecret>
<accesstoken></accesstoken>
<refreshtoken></refreshtoken>
</Database>
name
(required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.displayname
(required)- a unique identifier. This is what users see in the interface when using the Datasource.type
(required) - determines the Datasource type. The value is always an integer, where:0
= JDBC1
= REST BASIC4
= REST CUSTOM5
= REST OAUTH2Other Datasource types are not (yet) supported. Missing some Datasource type? Contact us!
url
(required for REST)- the datasource basic URL. This URL is used for all associated Queries.user
- the username used to log in.password
- the password used to log in.driver
(required for JDBC) - the JDBC Datasource driver. It can be one of the following:com.mysql.jdbc.Driver
- for MySQL 5 or 8org.postgresql.Driver
- for PostgreSQLcom.microsoft.sqlserver.jdbc.SQLServerDriver
- for MSSQLOther JDBC drivers are not (yet) supported. Missing some driver? Contact us!
testurl
- the URL used for REST datasource testing.requestparameters
- a semicolon-separated list of header names and their values. Each list item has the following format:{NAME}={VALUE}
. They will be used in every request. For example:param1=123;anotherParam=abc
requestheaders
- a semicolon-separated list of parameters and their values. Each list item has the following format:{NAME}={VALUE}
. They will be used in every request. For example:Authentication=Bearer%202913&Content-Type=text/plain
authurl
- the URL of the Authentication Server for OAuth2 Datasources.clientid
- the ID of the Client for OAuth2 Datasources.clientsecret
- the Secret of the Client for OAuth2 Datasources.accesstoken
- an access token for OAuth2 Datasources.refreshtoken
- a refresh token for OAuth2 Datasources.Other fields are not used in the Cloud version! In the case they contain a value, you will see a warning and the field will be automatically ignored.
Converter
<Converter>
<name>974ae81c-0a0e-439e-bd85-bda84e1890d0</name>
<displayname>REST Countries</displayname>
<content>
function convert(json) {
return JSON.parse(json).map(country => {
return {
"Flag": country.flag
}
});
}
</content>
</Converter>
name
(required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.displayname
(required) - a unique identifier. This is what users see in the interface when using the Converter.content
(required) - the body (JavaScript code) of the Converter.
Template
<Template>
<name>437088c3-e1f2-4ea6-8677-617deb1142da</name>
<displayname>T2</displayname>
<content>
<h1>$result</h1>
</content>
</Template>
name
(required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.displayname
(required) - a unique identifier. This is what users see in the interface when using the Template.content
(required) - the body (Apache Velocity code) of the Template.
Query
<Query>
<name>a21390ce-29be-435f-ab30-f7752e3f6042</name>
<displayname>Countries first</displayname>
<statement>/</statement>
<database>2b92600a-1bf7-431f-bcad-eb6199e0590d</database>
<template>f1486d6f-234b-434e-b8d6-d20ef4890d2f</template>
<spaces></spaces>
<indexed>false</indexed>
<paramtypes class="tree-map"/>
<cacheduration></cacheduration>
<jsonpath></jsonpath>
<converter>974ae81c-0a0e-439e-bd85-bda84e1890d0</converter>
</Query>
name
(required) - a unique UUID. This information is used to refer to the entity in many parts of PocketQuery.displayname
(required) - a unique identifier. This is what users see in the interface when using the query.statement
(required) - a SQL statement or REST URL used to query the Datasource.database
(required) - the Datasource reference using the datasource ID (the ID has to refer to an existing Datasource)template
- the Template reference using the Template ID (the ID has to refer an existing Template or it can benull
to use the default Template)paramtypes
- a semicolon-separated list of parameters and their type. Allowed types are:Boolean
Constant
Integer
ListOfStrings
ListOfIntegers
String
Example:
MyParam1=String;MyParam2=ListOfIntegers
converter
- the Converter reference using the Converter ID (the ID has to refer to an existing Converter or it can benull
to use the default Converter)