Mhttpd.js: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(97 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= About =
The midas documentation has moved. The new documentation about the midas JavaScript library is in:
 
* [https://midas.triumf.ca/docs/develop/api/javascript/ Midas JavaScript API] (overview of the libraries)
mhttpd.js contains javascript function wrappers for most MIDAS AJAX functions typically used for implementing interactive custom pages for MIDAS experiments.
* [https://midas.triumf.ca/docs/develop/api/javascript/midas/ midas.js] (the mjsonrpc_xxx JSON-RPC functions)
 
* [https://midas.triumf.ca/docs/develop/api/javascript/deprecated/#ajax-interface AJAX interface] on the Deprecated web features page (the old ODBGet(), ODBSet() etc. functions)
AJAX is a set of web development techniques used to construct interactive web applications:
* http://en.wikipedia.org/wiki/Ajax_(programming)
 
mhttpd.js is typically served by mhttpd from $MIDASSYS/resources/mhttpd.js
<pre>
<html>
<head>
...
<script src='mhttpd.js'></script>
...
</head>
...
</html>
</pre>
 
A mostly up to date copy of mhttpd.js is linked here:
* http://ladd00.triumf.ca/~daqweb/doc/midas/resources/mhttpd.js
* https://bitbucket.org/tmidas/midas/src/HEAD/resources/mhttpd.js?at=develop
 
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()
* function ODBExtractRecord(record, key)
* function ODBEdit(path)
* function ODBFinishInlineEdit(...)
* function ODBInlineEditKeydown(...)
* function ODBInlineEdit(...)
 
ODB access functions:
 
* function ODBSet(path, value, pwdname)
* function ODBGet(path, format, defval, len, type)
* function ODBMGet(paths, callback, formats)
* function ODBGetRecord(path)
* function ODBKey(path)
* function ODBCopy(path, format)
* function ODBMCopy(paths, callback, format)
 
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 =
 
{| class="wikitable"
|+ Summary of mhttpd.js functions
| Function || XML || JSON || JSON-P || async || AJAX
|-
| ODBSet(path, value, pwdname) || no || no || no || no || [[AJAX#jset|cmd=jset]]
|-
|ODBGet(path, format, defval, len, type) || no || no || no || no || [[AJAX#jget|cmd=jget]]
|-
| ODBMGet(paths, callback, formats) || no || no || no || yes || [[AJAX#jget|cmd=jget]]
|-
| ODBGetRecord(path) || ? || ? || ? || no || [[AJAX#jget|cmd=jget]]
|-
| ODBKey(path) || no || yes || no || no || cmd=jkey
|-
| ODBCopy(path, format) || yes || yes || yes || no || [[AJAX#jcopy|cmd=jcopy]]
|-
| ODBMcopy(paths, callback, format) || yes || yes || yes || yes || [[AJAX#jcopy|cmd=jcopy]]
|-
| ODBRpc_rev0(name, rpc, args) || no || no || no || no || cmd=jrpc_rev0
|-
| ODBRpc_rev1(name, rpc, max_reply_length, args) || no || no || no || no || cmd=jrpc_rev1
|-
| ODBRpc(...) || yes || yes || yes || yes || cmd=jrpc
|-
| ODBGetMsg(n) || no || no || no || no || cmd=jmsg
|-
| ODBGenerateMsg(m) || no || no || no || no || cmd=jgenmsg
|-
| ODBGetAlarms() || no || no || no || no || cmd=jalm
|}
 
= ODBSet =
 
http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/RC_mhttpd_custom_ODB_access.html#RC_mhttpd_custom_odbset
 
= ODBGet =
 
http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/RC_mhttpd_custom_ODB_access.html#RC_mhttpd_custom_odbget
 
= ODBMGet =
 
http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/RC_mhttpd_custom_ODB_access.html#RC_mhttpd_custom_odbmget
 
= ODBKey =
 
(doc incomplete)
 
http://ladd00.triumf.ca/~daqweb/doc/midas-old/html/RC_mhttpd_custom_ODB_access.html#RC_mhttpd_custom_odbkey
 
= ODBCopy =
 
AAA
 
= ODBMCopy =
 
AAA

Latest revision as of 22:01, 30 October 2026

The midas documentation has moved. The new documentation about the midas JavaScript library is in: