Javascript WasdiLib

Constructor

constructor()

Constructor method: init an instance of the library object. As convention the name “wasdi” is used, both for Javascript and Typescript.

Methods

loadConfig

loadConfig(configFile, parametersFile)

Loads configuration and parameters. If no filename is specified, it loads the file config.json and parameters.json from the same level directory of the calling URL. The config file can be hosted on an external URL.

Arguments
  • configFile (string) – a JSON containing all the required information to login to WASDI, please check repository for example

  • parametersFile (string) – a JSON containing the parameters that can be used in case of a launch of an appliciation

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 (string) – the file name of the JSON containing the parameters

login

login()

Api call for the login to WASDI services. Valid credential must be available.

Returns

<TODO: other type>|<TODO: other type>

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 (boolean) – if true, the method doesn’t output the response on the console

Returns

string

openWorkspace

openWorkspace(workspaceName)

Open a workspace and set it as active workspace, by using its Id

Arguments
  • workspaceName (string) –

Returns

any|number|string|{}|*}

createWorkspace

createWorkspace(wsName)

Create a new workspace for the active user.

Arguments
  • wsName (string) – The workspace name, if the name is already used WADI will append a further numeric identifier (like the OS for new folders)

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 (string) – The id of the selected workspace

Returns

any|number|string|{}|*}

getWorkspaces

getWorkspaces()

Retrieves the list of Workspace of the current logged user.

Returns

any

getProductsByActiveWorkspace

getProductsByActiveWorkspace()

Retrieve a list of workspace of the current logged user.

Returns

any

executeProcessor

executeProcessor(appname, jsonParameters)

Launch a process in the current workspace. Check getDeployed method to obtain a list of the available processors

Arguments
  • appname (string) – a String containing the name of the selected application

  • jsonParameters (string) – a JSON containing the parameters for the application, please check the app on WASDI for a specific reference

Returns

any

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 (string) – the string containing the processId selected

Returns

any – the process Object

setProcessPayload

setProcessPayload(sProcessId, data)

Set the payload of a process, identified by its processId

Arguments
  • sProcessId (string) – the processId to add the payload

  • data (string) – JSON string containing the payload

Returns

any

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

Returns

any

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 (string) – The product name in the current workspace

  • bandName (string) – The band that needs to be published

Returns

any

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 (string) – the Product name

  • sBand (string) – The band required

Returns

<TODO: reflection>