Lesson 9

From VistApedia
Revision as of 21:26, 10 October 2006 by Kdtop (talk | contribs)
Jump to: navigation, search

Linux / Apache / GT.M / Web Application Lesson 9.

By Ben Irvin, 
Copied from: http://www.doggiedudes.com/fscc/list.htm
Tutorial Home: M Web Tutorials
Prev: Lesson 8
Next: Lesson 10

We are moving into the Fileman world for the next few lessons. If you are just joining this line of lessons, we are developing a web interface to a Fileman application for maintaining a list of Library Books.

We are going to use the "namespace" of ZLIB for all of our library pieces. That means that all tables, files, globals, and routines will start with ZLIB.

We are going to create four tables for our library database.

ZLIBBOO        Books     Title
                              *Author
                              *Publisher
                              Date Published
                              *Location

                             
ZLIBAUT        Author         Name
                              Date of Birth
                              Date of Death
                             

ZLIBPUB        Publisher Name
                              Address
                              City
                              State
                              Zip Code
ZLIBLOC        Location  Location Code
                              Description

The tables ZLIBAUT, ZLIBPUB, and ZLIBLOC must be created first, before you can use them in the ZLIBBOO table.


The following listing shows how I created the four tables using Fileman, with the resulting global that was produced.

I added a book and again listed the resulting global.

This is a starting place just to see if everyone can get Fileman working smoothly. For some reason on my installation of Vista, Fileman is hidden under the option ZZFILEMAN.

