diff --git a/docs/ACMEScript.md b/docs/ACMEScript.md index 7c1d373c..3d759967 100644 --- a/docs/ACMEScript.md +++ b/docs/ACMEScript.md @@ -167,7 +167,7 @@ Data can be stored "persistently" during a CSE's runtime. This is intended to pa To store data persistently one may consider to store this data in the oneM2M resource tree. -See: [get-storage](ACMEScript-functions.md##get-storage), [has-storage](ACMEScript-functions.md##has-storage), [set-storage](ACMEScript-functions.md#set-storage) +See: [get-storage](ACMEScript-functions.md#get-storage), [has-storage](ACMEScript-functions.md#has-storage), [put-storage](ACMEScript-functions.md#put-storage) ### Evaluating S-Expressions in Strings and JSON Structures diff --git a/docs/docs/CNAME b/docs/docs/CNAME new file mode 100644 index 00000000..96a2ca01 --- /dev/null +++ b/docs/docs/CNAME @@ -0,0 +1 @@ +acmecse.net \ No newline at end of file diff --git a/docs/docs/development/ACMEScript-functions.md b/docs/docs/development/ACMEScript-functions.md index 57f49ac0..0377feba 100644 --- a/docs/docs/development/ACMEScript-functions.md +++ b/docs/docs/development/ACMEScript-functions.md @@ -22,6 +22,7 @@ Concatenate and return the stringified versions of the symbol arguments. (. "Time:" sp (datetime)) ;; Returns "Time: 20230308T231049.934630" ``` +--- ### argv @@ -48,6 +49,7 @@ The number of arguments available is stored in the variable [argc](../developmen (print "All arguments:" argv) ``` +--- ### assert @@ -61,6 +63,7 @@ The `assert` function terminates the script if its argument evaluates to *false* "IN")) ;; Terminates when the setting is different from "IN" ``` +--- ### base64-encode @@ -76,6 +79,7 @@ This function encodes a string as base64. (base64-encode "Hello, World") ;; Returns "SGVsbG8sIFdvcmxk" ``` +--- ### block @@ -116,6 +120,7 @@ One can use the `block` function to implement *break* and *continue* functionali (print i))) ``` +--- ### car @@ -134,6 +139,7 @@ The `car` function returns the first symbol from a list. It doesn't change the o (car '(1 2 3)) ;; Returns 1 ``` +--- ### case @@ -158,6 +164,7 @@ The special symbol `otherwise` for a *condition* s-expression always matches and (otherwise (print "Result: something else"))) ``` +--- ### cdr @@ -176,6 +183,7 @@ The `cdr` function returns a list with all symbols from a list except the first (cdr '(1 2 3)) ;; Returns (2 3) ``` +--- ### cons @@ -193,6 +201,7 @@ The `cons` function adds a new symbol to the front of a list and returns it. It (cons '(1 2) '(3 4)) ;; Returns ((1 2) 3 4) ``` +--- ### datetime @@ -208,6 +217,7 @@ All timestamps are UTC-based. (datetime "%H:%M") ;; Returns, for example, "22:16" ``` +--- ### defun @@ -242,6 +252,7 @@ The result of a function is the result of the expression that is evaluated last (fib 10) ;; Returns 55 ``` +--- ### dec @@ -261,6 +272,7 @@ The function returns the variable's new value. (dec a 2.5) ;; Decrement variable "a" by 2.5 ``` +--- ### dolist @@ -286,6 +298,7 @@ If the `result variable` is specified then the loop returns the value of that va (print result) ;; 55 ``` +--- ### dotimes @@ -300,7 +313,6 @@ If the `result variable` is specified then the loop returns the value of that va !!! see-also "See also" [dolist](#dolist), [while](#while) - === "Example" ```lisp (dotimes (i 10) @@ -312,6 +324,7 @@ If the `result variable` is specified then the loop returns the value of that va (print result) ;; 45 ``` +--- ### eval @@ -327,12 +340,13 @@ The `eval` function evaluates and executes a quoted list or symbol. (eval '(print "Hello, World")) ;; Prints "Hello, World" ``` +--- ### evaluate-inline `(evaluate-inline )` -With this function one can disable or enable the [evaluation of s-expressions in strings](ACMEScript.md#extras). +With this function one can disable or enable the [evaluation of s-expressions in strings](../development/ACMEScript.md#evaluating-s-expressions-in-strings-and-json-structures). === "Example" ```lisp @@ -340,6 +354,7 @@ With this function one can disable or enable the [evaluation of s-expressions in (print "1 + 2 = [(+ 1 2)]") ;; Prints "1 + 2 = [(+ 1 2)]" ``` +--- ### get-json-attribute @@ -362,6 +377,7 @@ The `get-json-attribute` function retrieves an attribute from a JSON structure v (get-json-attribute { "a" : [ "b", "c" ]} "{*}/{0}" ) ;; Returns "b" ``` +--- ### has-json-attribute @@ -383,6 +399,7 @@ This *key* may be a structured path to access elements deeper down in the JSON s (has-json-attribute { "a" : { "b" : "c" }} "a/c" ) ;; Returns false ``` +--- ### if @@ -401,6 +418,7 @@ The boolean expression can be any s-expression that evaluates to a boolean value (print "false")) ;; This expression is not executed ``` +--- ### in @@ -420,6 +438,7 @@ The function returns *true* if this is the case, or *false* otherwise. (in '(1 2) '((1 2) (3 4))) ;; Returns true ``` +--- ### inc @@ -441,6 +460,7 @@ The function returns the variable's new value. (inc a 2.5) ;; Increment variable "a" by 2.5 ``` +--- ### index-of @@ -461,6 +481,7 @@ The function returns the index as a number, or *nil* if the value could not be f (index-of "b" "abc") ;; Returns 1 ``` +--- ### is-defined @@ -478,6 +499,7 @@ The `is-defined` function tests whether a symbol (ie. a variable, built-in or de !!! note Most of the time the symbol argument needs to be quoted, otherwise the symbol is evaluated first and the function will not work as expected. +--- ### json-to-string @@ -493,6 +515,7 @@ The `json-to-string` function returns a JSON structure in a string. (json-to-string { "a" : { "b" : "c" }}) ;; Returns "{\"a\": {\"b\": \"c\"}}" ``` +--- ### jsonify @@ -508,8 +531,7 @@ The `jsonify` function returns a string where characters are escaped that would (jsonify "Hello, World") ;; Returns "Hello,\nWorld" ``` - - +--- ### lambda @@ -537,6 +559,7 @@ The result of a lambda function is the result of the expression that is evaluate ((y) 5) ;; Returns 25 ``` +--- ### length @@ -572,6 +595,7 @@ Each assignment consists, like the [setq](#setq) function, of an implicit quoted (let* (b 2) (c 3)) ;; Assigns 2 to b and 3 to c ``` +--- ### list @@ -587,6 +611,7 @@ The `list` function returns a list that contains all the symbol arguments. (list 1 2 3) ;; Returns ( 1 2 3 ) ``` +--- ### log @@ -604,6 +629,7 @@ The function always returns *nil*. (log "Hello, World") ;; Prints "Hello, World" to the log ``` +--- ### log-error @@ -621,6 +647,7 @@ The function always returns *nil*. (log-error "Hello, World") ;; Prints "Hello, World" to the warning log ``` +--- ### lower @@ -636,6 +663,7 @@ The `lower` function returns a lower case copy of the input string. (lower "Hello, World") ;; Returns "hello, world" ``` +--- ### match @@ -657,6 +685,7 @@ The `match` function determines whether a string matches a regular expression *r (match "aa" "b*") ;; Returns false ``` +--- ### nl @@ -672,6 +701,7 @@ The `nl` function returns a newline character. (. "Hello," nl "World") ;; Returns "Hello,\nWorld" ``` +--- ### nth @@ -690,6 +720,7 @@ The index is 0-based. (nth 2 "Hello, World") ;; Returns "l" ``` +--- ### parse-string @@ -705,6 +736,7 @@ The `parse-string` function parses a string that contains an s-expression and re (eval (parse-string "(print \"hello, world\")")) ;; Prints "hello, world" ``` +--- ### print @@ -722,6 +754,7 @@ The function always returns *nil*. (print "Hello, World") ;; Prints "Hello, World" ``` +--- ### progn @@ -740,6 +773,7 @@ This function is implicitly used internally when used to evaluate s-expressions. (progn (print "Hello, World") 1) ;; Prints "Hello, World" and returns 1 ``` +--- ### quit @@ -758,6 +792,7 @@ If a symbol is provided for the optional argument its value is taken as the resu (quit "a result") ;; Returns "a result" ``` +--- ### quit-with-error @@ -776,6 +811,7 @@ If a symbol is provided for the optional argument its value is taken as the resu (quit-with-error "a result") ;; Returns "a result" ``` +--- ### quote @@ -788,6 +824,7 @@ The `quote` function returns a quoted version of the argument. It can be used to (quote (1 2 3)) ;; Returns (1 2 3) ``` +--- ### random @@ -804,6 +841,7 @@ The default for the range, when no argument is given, is [0.0, 1.0]. If one numb (random 10 20) ;; returns, for example, 12.73221 ``` +--- ### remove-json-attribute @@ -821,6 +859,7 @@ The function doesn't change the original JSON structure, but returns an updated (remove-json-attribute { "a" : { "b" : "c" }} "a/b") ;; Returns { "a" : {} } ``` +--- ### return @@ -838,6 +877,7 @@ The `return` function stops the evaluation of a function or [while](#while) loop ) ``` +--- ### return-from @@ -855,6 +895,7 @@ The function may return a symbol, or *nil*. (block "myBlock" 1 (return-from "myBlock" 2) 3) ;; Returns 2 ``` +--- ### round @@ -868,6 +909,7 @@ The `round` function rounds a number to *precision* digits after the decimal poi (round 3.1415926 2) ;; Returns 3.14 ``` +--- ### set-json-attribute @@ -896,6 +938,7 @@ The function doesn't change the original JSON structure, but returns an updated (set-json-attribute { "a" : { "b" : "c" }} '('("a/b" "d") '("a/c" "e"))) ;; Returns { "a" : { "b" : "d", "c" : "e"} ``` +--- ### setq @@ -911,6 +954,7 @@ The `setq` function assigns a value to a variable. (setq a "Hello, World") ;; Returns "Hello, World" and sets the variable "a" ``` +--- ### sleep @@ -927,6 +971,7 @@ The function returns the delay. (sleep 1.5) ;; Sleep for 1.5 seconds ``` +--- ### slice @@ -944,6 +989,7 @@ The behavior is the same as slicing in Python, except that both *start* and *end (slice 99 100 '(1 2 3)) ;; Returns () ``` +--- ### sp @@ -959,6 +1005,7 @@ The `sp` function returns a space character. (. "Hello," sp "World") ;; Returns "Hello, World" ``` +--- ### string-to-json @@ -974,6 +1021,7 @@ The `string-to-json` function converts a string to a JSON structure and returns (string-to-json "{ \"a\" : { \"b\" : \"c\" }}") ;; Returns {"a": {"b": "c"}} ``` +--- ### to-number @@ -989,6 +1037,7 @@ The `to-number` function converts a string that contains a number to a number sy (to-number "123") ;; Returns the number 123 ``` +--- ### to-string @@ -1004,6 +1053,7 @@ The `to-string` function converts a symbol of any of the built-in types to a str (to-string '(1 2)) ;; Returns "[1, 2]" ``` +--- ### to-symbol @@ -1019,6 +1069,7 @@ The `to-symbol` function converts a string to a symbol and returns it. The resul (to-symbol "a-symbol") ;; Returns the symbol 'a-symbol' ``` +--- ### unwind-protect @@ -1041,6 +1092,7 @@ The function always returns the result of the cleanup s-expression. ((print "cleanup form") 2)) ``` +--- ### upper @@ -1056,6 +1108,7 @@ The `upper` function returns an upper case copy of the input string. (upper "Hello, World") ;; Returns "HELLO, WORLD" ``` +--- ### url-encode @@ -1071,6 +1124,7 @@ The `url-encode` function encodes a string so that may be safely used as part of (url-encode "Hello, World") ;; Returns "Hello%2C+World" ``` +--- ### while @@ -1111,6 +1165,7 @@ The `clear-console` function clears the console screen. (clear-console) ;; Clears the console screen ``` +--- ### cse-attribute-info @@ -1130,6 +1185,7 @@ The function returns a quoted list where each entry is another quoted list with (cse-attribute-info "acop") ;; Returns ( ( "acop" "accessControlOperations" "nonNegInteger" ) ) ``` +--- ### cse-status @@ -1150,6 +1206,7 @@ The return value is one of the following strings: (cse-status) ;; Returns "RUNNING" ``` +--- ### get-config @@ -1166,6 +1223,7 @@ The `get-config` function retrieves a setting from the CSE's internal configurat (get-config "cse.cseID") ;; Returns, for example, "/id-in" ``` +--- ### get-loglevel @@ -1184,6 +1242,7 @@ The `get-loglevel` function retrieves a the CSE's current log level setting. The (get-loglevel) ;; Return, for example, INFO ``` +--- ### get-storage @@ -1199,6 +1258,7 @@ The `get-storage` function retrieves a value from the CSE's internal script-data (get-storage "aStorageID" "aKey") ;; Retrieves the value for "aKey" from "aStorageID" ``` +--- ### has-config @@ -1215,6 +1275,7 @@ The `has-config` function determines whether a setting from the CSE's internal c (has-config "cse.unknown") ;; Returns false ``` +--- ### has-storage @@ -1230,6 +1291,7 @@ The `has-storage` function determines whether a value has been stored under the (has-storage "aStorageID" "aKey") ;; Tests whether the key "aKey" exists in "aStorageID" ``` +--- ### include-script @@ -1247,6 +1309,7 @@ The function returns the result of the finished script. (include-script "functions" "an argument") ;; Run the script "functions" ``` +--- ### log-divider @@ -1260,6 +1323,7 @@ The `log-divider` function inserts a divider line in the CSE's *DEBUG* log. It c (log-divider "Hello, World") ;; Add a divider with a centered message ``` +--- ### print-json @@ -1272,6 +1336,7 @@ The `print-json` function prints a JSON structure with syntax highlighting to th (print-json { "m2m:cnt" : { "rn": "myCnt" }}) ;; Print the JSON structure ``` +--- ### put-storage @@ -1287,6 +1352,7 @@ The `put-storage` function inserts or updates a *value* in the CSE's internal sc (put-storage "aStorageID" "aKey" "Hello, World") ;; Inserts or updates the key "aKey" in "aStorageID" ``` +--- ### remove-storage @@ -1308,6 +1374,7 @@ With two parameters the `remove-storage` function removes a *key*/*value* pair f (remove-storage "aStorageID") ;; Removes all keys and value from storageID ``` +--- ### reset-cse @@ -1322,6 +1389,7 @@ The script execution does continue after the CSE finished the reset. (reset-cse) ;; Resets the CSE ``` +--- ### run-script @@ -1339,6 +1407,7 @@ The function returns the result of the finished script. (setq result (run-script "aScript" "an argument")) ;; Run the script "aScript" and assign the result ``` +--- ### runs-in-ipython @@ -1351,6 +1420,7 @@ The `runs-in-ipython` function determines whether the CSE currently runs in an I (runs-in-ipython) ;; Returns true if the CSE runs in an iPython environment ``` +--- ### schedule-next-script @@ -1368,6 +1438,7 @@ This is different from [include-script](#include-script) and [run-script](#run-s (schedule-next-script "scriptName" "anArgument") ;; Schedule a script with an argument ``` +--- ### set-config @@ -1385,6 +1456,7 @@ It is only possible to update an existing setting, but not to create a new one. (set-config "cse.checkExpirationsInterval" 1.5) ;; Set the configuration to 1.5 ``` +--- ### set-console-logging @@ -1435,6 +1507,7 @@ The function returns a list: (create-resource "CAdmin" "cse-in" { "m2m:cnt" : { }} { "rvi": "3"}) ;; Returns ( 2001 { "m2m:cnt" ... } ) ``` +--- ### delete-resource @@ -1468,6 +1541,7 @@ The function returns a list: (delete-resource "CAdmin" "cse-in/myCnt" { "rvi": "3"}) ;; Returns ( 2002 { "m2m:cnt" ... } ) ``` +--- ### import-raw @@ -1475,41 +1549,34 @@ The function returns a list: The `import-raw` function creates a resource in the CSE without using the normal procedures when handling a [CREATE request](#create-resource). The resource is added to the resource tree without much validation. -This function is primarily used when importing initial resources, and when restoring resources during the [startup](ACMEScript-metatags.md#meta_init) of the CSE. +This function is primarily used when importing initial resources, and when restoring resources during the [startup](ACMEScript-metatags.md#init) of the CSE. `resource` is a valid oneM2M resource. All necessary attributes must be present in that resource, including the *parentID* ( *pi* ) attribute that determines the location in the resource tree. The function returns a list: `( )` - - *response status* is the oneM2M Response Status Code (RSC) for the request - - *resource* is the response content (usually *nil* if successful) -Example: - -```lisp -;; Add an AE resource under the CSEBase -(import-raw - "CmyAE" ;; Originator - { "m2m:ae": { - "ri": "CmyAE", - "rn": "CmyAE", - "pi": "${ (get-config \"cse.ri\") }", ;; Get the CSE's resource ID from the configuration - "rr": true, - "api": "NmyAppId", - "aei": "CmyAE", - "csz": [ "application/json", "application/cbor" ] - }}) -``` - -[top](#top) +=== "Example" + ```lisp + ;; Add an AE resource under the CSEBase + (import-raw + "CmyAE" ;; Originator + { "m2m:ae": { + "ri": "CmyAE", + "rn": "CmyAE", + "pi": "${ (get-config \"cse.ri\") }", ;; Get the CSE's resource ID from the configuration + "rr": true, + "api": "NmyAppId", + "aei": "CmyAE", + "csz": [ "application/json", "application/cbor" ] + }}) + ``` --- - - ### query-resource `(query-resource )` @@ -1524,26 +1591,22 @@ The function has the following arguments: The function returns a boolean indicating the query result. -See also: [get-json-attribute](#get-json-attribute) - -Examples: - -```lisp -;; Returns true -(query-resource - '(& (> x 100) (== rn "cnt1234")) - { "m2m:cnt": { - "rn": "cnt1234", - "x": 123 - }}) -``` +!!! see-also "See also" + [get-json-attribute](#get-json-attribute) -[top](#top) +=== "Examples" + ```lisp + ;; Returns true + (query-resource + '(& (> x 100) (== rn "cnt1234")) + { "m2m:cnt": { + "rn": "cnt1234", + "x": 123 + }}) + ``` --- - - ### retrieve-resource `(retrieve-resource [request arguments:JSON])` @@ -1563,26 +1626,21 @@ The function returns a list: `( )` - *response status* is the oneM2M Response Status Code (RSC) for the request - - *resource* is the response content (usually the target resource if successful) -See also: [create-resource](#create-resource), [delete-resource](#delete-resource), [send-notification](#send-notification), [update-resource](#update-resource) - -Examples: - -```lisp -(retrieve-resource "CAdmin" "cse-in/myCnt") -;; Returns ( 2000 { "m2m:cnt" ... } ) -(retrieve-resource "CAdmin" "cse-in/myCnt" { "rvi": "3"}) ;; Provide requestVersionIndicator -;; Returns ( 2000 { "m2m:cnt" ... } ) -``` +!!! see-also "See also" + [create-resource](#create-resource), [delete-resource](#delete-resource), [send-notification](#send-notification), [update-resource](#update-resource) -[top](#top) +=== "Examples" + ```lisp + (retrieve-resource "CAdmin" "cse-in/myCnt") ;; Returns ( 2000 { "m2m:cnt" ... } ) + + ;; Provide extra requestVersionIndicator + (retrieve-resource "CAdmin" "cse-in/myCnt" { "rvi": "3"}) ;; Returns ( 2000 { "m2m:cnt" ... } ) + ``` --- - - ### send-notification `(send-notification [request arguments:JSON])` @@ -1592,11 +1650,8 @@ The `send-notification` function sends a oneM2M NOTIFY request to a target resou The function has the following arguments: - *originator* of the request - - The target *resource-id* - - The *notification* JSON structure - - Optional: A JSON structure with additional *request arguments* The function will provide defaults for the required request arguments (e.g. rvi, rid). These can be overwritten if necessary by setting them in the *request arguments* argument. @@ -1606,23 +1661,18 @@ The function returns a list: `( )` - *response status* is the oneM2M Response Status Code (RSC) for the request - - *resource* is the response content -See also: [create-resource](#create-resource), [delete-resource](#delete-resource), [retrieve-resource](#retrieve-resource), [update-resource](#update-resource), - -Example: - -```lisp -(send-notification "CAdmin" "cse-in/myAE" { "m2m:sgn" : { ... }}) ;; Returns notification result -``` +!!! see-also "See also" + [create-resource](#create-resource), [delete-resource](#delete-resource), [retrieve-resource](#retrieve-resource), [update-resource](#update-resource) -[top](#top) +=== "Examples" + ```lisp + (send-notification "CAdmin" "cse-in/myAE" { "m2m:sgn" : { ... }}) ;; Returns notification result + ``` --- - - ### update-resource `(update-resource [request arguments:JSON])` @@ -1632,11 +1682,8 @@ The `update-resource` function sends a oneM2M UPDATE request to a target resourc The function has the following arguments: - *originator* of the request - - The target *resource-id* - - The *resource* JSON structure - - Optional: A JSON structure with additional *request arguments* The function will provide defaults for the required request arguments (e.g. rvi, rid). These can be overwritten if necessary by setting them in the *request arguments* argument. @@ -1646,52 +1693,35 @@ The function returns a list: `( )` - *response status* is the oneM2M Response Status Code (RSC) for the request - - *resource* is the response content -See also: [create-resource](#create-resource), [delete-resource](#delete-resource), [retrieve-resource](#retrieve-resource), [send-notification](#send-notification), - -Examples: - -```lisp -(update-resource "CAdmin" "cse-in" { "m2m:cnt" : { "mni": 10 }}) -;; Returns ( 2004 { "m2m:cnt" ... } ) -(update-resource "CAdmin" "cse-in" { "m2m:cnt" : { "mni": 10 }} { "rvi": "3"}) -;; Provide requestVersionIndicator -;; Returns ( 2004 { "m2m:cnt" ... } ) -``` +!!! see-also "See also" + [create-resource](#create-resource), [delete-resource](#delete-resource), [retrieve-resource](#retrieve-resource), [send-notification](#send-notification) -[top](#top) +=== "Examples" + ```lisp + (update-resource "CAdmin" "cse-in" { "m2m:cnt" : { "mni": 10 }}) ;; Returns ( 2004 { "m2m:cnt" ... } ) ---- + ;; Provide extra requestVersionIndicator + (update-resource "CAdmin" "cse-in" { "m2m:cnt" : { "mni": 10 }} { "rvi": "3"}) ;; Returns ( 2004 { "m2m:cnt" ... } ) + ``` - ## Text UI ---- - - - ### open-web-browser `(open-web-browser )` The `open-web-browser` function opens a web browser with the given URL. -Examples: - -```lisp -;; Opens the web browser with the URL "https://www.onem2m.org" -(open-web-browser "https://www.onem2m.org") -``` - -[top](#top) +=== "Example" + ```lisp + (open-web-browser "https://www.onem2m.org") ;; Opens the web browser with the URL "https://www.onem2m.org" + ``` --- - - ### set-category-description `(set-category-description )` @@ -1700,32 +1730,23 @@ The `set-category-description` function sets the description for a whole categor The description may contain Markdown formatting. -Examples: - -```lisp -;; Sets the description for the category "myCategory" -(set-category-description "myCategory" "My category description") -``` - -[top](#top) +=== "Example" + ```lisp + (set-category-description "myCategory" "My category description") ;; Sets the description for the category "myCategory" + ``` --- - - ### runs-in-tui `(runs-in-tui)` The `runs-in-tui` function determines whether the CSE currently runs in Text UI mode. -Examples: - -```lisp -(runs-in-tui) ;; Returns true if the CSE runs in Text UI mode -``` - -[top](#top) +=== "Example" + ```lisp + (runs-in-tui) ;; Returns true if the CSE runs in Text UI mode + ``` --- @@ -1750,63 +1771,43 @@ This function is only available in TUI mode. It has the following arguments: If one of the optional arguments needs to be left out, a *nil* symbol must be used instead. The function returns NIL. -Examples: - -```lisp -(tui-notify "a message") ;; Displays "a message" in an information notification for 3 seconds -(tui-notify "a message" "a title") ;; Displays "a message" with title "a title in an information notification for 3 seconds -(tui-notify "a message") ;; Displays "a message" in an information notification for 3 seconds -(tui-notify "a message" nil "warning") ;; Displays "a message" in a warning notification, no title -(tui-notify "a message" nil nil 10) ;; Displays "a message" in an information notification, no title, for 3 seconds - -``` - -[top](#top) +=== "Examples" + ```lisp + (tui-notify "a message") ;; Displays "a message" in an information notification for 3 seconds + (tui-notify "a message" "a title") ;; Displays "a message" with title "a title in an information notification for 3 seconds + (tui-notify "a message") ;; Displays "a message" in an information notification for 3 seconds + (tui-notify "a message" nil "warning") ;; Displays "a message" in a warning notification, no title + (tui-notify "a message" nil nil 10) ;; Displays "a message" in an information notification, no title, for 3 seconds + ``` --- - - ### tui-refresh-resources `(tui-refresh-resources)` The `tui-refresh-resources` function refreshes the resources in the CSE's Text UI. -Examples: - -```lisp -(tui-refresh-resources) ;; refreshes the resource tree -``` - -[top](#top) +=== "Example" + ```lisp + (tui-refresh-resources) ;; Refreshes the resource tree + ``` --- - - ### tui-visual-bell `(tui-visual-bell)` The `tui-visual-bell` function shortly flashes the script's entry in the scripts' list/tree. -Examples: - -```lisp -(tui-visual-bell) ;; Flashes the script's name -``` - -[top](#top) - ---- - - +=== "Example" + ```lisp + (tui-visual-bell) ;; Flashes the script's name + ``` ## Network - - ### http `(http [] [])` @@ -1816,11 +1817,8 @@ The `http` function sends an http request to an http server. The function has the following arguments: - *operation* of the request. This is one of the following supported quoted symbols: get, post, put, delete, patch - - The target server's *url*. This is a string with a valid URL. - - Optional: A JSON structure of header fields. Each header field is a JSON attribute with the name of the header field and its value. If the optional *body* argument is present then this argument must be present as well, ie. with at least an empty JSON structure or the *nil* symbol. - - Optional: The http request's body, which could be a string or a JSON structure. The function returns a list: @@ -1828,33 +1826,28 @@ The function returns a list: `( - ### ping-tcp-service `(ping-tcp-server [])` @@ -1869,20 +1862,173 @@ It has the following arguments: The function returns a boolean value. -Examples: +=== "Examples" + ```lisp + (ping-tcp-service "localhost" 8080) ;; Returns true if the service is reachable + (ping-tcp-service "localhost" 8080 2) ;; Returns true if the service is reachable. Timeout after 2 seconds. + ``` + +## Provided Functions + +In addition to the functions defined in this documentation, more functions are provided in the file [ASFunctions.as](https://github.com/ankraft/ACME-oneM2M-CSE/blob/master/acme/init/ASFunctions.as). + +These functions can be included and made available in own scripts with the [include-script](#include-script) function: + +=== "Example" + ```lisp + (include-script "ASFunctions") + ``` + +### cadr + +`(cadr )` + +The `cadr` function returns the second element of a list. + +!!! see-also "See also" + [caddr](#caddr) + +=== "Example" + ```lisp + (cadr '(1 2 3)) ;; Returns 2 + ``` + +--- + +### caddr + +`(caddr )` + +The `caddr` function returns the third element of a list. + +!!! see-also "See also" + [cadr](#cadr) + +=== "Example" + ```lisp + (caddr '(1 2 3)) ;; Returns 3 + ``` + +--- + +### set-and-store-config-value + +`(set-and-store-config-value )` + +The `set-and-store-config-value` function stores the current value of a configuration setting and then updates the setting with a new value. + +The function has the following arguments: + +- The *key* of the configuration setting +- The *value* to set -```lisp -(ping-tcp-service "localhost" 8080 2) -;; Returns true if the service is reachable. Timeout after 2 seconds. -``` +The function returns the previous value of the configuration setting. -[top](#top) +!!! see-also "See also" + [restore-config-value](#restore-config-value) + +=== "Example" + ```lisp + (set-and-store-config-value "cse.checkExpirationsInterval" 10) ;; Returns the previous value of the configuration setting + ``` --- +### restore-config-value + +`(restore-config-value )` + +The `restore-config-value` function restores a configuration setting to its previous value. + +The function has the following arguments: + +- The *key* of the configuration setting + +!!! see-also "See also" + [set-and-store-config-value](#set-and-store-config-value) + +=== "Example" + ```lisp + (restore-config-value "cse.checkExpirationsInterval") ;; Restores the configuration setting + ``` + +--- + +### get-response-status + +`(get-response-status )` + +The `get-response-status` function returns the response status of a oneM2M request. + +The function has the following arguments: + +- The *response* list + +The function returns the response status. +!!! see-also "See also" + [get-response-resource](#get-response-resource) + +=== "Example" + ```lisp + (get-response-status (retrieve-resource "CAdmin" "cse-in/myCnt")) ;; Returns the response status + ``` + +--- + +### get-response-resource + +`(get-response-resource )` + +The `get-response-resource` function returns the response resource of a oneM2M request. + +The function has the following arguments: + +- The *response* list + +The function returns the response resource. + +!!! see-also "See also" + [get-response-status](#get-response-status) + +=== "Example" + ```lisp + (get-response-resource (retrieve-resource "CAdmin" "cse-in/myCnt")) ;; Returns the response resource + ``` + +--- + +### eval-if-resource-exists + +`(eval-if-resource-exists )` + +The `eval-if-resource-exists` function evaluates a command if a resource exists and can be retrieved. Otherwise, it evaluates an alternative command. + +If found, the resource is stored in the "_resource" variable that can be used in the "cmd" command. + +The function has the following arguments: + +- The *originator* of the request +- The *id* of the resource +- The *cmd* to evaluate if the resource exists +- The *else-cmd* to evaluate if the resource does not exist + +The function returns the result of the evaluated command. + +=== "Example" + ```lisp + (eval-if-resource-exists "CAdmin" "cse-in/myCnt" (print "Resource exists") (print "Resource does not exist")) ;; Evaluates the command + ``` -**ASFunctions.as** +;; Run a command if the resource exists and can be retrieved +;; Otherwise run the "else-cmd" command. +;; If found, the resource is stored in the "_resource" variable +;; that can be used in the "cmd" command. +(defun eval-if-resource-exists (originator id cmd else-cmd) + ( (setq response (retrieve-resource originator id)) + (if (== (get-response-status response) 2000) + ( (setq _resource (get-response-resource response)) + (eval cmd)) + (eval else-cmd)))) -In addition more functions are provided in the file [ASFunctions.as](../init/ASFunctions.as). These functions can be included and made available in own scripts with the [include-script](#include-script) function. diff --git a/docs/docs/development/ACMEScript-loading.md b/docs/docs/development/ACMEScript-loading.md index c22f23d8..15c03ff2 100644 --- a/docs/docs/development/ACMEScript-loading.md +++ b/docs/docs/development/ACMEScript-loading.md @@ -9,40 +9,40 @@ All files in those directories with the extension `.as` are treated as ACMEScrip There are many different ways to run scripts: - Scripts can be manually run from the console interface with the `R` (Run) command. -- They can also be run by a specified keypress from the console interface (see the [onKey](ACMEScript-metatags.md#meta_onkey) meta tag). -- Scripts can be scheduled to run at specific times or dates. This is similar to the Unix cron system (see the [at](ACMEScript-metatags.md#meta_at) meta tag). -- It is possible to schedule scripts to run at certain events. Currently, the CSE [init](ACMEScript-metatags.md#meta_init), [onStartup](ACMEScript-metatags.md#meta_onstartup), [onRestart](ACMEScript-metatags.md#meta_onrestart), and [onShutdown](ACMEScript-metatags.md#meta_onshutdown) events are supported. -- Scrips can be run as a receiver of a NOTIFY request from the CSE. See the [onNotification](ACMEScript-metatags.md#meta_onnotification) meta tag. +- They can also be run by a specified keypress from the console interface (see the [onKey](ACMEScript-metatags.md#onkey) meta tag). +- Scripts can be scheduled to run at specific times or dates. This is similar to the Unix cron system (see the [at](ACMEScript-metatags.md#at) meta tag). +- It is possible to schedule scripts to run at certain events. Currently, the CSE [init](ACMEScript-metatags.md#init), [onStartup](ACMEScript-metatags.md#onstartup), [onRestart](ACMEScript-metatags.md#onrestart), and [onShutdown](ACMEScript-metatags.md#onshutdown) events are supported. +- Scrips can be run as a receiver of a NOTIFY request from the CSE. See the [onNotification](ACMEScript-metatags.md#onnotification) meta tag. - They can also be run as a command of the [Upper Tester Interface](Operation.md#upper_tester). - Scripts can be integrated as tools in the [Text UI](TextUI.md). See also the section [Text UI meta-tags](ACMEScript-metatags.md#_textui) for available tags. ## Script Arguments -Scripts may have arguments that can be accessed with the [argv](ACMEScript-functions.md#argv) function and [argc](ACMEScript-functions.md#argc) variable. +Scripts may have arguments that can be accessed with the [argv](ACMEScript-functions.md#argv) function and [argc](ACMEScript-variables.md#argc) variable. !!! Note - Not all of the above methods support script arguments. For example, scripts that are run by the [onStartup](ACMEScript-metatags.md#meta_onstartup), [onRestart](ACMEScript-metatags.md#meta_onrestart), or [onShutdown](ACMEScript-metatags.md#meta_onshutdown) events do not support arguments. + Not all of the above methods support script arguments. For example, scripts that are run by the [onStartup](ACMEScript-metatags.md#onstartup), [onRestart](ACMEScript-metatags.md#onrestart), or [onShutdown](ACMEScript-metatags.md#onshutdown) events do not support arguments. ## Script Prompt -A script may ask for input before it runs. This can be enabled with the [@prompt](ACMEScript-metatags.md#meta_prompt) meta tag. The prompt's answer is then assigned as the script's first argument. +A script may ask for input before it runs. This can be enabled with the [@prompt](ACMEScript-metatags.md#prompt) meta tag. The prompt's answer is then assigned as the script's first argument. !!! Warning "Attention" - The [@prompt](ACMEScript-metatags.md#meta_prompt) meta tag should only be used when human interaction can be ensured. Running a script with this meta tag, for example, [scheduled](ACMEScript-metatags.md#meta_at) or unattended will cause the script to wait forever for user input. + The [@prompt](ACMEScript-metatags.md#prompt) meta tag should only be used when human interaction can be ensured. Running a script with this meta tag, for example, [scheduled](ACMEScript-metatags.md#at) or unattended will cause the script to wait forever for user input. ## Running Scripts at Startup, Restart, and Shutdown -Right after a CSE finished the start-up or restart, or just before a CSE shuts down it looks for scripts that have the [@onStartup](ACMEScript-metatags.md#meta_onstartup), [@onRestart](ACMEScript-metatags.md#meta_onrestart), or [@onShutdown](ACMEScript-metatags.md#meta_onshutdown) meta tags set, and runs them respectively. +Right after a CSE finished the start-up or restart, or just before a CSE shuts down it looks for scripts that have the [@onStartup](ACMEScript-metatags.md#onstartup), [@onRestart](ACMEScript-metatags.md#onrestart), or [@onShutdown](ACMEScript-metatags.md#onshutdown) meta tags set, and runs them respectively. ## Initialization Script -Whenever a CSE starts or is restarted (or reset) it is necessary to create couple of oneM2M resources and to build a basic resource tree. This is done by running a script that has the [@init](ACMEScript-metatags.md#meta_init) meta tag set. A script with this tag is executed right after the start of the internal services during the initialization of the *importer* service. +Whenever a CSE starts or is restarted (or reset) it is necessary to create couple of oneM2M resources and to build a basic resource tree. This is done by running a script that has the [@init](ACMEScript-metatags.md#init) meta tag set. A script with this tag is executed right after the start of the internal services during the initialization of the *importer* service. !!! Info "Note" - Only one script must have the [@init](ACMEScript-metatags.md#meta_init) meta tag set. By default this is the [init.as](https://github.com/ankraft/ACME-oneM2M-CSE/blob/master/acme/init/init.as){target=_new} script from the CSE's [init](https://github.com/ankraft/ACME-oneM2M-CSE/blob/master/acme/init){target=_new} directory. + Only one script must have the [@init](ACMEScript-metatags.md#init) meta tag set. By default this is the [init.as](https://github.com/ankraft/ACME-oneM2M-CSE/blob/master/acme/init/init.as){target=_new} script from the CSE's [init](https://github.com/ankraft/ACME-oneM2M-CSE/blob/master/acme/init){target=_new} directory. diff --git a/docs/docs/development/ACMEScript-metatags.md b/docs/docs/development/ACMEScript-metatags.md new file mode 100644 index 00000000..136b83b8 --- /dev/null +++ b/docs/docs/development/ACMEScript-metatags.md @@ -0,0 +1,400 @@ +# ACMEScript - Meta Tags + +Meta tags are special commands in a script that are not executed during the runtime of a script, but describe certain capabilities of the script or give, for example, the script a name or provide instructions when a script should be executed. + +Meta tags are keywords that start with an at-character `@`. They can appear anywhere in a script file on a single line, but it is recommend to collect them either at the start or the end of a script. + +!!! important + Meta tag names are case sensitive. + + +## Accessing Meta Tags +Meta tags are added as constants to the script's environment and are prefixed with `meta.`. +They can be accessed like any other environment variable, for example: + +=== "Accessing a Meta Tag" + ```lisp + (if (is-defined 'meta.name) ;; note the quote in front of meta.name to prevent evaluation + (print "Script name:" meta.name)) ;; prints the script's name + ``` + +## Basic Meta Tags + +### @at + +`@at ` + +The `@at` meta tag specifies a time / date pattern when a script should be executed. This pattern follows the Unix [crontab](https://crontab.guru/crontab.5.html){target=_new} pattern. + +A crontab pattern consists of the following six fields: + +`second minute hour dayOfMonth month dayOfWeek year` + +Each field is mandatory and must comply to the following values: + +- `*` : any valid integer number for that field, or +- `*/` : step, or +- `-` + +A short one-line description of a script's purpose. This is used, for example, for the console's script catalog. + +A description must be a single line, but may include line breaks (i.e. `\n` characters). A description may also be formatted as markdown. This is then correctly displayed in the Text UI. + +!!! see-also "See also" + [@usage](#usage) + +=== "Examples" + ```lisp + @description The purpose of this script is to demonstrate the @description meta tag + + @description # Markdown header\n\nFormatted **Markdown** text. + ``` + +--- + +### @filename + +`@filename ` + +This meta tag is for internal use. It contains the script's full filename when read by the script manager. + +--- + +### @hidden + +`@hidden` + +This meta tag indicates that a script will not be listed in the console's script catalog. + +=== "Example" + ```lisp + @hidden + ``` + +--- + +### @init + +`@init` + +This meta tag indicates that the script will be executed during the CSE's startup and restart. It is used to initialize the CSE and creates the basic resources. + +!!! important + Only one script can have this meta tag set. + +!!! see-also + [@onRestart](#onrestart), [@onShutdown](#onshutdown), [@onStartup](#onstartup) + +=== "Example" + ```lisp + @init + ``` + +--- + +### @name + +`@name ` + +This meta tag assigns a name to a script. This name is used for identifying the script, for example when running a script from the console. + +!!! see-also + [@uppertester](#uppertester) + +=== "Example" + ```lisp + @name exampleScript + ``` + +--- + + +### @onKey + +`@onKey ` + +With this meta tag a script registers to a key-press event of the console interface. If the key is pressed then the script is run. The event and the key are passed as the environment variables [event.type](../development/ACMEScript-variables.md#eventtype) and [event.data](../development/ACMEScript-variables.md#eventdata), respectively. + +The keys may be normal ASCII characters or a function key. Please consult the console's [supported function key table](../setup//Console.md#supported-function-keys) for the function key's names. Note, that not all function keys are available on all OS platforms. + +A script can only register for a single key event. + +=== "Example" + ```lisp + ;; Run the script when the '9' key is pressed + @onkey F9 + + (print (event.data)) + ``` + +--- + +### @onNotification + +`@onNotification ` + +With this meta tag a script acts as a handler for a notification request from the CSE. + +The ACME URL scheme "acme://<identifier>" is used to define a URI that is targeting the script. Such a URI must be used in either the *notificationURI* attribute of a subscription resource, or the *pointOfAccess* of an AE. + +When a notification is received and the handler script is run the following variables are set: + + +- [notification.originator](../development//ACMEScript-variables.md#notificationoriginator) : The notification's originator +- [notification.resource](../development/ACMEScript-variables.md#notificationresource) : The notification's resource +- [notification.uri](../development/ACMEScript-variables.md#notificationuri) : The notification's target URI + +=== "Example" + ```lisp + ;; Run the script when the 'acme://aNotification' notificastion is received + @onNotification acme://aNotification + + (print (notification.resource)) + ``` + +--- + +### @onRestart + +`@onRestart` + +This meta tag indicates that the script will be executed just after the CSE restarted, for example after a reset. + +If multiple scripts have this meta tag set then they will run in random order. + +!!! see-also + [@init](#init), [@onShutdown](#onshutdown), [@onStartup](#onstartup) + +=== "Example" + ```lisp + @onRestart + ``` + +--- + +### @onShutdown + +`@onShutdown` + +This meta tag indicates that the script will be executed just before the CSE shuts down. + +If more than one script have this meta tag set then they will run in random order. + +!!! see-also + [@init](#init), [@onRestart](#onrestart), [@onStartup](#onstartup) + +=== "Example" + ```lisp + @onShutdown + +--- + +### @onStartup + +`@onStartup` + +This meta tag indicates that the script will be executed just after the CSE started. It will be run only after start up, but not when the CSE restarted. If more than one script have this meta tag set then they will be run in random order. + +!!! see-also + [@init](#init), [@onRestart](#onrestart), [@onShutdown](#onshutdown) + +=== "Example" + ```lisp + @onStartup + ``` + +--- + +### @prompt + +`@prompt ` + +A script with this meta tag will present a prompt before it is executed and ask a user for input. The result is then passed on as [script arguments](../development/ACMEScript-loading.md#script-arguments). + +This meta tag should only be used when human interaction can be ensured. Running a script with this meta tag scheduled or unattended will cause the script to wait forever for user input. + +=== "Example" + ```lisp + @prompt Enter some arguments + ``` + +--- + +### @timeout + +`@timeout ` + +This meta tag sets a timeout after which the script execution is terminated with a *timeout* error + +Note, that the script may terminate some time after the timeout when a script command takes longer to run. + +=== "Example" + ```lisp + @timeout 10 + ``` + +--- + +### @tuiNoExecute + +`@tuiNoExecute` + +This meta tag disables the `Execute` button for this script in the Text UI's *Tools* section. + +=== "Example" + ```lisp + @tuiNoExecute + ``` + +--- + +### @uppertester + +`@uppertester` + +This meta tag indicates that a script is runnable through the [Upper Tester Interface](../setup/Operation-uppertester.md). In this case the script name specified by the [@name](#name) meta tag is used as the command name. + +Scripts without this meta tag cannot be run through the Upper Tester interface. + +!!! see-also + [@name](#name), [Upper Tester Integration](../development/ACMEScript-uppertester.md), [Upper Tester Interface](../setup/Operation-uppertester.md) + +=== "Example" + ```lisp + @uppertester + ``` + +--- + +### @usage + +`@usage ` + +This meta tag provides a short help message for a script's usage. + +!!! see-also + [@description](#description) + +=== "Example" + ```lisp + @usage exampleScript + ``` + +--- + +## Text UI + +### @category + +`@category ` + +A category name for the script. This is used, for example, in the text UI tools to group scripts. + +!!! see-also + [@name](#name), [@tool](#tool) + +=== "Example" + ```lisp + @categoy System + ``` + +--- + +### @tuiAutoRun + +`@tuiAutoRun [] ` + +This meta tag, when present, configures a script that it is run automatically when it is selected in the *Tools* overview in the text UI. + +Without the optional *interval* argument the script runs only once when it is selected. + +When the *interval* argument is present it must be a positive float number that specifies the interval, in seconds, after which the script is repeatedly run again. + +If this meta tag is present, with or without the *interval* argument, the environment variable `tui.autorun` is set to *true* when the script is run. + +=== "Example" + ```lisp + @tuiAutoRun 10 + ``` + +--- + +### @tuiExecuteButton + +`@tuiExecuteButton []` + +This meta tag configures the script's `Execute` button of the text UI. + +The following configurations are possible: + +- Not present in a script: The button displays the default text "Execute". +- Present in a script with an argument: The argument is used for the button's label. +- Present in a script with no argument: The button is hidden. + +=== "Example" + ```lisp + @tuiExecuteButton A Label + ``` + +--- + +### @tuiInput + +`@tuiInput []` + +This meta tag adds an input field to text UI. Text entered in this field is passed as +arguments to the script that can be access using the [argv](../development/ACMEScript-functions.md#argv) function. + +The following configurations are possible: + +- Not present in a script or without a label: No input field is added. +- Present in a script with an argument: The argument is used for the input field's label. + +=== "Example" + ```lisp + @tuiInput A Label + ``` + +--- + +### @tuiSortOrder + +`@tuiSortOrder ` + +With this meta tag one can specify the sort order of a script in the Text UI's *Tools* section. + +The default sort order is 500. Scripts with a lower priority number are listed first. Scripts with the same priority are sorted alphabetically. + +=== "Example" + ```lisp + @tuiSortOrder 100 + ``` + +--- + +### @tuiTool + +`@tuiTool` + +This meta tag categorizes a script as a tool. Scripts marked as *tuiTools* are listed in the Text UI's *Tools* section. + +=== "Example" + ```lisp + @tuiTool + ``` diff --git a/docs/docs/development/ACMEScript-uppertester.md b/docs/docs/development/ACMEScript-uppertester.md index 630e30a4..e52e3a1b 100644 --- a/docs/docs/development/ACMEScript-uppertester.md +++ b/docs/docs/development/ACMEScript-uppertester.md @@ -1,6 +1,6 @@ # Upper Tester Integration -ACMEScript is integrated with the [Upper Tester (UT) Interface](../setup/Operation.md#upper_tester). To enable this a script must have the [@uppertester](ACMEScript-metatags.md#meta_uppertester) meta tag set. It can then be run through the UT interface by having its [@name](ACMEScript-metatags.md#meta_name) (and optional script arguments) as the parameter of the upper tester's *X-M2M-UTCMD* header field of a http request: +ACMEScript is integrated with the [Upper Tester (UT) Interface](../setup/Operation.md#upper_tester). To enable this a script must have the [@uppertester](ACMEScript-metatags.md#uppertester) meta tag set. It can then be run through the UT interface by having its [@name](ACMEScript-metatags.md#name) (and optional script arguments) as the parameter of the upper tester's *X-M2M-UTCMD* header field of a http request: ```text X-M2M-UTCMD: aScript param1 param2 diff --git a/docs/docs/development/ACMEScript-variables.md b/docs/docs/development/ACMEScript-variables.md index 7a0fe187..53b83a11 100644 --- a/docs/docs/development/ACMEScript-variables.md +++ b/docs/docs/development/ACMEScript-variables.md @@ -18,6 +18,7 @@ Evaluates to the number of elements in [argv](../development/ACMEScript-function (quit-with-error))) ``` +--- ## event.data @@ -37,6 +38,7 @@ Evaluates to the payload data of an event. This could be, for example, the strin (print "Key:" event.data)) ;; Print the pressed key ``` +--- ## event.type @@ -57,6 +59,7 @@ Example: (print "Key:" event.data)) ;; Print the pressed key ``` +--- ## notification.originator @@ -71,6 +74,7 @@ It contains the notification's originator. (print notification.originator) ``` +--- ## notification.resource @@ -85,6 +89,7 @@ It contains the notification's JSON body. (print notification.resource) ``` +--- ## notification.uri @@ -99,15 +104,16 @@ It contains the notification's target URI. (print notification.uri) ``` +--- ## tui.autorun `tui.autorun` -Evaluates to *true* if the script was started as an "autorun" script. This is the case when the [@tuiAutoRun](ACMEScript-metatags.md#meta_tuiAutoRun) meta tag is set in a script. +Evaluates to *true* if the script was started as an "autorun" script. This is the case when the [@tuiAutoRun](ACMEScript-metatags.md#tuiautorun) meta tag is set in a script. !!! see-also "See also" - [tuiAutoRun](ACMEScript-metatags.md#meta_tuiAutoRun) + [tuiAutoRun](ACMEScript-metatags.md#tuiautorun) !!! note This variable is only set when the script is run from the text UI. @@ -119,6 +125,7 @@ Evaluates to *true* if the script was started as an "autorun" script. This is th (print "Autorun: True"))) ;; Print a message ``` +--- ## tui.theme diff --git a/docs/docs/development/ACMEScript.md b/docs/docs/development/ACMEScript.md index d261b41d..0e9d248e 100644 --- a/docs/docs/development/ACMEScript.md +++ b/docs/docs/development/ACMEScript.md @@ -112,7 +112,7 @@ Data can be stored "persistently" during a CSE's runtime. This is intended to pa To store data persistently one may consider to store it in the oneM2M resource tree. -See: [get-storage](ACMEScript-functions.md##get-storage), [has-storage](ACMEScript-functions.md##has-storage), [set-storage](ACMEScript-functions.md#set-storage) +See: [get-storage](ACMEScript-functions.md#get-storage), [has-storage](ACMEScript-functions.md#has-storage), [set-storage](ACMEScript-functions.md#set-storage) ### Evaluating S-Expressions in Strings and JSON Structures diff --git a/docs/docs/help/FAQ.md b/docs/docs/help/FAQ.md index 9d9198fa..a7083e77 100644 --- a/docs/docs/help/FAQ.md +++ b/docs/docs/help/FAQ.md @@ -4,7 +4,7 @@ 1. **Can I install the ACME CSE on a Raspberry Pi?** Yes, the ACME CSE can be installed and run on a Raspberry Pi. However, this usually requires to install a newer version of Python than the one that is installed by default on the Raspberry Pi, and to install some additional libraries, tools, and packages. - See the HowTo [Install ACME on a Raspberry Pi](../setup/RaspberryPi.md){target=_new} for further details. + See the HowTo [Install ACME on a Raspberry Pi](../howtos/RaspberryPi.md){target=_new} for further details. ## Network 1. **How can I access the CSE from remote/another computer on my network?** diff --git a/docs/docs/home/Supported.md b/docs/docs/home/Supported.md index 13969ffe..acb9518f 100644 --- a/docs/docs/home/Supported.md +++ b/docs/docs/home/Supported.md @@ -186,7 +186,7 @@ The ACME CSE runs at least on the following runtime environments: | Runtime Environment | Supported | Remark | |:--------------------|:---------:|:--------------------------------------------------------------------------------------| -| Generic Linux | ✓ | Including [Raspberry Pi OS (32bit)](../setup/RaspberryPi.md) on Raspberry Pi 3 and 4. | +| Generic Linux | ✓ | Including [Raspberry Pi OS (32bit)](../howtos/RaspberryPi.md) on Raspberry Pi 3 and 4. | | Mac OS | ✓ | Intel and Apple silicon. | | MS Windows | ✓ | | | Jupyter Notebooks | ✓ | ACME CSE can be run headless inside a Jupyter Notebook. | diff --git a/docs/docs/setup/Docker.md b/docs/docs/howtos/Docker.md similarity index 100% rename from docs/docs/setup/Docker.md rename to docs/docs/howtos/Docker.md diff --git a/docs/docs/setup/RaspberryPi.md b/docs/docs/howtos/RaspberryPi.md similarity index 100% rename from docs/docs/setup/RaspberryPi.md rename to docs/docs/howtos/RaspberryPi.md diff --git a/docs/docs/index.md b/docs/docs/index.md index 41ece74b..ee2bed05 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -48,6 +48,7 @@ hide: The intention is to provide an easy to install and use, extensible, and maintainable oneM2M CSE. + TODO reference? [:octicons-arrow-right-24: Reference](#) - :material-scale-balance:{ .lg .middle } **Open Source | BSD 3-Clause** diff --git a/docs/docs/neu/ACMEScript-metatags.md b/docs/docs/neu/ACMEScript-metatags.md deleted file mode 100644 index f947af8d..00000000 --- a/docs/docs/neu/ACMEScript-metatags.md +++ /dev/null @@ -1,526 +0,0 @@ -[← README](../README.md) -[← ACMEScript](ACMEScript.md) - -# ACMEScript - Meta Tags - -Meta tags are special commands in a script that are not executed during the runtime of a script, but describe certain capabilities of the script or give, for example, the script a name or provide instructions when a script should be executed. - -Meta tags are keyword that start with an at-sign "@". They can appear anywhere in a script file on a single line, but it is recommend to collect them either at the start or the end of a script. - -> **Important** -> Meta tag names are case sensitive. - - - -| Type | Meta Tag | Description | -|---------------------|---------------------------------------------|------------------------------------------------------------------------------------------------| -| [Basic](#_basic) | [@at](#meta_at) | Schedule scripts to run at a certain time or time interval | -| | [@description](#meta_description) | Provide a one-line script description | -| | [@filename](#meta_filename) | Contains the script's filename (internal only) | -| | [@hidden](#meta_hidden) | Hide a script from the console's script catalog | -| | [@init](#init) | Run a script to initialize the CSE during startup and restart | -| | [@name](#meta_name) | Assign a name to a script | -| | [@onKey](#meta_onkey) | Run a script when the specified key is pressed | -| | [@onNotification](#meta_onnotification) | Run a script as a receiver of a NOTIFY request from the CSE | -| | [@onRestart](#meta_onrestart) | Run a script just after the CSE restarted | -| | [@onShutdown](#meta_onshutdown) | Run a script just before the CSE shuts down | -| | [@onStartup](#meta_onstartup) | Run a script just after the CSE started | -| | [@prompt](#meta_prompt) | Prompt the user for input before the script is run | -| | [@timeout](#meta_timeout) | Set a timeout after which script execution is stopped | -| | [@uppertester](#meta_uppertester) | A script with this test can be run via the [Upper Tester Interface](Operation.md#upper_tester) | -| [Text UI](#_textui) | [@category](#meta_category) | Add a category to the script for the text UI's *Tools* section | -| | [@tuiAutoRun](#meta_tuiAutoRun) | Automatically run scripts when selecting them, and optionally repeat | -| | [@tuiExecuteButton](#meta_tuiExecuteButton) | Configure the script's `Execute` button in the text UI | -| | [@tuiInput](#meta_tuiInput) | Add an input field for script arguments in the text UI | -| | [@tuiSortOrder](#meta_tuiSortOrder) | Specify the sort order for scripts in a category in the text UI's *Tools* section | -| | [@tuiTool](#meta_tuiTool) | Tag a script for listing in the text UI's *Tools* section | - -## Accessing Meta Tags -Meta tags are added as constants to the script's environment, prefixed with "meta.". -They can be accessed like any other environment variable, for example: - -```lisp -(if (is-defined 'meta.name) ;; note the quote in front of meta.name - (print "Script name:" meta.name)) ;; prints the script's name -``` - ---- - - - -## Basic - - - -### @at - -`@at ` - -The `@at` meta tag specifies a time / date pattern when a script should be executed. This pattern follows the Unix [crontab](https://crontab.guru/crontab.5.html){target=_new} pattern. - -A crontab pattern consists of the following six fields: - -`second minute hour dayOfMonth month dayOfWeek year` - -Each field is mandatory and must comply to the following values: - -- `*` : any valid integer number for that field, or -- `*/` : step, or -- `- - -### @description - -`@description ` - -A short one-line description of a script's purpose. This is used, for example, for the console's script catalog. - -A description must be a single line, but may include line breaks (in the form of \n characters). A description may also be formatted as markdown. This is then correctly displayed in the Text UI. - -See also: [@usage](#meta_usage) - -Example: -```lisp -@description The purpose of this script is to demonstrate the @description meta tag - -@description # Markdown header\n\nFormatted **Markdown** text. -``` - -[top](#top) - ---- - - - -### @filename - -`@filename ` - -This meta tag is for internal use. It will be assigned the script's full filename when read by the script manager. - -[top](#top) - ---- - - - -### @hidden - -`@hidden` - -This meta tag indicates that a script will not be listed in the console's script catalog. - -Example: -```lisp -@hidden -``` - -[top](#top) - ---- - - - -### @init - -`@init` - -This meta tag indicates that the script will be executed during the CSE's startup and restart. It is used to initialize the CSE and creates the basic resources. - -Only one script can have this meta tag set. - -See also: [@onRestart](#meta_onrestart), [@onShutdown](#meta_onshutdown), [@startup](#meta_onstartup) - -Example: - -```text -@init -``` - -[top](#top) - ---- - - - -### @name - -`@name ` - -This meta tag assigns a name to a script. This name is used for identifying the script, for example when running a script from the console. - -See also: [@uppertester](#meta_uppertester) - -Example: -```lisp -@name exampleScript -``` - -[top](#top) - ---- - - - -### @onKey - -`@onKey ` - -With this meta tag a script registers to a key-press event of the console interface. If the key is pressed then the script is run. The event and the key are passed as the environment variables [event.type]() and [event.data](), respectively. - -The keys may be normal ASCII characters or a function key. Please consult the console's [supported function key table](Console.md#function_keys) for the function key's names. Note, that not all function keys are available on all OS platforms. - -A script can only register for a single key event. - -Example: -```lisp -;; Run the script when the '9' key is pressed -@onkey F9 - -(print (event.data)) -``` - -[top](#top) - ---- - - - -### @onNotification - -`@onNotification ` - -With this meta tag a script acts as a handler for a notification request from the CSE. - -The ACME URL scheme "acme://<identifier>" is used to define a URI that is targeting the script. Such a URI must be used in either the *notificationURI* attribute of a subscription resource, or the *pointOfAccess* of an AE. - -When a notification is received and the handler script is run the following variables are set: - - -- [notification.originator](ACMEScript-functions.md#var_notification_originator) : The notification's originator -- [notification.resource](ACMEScript-functions.md#var_notification_resource) : The notification's resource -- [notification.uri](ACMEScript-functions.md#var_notification_uri) : The notification's target URI - - -Example: -```lisp -;; Run the script when the 'acme://aNotification' notificastion is received -@onNotification acme://aNotification - -(print (notification.resource)) -``` - -[top](#top) - ---- - - - -### @onRestart - -`@onRestart` - -This meta tag indicates that the script will be executed just after the CSE restarted, for example after a reset. - -If multiple scripts have this meta tag set then they will run in random order. - -See also: [@init](#meta_init), [@onStartup](#meta_onstartup), [@onShutdown](#meta_onshutdown) - -Example: -```lisp -@onRestart -``` - -[top](#top) - ---- - - - -### @onShutdown - -`@onShutdown` - -This meta tag indicates that the script will be executed just before the CSE shuts down. - -If more than one script have this meta tag set then they will run in random order. - -See also: [@init](#meta_init), [@onRestart](#meta_onrestart), [@onStartup](#meta_onstartup) - -Example: -```lisp -@onShutdown -``` - -[top](#top) - ---- - - - -### @onStartup - -`@onStartup` - -This meta tag indicates that the script will be executed just after the CSE started. It will be run only after start up, but not when the CSE restarted. If more than one script have this meta tag set then they will be run in random order. - -See also: [@init](#meta_init), [@onRestart](#meta_onrestart), [@onShutdown](#meta_onshutdown) - -Example: -```text -@onStartup -``` - -[top](#top) - ---- - - - -### @prompt - -`@prompt ` - -A script with this meta tag will present a prompt before it is executed and ask a user for input. The result is then passed on as [script arguments](ACMEScript.md#arguments). - -This meta tag should only be used when human interaction can be ensured. Running a script with this meta tag scheduled or unattended will cause the script to wait forever for user input. - -Example: -```lisp -@prompt Enter some arguments -``` - -[top](#top) - ---- - - - -### @timeout - -`@timeout ` - -This meta tag sets a timeout after which the script execution is terminated with a *timeout* error - -Note, that the script may terminate some time after the timeout when a script command takes longer to run. - -Example: -```lisp -@timeout 10 -``` - -[top](#top) - ---- - - - -### @tuiNoExecute - -`@tuiNoExecute` - -This meta tag disables the `Execute` button for this script in the Text UI's *Tools* section. - -Example: - -```lisp -@tuiNoExecute -``` - -[top](#top) - ---- - - - -### @uppertester - -`@uppertester` - -This meta tag indicates that a script is runnable through the [Upper Tester Interface](Operation.md#upper_tester) interface. In this case the script name specified by the [@name](#meta_name) meta tag is used as the command name. - -Scripts without this meta tag cannot be run through the Upper Tester interface. - -See also: [@name](#meta_name) - -Example: -```lisp -@uppertester -``` - -[top](#top) - ---- - - - -### @usage - -`@usage ` - -This meta tag provides a short help message for a script's usage. - -See also: [@description](#meta_description) - -Example: -```lisp -@usage exampleScript -``` - -[top](#top) - ---- - - - -## Text UI - - - -### @category - -`@category ` - -A category name for the script. This is used, for example, in the text UI tools to group scripts. - -See also: [@name](#meta_name), [@tool](#meta_tool) - -Example: - -```lisp -@categoy System -``` - -[top](#top) - - ---- - - - -### @tuiAutoRun - -`@tuiAutoRun [] ` - -This meta tag, when present, configures a script that it is run automatically when it is selected in the *Tools* overview in the text UI. - -Without the optional *interval* argument the script runs only once when it is selected. - -When the *interval* argument is present it must be a positive float number that specifies the interval, in seconds, after which the script is repeatedly run again. - -If this meta tag is present, with or without the *interval* argument, the environment variable `tui.autorun` is set to *true* when the script is run. - -Example: - -```lisp -@tuiAutoRun 10 -``` - -[top](#top) - ---- - - - -### @tuiExecuteButton - -`@tuiExecuteButton []` - -This meta tag configures the script's `Execute` button of the text UI. - -The following configurations are possible: - -- Not present in a script: The button displays the default text "Execute". -- Present in a script with an argument: The argument is used for the button's label. -- Present in a script with no argument: The button is hidden. - -Example: - -```lisp -@tuiExecuteButton A Label -``` - -[top](#top) - ---- - - - -### @tuiInput - -`@tuiInput []` - -This meta tag adds an input field to text UI. Text entered in this field is passed as -arguments to the script that can be access using the [argv](ACMEScript-functions.md#argv) function. - -The following configurations are possible: - -- Not present in a script or without a label: No input field is added. -- Present in a script with an argument: The argument is used for the input field's label. - -Example: - -```lisp -@tuiInput A Label -``` - -[top](#top) - ---- - - - -### @tuiSortOrder - -`@tuiSortOrder ` - -With this meta tag one can specify the sort order of a script in the Text UI's *Tools* section. - -The default sort order is 500. Scripts with a lower priority number are listed first. -Scripts with the same priority are sorted alphabetically. - -Example: - -```lisp -@tuiSortOrder 100 -``` - -[top](#top) - ---- - - - -### @tuiTool - -`@tuiTool` - -This meta tag categorizes a script as a tool. Scripts marked as *tuiTools* are listed in the Text UI's *Tools* -section. - -Example: - -```lisp -@tuiTool -``` - -[top](#top) - ---- - -[← ACMEScript](ACMEScript.md) -[← README](../README.md) diff --git a/docs/docs/neu/Importing.md b/docs/docs/neu/Importing.md index ff3bd006..531f08c7 100644 --- a/docs/docs/neu/Importing.md +++ b/docs/docs/neu/Importing.md @@ -11,11 +11,11 @@ ## Initial Resources -During CSE startup and restart it is necessary to import a first set of resources to the CSE. This is done automatically by the CSE by running a script that has the [@init](ACMEScript-metatags.md#meta_init) meta tag set. By default this is the [init.as](../init/init.as) script from the [init](../init) directory. +During CSE startup and restart it is necessary to import a first set of resources to the CSE. This is done automatically by the CSE by running a script that has the [@init](ACMEScript-metatags.md#init) meta tag set. By default this is the [init.as](../init/init.as) script from the [init](../init) directory. Not much validation, access control, or registration procedures are performed when importing resources this way. -See also [@init meta tag](ACMEScript-metatags.md#meta_init) +See also [@init meta tag](ACMEScript-metatags.md#init) **Mandatory Resources to the CSE** @@ -23,7 +23,7 @@ Please note that importing is required for creating the CSEBase, the administrat **Other Resources** -Another option to import more resources automatically whenever the CSE starts or restarts is to have a script as an event handler for the *[onStartup](ACMEScript-metatags.md#meta_onstartup)* and *[onRestart](ACMEScript-metatags.md#meta_onrestart)* events. +Another option to import more resources automatically whenever the CSE starts or restarts is to have a script as an event handler for the *[onStartup](ACMEScript-metatags.md#onstartup)* and *[onRestart](ACMEScript-metatags.md#onrestart)* events. TODO move to scripts diff --git a/docs/docs/setup/Configuration-basic.md b/docs/docs/setup/Configuration-basic.md index a13336b3..87a5b6b0 100644 --- a/docs/docs/setup/Configuration-basic.md +++ b/docs/docs/setup/Configuration-basic.md @@ -1,7 +1,7 @@ # Configuration - Basic Settings The CSE is configured using the configuration file `acme.ini`. This file contains all necessary settings for the CSE to run. -These settings are used throughout the configuration settings using [interpolation](Configuration-introduction.md#interpolation-of-configuration-settings). +These settings are used throughout the configuration settings using [interpolation](Configuration-introduction.md#settings-interpolation). When creating the configuration file, it is recommended to use the [interactive procedure](../setup/Installation.md#guided-configuration) to generate a file with basic configuration settings. [^1] diff --git a/docs/docs/setup/Configuration-cse.md b/docs/docs/setup/Configuration-cse.md index 778f2947..aed2571b 100644 --- a/docs/docs/setup/Configuration-cse.md +++ b/docs/docs/setup/Configuration-cse.md @@ -25,7 +25,7 @@ These settings are used to configure basic settings and the general behavior of | requestExpirationDelta | Expiration time for requests sent by the CSE in seconds. | 10.0 seconds | cse.requestExpirationDelta | | resourceID | The \ resource's resource ID. This should be the same value as *cseID* without the leading "/". | id-in | cse.resourceID | | resourceName | The CSE's resource name or CSE-Name. | cse-in | cse.resourceName | -| resourcesPath | Directory of the CSE's *init* directory that hosts resources, policies, and other settings to import.
See also command line argument [–-init-directory](../setup/Running.md#command-line-arguments). | [${basic.config:initDirectory}](../setup/Configuration-introduction.md#interpolation-of-configuration-settings) | cse.resourcesPath | +| resourcesPath | Directory of the CSE's *init* directory that hosts resources, policies, and other settings to import.
See also command line argument [–-init-directory](../setup/Running.md#command-line-arguments). | [${basic.config:initDirectory}](../setup/Configuration-introduction.md#settings-interpolation) | cse.resourcesPath | | sendToFromInResponses | Indicate whether the optional "to" and "from" parameters shall be sent in responses. | true | cse.sendToFromInResponses | | serviceProviderID | The CSE's service provider ID. | acme.example.com | cse.serviceProviderID | | sortDiscoveredResources | Enable alphabetical sorting of discovery results. | true | cse.sortDiscoveredResources | diff --git a/docs/docs/setup/Console.md b/docs/docs/setup/Console.md index 327ff01b..209b9661 100644 --- a/docs/docs/setup/Console.md +++ b/docs/docs/setup/Console.md @@ -42,7 +42,7 @@ The CSE's resource tree can be shown by pressing the `t` key:
ACME CSE's resource tree in the console
-In addition to the build-in commands, the console shows the [Script commands](ACMEScript.md) with a configured [key binding](ACMEScript-metatags.md#meta_onkey). +In addition to the build-in commands, the console shows the [Script commands](ACMEScript.md) with a configured [key binding](ACMEScript-metatags.md#onkey). ## Exporting Resources diff --git a/docs/docs/setup/Running.md b/docs/docs/setup/Running.md index a10a156e..07b5504a 100644 --- a/docs/docs/setup/Running.md +++ b/docs/docs/setup/Running.md @@ -54,29 +54,27 @@ A base directory may also host a secondary *init* directory that is used for imp The ACME CSE provides a number of command line arguments that will override the respective settings from the configuration file. They can be used to change certain CSE behaviours without changing the configuration file. -TODO correct links - -| Command Line Argument | Description | -|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| -| -h, --help | Show a help message and exit. | -| --config <filename> | Specify a configuration file that is used instead of the default (*acme.ini*) one. | -| --base-directory <directory>,
-dir <directory> | Specify the root directory for runtime data such as data, logs, and temporary files. | -| --db-directory <directory> | Specify the directory where the CSE's data base files are stored. | -| --db-reset | Reset and clear the database when starting the CSE. | -| --db-type {memory, tinydb, postgresql} | Specify the DB's storage type.
This overrides the [database.type](../setup/Configuration-database.md) configuration setting. | -| --headless | Operate the CSE in headless mode. This disables almost all screen output and also the build-in console interface. | -| --http, --https | Run the CSE with http or https server.
This overrides the [useTLS](../setup/Configuration-http.md#security) configuration setting. | -| --http-wsgi | Run CSE with http WSGI support.
This overrides the [http.wsgi.enable](../setup/Configuration-http.md#wsgi) configuration setting. | -| --http-address <server URL> | Specify the CSE's http server URL.
This overrides the [address](../setup/Configuration-http.md#general-settings) configuration setting. | -| --http-port <http port> | Specify the CSE's http server port.
This overrides the [address](../setup/Configuration-http.md#general-settings) configuration setting. | -| --init-directory <directory> | Specify the import directory.
This overrides the [resourcesPath](../setup/Configuration-basic.md) configuration setting. | -| --network-interface <ip address | Specify the network interface/IP address to bind to.
This overrides the [listenIF](../setup/Configuration-http.md#general-settings) configuration setting. | -| --log-level {info, error, warn, debug, off} | Set the log level, or turn logging off.
This overrides the [level](Configuration.md#logging) configuration setting. | -| --mqtt, --no-mqtt | Enable or disable the MQTT binding.
This overrides the [mqtt.enable](Configuration.md#client_mqtt) configuration setting. | -| --remote-cse, --no-remote-cse | Enable or disable remote CSE connections and checking.
This overrides the [enableRemoteCSE](Configuration.md#general) configuration setting. | -| --statistics, --no-statistics | Enable or disable collecting CSE statistics.
This overrides the [enable](Configuration.md#statistics) configuration setting. | -| --textui | Run the CSE's text UI after startup. | -| --ws, --no-ws | Enable or disable the WebSocket binding.
This overrides the [websocket.enable](Configuration.md#websocket) configuration setting. | +| Command Line Argument | Description | +|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| -h, --help | Show a help message and exit. | +| --config <filename> | Specify a configuration file that is used instead of the default (*acme.ini*) one. | +| --base-directory <directory>,
-dir <directory> | Specify the root directory for runtime data such as data, logs, and temporary files. | +| --db-directory <directory> | Specify the directory where the CSE's data base files are stored. | +| --db-reset | Reset and clear the database when starting the CSE. | +| --db-type {memory, tinydb, postgresql} | Specify the DB's storage type.
This overrides the [database.type](../setup/Configuration-database.md#general-settings) configuration setting. | +| --headless | Operate the CSE in headless mode. This disables almost all screen output and also the build-in console interface. | +| --http, --https | Run the CSE with http or https server.
This overrides the [useTLS](../setup/Configuration-http.md#security) configuration setting. | +| --http-wsgi | Run CSE with http WSGI support.
This overrides the [http.wsgi.enable](../setup/Configuration-http.md#wsgi) configuration setting. | +| --http-address <server URL> | Specify the CSE's http server URL.
This overrides the [address](../setup/Configuration-http.md#general-settings) configuration setting. | +| --http-port <http port> | Specify the CSE's http server port.
This overrides the [address](../setup/Configuration-http.md#general-settings) configuration setting. | +| --init-directory <directory> | Specify the import directory.
This overrides the [resourcesPath](../setup/Configuration-cse.md#general-settings) configuration setting. | +| --network-interface <ip address | Specify the network interface/IP address to bind to.
This overrides the [listenIF](../setup/Configuration-http.md#general-settings) configuration setting. | +| --log-level {info, error, warn, debug, off} | Set the log level, or turn logging off.
This overrides the [level](../setup/Configuration-logging.md#configuration---logging) configuration setting. | +| --mqtt, --no-mqtt | Enable or disable the MQTT binding.
This overrides the [mqtt.enable](../setup/Configuration-mqtt.md#general-settings) configuration setting. | +| --remote-cse, --no-remote-cse | Enable or disable remote CSE connections and checking.
This overrides the [enableRemoteCSE](../setup/Configuration-cse.md#general-settings) configuration setting. | +| --statistics, --no-statistics | Enable or disable collecting CSE statistics.
This overrides the [enable](../setup/Configuration-cse.md#statistics) configuration setting. | +| --textui | Run the CSE's text UI after startup. | +| --ws, --no-ws | Enable or disable the WebSocket binding.
This overrides the [websocket.enable](../setup//Configuration-ws.md#general-settings) configuration setting. | TODO: To Development diff --git a/docs/docs/setup/TextUI.md b/docs/docs/setup/TextUI.md index bdd90d41..18def9a2 100644 --- a/docs/docs/setup/TextUI.md +++ b/docs/docs/setup/TextUI.md @@ -37,7 +37,7 @@ The different sections of the text UI are described below. They can be selected **Tools** : This tab contains some tools that can be used to perform operations on the CSE, or run applications as scrips. -: See the [ACMEScript meta-tags](ACMEScript-metatags.md#meta_tuiTool) for more information. +: See the [ACMEScript meta-tags](ACMEScript-metatags.md#tuiTool) for more information. **Infos** : This tab shows the current number of resources, requests, and other statistics and useful information. diff --git a/docs/docs/setup/WebUI.md b/docs/docs/setup/WebUI.md index 38e1b53b..6e21715f 100644 --- a/docs/docs/setup/WebUI.md +++ b/docs/docs/setup/WebUI.md @@ -23,7 +23,7 @@ The web UI also provides a REST UI where you can send REST requests directed at The web UI can also be run as an independent application. Since it communicates with the CSE via the Mca interfave it should be possible to use it with other CSE implementations as well as long as those third party CSEs follow the oneM2M http binding specification. It only supports the resource types that the ACME CSE supports, but at least it will present all other resource types as *unknown*. -You can start the stand-alone web UI in a terminal like this (in the sub-directory [acme/webui](../acme/webui): +You can start the stand-alone web UI in a terminal like this (in the sub-directory [acme/webui](https://github.com/ankraft/ACME-oneM2M-CSE/tree/master/acme/webui): ```bash python3 webUI.py diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 621eca13..e8f5f1c3 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -151,9 +151,6 @@ nav: - 'Console UI': 'setup/Console.md' - 'Text UI': 'setup/TextUI.md' - 'Web UI': 'setup/WebUI.md' - - 'Additional Platforms': - - 'Docker': 'setup/Docker.md' - - 'Raspberry Pi': 'setup/RaspberryPi.md' - 'Development': - 'Overview': 'development/Overview.md' - 'Unit Tests': 'development/UnitTests.md' @@ -163,10 +160,12 @@ nav: - 'Operations': 'development/ACMEScript-operations.md' - 'Functions': 'development/ACMEScript-functions.md' - 'Variables': 'development/ACMEScript-variables.md' + - 'Meta Tags': 'development/ACMEScript-metatags.md' - 'Upper Tester Integration': 'development/ACMEScript-uppertester.md' - 'HowTos': + - 'Docker': 'howtos/Docker.md' - 'Pyenv Setup': 'howtos/HowTo-pyenv.md' - - 'Raspberry Pi': 'setup/RaspberryPi.md' + - 'Raspberry Pi': 'howtos/RaspberryPi.md' - 'Help': - 'FAQ': 'help/FAQ.md' - 'Contributing': 'help/Contributing.md'