Operation Plugin

Members

(inner) Operation.

render a upload interface for the configured operation
Properties:
Name Type Description
id string unique identifier of the operation
labelId string label id for the menu button on the action navbar that opens the upload interface
blocking boolean if true the ui will prevent interaction with the resource until the operation is completed
iconName string a font awesome icon name for the central section
titleMsgId string title for the central section
descriptionMsgId string description for the central section
action string the operation action used in the upload process
pageReload boolean if true the page is reloaded after clicking on reload
api object an object with the api configuration for upload and execution request
Properties
Name Type Description
upload object configuration for the upload process
Properties
Name Type Description
url string upload endpoint
method string request method (default post)
maxParallelUploads number number of maximum parallel uploads
enableRemoteUploads boolean enable the remote upload button
supportedFiles array list of supported type of upload
body object body request configuration
Properties
Name Type Description
file object body request configuration for file uploads
remote object body request configuration for remote uploads
executionRequest object configuration for the execution requests
Properties
Name Type Description
url string execution requests endpoint
params object query parameters for the request
Source:
Example
{
 "name": "Operation",
 "cfg": {
     "containerPosition": "header",
     "id": "operation-id",
     "labelId": "gnviewer.operationLabel",
     "blocking": true,
     "iconName": "file",
     "titleMsgId": "gnviewer.operationTitle",
     "descriptionMsgId": "gnviewer.operationDescription",
     "action": "upload",
     "api": {
         "upload": {
             "url": "{context.getEndpointUrl('uploads', '/upload')}",
             "maxParallelUploads": 1,
             "enableRemoteUploads": false,
             "supportedFiles": "{context.getSupportedFilesByResourceType('dataset', { actions: ['upload'] })}",
             "body": {
                 "file": {
                     "base_file": "{context.getUploadMainFile}",
                     "resource_pk": "{context.get(state('gnResourceData'), 'pk')}",
                     "action": "upload"
                 }
             }
         },
         "executionRequest": {
             "url": "{context.getEndpointUrl('executionrequest')}",
             "params": {
                 "filter{action}": "upload",
                 "sort[]": "-created",
                 "filter{geonode_resource}": "{context.get(state('gnResourceData'), 'pk')}"
             }
         }
     }
 },
 "override": {
     "ActionNavbar": {
         "name": "OperationId"
     }
 }
}