If you need help at any point along the way, just try the question mark, ?. It usually helps with information or a listing of options. The general Vista way of answering requests for help is if you use one ?, you get some help, if you use two ??, you get more help, if you use three ???, you get more help then you wanted.

        GTM>D ^XUP


        Setting up programmer environment

        Access Code:
 
        Terminal Type set to: C-VT320

        Select OPTION NAME: ZZFILEMAN       FileMan
        FileMan

        VA FileMan 22.0

        Select OPTION: ?
           Answer with OPTION NUMBER, or NAME
          Choose from:
          1            ENTER OR EDIT FILE ENTRIES
          2            PRINT FILE ENTRIES
          3            SEARCH FILE ENTRIES
          4            MODIFY FILE ATTRIBUTES
          5            INQUIRE TO FILE ENTRIES
          6            UTILITY FUNCTIONS
          7            OTHER OPTIONS
          8            DATA DICTIONARY UTILITIES
          9            TRANSFER ENTRIES
  
        Select OPTION: 4  MODIFY FILE ATTRIBUTES

        Do you want to use the screen-mode version? YES// NO
        MODIFY WHAT FILE: ZLIBLOC

         Are you adding 'ZLIBLOC' as a new FILE? No// Y  (Yes)

          FILE NUMBER: 1956001//

        INTERNAL GLOBAL REFERENCE: ^DIZ(1956001,// ^ZLIB(1956001,
        ...EXCUSE ME, HOLD ON...

           A FreeText NAME Field (#.01) has been created.




        Select FIELD: NAME 
        LABEL: NAME// LOCATION CODE
        TITLE:
        AUDIT:
        AUDIT CONDITION:
        READ ACCESS (OPTIONAL):
        DELETE ACCESS (OPTIONAL):
        WRITE ACCESS (OPTIONAL):
        SOURCE:

        Select DESTINATION:

        Select GROUP:

        DESCRIPTION:

         No existing text
         Edit? NO//

        TECHNICAL DESCRIPTION:

         No existing text
         Edit? NO//

        DATA TYPE OF LOCATION CODE: FREE TEXT//
        MINIMUM LENGTH: 3// 2 
        MAXIMUM LENGTH: 30// 10
        (OPTIONAL) PATTERN MATCH (IN 'X'): X'?1P.E//
        IS LOCATION CODE ENTRY MANDATORY (Y/N): Y//   YES
        ....
        'HELP'-PROMPT: Answer must be 2-10 characters in length.
                   Replace
        XECUTABLE 'HELP':
        Select FIELD: DESCRIPTION

         Are you adding 'DESCRIPTION' as a new FIELD (the 2ND)? No// Y  (Yes)
           FIELD NUMBER: 1//

       DATA TYPE OF DESCRIPTION: ?
           Answer with DATA TYPE NUMBER, or NAME
          Choose from:
          1            DATE/TIME
          2            NUMERIC
          3            SET OF CODES
          4            FREE TEXT
          5            WORD-PROCESSING
          6            COMPUTED
          7            POINTER TO A FILE
          8            VARIABLE-POINTER
          9            MUMPS
       IF YOU WANT THE SAME ANSWER ALLOWED FOR DESCRIPTION
       AS FOR LOCATION CODE, JUST HIT THE SPACE KEY

       DATA TYPE OF DESCRIPTION: 4  FREE TEXT
       MINIMUM LENGTH: 2
       MAXIMUM LENGTH: 200
       (OPTIONAL) PATTERN MATCH (IN 'X'):
       WILL DESCRIPTION FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 2//
       IS DESCRIPTION ENTRY MANDATORY (Y/N): NO// Y  YES
       ....
       'HELP'-PROMPT: Answer must be 2-200 characters in length.
                  Replace
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD:

       Select OPTION: ?
           Answer with OPTION NUMBER, or NAME
          Choose from:
          1            ENTER OR EDIT FILE ENTRIES
          2            PRINT FILE ENTRIES
          3            SEARCH FILE ENTRIES
          4            MODIFY FILE ATTRIBUTES
          5            INQUIRE TO FILE ENTRIES
          6            UTILITY FUNCTIONS
          7            OTHER OPTIONS
          8            DATA DICTIONARY UTILITIES
          9            TRANSFER ENTRIES
  
       Select OPTION: 1  ENTER OR EDIT FILE ENTRIES


       INPUT TO WHAT FILE: ZLIBLOC//
       EDIT WHICH FIELD: ALL//


       Select ZLIBLOC LOCATION CODE: BR01BS01
         Are you adding 'BR01BS01' as a new ZLIBLOC (the 1ST)? No// Y  (Yes)
       DESCRIPTION: BED ROOM ONE BOOKSHELVE ONE


       Select ZLIBLOC LOCATION CODE: BR01BS02
         Are you adding 'BR01BS02' as a new ZLIBLOC (the 2ND)? No// Y  (Yes)
       DESCRIPTION: BED ROOM ONE BOOKSHELVE TWO


       Select ZLIBLOC LOCATION CODE:


       Select OPTION:
       GTM>D ^%G

       Output device: <terminal>:

       List ^ZLIB
       ^ZLIB(1956001,0)="ZLIBLOC^1956001^2^2"
       ^ZLIB(1956001,1,0)="BR01BS01^BED ROOM ONE BOOKSHELVE ONE"
       ^ZLIB(1956001,2,0)="BR01BS02^BED ROOM ONE BOOKSHELVE TWO"
       ^ZLIB(1956001,"B","BR01BS01",1)=""
       ^ZLIB(1956001,"B","BR01BS02",2)=""

       List ^


       GTM>D ^XUP

       Setting up programmer environment
       Terminal Type set to: C-VT320

       Select OPTION NAME: ZZFILEMAN       FileMan
       FileMan

       VA FileMan 22.0


       Select OPTION: ?
           Answer with OPTION NUMBER, or NAME
          Choose from:
          1            ENTER OR EDIT FILE ENTRIES
          2            PRINT FILE ENTRIES
          3            SEARCH FILE ENTRIES
          4            MODIFY FILE ATTRIBUTES
          5            INQUIRE TO FILE ENTRIES
          6            UTILITY FUNCTIONS
          7            OTHER OPTIONS
          8            DATA DICTIONARY UTILITIES
          9            TRANSFER ENTRIES
  
       Select OPTION: 4  MODIFY FILE ATTRIBUTES
       Do you want to use the screen-mode version? YES// NO

       MODIFY WHAT FILE: ZLIBPUB
         Are you adding 'ZLIBPUB' as a new FILE? No// Y  (Yes)
          FILE NUMBER: 1956003//

       INTERNAL GLOBAL REFERENCE: ^DIZ(1956003,// ^ZLIB(1956003,

       ...EXCUSE ME, HOLD ON...
            A FreeText NAME Field (#.01) has been created.


       Select FIELD: ADDRESS
         Are you adding 'ADDRESS' as a new FIELD (the 2ND)? No// Y  (Yes)
          FIELD NUMBER: 1//

       DATA TYPE OF ADDRESS: FREE TEXT 
       MINIMUM LENGTH: ??
       MINIMUM LENGTH: 0??
       MINIMUM LENGTH: 2
       MAXIMUM LENGTH: 80
       (OPTIONAL) PATTERN MATCH (IN 'X'):
       WILL ADDRESS FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 2//
       IS ADDRESS ENTRY MANDATORY (Y/N): NO//   NO
       ....
       'HELP'-PROMPT: Answer must be 2-80 characters in length.
                  Replace
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: CITY
         Are you adding 'CITY' as a new FIELD (the 3RD)? No// Y  (Yes)
          FIELD NUMBER: 2//

       DATA TYPE OF CITY: FREE TEXT 
       MINIMUM LENGTH: 2
       MAXIMUM LENGTH: 20
       (OPTIONAL) PATTERN MATCH (IN 'X'):
       WILL CITY FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 3//
       IS CITY ENTRY MANDATORY (Y/N): NO//   NO
       ....
       'HELP'-PROMPT: Answer must be 2-20 characters in length.
                  Replace
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: STATE
         Are you adding 'STATE' as a new FIELD (the 4TH)? No// Y  (Yes)
          FIELD NUMBER: 3//

       DATA TYPE OF STATE: FREE TEXT 
       MINIMUM LENGTH: 2
       MAXIMUM LENGTH: 2
       (OPTIONAL) PATTERN MATCH (IN 'X'):
       WILL STATE FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 4//
       IS STATE ENTRY MANDATORY (Y/N): NO// N  NO
       ....
       'HELP'-PROMPT: Answer must be 2 characters in length.
                  Replace
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: ZIP CODE
         Are you adding 'ZIP CODE' as a new FIELD (the 5TH)? No// Y  (Yes)
          FIELD NUMBER: 4//

       DATA TYPE OF ZIP CODE: FREE TEXT 
       MINIMUM LENGTH: 5
       MAXIMUM LENGTH: 10
       (OPTIONAL) PATTERN MATCH (IN 'X'):
       WILL ZIP CODE FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 5//
       IS ZIP CODE ENTRY MANDATORY (Y/N): NO//   NO
       ....
       'HELP'-PROMPT: Answer must be 5-10 characters in length.
                  Replace
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       GTM>D ^XUP

       Setting up programmer environment
       Terminal Type set to: C-VT320

       Select OPTION NAME: ZZFILEMAN       FileMan
       FileMan

       VA FileMan 22.0


       Select OPTION: MODIFY FILE ATTRIBUTES 
       Do you want to use the screen-mode version? YES// NO

       MODIFY WHAT FILE: ZLIBPUB// ZLIBAUT
         Are you adding 'ZLIBAUT' as a new FILE? No// Y  (Yes)
          FILE NUMBER: 1956005//

       INTERNAL GLOBAL REFERENCE: ^DIZ(1956005,// ^ZLIB(1956005,

       ...EXCUSE ME, LET ME PUT YOU ON 'HOLD' FOR A SECOND...
            A FreeText NAME Field (#.01) has been created.


       Select FIELD: DATE OF BIRTH
         Are you adding 'DATE OF BIRTH' as a new FIELD (the 2ND)? No// Y  (Yes)
          FIELD NUMBER: 1//

       DATA TYPE OF DATE OF BIRTH: ?
           Answer with DATA TYPE NUMBER, or NAME
          Choose from:
          1            DATE/TIME
          2            NUMERIC
          3            SET OF CODES
          4            FREE TEXT
          5            WORD-PROCESSING
          6            COMPUTED
          7            POINTER TO A FILE
          8            VARIABLE-POINTER
          9            MUMPS
  

       DATA TYPE OF DATE OF BIRTH: 1  DATE/TIME
       EARLIEST DATE (OPTIONAL):
       CAN DATE BE IMPRECISE (Y/N): YES//
       CAN TIME OF DAY BE ENTERED (Y/N): NO//
       WILL DATE OF BIRTH FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 2//
       IS DATE OF BIRTH ENTRY MANDATORY (Y/N): NO//   NO
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: DATE OF DEATH
         Are you adding 'DATE OF DEATH' as a new FIELD (the 3RD)? No// Y  (Yes)
          FIELD NUMBER: 2//
       DATA TYPE OF DATE OF DEATH: DATE/TIME 
       EARLIEST DATE (OPTIONAL):
       CAN DATE BE IMPRECISE (Y/N): YES//
       CAN TIME OF DAY BE ENTERED (Y/N): NO//
       WILL DATE OF DEATH FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 3//
       IS DATE OF DEATH ENTRY MANDATORY (Y/N): NO//   NO
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD:


       Select OPTION:


       GTM>D ^XUP

       Setting up programmer environment
       Terminal Type set to: C-VT320

       Select OPTION NAME: ZZFILEMAN       FileMan
       FileMan

       VA FileMan 22.0


       Select OPTION: MODIFY FILE ATTRIBUTES 
       Do you want to use the screen-mode version? YES// NO

       MODIFY WHAT FILE: ZLIBAUT// ZLIBBOO
         Are you adding 'ZLIBBOO' as a new FILE? No// Y  (Yes)
          FILE NUMBER: 1956007//

       INTERNAL GLOBAL REFERENCE: ^DIZ(1956007,// ^ZLIB(1956007,

       ...EXCUSE ME, JUST A MOMENT PLEASE...
            A FreeText NAME Field (#.01) has been created.


       Select FIELD: .01  NAME
       LABEL: NAME// TITLE
       TITLE:
       AUDIT:
       AUDIT CONDITION:
       READ ACCESS (OPTIONAL):
       DELETE ACCESS (OPTIONAL):
       WRITE ACCESS (OPTIONAL):
       SOURCE:
       Select DESTINATION:
       Select GROUP:
       DESCRIPTION:
         No existing text
         Edit? NO//
       TECHNICAL DESCRIPTION:
         No existing text
         Edit? NO//

       DATA TYPE OF TITLE: FREE TEXT//
       MINIMUM LENGTH: 3//
       MAXIMUM LENGTH: 30// 200
       (OPTIONAL) PATTERN MATCH (IN 'X'): X'?1P.E//
       IS TITLE ENTRY MANDATORY (Y/N): Y//   YES
       ....
       'HELP'-PROMPT: Answer must be 3-200 characters in length.
                  Replace
       XECUTABLE 'HELP':


       Select FIELD: AUTHOR
         Are you adding 'AUTHOR' as a new FIELD (the 2ND)? No// Y  (Yes)
          FIELD NUMBER: 1//

       DATA TYPE OF AUTHOR: ?
           Answer with DATA TYPE NUMBER, or NAME
          Choose from:
          1            DATE/TIME
          2            NUMERIC
          3            SET OF CODES
          4            FREE TEXT
          5            WORD-PROCESSING
          6            COMPUTED
          7            POINTER TO A FILE
          8            VARIABLE-POINTER
          9            MUMPS
  
       IF YOU WANT THE SAME ANSWER ALLOWED FOR AUTHOR
       AS FOR TITLE, JUST HIT THE SPACE KEY
       DATA TYPE OF AUTHOR: 7  POINTER TO A FILE
       POINT TO WHICH FILE: ZLIBAUT 
       SHOULD 'ADDING A NEW ZLIBAUT FILE ENTRY' ("LAYGO")
       BE ALLOWED WHEN ANSWERING THE AUTHOR' QUESTION? No// Y  (Yes)
       SHOULD 'ZLIBAUT' ENTRIES BE SCREENED? No//   (No)
       WILL AUTHOR FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 2//
       IS AUTHOR ENTRY MANDATORY (Y/N): NO// Y  YES
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: PUBLISHER
         Are you adding 'PUBLISHER' as a new FIELD (the 3RD)? No// Y  (Yes)
          FIELD NUMBER: 2//

       DATA TYPE OF PUBLISHER: ?
           Answer with DATA TYPE NUMBER, or NAME
          Choose from:
          1            DATE/TIME
          2            NUMERIC
          3            SET OF CODES
          4            FREE TEXT
          5            WORD-PROCESSING
          6            COMPUTED
          7            POINTER TO A FILE
          8            VARIABLE-POINTER
          9            MUMPS
  

       DATA TYPE OF PUBLISHER: 7  POINTER TO A FILE
       POINT TO WHICH FILE: ZLIBPUB 
       SHOULD 'ADDING A NEW ZLIBPUB FILE ENTRY' ("LAYGO")
       BE ALLOWED WHEN ANSWERING THE PUBLISHER' QUESTION? No// Y  (Yes)
       SHOULD 'ZLIBPUB' ENTRIES BE SCREENED? No//   (No)
       WILL PUBLISHER FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 3//
       IS PUBLISHER ENTRY MANDATORY (Y/N): NO// Y  YES
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: DATE PUBLISHED
         Are you adding 'DATE PUBLISHED' as a new FIELD (the 4TH)? No// Y  (Yes)
          FIELD NUMBER: 3//

       DATA TYPE OF DATE PUBLISHED: DATE/TIME 
       EARLIEST DATE (OPTIONAL):
       CAN DATE BE IMPRECISE (Y/N): YES//
       CAN TIME OF DAY BE ENTERED (Y/N): NO// N  NO
       WILL DATE PUBLISHED FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 4//
       IS DATE PUBLISHED ENTRY MANDATORY (Y/N): NO// Y  YES
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD: LOCATION
         Are you adding 'LOCATION' as a new FIELD (the 5TH)? No// Y  (Yes)
          FIELD NUMBER: 4//

       DATA TYPE OF LOCATION: ?
           Answer with DATA TYPE NUMBER, or NAME
          Choose from:
          1            DATE/TIME
          2            NUMERIC
          3            SET OF CODES
          4            FREE TEXT
          5            WORD-PROCESSING
          6            COMPUTED
          7            POINTER TO A FILE
          8            VARIABLE-POINTER
          9            MUMPS
  
       IF YOU WANT THE SAME ANSWER ALLOWED FOR LOCATION
       AS FOR DATE PUBLISHED, JUST HIT THE SPACE KEY

       DATA TYPE OF LOCATION: 7  POINTER TO A FILE
       POINT TO WHICH FILE: ZLIBLOC 
       SHOULD 'ADDING A NEW ZLIBLOC FILE ENTRY' ("LAYGO")
       BE ALLOWED WHEN ANSWERING THE LOCATION' QUESTION? No// Y  (Yes)
       SHOULD 'ZLIBLOC' ENTRIES BE SCREENED? No//   (No)
       WILL LOCATION FIELD BE MULTIPLE? No//   (No)

       SUBSCRIPT: 0//
       ^-PIECE POSITION: 5//
       IS LOCATION ENTRY MANDATORY (Y/N): NO// Y  YES
       ....
       'HELP'-PROMPT:
       XECUTABLE 'HELP':
       DESCRIPTION:
         No existing text
         Edit? NO//


       Select FIELD:


       Select OPTION:
       GTM>

       GTM>D ^XUP

       Setting up programmer environment
       Terminal Type set to: C-VT320

       Select OPTION NAME: ZZFILEMAN       FileMan
       FileMan

       VA FileMan 22.0


       Select OPTION: ?
           Answer with OPTION NUMBER, or NAME
          Choose from:
          1            ENTER OR EDIT FILE ENTRIES
          2            PRINT FILE ENTRIES
          3            SEARCH FILE ENTRIES
          4            MODIFY FILE ATTRIBUTES
          5            INQUIRE TO FILE ENTRIES
          6            UTILITY FUNCTIONS
          7            OTHER OPTIONS
          8            DATA DICTIONARY UTILITIES
          9            TRANSFER ENTRIES
       Select OPTION: 1  ENTER OR EDIT FILE ENTRIES


       INPUT TO WHAT FILE: ZLIBBOO//
       EDIT WHICH FIELD: ALL//


       Select ZLIBBOO TITLE: Meatless Dishes in Twenty Minutes
         Are you adding 'Meatless Dishes in Twenty Minutes' as
           a new ZLIBBOO (the 1ST)? No// y  (Yes)
       AUTHOR: Karen A. Levin
         Are you adding 'Karen A. Levin' as a new ZLIBAUT (the 1ST)? No// y  (Yes)
       PUBLISHER: Contemporary Books, Inc.
         Are you adding 'Contemporary Books, Inc.' as a new ZLIBPUB (the 1ST)? No// y
         (Yes)
       DATE PUBLISHED: 1993  (1993)
       LOCATION: KT01BS01
         Are you adding 'KT01BS01' as a new ZLIBLOC (the 3RD)? No// Y  (Yes)


       Select ZLIBBOO TITLE:


       Select OPTION:
       GTM>D ^%G

       Output device: <terminal>:

       List ^ZLIB
       ^ZLIB(1956001,0)="ZLIBLOC^1956001^3^3"
       ^ZLIB(1956001,1,0)="BR01BS01^BED ROOM ONE BOOKSHELVE ONE"
       ^ZLIB(1956001,2,0)="BR01BS02^BED ROOM ONE BOOKSHELVE TWO"
       ^ZLIB(1956001,3,0)="KT01BS01"
       ^ZLIB(1956001,"B","BR01BS01",1)=""
       ^ZLIB(1956001,"B","BR01BS02",2)=""
       ^ZLIB(1956001,"B","KT01BS01",3)=""
       ^ZLIB(1956003,0)="ZLIBPUB^1956003^1^1"
       ^ZLIB(1956003,1,0)="Contemporary Books, Inc."
       ^ZLIB(1956003,"B","Contemporary Books, Inc.",1)=""
       ^ZLIB(1956005,0)="ZLIBAUT^1956005^1^1"
       ^ZLIB(1956005,1,0)="Karen A. Levin"
       ^ZLIB(1956005,"B","Karen A. Levin",1)=""
       ^ZLIB(1956007,0)="ZLIBBOO^1956007^1^1"
       ^ZLIB(1956007,1,0)="Meatless Dishes in Twenty Minutes^1^1^2930000^3"
       ^ZLIB(1956007,"B","Meatless Dishes in Twenty Minu",1)=""

       List ^
Tutorial Home: M Web Tutorials
Prev: Lesson 8
Next: Lesson 10