Mhttpd.js: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| Line 60: | Line 60: | ||
{| class="wikitable"  | {| class="wikitable"  | ||
|+ Summary of mhttpd.js functions  | |+ Summary of mhttpd.js functions  | ||
| Function || XML || JSON || JSON-P || async || AJAX  | | Function || XML || JSON || JSON-P || async || AJAX  | ||
|-  | |-  | ||
| ODBSet(path, value, pwdname) || no || no || no || no || cmd=jset  | | ODBSet(path, value, pwdname) || no || no || no || no || cmd=jset  | ||
| Line 68: | Line 68: | ||
| ODBMGet(paths, callback, formats)  | | ODBMGet(paths, callback, formats)  | ||
|-  | |-  | ||
ODBGetRecord(path)  | | ODBGetRecord(path)  | ||
ODBExtractRecord(record, key)  | |-  | ||
ODBKey(path)  | | ODBExtractRecord(record, key)  | ||
ODBCopy(path, format)  | |-  | ||
ODBEdit(path)  | | ODBKey(path)  | ||
ODBRpc_rev0(name, rpc, args)  | |-  | ||
ODBRpc_rev1(name, rpc, max_reply_length, args)  | | ODBCopy(path, format)  | ||
ODBGetMsg(n)  | |-  | ||
ODBGenerateMsg(m)  | | ODBMcopy(...) || yes || yes || yes || yes || cmd=jcopy  | ||
ODBGetAlarms()  | |-  | ||
| ODBEdit(path)  | |||
|-  | |||
| ODBRpc_rev0(name, rpc, args)  | |||
|-  | |||
| ODBRpc_rev1(name, rpc, max_reply_length, args)  | |||
|-  | |||
| ODBRpc(...)  | |||
|-  | |||
| ODBGetMsg(n)  | |||
|-  | |||
| ODBGenerateMsg(m)  | |||
|-  | |||
| ODBGetAlarms()  | |||
|}  | |}  | ||
Revision as of 22:14, 12 August 2013
About
mhttpd.js contains javascript function wrappers for most MIDAS AJAX functions typically used for implementing interactive custom pages for MIDAS experiments.
AJAX is a set of web development techniques used to construct interactive web applications:
mhttpd.js is typically served by mhttpd from $MIDASSYS/resources/mhttpd.js
<html> <head> ... <script src='mhttpd.js'></script> ... </head> ... </html>
A mostly up to date copy of mhttpd.js is linked here:
An example for using all mhttpd.js functions is included in the MIDAS distribution under examples/javascript1:
- http://ladd00.triumf.ca/~daqweb/doc/midas/examples/javascript1/
 - http://ladd00.triumf.ca/~daqweb/doc/midas/examples/javascript1/example.html
 
MIDAS AJAX functions can be accessed directly without using mhttpd.js wrappers (i.e. using the JSON-P script-tag method)
- AJAX - MIDAS AJAX functions
 
Functions
Helper functions:
- function getMouseXY(e)
 - function XMLHttpRequestGeneric()
 
ODB access functions:
- function ODBSet(path, value, pwdname)
 - function ODBGet(path, format, defval, len, type)
 - function ODBMGet(paths, callback, formats)
 - function ODBGetRecord(path)
 - function ODBExtractRecord(record, key)
 - function ODBKey(path)
 - function ODBCopy(path, format)
 - function ODBEdit(path)
 
MIDAS access functions:
- function ODBRpc_rev0(name, rpc, args)
 - function ODBRpc_rev1(name, rpc, max_reply_length, args)
 - function ODBGetMsg(n)
 - function ODBGenerateMsg(m)
 - function ODBGetAlarms()
 
Summary table
| Function | XML | JSON | JSON-P | async | AJAX | 
| ODBSet(path, value, pwdname) | no | no | no | no | cmd=jset | 
| ODBGet(path, format, defval, len, type) | no | no | no | no | cmd=jget | 
| ODBMGet(paths, callback, formats) | |||||
| ODBGetRecord(path) | |||||
| ODBExtractRecord(record, key) | |||||
| ODBKey(path) | |||||
| ODBCopy(path, format) | |||||
| ODBMcopy(...) | yes | yes | yes | yes | cmd=jcopy | 
| ODBEdit(path) | |||||
| ODBRpc_rev0(name, rpc, args) | |||||
| ODBRpc_rev1(name, rpc, max_reply_length, args) | |||||
| ODBRpc(...) | |||||
| ODBGetMsg(n) | |||||
| ODBGenerateMsg(m) | |||||
| ODBGetAlarms() |