From wiki.ginstr.com
Jump to: navigation, search

Ginstr username

Widget is used to load ginstr user into variable. Value will be stored in couchdb as datatype text.
Widget is hidden.

Widget id, ${gbamID}:

actionUser

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as email datatype.

Predefined user data

PreLoaded

Properties panel

User will configure this data in properties panels of selected widget:

GENERAL
VALIDATIONS
  • -
internal validators
  • -
ACTION
  • "on event" triggers the action in common widget code at specific event. Events are are listed in a dropdown can be:
  • screen load widget code is added into root node of the screen in attribute gn:act_beforeLoad as:
gn:act_beforeLoad="[gn:act_trigger]|[@+id/idOfCurrentWidget,gn:act_set]"
gn:act_set="Common widget code"
[gn:act_trigger]|[@+id/idOfCurrentWidget,gn:act_set]
as attribute to Button save widget:
gn:act_set="Common widget code"
needs to be added to widget Button save at:
Two options when to execute:
and into rawWrite values is included columnId of this widget and target {variableId}
IMPORTANT , if code from other widgets is inserted into "gn:act_beforeLoad", then code from this widget is inserted at the top of execution block.
ACTION MESSAGES
  • -
DATABASE
  • "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.
  • "additional ginstr web column settings":
  • "align text", radio button options with values: "left", "middle", "right", add to configuration.xml:
<columnText>
    <horizontalAlignment>left|center|right</horizontalAlignment>
</columnText>
  • "list of allowed values" array with list of allowed values, add to configuration.xml:
<columnText>
  <valuesList>
    <value>val1</value>
    <value>val2</value>
  </valuesList>
</columnText>
  • "pattern", add to configuration.xml:
<columnText>
    <pattern errorMessage="invalidTextTableValue">[0-9A-Z]{3}</pattern>
</columnText>
  • "related unique columns", add to configuration.xml:
<columnText>
    <uniqueInsideList>
        <reference>
          <table>refTableId1</table>
          <column>refColumnField1</column>
        </reference>
        <reference>
          <table>refTableId2</table>
          <column>refColumnField2</column>
        </reference>
    </uniqueInsideList>
</columnText>

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

  • ${widgetID} {variableId} is generated based on the widgetID
  • variableId name of variable datatype text into which user id will be stored
  • variableEmailId name of variable datatype email into which value will be moved after conversion

Common widget code

screen.xml
    [gn:act_getUserData]|[{variableId},userName],
    [gn:act_convertDatatype]|[{variableId},{variableEmailId},{variableEmailId}]