-
- About server
- LegEasy Connect
- Dev server
- Live Server
- DERun
- Hello world
- Call script after startup
- Using tools
- Authentication
- Custom authentication
- External authentication
- Basic authentication
- Folder Security
- Data manipulation
- Read one record
- Read many records
- Write one record
- Delete one record
- Direct Page/DQL
- Page data definition
- Directory listing
- File handling
- Prism lists
- Data Defintions
- Get data definitions
- Create data Definitions
- Update data definitions
- Delete data definitions
- Definition format
- A web page
- Page definition
- DQL pages
- Single file/memo DQL
- Single file/memo Page
- LiveText tags
- Url commands
- Tags
- How data is triggered in a page
- Form goals
- Auto form
- Setting up autoform
- A single form
- Form with subform
- Form actions
- About Update
- About DataEaseConnect
- checkquery
- callbacksuccess
- clearrecord
- connectonfieldchange
- convertvaltonumber
- decodequery
- deletedata
- deletetdf
- displayerrormsg
- doaction
- ensurequry
- fetchrecord
- fetchrecords
- finddatatype
- findfieldindef
- formdata
- formdefs
- forminit
- forminitdone
- formloaded
- generateid
- getcookied
- getdata
- getelement
- getfield
- getmyhost
- getnumlines
- getrecordcontent
- getrecorddef
- getrecordnofromurl
- gettdf
- gettablefromurl
- istrueval
- login
- logout
- makenewline
- multirecordinit
- newdata
- newtdf
- rundql
- populateoneselect
- selectpopulate
- setcsrfheader
- setelement
- setfield
- singlerecordinit
- stringify
- stripsuffix
- updatedata
- updatetdf
- useisodatetime
- usenumber
- version
- About decommon.js
- The loader
- calccaretpos
- decodequery
- generateid
- insertitem
- loadfilelist
- loadfile
- loadinternals
- message
- rundql
- runpage
- savefile
- selectitem
- testdql
- version
- About jsBridge.js
- Action names
- deCheckVersion
- DEOS
- getnumlines
- GetCurrent
- GetValue
- GetVar
- jsAction
- jsActionExt
- jsActionExt2
- jsAddClass
- jsDEOS
- jsDerivation
- jsDerivationDebug
- jsDocumentDelete
- jsDocumentEdit
- jsDocumentOpen
- jsExecDQL
- jsGetActiveDocState
- jsGetVar
- jsGetCurrent
- jsGetDocumentState
- jsGetValue
- jsGetPRISMValue
- jsHide
- jsInt21
- jsLiveText
- jsLog
- jsMemoExecDQL
- jsMenuItem
- jsNewBlankForm
- jsOpenAppCat
- jsPrismDerivation
- runPrismFunction
- jsRefreshDocuments
- jsReorganize
- jsReorganizeAll
- jsRemoveClass
- jsSetFixedValue
- jsSetVarFromField
- jsSetValue
- jsSetVar
- jsSetCurrent
- jsSetWebField
- jsSetWebFieldFromVar
- jsShow
- jsToggle
- jsToggleClass
- makenewline
- SetCurrent
- SetValue
- SetVar
- startdebugger
Single file/memo Page
If you do not want to use a DQL to produce data output, you can use the single file/memo based page format for serving data from PRISM together with the html code. The file/body has to start with .data as the first line. The data definition in json format then follows and is read until the first line that starts with a new page parts (that is start with a dot (.) as first character on the line. It also support a .template command that tells what template to use from the template cache. If the first section command after the .data is a .end this .end will be removed before the body is extracted from the file.
Ex.
.data [ { "type" : "record", "tablename" : "Order" }, { "type" : "list", "tablename" : "OrderLine" } ] .end <h1>The list of all addresses</h1> <table class="table"> .items <tr> <td>[{ID}]</td> <td>[{Name}]</td> <td>[{Address1}] [{Address2}]</td> <td>[{PostAddress}] [{PostCode}]</td> <td>[{EMail}]</td> </tr> .end </table>
The rest of the file will then be added as the body template before it is compiled. If the compilation holds a ".template templatename" this will be fetched before the DQL is compiled, run and processed through the LivePage.If you are not using a .template, you must close the dql with a .end if you want to use preheader/items html. The example above do not need this as it uses .template.
Commands to control what is output
If you use a .data file without any body portion, the data will be returned as json. With a body, you get the generated html file. It you for some reason want to override this, you have a few query commands you can use.
json=1 Return json even if there is a body. getcode=1 Return the data definition getbodytree=1 Return the definition of the template as the server will see it. This is named a BodyTree. getdefinition=1 Return the data field definition jsonpretty=1 Return human readable json code. astext=1 Return body as mime text/text instead of text/html All but astext=1 only works on pages that return json, so to use them on a page with body make sure to add json=1 as well.