-
- 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
File handling
The server reads files as an integral part of the server. Files read will then be parsed to see if they are pages or templates if they are of type .html, .htm, .dql and .page. If they are pages/templates they will be used as any other page and the resulting code generated is the page and not the source. Due to this we have another set of requests that manipulate files as they are.
File manipulation
To manipulate a file on the server, you need to be logged in as a user with High security. The handling is done using the /filehandling/url. This handler support GET for reading PUT for updating, POST for creating and DELETE for deleting files.
Read a raw file
var url = '/filehandler/editor/pageeditor.html'; var options = { 'url' : url, 'type' : 'GET', 'dataType' : 'text' }; $.ajax(options).done(function(code,status,xhr){ // the content of the file is now in code _this.myfilecontent = code; }).fail(function(code,status,xhr){ //do error handling here });
This reads a file as raw data from /static/editor/pageeditor.html in the application started using jquery
Write a raw file
var thecode = 'This is a text to put into the file\nSecond line\nThird line\n'; var url = '/filehandler/editor/'; var filename = 'pageeditor.html'; var fdata = new FormData(); fdata.append('file', new File([new Blob([thecode])],filename)); var options = { 'url' : url, 'data' : fdata, 'processData' : false, 'contentType' : false, 'type' : 'POST' }; $.ajax(options).done(function(jdata,status,xhr){ // do some messaging if the write was ok if (jdata.result=='ok') $("#messages").html("The file was saved"); }).fail(function(code,status,xhr){ //do error handling here });
This saves or creates a file as raw data from /static/editor/pageeditor.html in the application started using jquery
Delete the file
var url = '/filehandler/editor/pageeditor.html'; var options = { 'url' : url, 'type' : 'DELETE' }; $.ajax(options).done(function(jdata,status,xhr){ // do some messaging if the delete was ok if (jdata.result=='ok') $("#messages").html("The file was deleted"); }).fail(function(code,status,xhr){ //do error handling here });
This deletes the file from /static/editor/pageeditor.html in the application started using jquery