Getting data definitions from the server i done by defining what to get using an url and then you get back the definition as JSON code. You can get back definitions on tables and DQL. You can get the definitions of the underlying queries or tables on all functions returning data in JSON format by adding a query key named "getdefinition=1".

To make the JSON code human readable add the query parameter jsonpretty=1 to the url.

In DEDevServer you have an own service for reading all definitions from the application. All is collected under one url named "/definition/". To read the definition you issue a get request. The second parameter tell what kind of definition you want to fetch.

dql Get the fields and stats you will get for all levels on the dql
table Get the tables field definition for a table name given in third part of the url. It also supports getrelation=relname or getrelation=1 for all relations for this table. You can also get only relation names by adding getrelationnames=1
Ex 1. /definition/table/Orders/?&jsonpretty=1 will list the table definiton to Orders with a human readable format of the json code
Ex 2. /definition/table/Orders/?&getrelationnames=1 will list the definition of the table and all the other tables this have relations to
Ex 3. /definition/table/Orders/?&getrelation=1 will list the definition of the table and all related tables with what fields and setting used in the relation
listcommands Get a list of all commands in prism. Returns json object with an array of strings named commands {'result' : 'ok', 'commands' : ['cname'...]}
listdocuments Get a list of all form documents in this application
listfiles Get list of files in the static directory to this application. You can tell where to start by adding folders after listfiles. To tell what to query, you can add recursive=1 to list subfolder and match=filter where filter is a list seperated by |
Ex. /definition/listfiles/img?&recursive&match=*.jpg|*.png will list all jpg and png files in static/img folder and all sub folders of img.
listfunctions Get a list of all functions in prism. Returns json object with an array of strings named functions {'result' : 'ok', 'functions' : ['fname'...]}
listinternals Get a list of all functions, commands and operators in prism. Returns json object with multiple arrays of strings named commands, functions and operators. 
Ex. {'result' : 'ok', 'functions' : ['fname'...], 'operators' :['oname'...], 'commands' : '['oname'..]}
listoperators Get a list of all operators in prism. Returns json object with an array of strings named operators {'result' : 'ok', operators' : ['oname'...]}
listtablesGet the an array of available tables in this application.
testdqlYou can send a dql to the sever and test it for errors. The result comes back as a json dql tdf definition from an ordinary page with one dql. That is in dqldefinition.default.

What DQL definition to fetch

The dqls can be stored in several ways in the development server, so there can be from 1 to 9 extra parameters for fetching the definition. Here is the order of the extra parameters from the last to the first. If you just use one extra parameters all others will be default values defined in the server. 

Default values

table name WebServer
code field Code
name field
Name
url field URL
id field
ID
template field Template
security field Security
body field Body
lookup id ID

The parameters in reverse order

1 extra Then you only supply the ID value used to lookup the DQL using all tables and fields with the default values.
Ex: /definition/dql/ELM00005/
2 extra You supply the table name and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/ELM00005/
3 extra You supply the table name, code field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/ELM00005/
4 extra You supply the table name, code field, name field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Description/ELM00005/
5 extra You supply the table name, code field, name field, URL field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Description/Path/ELM00005/
6 extra You supply the table name, code field, name field, URL field, ID field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Description/Path/LookupKey/ELM00005/
7 extra You supply the table name, code field, name field, URL field, the id field, template field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Path/LookupKey/Description/Templ/ELM00005/
8 extra You supply the table name, code field, name field, URL field, the id field, template field, security field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Path/LookupKey/Description/Templ/PageSec/ELM00005/
9 extra You supply the table name, code field, name field, the id field, template field, security field, Body field and the ID using all default field names.
Ex: /definition/dql/MyDQLStore/DQL/Path/LookupKey/Description/Templ/PageSec/HTML/ELM00005/

Extra definitions for DQL

All extra definitions are activated by using a query command in the form ?command=1&command2=1 etc. Here are a list of the valid commands

getbody Get the body of the dql
getbodytree Get a compiled version of the body
getcode Get the dql code as given to the dql processor
getrawcode Get the dql code as of before preparsing for as "name" for use in editor
jsonpretty format the json code in a way readable for humans.
{
    "dqldef": {
        "default": {
            "dataentries": [
                "field1",
                "field2",
                "field3",
                "field4"
            ],
            "dqlrun": "for Address ;\nlist records\n    ID;\n    Name ;\n    Address1 ;\n    Address2 ;\n    PostAddress  ;\n    PostCode ;\n    EMail .\nend\n",
            "multiview": [
                {
                    "fdefs": [
                        {
                            "escname": "ID",
                            "hasindex": "yes",
                            "isreqired": "yes",
                            "isunique": "yes",
                            "isvirtual": "no",
                            "length": 5,
                            "name": "ID",
                            "preventedit": "yes",
                            "readsec": "Low3",
                            "type": "text",
                            "writesec": "Low3"
                        },
                        {
                            "escname": "Name",
                            "hasindex": "no",
                            "isreqired": "no",
                            "isunique": "no",
                            "isvirtual": "no",
                            "length": 60,
                            "name": "Name",
                            "preventedit": "no",
                            "readsec": "Low3",
                            "type": "text",
                            "writesec": "Low3"
                        },
                        ...
                    ],
                    "level": 0,
                    "tableview": 0,
                    "tvname": "Address"
                }
            ]
        }
    },
    "result": "ok"
}

Example of an ordinary page dql definition returned by ?&getdefinition=1&jsonpretty=1&json=1

{
    "dqldef": {
        "default": {
            "dataentries": [
                "field1",
                "field2",
                "field3",
                "field4"
            ],
            "error": "error defining list records.",
            "errorincode": "for Address ;\nlist records##*-> with Arrdno = 123;\n    ID;\n    Name ;\n    Address1 ;\n    Address2 ;\n    PostAddress  ;\n    PostCode",
            "errorno": 247,
            "errorpos": 26
        }
    },
    "result": "error"
}<br>

Example with error in dql

What table to get

To fetch a Table you only need to supply one parameter, the table name. 

getrelation=relname get the relationship definitions matching the given name. If you use 1 instead of relname, you will get the relations defined for the current table name.
jsonpretty=1 format the json code in a way readable for humans
Ex. to fetch address book TDF
/definition/table/Customer/?jsonpretty=1
Ex. will return
{
   "tdf" : {
      "fdef" : [
         {
            "derived" : "sequence from 1",
            "hasindex" : false,
            "isreqired" : false,
            "isunique" : false,
            "isvirtual" : false,
            "length" : 5,
            "name" : "CustomerNr",
            "preventedit" : true,
            "readsec" : 7,
            "type" : "numstring",
            "writesec" : 7
         },
         {
            "hasindex" : false,
            "isreqired" : false,
            "isunique" : false,
            "isvirtual" : false,
            "length" : 40,
            "name" : "Customer",
            "preventedit" : false,
            "readsec" : 7,
            "type" : "text",
            "writesec" : 7
         }
      ],
      "tablecreatesecurity" : 4,
      "tabledeletesecurity" : 4,
      "tabledopreservedataonmodify" : true,
      "tablehasencrypteddata" : false,
      "tablemodifysecurity" : 4,
      "tableviewsecurity" : 7,
      "tname" : "Customer"
   }
}

List documents

Get a list of all documents in this application. This is a list records from "Application Objects" except  we make the "Object Type" field human readable by translating it to a "type" field and list the different Object Types as human readable.

{
    "documents": [
        {
            "Current Mode": "1",
            "Description": "02/22/18;",
            "File Name": "WEBSDAAA.FRM",
            "Object Name": "WebServer",
            "Object Type": "1",
            "Style Name": "WebServer",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "11/08/16;",
            "File Name": "ADDRDAAA.FRM",
            "Object Name": "Address",
            "Object Type": "1",
            "Style Name": "Address",
            "type": "Form"
        },
        {
            "Current Mode": "0",
            "Description": "02/24/18;",
            "File Name": "STARDAAA.FRM",
            "Object Name": "StartMenu",
            "Object Type": "5",
            "Style Name": "$DeStat_MenuTable$",
            "type": "Menu"
        },
        {
            "Current Mode": "1",
            "Description": "11/08/16;",
            "File Name": "ORDEDAAA.FRM",
            "Object Name": "OrderLine",
            "Object Type": "1",
            "Style Name": "OrderLine",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "11/08/16;",
            "File Name": "STOCDAAA.FRM",
            "Object Name": "Stock",
            "Object Type": "1",
            "Style Name": "Stock",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "11/20/16;",
            "File Name": "ORDEDAAB.FRM",
            "Object Name": "Order",
            "Object Type": "1",
            "Style Name": "Order",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "01/15/18;",
            "File Name": "SCHEDAAA.FRM",
            "Object Name": "Scheduler",
            "Object Type": "1",
            "Style Name": "Scheduler",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "02/23/18;",
            "File Name": "CONFDAAA.FRM",
            "Object Name": "Config",
            "Object Type": "1",
            "Style Name": "Config",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "12/12/17;",
            "File Name": "SCHEDAAB.FRM",
            "Object Name": "SchedulerLogEntry",
            "Object Type": "1",
            "Style Name": "SchedulerLogEntry",
            "type": "Form"
        },
        {
            "Current Mode": "1",
            "Description": "02/23/18;",
            "File Name": "WEBEDAAA.FRM",
            "Object Name": "WebEditor",
            "Object Type": "1",
            "Style Name": "WebEditor",
            "type": "Form"
        }
    ],
    "result": "ok"
}

example from the WebServerDemo app

List files

This will let you list all files and directories in the static directory in your application. The static directory are merged in with the pages and will adhere to the same folder security rules as the pages. 

Supported parameters are recursive=1 to list all files in sub directories that you have rights to see.

{
    "files": [
        {
            "files": [
                {
                    "ext": ".js",
                    "name": "dataeaseconnect.js",
                    "size": 35122,
                    "type": "file"
                }
            ],
            "name": "deserver",
            "type": "dir"
        },
        {
            "ext": ".css",
            "name": "deserver.css",
            "size": 2652,
            "type": "file"
        },
        {
            "files": [
                {
                    "ext": ".html",
                    "name": "catalog.html",
                    "size": 3061,
                    "type": "file"
                },
                {
                    "ext": ".css",
                    "name": "deeditor.css",
                    "size": 3520,
                    "type": "file"
                },
                {
                    "ext": ".js",
                    "name": "deeditor.js",
                    "size": 15907,
                    "type": "file"
                },
                {
                    "ext": ".js",
                    "name": "deeditormenu.js",
                    "size": 20484,
                    "type": "file"
                },
                {
                    "ext": ".html",
                    "name": "fileeditor.html",
                    "size": 6810,
                    "type": "file"
                },
                {
                    "ext": ".html",
                    "name": "pageeditor.html",
                    "size": 7233,
                    "type": "file"
                },
                {
                    "ext": ".html",
                    "name": "reporteditor.html",
                    "size": 3125,
                    "type": "file"
                },
                {
                    "ext": ".html",
                    "name": "templateeditor.html",
                    "size": 5788,
                    "type": "file"
                }
            ],
            "name": "editor",
            "type": "dir"
        }
    ],
    "result": "ok"
}

Example list all files recursive by url: /definition/listfiles?&recursive=1&jsonpretty=1

{
    "files": [
        {
            "ext": ".html",
            "name": "catalog.html",
            "size": 3061,
            "type": "file"
        },
        {
            "ext": ".css",
            "name": "deeditor.css",
            "size": 3520,
            "type": "file"
        },
        {
            "ext": ".js",
            "name": "deeditor.js",
            "size": 15907,
            "type": "file"
        },
        {
            "ext": ".js",
            "name": "deeditormenu.js",
            "size": 20484,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "fileeditor.html",
            "size": 6810,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "pageeditor.html",
            "size": 7233,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "reporteditor.html",
            "size": 3125,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "templateeditor.html",
            "size": 5788,
            "type": "file"
        }
    ],
    "result": "ok"
}

Example list only files in editor folder by url: /definition/listfiles/editor?&jsonpretty=1

The listtables

This will return a simple array of table names. It will remove all hidden tables form the list. To get the hidden tables as well, add the query parameter showhidden=1 to the url.

Ex. to list all tables
/definition/listtables/?jsonpretty=1 
Returns
{
   "result" : "ok",
   "tables" : [
      "Customer",
      "Article",
      "WebServer",
      "System - Info",
      "DQL Test"
   ]
}