Apps-related functions
getAppPropertiesByFullName
public static webappos.getAppPropertiesByFullName(
appFullName
)

Returns some properties of the given app.

Parameter
appFullName

full app name

Returns

a JSON object

{
fullName: "<name-of-webAppOS-app.webapp>",
displayedName:: "<name-of-webAppOS-web-app>",
urlName: "<name-of-app-without-blanks-lower-case>",
iconURL: "<icon-path>",
projectExtension: "app-project-extension",
singleton: true|false
}

or {}, if no app corresponds to the given full app name;

getAppPropertiesByUrlName
public static webappos.getAppPropertiesByUrlName(
appUrlName
)

Returns some properties of the given app.

Parameter
appUrlName

app URL name

Returns

a JSON object

{
fullName: "<name-of-webAppOS-app.webapp>",
displayedName:: "<name-of-webAppOS-web-app>",
urlName: "<name-of-app-without-blanks-lower-case>",
iconURL: "<icon-path>",
projectExtension: "app-project-extension",
singleton: true|false
}

or {}, if no app corresponds to the given URL name;

getAssociatedAppsByExtension
static webappos.getAssociatedAppsByExtension(
extension
)

Finds installed webAppOS apps (availabe for the current login) that are able to handle projects or files with the given file extension.

Parameter
extension

project file extension (with or without a dot)

Returns

a JSON array of objects

{
fullName: "<name-of-webAppOS-app.webapp>",
displayedName:: "<name-of-webAppOS-web-app>",
urlName: "<name-of-app-without-blanks-lower-case>",
iconURL: "<icon-path>",
projectExtension: "app-project-extension"
}
getAvailableApps
static webappos.getAvailableApps

Finds installed webAppOS apps that are available for the current login.

Returns

a JSON array of objects

{
fullName: "<name-of-webAppOS-app.webapp>",
displayedName:: "<name-of-webAppOS-web-app>",
urlName: "<name-of-app-without-blanks-lower-case>",
iconURL: "<icon-path>"
}
appRequiresTemplate
public static webappos.appRequiresTemplate(
appFullName
)

Returns wheter the given app requires initial template to create a new project.  If not, then a new project can be bootstrapped via the initial transformation specified for this app.

Parameter
appFullName

the full name of the application

Returns
{
result: true|false //true (if a template is required) or false (if the initial transformation can be used)
}

or

{
error: "<message>"
}
getAppTemplates
public static webappos.getAppTemplates(
appFullName
)

Returns all app templates that can be used to create a new project for the given app.

Parameter
appFullName

the full name of the application

Returns

a JSON array of template names (strings); [], if no app templates found;

getPublishedTemplates
public static webappos.getPublishedTemplates(
appFullName
)

Returns all published templates that can be used to create a new project for the given app.

Parameter
appFullName

the full name of the application

Returns

a JSON array of template names (strings); [], if no app templates found;

getUserTemplates
static webappos.getUserTemplates(
appFullName
)

