Files with the .webcalls extensions contain webAppOS web calls declarations in Java properties format containing name/value pairs, e.g.,
name=value
name\ with\ spaces=value with spaces
#comment
Each web call declaration must be in the form:
[modifiers] [action-name]=[web-call-adapter]:[adapter-specific-location]
[modifiers] is a space-separated sequence of modifiers listed below (Java Properties format require to add backslash before each space prior the ``='');
[action-name] is a user-friendly name of the action performed by this web call; optional brackets with a list of parameters can be appended to the action name. The information within brackets will be ignored, but it may be useful for developers. Please, use fully qualified actions names, similar to Java conventions. If you owe the module M, you can use the "M." prefix to name your web calls actions, e.g., M.actionName.
[web-call-adapter-name] is the name of the web call adapter that has to be used to invoke the call;
[adapter-specific-location] is an adapter-specific string representing the code location
Comments in the Natural Docs syntax can be used to generate documentation.
##
# Function: getAppPropertiesByFullName
# Returns some properties of the given app.
#
# Parameter:
# appFullName - full app name
#
# Returns:
# a JSON object... or {}, if no app corresponds to the given full app name;
public\ static\ webappos.getAppPropertiesByFullName(appFullName)=staticjava:org.webappos.webcalls.AppsActions_webcalls#getAppPropertiesByFullName
There are only 2 possible modifiers to specify the calling conventions:
jsoncall | (default) a string or a JSON is passed as an argument, a JSON is always returned; |
webmemcall | a web memory object (or its reference) is passed as an argument, nothing is returned. |
When the calling convention modifier is not specified, jsoncall is assumed.
Additional optional modifiers are:
static | denotes a web call that requires an authenticated user session, but do not require an MRAM slot; |
public | (must include also static) denotes a web call that neither requires an authenticated user, nor an MRAM slot; |
inline | denotes a web call that should be executed by the bridge directly, without passing it to web processors and then to a web call adapter; |
single | denotes a client-side web call, which, being invoked at the server side, will be synchronized only with the user, who originated the parent web call; other users connected to the same MRAM slot will not receive the call. |
If no additional optional modifiers specified, the web call will be non-static (requiring an MRAM slot), private (requiring an authenticated user), non-inline (will be passed to a web processor) and non-single (will be synchronized with all users connected to the same MRAM slot).
Some implications:
webmemcall | implies non-public and non-static web call |
single | implies webmemcall calling conventions (and the web call has to be implemented at the client side) |
.webcalls files are searched by webAppOS in the following directories:
/etc/webcalls
/apps/[app-name.webapp]
/apps/[service-name.webservice]
/apps/[library-name.weblibrary]
If the file name ends with "auto.webcalls" then all web calls from this file will be executed automatically on opening each project. Such web calls are useful for migrating old projects to a newer app version. Automatic web calls must conform to the "webmemcall" calling convention. A zero argument (no argument) will be passed, when invoking them.