Dob attr type info

From SDU
Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This method metadata information about one attribute on a factory. It can be called in Spell Code using send_wait method.

Usage

<source lang="javascript"> void send_wait (int timeout, object top_object, "call_attr", string factory_name, "dob_attr_type_info", string attribute_name) </source>

  • timeout - how long (?in seconds?) should the method wait for finishing the method (0 means infinite)
  • top_object - root object for the method (on which the method is called)
  • factory_name - a factory containing the attribute (could be anything like pcat, cnt, cr, alg, ...)
  • attr_name - a name of an attribute that we are looking for

Results

On success the resulted list is filled into a global array msg. Content of the array depends on an attribute type:

Type = VALUE

  • msg[0] = attribute name
  • msg[1] = "VALUE"
  • msg[2] = exact attribute datatype
    • 0 = INTEGER
    • 1 = DOUBLE
    • 2 = STRING
    • 6 = LOCAL_TIME
    • 7 = DATE
    • 8 = DURATION
    • 9 = UUID
  • msg[3] = string length in characters if msg[2] == 2
  • msg[4] = Private/Public
  • msg[5] = Required/Non-Required
  • msg[6] = display name
  • msg[7] = UI_INFO

Type = SREL

  • msg[0] = attribute name
  • msg[1] = "SREL"
  • msg[2] = foreign factory name
  • msg[3] = relation attribute of a foreign factory
  • msg[4] = Private/Public
  • msg[5] = Required/Non-Required
  • msg[6] = display name
  • msg[7] = ???
  • msg[8] = UI_INFO

Type = BREL/QREL

  • msg[0] = attribute name
  • msg[1] = "QREL"
  • msg[2] = foreign factory name
  • msg[3] = WHERE query for QREL relations
  • msg[4] = list of attributes used as parameters to WHERE query in msg[3]
  • msg[5] = DOMSET name
  • msg[6] = sorting definition
  • msg[7] = list columns
  • msg[8] = attribute name
  • msg[9] = foreign attribute name for BREL relations
  • msg[10] = UI_INFO

Type = LREL

  • msg[0] = attribute name
  • msg[1] = "LREL"
  • msg[2] = name of intermediate relation factory (table)
  • msg[3] = factory handler?
  • msg[4] = attribute name
  • msg[5] = UI_INFO

Examples

<source lang="javascript"> int i, num_args; send_wait( 0, top_object(), "call_attr", "cnt", "dob_attr_type_info", "last_name"); if ( msg_error()) {

   printf("Error: Can't get attributes info: %s\n", msg[0]);
   type = "VALUE";

} num_args = msg_length(); logf(SIGNIFICANT, "num_args = %s", num_args); for (i=0; i<num_args; i++)

   logf(SIGNIFICANT, "msg[%s] = %s", i, msg[i]);

</source>