Returns local user templates (from the user's home folder) that can be used to create a new project for the given app.

Parameter
appFullName

the full name of the application

Returns

a JSON array of template names (strings); [], if no user templates found;

initializeProject
webappos.initializeProject()

Launches the main web call of the current app.

Returns

{}

File system-related functions
getFileContentAsUTF8String
static webappos.getFileContentAsUTF8String(
fileName
)

Reads the given file from the user's home directory.

Parameter
fileName

the file name relative to the global webAppOS /home directory (user login must be the first path element)

Returns

a JSON object

{
content: "<file-content-as-string>"
}

or

{
error: "<message>"
}
fileExists
static webappos.fileExists(
fileName
)

Checks whether the given path exists in the user's home directory.

Parameter
fileName

the file name relative to the global webAppOS /home directory (user login must be the first path element)

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
fileExistsInCurrentProject
static webappos.fileExistsInCurrentProject(
fileName
)

Checks whether the given path exists in the cache folder of the current webAppOS project.

Parameter
fileName

the file name relative to the project cache folder

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
isDirectory
static webappos.isDirectory(
fileName
)

Checks whether the given path exists and is a directory.

Parameter
fileName

the file/directory name relative to the global webAppOS /home directory (user login must be the first path element)

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
isDirectoryInCurrentProject
static webappos.isDirectoryInCurrentProject(
fileName
)

Checks whether the given path exists and is a directory in the cache folder of the current webAppOS project.

Parameter
fileName

the file/directory name relative to the project cache folder

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
getFileContentFromCurrentProjectAsUTF8String
webappos.getFileContentFromCurrentProjectAsUTF8String(
fileName
)

Reads the given file from the cache folder of the current webAppOS project.

Parameter
fileName

the file name relative to the project cache folder

Returns

a JSON object

{
content: "<file-content-as-string>"
}

or

{
error: "<message>"
}
deleteFile
static webappos.deleteFile(
fileName
)

deletes the the given file from the user's home directory

Parameter
fileName

the file name relative to the global webAppOS /home directory (user login must be the first path element)

Returns
{
result: true|false
}

or

{
error: "<message>"
}
deleteFileFromCurrentProject
webappos.deleteFileFromCurrentProject(
fileName
)

deletes the the given file from the cache folder of the current webAppOS project

Parameter
fileName

the file name relative to the project cache folder

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
uploadFile
static webappos.uploadFile(
JSON
)

creates (uploads) the file with the given content in the user's home directory

Parameter

a JSON object

{
fileName: "<file-name-relative-to-the-/home-folder>", // (user login must be the first path element)
content: "<file-content-as-string>"
}
Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
uploadFileToCurrentProject
webappos.uploadFileToCurrentProject(
JSON
)

creates (uploads) the file with the given content within the cache folder of the current webAppOS project

Parameter

a JSON object

{
fileName: "<file-name-relative-to-the-project-cache-folder>",
content: "<file-content-as-string>"
}
Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
renameActiveProject
webappos.renameActiveProject(
JSON
)
Parameter

a JSON object

{
project_id: "old/path/relative/to/global/home",
new_project_id: "new/path/relative/to/global/home"
}
Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
getSupportedFileSystems
static inline jsoncall webappos.getSupportedFileSystems()
Parameter

none required

Returns

a JSON object

{
result: [array of driver names]
}

or

{
error: "<message>"
}
Registry-related functions
getUserRegistryValue
static jsoncall webappos.getUserRegistryValue(
key
)

Gets the value of the given registry key in the "users" area of the registry.

Parameter

a string represeting a path to key, e.g., "path/to/key"

Returns

a JSON object

{
result: <value-as-primitive-or-JSON>
}

or

{
error: "<message>"
}
setUserRegistryValue
static jsoncall webappos.setUserRegistryValue(
JSON
)

Sets the value of the given registry key in the "users" area of the registry.

Parameter

a JSON object

{
key: "path/to/key",
value: <value-as-primitive-or-JSON>
}
Returns

a JSON object

{
result: true|false
}

or

{
result: "false",
error: "<message>"
}
Web calls-related functions
getAvailableWebCalls
static webappos.getAvailableWebCalls()

Returns the currently available web calls.  If called statically, only static web calls are returned, otherwise, static + app-specific web calls are returned.

Returns

a JSON object

{
<action<i>-name>: {
resolvedInstructionSet: "<instruction-set-name>",
resolvedLocation: "<specific-location>",
isPublic: true|false,
isStatic: true|false,
isInline: true|false,
isSingle: true|false,
isClient: true|false,
callingConventions: "webmemcall" or "jsoncall"
},
...
}

or

{
error: "<message>"
}
Users-related functions
userInGroup
static webappos.userInGroup(
groupName
)

Checks whether the current user belongs to the given group.

Parameter
groupName

the name of the group to check

Returns

a JSON object

{
result: true|false
}

or

{
error: "<message>"
}
Miscellaneous functions
echo
public static echo(
json
)

Returns the same JSON as passed.

Parameter
json

a stringified JSON

Returns

a JSON object that is equal to the JSON object received (formatting may differ, though)

or

{
error: "<message>"
}