-
- Command line
- Server Settings
- Commands
- Session
- 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
- 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 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
- About decommon.js
- The loader
- calccaretpos
- decodequery
- generateid
- insertitem
- loadfilelist
- loadfile
- loadinternals
- message
- rundql
- runpage
- savefile
- selectitem
- testdql
- version
- .end
- .form header
- .form trailer
- .items
- assign
- application status
- backup db
- begin transaction
- break
- call menu
- call program
- case
- cluster by
- commit
- connect
- copy all from
- data-entry
- db status
- delete records
- define
- disconnect
- do
- documents
- exec SQL
- else
- end
- enter a record
- error messages off
- error messages on
- exit
- export
- for
- global
- if
- import
- imports
- in
- input using
- install application
- into
- list records
- lock
- lock db
- modify records
- message
- named
- others
- prompt
- query selection
- record entry
- records
- reorganize
- restore db
- rollback
- run procedure
- servers
- temp
- then
- tran off
- tran on
- unclustered
- unlock
- unlock db
- via form
- while
- with
- abs
- acos
- addressof
- ampm
- anylookup
- asin
- atan
- atan2
- ceil
- CHR
- concat
- ConsoleCopy
- ConsoleMemoCopy
- ConsoleShow
- ConsoleWriteToFile
- cos
- cosh
- date
- DatePicker
- day
- DEOS
- DialogOpen
- DialogOpenRelated
- DocumentCloseName
- DoesObjectExist
- ExecDQL
- ExecuteFile
- exp
- FileExecDQL
- firstc
- firstlast
- firstw
- FixedWidth
- floor
- futurevalue
- GetCurrent
- GetVar
- hours
- if
- installment
- jointext
- julian
- lastc
- lastfirst
- lastw
- length
- log
- log10
- lower
- MemoChunk
- MemoCopy
- MemoDecodePair
- MemoExecDQL
- MemoFind
- MemoGetGlobal
- MemoLength
- MemoMemoCopy
- MemoMemoReplace
- MemoReadFromFile
- MemoReplace
- MemoSetGlobal
- MemoStringBetween
- MemoStringFrom
- MemoStringTo
- MemoWordCount
- MemoWriteToFile
- midc
- midw
- minutes
- mod
- month
- OpenForm
- OpenMenu
- OpenProcedure
- OpenReport
- periods
- power
- presentvalue
- proper
- random
- rate
- RefreshForm
- RefreshScreen
- RefreshStatus
- Remote
- Remote authentication
- Remote POP3
- Remote IMAP
- Remote SMTP
- Remote XML
- seconds
- SetColor
- SetCurrent
- SetFocus
- SetLabelText
- SetMemoValue
- SetState
- SetStyle
- SetValue
- SetVar
- sin
- sinh
- spellcurrency
- spelldate
- spellmonth
- spellnumber
- spellweekday
- sqrt
- StringBetween
- StringEscape
- StringFind
- StringFrom
- StringReplace
- StringTo
- tan
- tanh
- textpos
- timeampm
- ToText
- UniqueID
- upper
- Wait
- weekday
- WriteToFile
- year
- yearday
- yearweek
- " (quotation marks)
- () (parentheses)
- + (addition)
- , (comma)
- - (subtraction)
- . (period)
- -- (comment)
- / (division)
- * (multiplication)
- * (asterisk)
- ? (question mark)
- ~ (tilde)
- : (colon)
- := (assignment operator)
- ; (semicolon)
- < (less than)
- <= (less than or equal to)
- = (equals)
- > (greater than)
- >= (greater than or equal to)
- all
- all files
- and
- any
- between
- blank
- count
- count of
- file
- highest of
- in groups
- in groups with group-totals
- in order
- in reverse
- item (Statistical)
- item (Conditional Statistical)
- lock files
- lock nothing
- lock records
- lookup
- lowest of
- max
- mean
- mean of
- min
- not
- number
- numeric string
- or
- pause
- percent
- selected record
- std.dev.
- std.err.
- sum
- sum of
- text
- time
- to
- variance
- window
- @GetDefinition
- . document
- . listcommands
- . listdocuments
- . listdrives
- . listfiles
- . listfunctions
- . listinternals
- . listoperators
- . listrelated
- . listtables
- . object
- . table
- . testdql
- @SetDefinition
- . document
- . object
The loader
Since the server and DfW have different layout of where to find the files, you need a loader to iron out the differences between the server and DfW. The server only sees the files in your /static/ folder but the DfW will see the app folder with a /static/ folder inside it. There is also a difference when loading files form the server and form locale storage. When reading information from the server, a async call is done to the server. Then the server has returned the information a function is called by the ajax call. When doing the same in DfW, you instantly get the information back. To be able to use server and DfW the same way we have to simulate the callback way of doing thing in DfW.
The dynloader to use
function dynload(url, callback) { // Adding the script tag to the head as suggested before var head = document.getElementsByTagName('head')[0]; var elm=null; var ext=''; var pos = url.lastIndexOf("."); if (pos>=0){ ext = url.substr(pos); ext = ext.toLowerCase(); } switch (ext){ case '.js': elm = document.createElement('script'); elm.type = 'text/javascript'; elm.async = false; elm.src = url; // Then bind the event to the callback function. // There are several events for cross browser compatibility. elm.onreadystatechange = callback; elm.onload = callback; break; case '.css': elm = document.createElement('link'); elm.rel = 'stylesheet'; elm.type = 'text/css'; elm.href = url; elm.media = 'all'; break; } // Fire the loading head.appendChild(elm); }
The loader supports .js files and .css files for now. It will run the callback function when the file is loaded.
Using the loader
indataease = false; // Test to see if we are running inside DataEase if (window.external && window.external.hasPrismConnection){ // We are in DataEase fromwhere = "DataEase"; indataease = true; dynload("./../editor/deeditor.css"); dynload("./../js/jquery.min.js",loadJQueryDone); dynload("./decommon.js",loadDone); } else { // We are not in DataEase fromwhere = "The server"; dynload("/editor/deeditor.css"); dynload("/js/jquery.min.js",loadJQueryDone); dynload("/DSEditors/decommon.js",loadDone); }
Example of setting up a loader from the server and DfW. As you can see each of the files loaded can have their own callback the gets called when the loading is done. You can also omit the callback if you have nothing to do.
Setting up decommon.js for use
// What to do when we are done loading the wrappers that looks the same for server and DataEase function loadDone(){ var dec = new DECommon(indataease); // setting it up and telling it if we are in server or DfW dec.loadinternals(); dec.loadfilelist('/MyDQLs/'); var query = window.location.search; if (query.length>0) { var params = dec.decodequery(query); var url=params.file; if (url) dec.loadfile(url); } $("#test").on('click',function(me){ var elm=$("#dqlcontent"); var code = elm.val(); dec.testdql(code); }); $("#delete").on('click',function(me){ dec.delete(); }); $("#save").on('click',function(me){ var elm=$("#dqlcontent"); var code = elm.val(); dec.savefile(dec.url,code); }); $(document).on('click','.listiteml2',function(me){dec.selectitem($(me.target));}); $(document).on('dblclick','.listiteml2',function(me){dec.insertitem($(me.target));}); $('div[contenteditable]').on('keydown',function(e){dec.editorkeydownhandler(e)}); $('div[contenteditable]').on('keyup',function(e){dec.editorkeyuphandler(e)}); $('div[contenteditable]').on('focus',function(){dec.calccaretpos()}); $('div[contenteditable]').on('click',function(){dec.calccaretpos()}); }
Setting up decommon.js and calling functions for setting up the environment. As you can see now the differences between server and DfW are hidden from you. The only thing you have to do is use the object created after the dynamic loading of the libraries from the file structure. The object in this example have got the name "dec" for DataEase Common.