From wiki.ginstr.com
Revision as of 15:58, 4 June 2020 by Dinko (talk | contribs) (Action signatures)
Jump to: navigation, search
added in Milestone 101.6

gn:act_getAttachmentFromServer

Description
Action is used to download attachment asynchronously (M103.8) from the server when replication is not enabled for attachments.
Action returns
void

Action signatures

Download attachment

[gn:act_getAttachmentFromServer]|[tableName,rowId,columnName]
Parameter Description
tableName table name as defined in configuration.xml from which the document will be retrieved
  • Value should be hardcoded - to be able to query the table from the external app use @externalTable/appId_tableId syntax
rowId internal id of row which contains attachment information.
  • Valid target should be of datatype text
columnName Name of the column within the row which contains attachment information
  • Valid target should be of datatype text

Example

variables.xml
<variable id="rowId" type="text">e0567dffe-7775-467c-8f56-6641a9ac3eb8</variable>
<variable id="columnName" type="text">photos</variable>
screen.xml
<FrameLayout
    android:id="@+id/exampleFrame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    gn:act_set="[gn:act_getAttachmentFromServer]|[coffeeMachinesMaintenance,@variable/rowId,@variable/columnName]" />

After action execution images will be stored locally into appId/userData/attachments folder

Download attachment with callback

[gn:act_getAttachmentFromServer]|[tableName,rowId,columnName]
Parameter Description
tableName table name as defined in configuration.xml from which the document will be retrieved
  • Value should be hardcoded - to be able to query the table from the external app use @externalTable/appId_tableId syntax
rowId internal id of row which contains attachment information.
  • Valid target should be of datatype text
columnName Name of the column within the row which contains attachment information
  • Valid target should be of datatype text

Example

variables.xml
<variable id="rowId" type="text">e0567dffe-7775-467c-8f56-6641a9ac3eb8</variable>
<variable id="columnName" type="text">photos</variable>
screen.xml
<FrameLayout
    android:id="@+id/exampleFrame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    gn:act_set="[gn:act_getAttachmentFromServer]|[coffeeMachinesMaintenance,@variable/rowId,@variable/columnName]" />

After action execution images will be stored locally into appId/userData/attachments folder