Frames

From Telstar Wiki
Revision as of 21:40, 2 April 2022 by John (talk | contribs) (Created page with "# Frames in More Detail __*** Please note TELSTAR as an application is still under development and subject to change. ***__ ## Basic Frame Frames are defined in JSON. The simplest frame that can be viewed on TELSTAR would be as follows. { "pid": { "page-no": 101, "frame-id": "a" }, "visible": true } This frame, if posted to the TELSTAR API would result in a simple welcome message being displayed when viewed on TELSTAR using an appropriate videotex clie...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. Frames in More Detail

__*** Please note TELSTAR as an application is still under development and subject to change. ***__

    1. Basic Frame

Frames are defined in JSON. The simplest frame that can be viewed on TELSTAR would be as follows.

{ "pid": { "page-no": 101, "frame-id": "a" }, "visible": true }

This frame, if posted to the TELSTAR API would result in a simple welcome message being displayed when viewed on TELSTAR using an appropriate videotex client.

To hide the frame from view, simply set the *visible key* to false.

    1. Adding Content with the Edit.tf editor

There are several ways to add content to a page. One of the easiest is to create the page in an editor such as http://edit.tf.

The JSON file would look something like the one showm below. Note that the content type is set to editf and the content data contains the edit.tf url.

   {
       "pid": {
           "page-no": 101,
           "frame-id": "a"
       },
       "visible": true,
       "frame-type": "information",
       "content": {
           "data": "http://edit.tf/#0:QIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQICn_OmTJkSJApUqVKlSpUlcHApiTJkyZEiRIkyZMmTIkSJFmKf3JX58____RBg-fPnzog__2iBBo-fNX9qgQcOHDh8-fGiAp_zFf______2v7_____7X___oEGr__Qa0ur_________QoCn9ywK__6D__a__7dH__tf___1QIv_9AiQIkaPX_bo0aMpiKf_-Yr__oP_9r__tUH_-1____9og__yjnz5cldX9qUc-fPkp__uSv_-g__2v_-1Qf_7X__aIv____KZv_dIV__2pTN___yn__mK___z__a____5__tf_9qgVf__8o5_vWJX__alHP___Kf_7kr____6dBr_____-h__2qBBr__ymbPnSFf69CUzf__8pnz5iq9ejRoECBWvXr0KBGjQYOHBHz4cECBAgwcCily7__yqDhw4ePnzogQeP7RAg0fPiBB___9X___QYPH___-sCmb__KoP________3B__tUCDV__tUH___1f36XB-_______KOf_8qgRo__9B__v9X___QINX___Qav__B8-NNX_-jR___8pm__ymYrq______h_odX9qg1f___7q__9X_-h1f_5TBgwYM37__KOSur-_Ro0Pr_8_f_qDV_b___r__1f_6D___lFKlSpUu__8pmK_v7VAgwf______tNX9r______V__oP__-gQaPnwpm__yqDB__tUCD__QIEG___1f2qL____9X_-g____z5-__ymb__KoNX_-lQKl6VAgQav6_V__oNf___1f2qBX_____9-hKOf_8qgVJ0JRw4cOPLkqiQoESNGgVL0aFEjQoECJGjRoymDNm__ymTJkzZv3_____-3bt27du3Thw8efPnz58-fPnz58-fP___QIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECA",
           "type": "edit.tf"
       }    
   }
   
    1. Adding Content using Markup

Content can be added directly to the JSON file using a very simple markup. For example consider the following frame definition.

   {
       "pid": {
           "page-no": 101,
           "frame-id": "a"
       },
       "visible": true,
       "frame-type": "information",
       "title": {
           "data": "[D]Welcome\r\n\r\n",
           "type": "markup"
       },
       "content": {
           "data": "[Y]Hello[C]Telstar[M]World",
           "type": "markup"
       }
   }
   

This frame uses markup in the title and the content, The title is specified as [D]ouble height and the three words used in the content are coloured yellow, cyan and magenta respectively.

The markup definitions are shown below.

   [R] alpha_red
   [G] alpha_green
   [Y] alpha_yellow
   [B] alpha_blue
   [M] alpha_magenta
   [C] alpha_cyan
   [W] alpha_white
   [F] flash
   [S] steady
   [N] normal_height
   [D] double_height
   
    1. Raw Content

If the content type or title type is specified as raw, the data will be presented within TELSTAR without modification.

For example the previous frame in raw format would be defined as follows.

   {
       "pid": {
           "page-no": 101,
           "frame-id": "a"
       },
       "visible": true,
       "title": {
           "data": "\u001bMWelcome\r\n\r\n",
           "type": "raw"
       },
       "content": {
           "data": "\u001bCHello\u001bFTelstar\u001bEWorld",
           "type": "raw"
       }
   }
   

The unicode values specified for colour and double height are the values as specified in the videotex specification.

![FTSE_small.png](https://bitbucket.org/repo/LXaBk6A/images/3173163590-FTSE_small.png)

    1. More complete JSON Frame Description

The frame below is a standard information page from the TELSTAR system shown in its JSON format. It represents the first frame of page 899. Taking this page as an example, a description of the fields and their meaning is decribed below.

__The full json schema can be found [here](frame-schema.md).__

{ "pid": { "page-no": 9, "frame-id": "a" }, "visible": true, "header-text": "", "cost": 0, "frame-type": "information", "redirect": { "page-no": 0, "frame-id": "" }, "content": { "data": "https://edit.tf/#0:QIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgc4UCBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQICixYsWLFixYsWLFixYsWLFixYsWLFixYsWLFixYsWLFixYgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAxQIIs6PJnRYtKTOjoKkWnUQUIMeLTQIECBAgQIECBAgQIEDRAgp2adSLNQSZ0aegQIECBAgQIECBAgQIECBAgQIECBAgQNkCCPBqRa8GygpxaVaTDi00CBAgQIECBAgQIECBAgQIECBA4QIIc-dUgw6iCJFqQZMymgQIECBAgQIECBAgQIECBAgQIEDlAgmT46CfOQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQMECCZPjoJ8aMgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQICixYsWLFixYsWLFixYsWLFixYsWLFixYsWLFixYsWLFixYgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECAFUQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgBVAMUNMQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIAVQDFDTAlMPUQIECBAgQIECBAgQIECBAgQIECBAgQIECAFUAxQ0wJTD1A0EHSQIECBAgQIECBAgQIECBAgQIECBAgQIECANMCUw9QNBB0kCBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECAPUDQQdJAgQIECBAgQIECBAgQIECAosWLFixYsWLFixYsQIECAHSQIECAosWLFixYsWLFixYsWIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIECA", "type": "edit.tf' }, "title": { "data": "", "type": "" }, "routing-table": [ 90, 91, 92, 93, 94, 95, 6, 97, 98, 990, 0 ], "cursor": false, "connection": { "address": "", "mode": "", "port": 0 }, "author-id": "", "response-data": { "responses": null, "response-action": { "exec": "", "args": null, "post-action-frame": { "page-no": 0, "frame-id": }, "post-cancel-frame": { "page-no": 0, "frame-id": "" } } }, "navmessage-select": "[B][n][Y]Select item or[W]*page# : [_+]", "navmessage-notfound": "[B][n][Y]Page not Found :[W]" }

    1. pid
   page_no, frame_id
    1. visible
     "visible": true,
    1. header-text
     "header-text": "[Y]MICRONETn 800 (C)",
    1. cache-id
     "cache-id": "d4f71dbd-5cc0-4214-912e-e0340696291d",
    1. frame-type

The API supports the following frame types *initial*, *mainindex*, *information*, *exit*, *gateway*, *test*, *response*.

     "frame-type": "information",
      1. initial

This frame type is used on the start page. The start page is specified within the *telstar.json* config file. The default page number is *99a*. Typically only one of these frames would exist within a system.

      1. mainindex

This frame type is used on the main index page. The main index page is specified within the *telstar.json* config file. The default page number is *0a*. Only one of these frames should exist within a system.

      1. information

This frame type is used for all normal content frames.

      1. exit

This frame type is used for an exit page, any number of exit pages can be defined. When an exit page is rendered it will close the connection.

      1. gateway

This page type is used to define a gateway page and is used in conjunction with the connection element (see below).

      1. test

This page type indicates a test page and prevents navigation and system messages from being shown. this is typically used for frames that need to use the whole display such as 'test cards' etc.

      1. response

This frame type is used in conjunction with the *response-fields element (see below) for response frames. See [Response Frames](response_frames.md).

    1. content

__Description to be added...__

     "content":
    1. title

__Description to be added...__

     "title": {
       "data": "",
       "type": ""
     },
    1. routing-table

__Description to be added...__

     "routing-table": [
       8000,
       8001,
       8002,
       8003,
       8004,
       8005,
       8006,
       8007,
       8008,
       8009,
       800
     ],
    1. cursor

This element determines whether a cursor is shown on the page. Typically a cursor would only be shown on response frames.

     "cursor": false,
    1. connection

This elements specifies the connection object used for gateway pages.

     "connection": {
       "address": "",
       "mode": "",
       "port": 0
     },
      1. address and port

This represent the endpoint of the system being accessed.

      1. mode

This determines how the system is accessed, the options are.

   viewdata
   full_duplex
   full_duplex_no_echo

    1. author-id

This is an optional field that can be used to indicate eith the author of the page or other source.

     "author-id": "editf-frame-generator",
    1. response-fields

These fields relate to the fields used in a *response-frame*, a response frame is a frame where a user is asked to enter information. The Telstar system weather page is one such frame where the user is asked to enter a city.

For information frames the value can be left blank as shown below or simply ommited altogether.

    "response-fields": [],

The following JSON snippet is taken from the TELSTAR system repsonse frame and shows a single field.

   "response-fields": [
     {
       "label": "City/Town : ",
       "vpos": 8,
       "hpos": 4,
       "required": true,
       "length": 16,
       "type": "alpha",
       "auto_submit": true,
       "value": "",
       "valid": false,
       "password": false
     }
   ]
      1. label

The *label* element will be displayed alongside the data entry area.


      1. vpos, hpos

These specify where the field is displayed on the page.

      1. required

If set to *true*, it will not be possible to continue past the page until some data is entered.

      1. length

Refers to the length of the data field. See *auto_submit* below

      1. type

This element defines what characters can be entered into the field the options are

  • numeric*, *alpha* and *alphanumeric*.
      1. auto_submit

If, when enter data into the field, a user reaches the *length* (see above), the page will auto submit if this value is set to true.

      1. value

The value will contain the entered data when the response frame is processed. See plugins.

      1. valid


      1. password

Set to tru will ensure that the entered data is not echoed back to the user. Asterisks are sent instead.

      1. navmsg-forecolour, navmsg-backcolour and navmsg-highlight

These elements represent the colours of the navigation message on ro 23 of the frame, these are optional values and will default to Yellow, Blue and White respectively.

   "navmsg-forecolour": "yellow",
   "navmsg-backcolour": "blue",
   "navmsg-highlight": "white",