Alex,

The best way that I have found to learn ARS is to use ARS. :)

Run the driver against a known field on a known schema. Examine the
output. You should see something like the following:

[
Command: gsf
GET FIELD
Schema name: User
Field id (1): 101

  ARGetField  results
ReturnCode:  OK
Field name:  Login Name
Field mapping:
  Field type:  REGULAR
Datatype:  4
Field option:  1
Field create mode:  1
Value:  NULL
Permission List : 2 items
Permission Struct:
  Group id: 0
  Permissions:  VIEW
Permission Struct:
  Group id: 4
  Permissions:  CHANGE
Field Limit Struct:
CHARACTER
  Maximum length: 30
  Menu style: 1
  QBE match operation: 1
  Character menu:
  Pattern:
  FullText Options: 0
Display Instance List : 2 items
  Common Prop List : 0 items
  Display Instance : #0 for VUI 20000
  Instance Prop List : 18 items
  Prop Struct:  BBOX
     Value:  (coordlist)   2 items
             x: 1125, y: 4600
             x: 20025, y: 8100
  Prop Struct:  LABEL
     Value:  (char)   Login Name
  Prop Struct:  LABEL POS JUSTIFY
     Value:  (enumerated)   1
  Prop Struct:  LABEL POS ALIGN
     Value:  (enumerated)   4
  Prop Struct:  LABEL POS SECTOR
     Value:  (bitmask)   2
  Prop Struct:  DATA COLS
     Value:  (ulong)   31
  Prop Struct:  DATA ROWS
     Value:  (ulong)   1
  Prop Struct:  VISIBLE
     Value:  (enumerated)   1
  Prop Struct:  Z ORDER
     Value:  (ulong)   2147483642
  Prop Struct:  TAB ORDER
     Value:  (ulong)   4294967295
  Prop Struct:  DISPLAY PARENT
     Value:  (ulong)   0
  Prop Struct:  LABEL BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 18900, y: 1300
  Prop Struct:  DATA BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 1400
             x: 18900, y: 3500
  Prop Struct:  MENU BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0
  Prop Struct:  EXPAND BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0
  Prop Struct:     <undefined property = 231>
     Value:  (enumerated)   0
  Prop Struct:     <undefined property = 250>
     Value:  (enumerated)   0
  Prop Struct:     <undefined property = 246>
     Value:  (integer)   -1
  Display Instance : #1 for VUI 536870912
  Instance Prop List : 18 items
  Prop Struct:  BBOX
     Value:  (coordlist)   2 items
             x: 1100, y: 4766
             x: 20900, y: 8341
  Prop Struct:  LABEL
     Value:  (char)   Login Name
  Prop Struct:  LABEL POS JUSTIFY
     Value:  (enumerated)   1
  Prop Struct:  LABEL POS ALIGN
     Value:  (enumerated)   4
  Prop Struct:  LABEL POS SECTOR
     Value:  (bitmask)   2
  Prop Struct:  DATA COLS
     Value:  (ulong)   26
  Prop Struct:  DATA ROWS
     Value:  (ulong)   1
  Prop Struct:  VISIBLE
     Value:  (enumerated)   1
  Prop Struct:  Z ORDER
     Value:  (ulong)   2147483642
  Prop Struct:  TAB ORDER
     Value:  (ulong)   4294967295
  Prop Struct:  DISPLAY PARENT
     Value:  (ulong)   0
  Prop Struct:  LABEL BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 19800, y: 1300
  Prop Struct:  DATA BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 1408
             x: 19800, y: 3574
  Prop Struct:  MENU BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0
  Prop Struct:  EXPAND BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0
  Prop Struct:     <undefined property = 231>
     Value:  (enumerated)   0
  Prop Struct:     <undefined property = 250>
     Value:  (enumerated)   0
  Prop Struct:     <undefined property = 246>
     Value:  (integer)   -1
Help text:  The name a user allowed to access the AR System will enter
in the Use
r Name field on the Login dialog box when logging in to the system.

This field is a required field. You must enter data in this field
before saving t
he record.
Last update time:  1112106075
Owner:  Demo
Last changed:  Demo
Change Diary:  0 diary entries
Status List : 0 items

]


I think you can see that "Display Instance List" and the following
properties all work together to place the various parts of a field on
the form in the scope of a view:

  Display Instance : #0 for VUI 20000
  Instance Prop List : 18 items
(specifically)
Prop Struct:  BBOX
     Value:  (coordlist)   2 items
             x: 1125, y: 4600
             x: 20025, y: 8100
  Prop Struct:  LABEL
     Value:  (char)   Login Name
  Prop Struct:  LABEL POS JUSTIFY
     Value:  (enumerated)   1
  Prop Struct:  LABEL POS ALIGN
     Value:  (enumerated)   4
  Prop Struct:  LABEL POS SECTOR
     Value:  (bitmask)   2
  Prop Struct:  DATA COLS
     Value:  (ulong)   31
  Prop Struct:  DATA ROWS
     Value:  (ulong)   1
  Prop Struct:  VISIBLE
     Value:  (enumerated)   1
  Prop Struct:  Z ORDER
     Value:  (ulong)   2147483642
  Prop Struct:  DISPLAY PARENT
     Value:  (ulong)   0
  Prop Struct:  LABEL BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 18900, y: 1300
  Prop Struct:  DATA BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 1400
             x: 18900, y: 3500
  Prop Struct:  MENU BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0
  Prop Struct:  EXPAND BBOX
     Value:  (coordlist)   2 items
             x: 0, y: 0
             x: 0, y: 0


Now this field does not have a menu attached to it, but if you did the
gsl command for a field with a known Menu name then I am sure it would
stand out as to what data structure drives that part too.


BTW, I have often thought that it would be a great improvement for the
Driver tool to be able to "record and duplicate" fields between
servers. However that would likely compete with Migrator and would
likely not be something that BMC would be thrilled about. :)


However, I really think the best way to go about all of this is to do
the bulk of the work in the Admin tool. :)  Import in Place works like
a champ in 99% of the cases. :)

But if you demand an API granularity then I would suggest using the
Java API. It is actually fairly trivial to "get an object of a field"
from a form on one server and "relocate" it to a different form (maybe
on a different server).

In short.
 Login to two servers (and keep two control pointers)
 Get the source schema of interest (to verify that it exists)
 Get the fields for that schema and locate the fields of interest.

 Get the target schema of interest (and verify that it exists)
  Set the Schema on the selected field object to the target schema
  Set the login context on the selected field object to the target schema
  Call the "create" method on the field object.

Now there are a few downfalls depending on what your doing...
This is a short list of things to watch for in the general case:
   If the target and source forms have different number of views....
   If the target and source forms have different view IDs....
   If the target and source forms are different types of forms....

HTH.

--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Love, then teach
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.


On 9/13/06, Alex Straph <[EMAIL PROTECTED]> wrote:
I have been playing around with the Driver.exe file
for a while now, and although I am able to add fields
which is not included in any views, delete fields, and
set some field limits, there are some specific things
that I have not been able to accomplish.

The two things I am looking to set via driver.exe is
the following:
1) how to set up a field in a specific position on a
view.
2) how to set up a menu to be attached to a character
field.

Sure, I could simply just edit the form in question,
but the form is being used in six separate servers,
with each server having its own version of the form in
question.  A driver script would be the most
non-intrusive way to add or change fields.

Any advice would be appreciated.

Thanks.

Alex

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org

Reply via email to