From wiki.ginstr.com
Jump to: navigation, search
(Action signatures)
Line 9: Line 9:
  
 
===Download attachment===
 
===Download attachment===
 +
 +
:;<code>[gn:act_getAttachmentFromServer]|[tableName,rowId,columnName]</code>
 +
 +
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Parameter
 +
! scope="col" | Description
 +
|-
 +
| <code>tableName</code>
 +
| 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
 +
|-
 +
|<code>rowId</code>
 +
|internal id of row which contains attachment information.
 +
* Valid [[target|target]] should be of datatype <code>text</code>
 +
|-
 +
|<code>columnName</code>
 +
|Name of the column within the row which contains attachment information
 +
* Valid [[target|target]] should be of datatype <code>text</code>
 +
|}
 +
 +
====Example====
 +
=====variables.xml=====
 +
<syntaxhighlight lang="xml">
 +
<variable id="rowId" type="text">e0567dffe-7775-467c-8f56-6641a9ac3eb8</variable>
 +
<variable id="columnName" type="text">photos</variable>
 +
</syntaxhighlight>
 +
 +
=====screen.xml=====
 +
<syntaxhighlight lang="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]" />
 +
</syntaxhighlight>
 +
 +
After action execution images will be stored locally into appId/userData/attachments folder
 +
 +
===Download attachment with callback===
  
 
:;<code>[gn:act_getAttachmentFromServer]|[tableName,rowId,columnName]</code>
 
:;<code>[gn:act_getAttachmentFromServer]|[tableName,rowId,columnName]</code>

Revision as of 15:58, 4 June 2020

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