Javascript WasdiLib
Methods
loadConfig
- loadConfig(configFile, parametersFile)
Loads configuration and parameters. If no filename is specified, the method attempts to load config.json and parameters.json files from the root level URL of the developed application. The config file can be also hosted on an external URL.
- Arguments:
configFile – a JSON containing all the required information to login to WASDI, please check repository for a complete example
parametersFile – a JSON containing the parameters that can be used during the launch of the application
loadParameters
- loadParameters(filename)
Loads a json containing the parameters which are then imported in a dedicated field. If filename is not specified the methods search for “parameters.json”, as default
- Arguments:
filename – the file name of the JSON containing the parameters
login
- login(sUserName, sPassword)
Api call for the login to WASDI services. Valid credential must be available.
- Arguments:
sUserName – The username, corresponding to the e-mail used during registration
sPassword – The selected password
checkBaseUrl
- checkBaseUrl()
Util methods to check initialization of the current base URL. Can be used to verify the WASDI service on the selected node.
- Returns:
boolean – true, if the connection is ok, false instead
helloWasdiWorld
- helloWasdiWorld(noOutput)
Test method to check wasdi instance, with a tiny bit of developer’s traditions. Used across this library to check the connection state.
- Arguments:
noOutput – if true, the method doesn’t output the response on the console
openWorkspace
- openWorkspace(workspaceID)
Open a workspace and set it as active workspace, by using its Id
- Arguments:
workspaceID – The id of the selected workspace
- Returns:
Object|number|string|Object|* –
createWorkspace
- createWorkspace(wsName)
Create a new workspace for the active user.
- Arguments:
wsName – The workspace name, if the name is already used WADI will append a further numeric identifier (like the OS for new folders)
openWorkspaceById
- openWorkspaceById(workspaceID)
Opens a workspace and set it as active workspace. The active workspace is the one used for the following operations, like launch a processor or execute a workflow.
- Arguments:
workspaceID – The id of the selected workspace
- Returns:
Object|number|string|Object|* –
getWorkspaces
- getWorkspaces()
Retrieves the list of Workspace of the current logged user.
getProductsByActiveWorkspace
- getProductsByActiveWorkspace()
Retrieve a list of workspace of the current logged user.
executeProcessor
- executeProcessor(appname, jsonParameters)
Launch a process in the current workspace. Check getDeployed method to obtain a list of the available processors
- Arguments:
appname – a String containing the name of the selected application
jsonParameters – a JSON containing the parameters for the application, please check the app on WASDI for a specific reference
getProcessStatus
- getProcessStatus(processId)
Retrieves the process status of a process, identified by its processId. The response contains, among other data, the status and the progress percentage
- Arguments:
processId – the string containing the processId selected
- Returns:
the process Object
setProcessPayload
- setProcessPayload(sProcessId, data)
Set the payload of a process, identified by its processId
- Arguments:
sProcessId – the processId to add the payload
data – JSON string containing the payload
getDeployed
- getDeployed()
Retrieves a list of applications available on the WASDI marketplace. The response is an array of strings that can be used to launch the particular application
publishBand
- publishBand(fileName, bandName)
Publish a band of the particular product selected. To obtain a list of available bands, a function that retrieves the product details can be used.
- Arguments:
fileName – The product name in the current workspace
bandName – The band that needs to be published
getLayerWMS
- getLayerWMS(sProductName, sBand)
Returns an object containing 2 string with WMS parameters: - server e.g. “https://[URL]/geoserver/ows?” if using Geoserver - layerId
- Arguments:
sProductName – the Product name
sBand – The band required