{
  "name": "ddex",
  "label": "DDEX",
  "description": "Implementation of schemas for DDEX messages",
  "version": "0.0.0",
  "infoUrl": "https://ddex.net/",
  "maintainer": "Kendraio",
  "supportUrl": "https://kendra.io",
  "database": [],
  "dashboard": {
    "icon": "brightness_5",
    "label": "DDEX",
    "workflowId": "dashboard"
  },
  "services": [
    {
      "label": "Import ERN4",
      "icon": "cloud_upload",
      "workflowId": "importDdexErn4"
    },
    {
      "label": "Resources",
      "icon": "file_copy",
      "workflowId": "resourceList"
    },
    {
      "label": "PartyList",
      "icon": "file_copy",
      "workflowId": "partyList"
    },
    {
      "label": "Releases",
      "icon": "file_copy",
      "workflowId": "releaseList"
    }
  ],
  "workflow": [
    {
      "title": "Dashboard",
      "workflowId": "dashboard",
      "config": "configs/dashboard.json"
    },
    {
      "title": "Delete party",
      "workflowId": "deleteParty",
      "config": "configs/deleteParty.json"
    },
    {
      "title": "Edit party",
      "workflowId": "editParty",
      "config": "configs/editParty.json"
    },
    {
      "title": "Party list",
      "workflowId": "partyList",
      "config": "configs/partyList.json"
    },
    {
      "title": "Delete release",
      "workflowId": "deleteRelease",
      "config": "configs/deleteRelease.json"
    },
    {
      "title": "Edit release",
      "workflowId": "editRelease",
      "config": "configs/editRelease.json"
    },
    {
      "title": "Release list",
      "workflowId": "releaseList",
      "config": "configs/releaseList.json"
    },
    {
      "title": "Delete resource",
      "workflowId": "deleteResource",
      "config": "configs/deleteResource.json"
    },
    {
      "title": "Edit Resource",
      "workflowId": "editResource",
      "config": "configs/editResource.json"
    },
    {
      "title": "Resource list",
      "workflowId": "resourceList",
      "config": "configs/resourceList.json"
    },
    {
      "title": "Import DDEX ERN v4",
      "workflowId": "importDdexErn4",
      "config": "configs/importDdexErn4.json"
    },
    {
      "title": "DDEX Electronic Release Notification Import",
      "config": "configs/ern4-import.json"
    }
  ],
  "forms": [],
  "tags": [
    "music",
    "b2b",
    "demo"
  ],
  "attachments": {
    "configs/dashboard.json": {
      "title": "DDEX dashboard",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "multi",
          "batches": [
            {
              "blocks": [
                {
                  "type": "db",
                  "operation": "get",
                  "adapterName": "ddexErn4",
                  "schema": "resource"
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "db",
                  "operation": "get",
                  "adapterName": "ddexErn4",
                  "schema": "party"
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "db",
                  "operation": "get",
                  "adapterName": "ddexErn4",
                  "schema": "release"
                }
              ]
            }
          ]
        },
        {
          "type": "mapping",
          "//debug": true,
          "mapping": {
            "[": [
              {
                "label": "'Party (contributor) records'",
                "value": "length(data[1])"
              },
              {
                "label": "'Resources'",
                "value": "length(data[0])"
              },
              {
                "label": "'Releases (including tracks)'",
                "value": "length(data[2])"
              }
            ]
          }
        },
        {
          "type": "debug"
        },
        {
          "type": "chart"
        }
      ]
    },
    "configs/deleteParty.json": {
      "title": "Delete party",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "debug",
          "showContext": true
        },
        {
          "type": "message",
          "message": "Are you sure you want to delete {{ ReleaseID }} with UUID: {{ context.queryParams.uuid }}?"
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Delete",
              "color": "warn",
              "blocks": [
                {
                  "type": "db",
                  "operation": "delete",
                  "uuidGetter": "context.queryParams.uuid"
                }
              ]
            },
            {
              "label": "Cancel",
              "blocks": [
                {
                  "type": "init"
                }
              ]
            }
          ]
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "partyList"
        }
      ]
    },
    "configs/deleteRelease.json": {
      "title": "Delete release",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "debug",
          "showContext": true
        },
        {
          "type": "message",
          "message": "Are you sure you want to delete {{ ReleaseID }} with UUID: {{ context.queryParams.uuid }}?"
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Delete",
              "color": "warn",
              "blocks": [
                {
                  "type": "db",
                  "operation": "delete",
                  "uuidGetter": "context.queryParams.uuid"
                }
              ]
            },
            {
              "label": "Cancel",
              "blocks": [
                {
                  "type": "init"
                }
              ]
            }
          ]
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "releaseList"
        }
      ]
    },
    "configs/deleteResource.json": {
      "title": "Delete resource",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "debug",
          "showContext": true
        },
        {
          "type": "message",
          "message": "Are you sure you want to delete {{Type}} {{ DisplayTitleText }} with UUID: {{ context.queryParams.uuid }}?"
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Delete",
              "color": "warn",
              "blocks": [
                {
                  "type": "db",
                  "operation": "delete",
                  "uuidGetter": "context.queryParams.uuid"
                }
              ]
            },
            {
              "label": "Cancel",
              "blocks": [
                {
                  "type": "init"
                }
              ]
            }
          ]
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "resourceList"
        }
      ]
    },
    "configs/editParty.json": {
      "title": "Edit party",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "form",
          "label": "Save",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "uuid": {
                "title": "uuid",
                "type": "string"
              },
              "PartyReference": {
                "title": "PartyReference",
                "type": "string"
              },
              "PartyName": {
                "title": "PartyName",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "FullName": {
                      "title": "FullName",
                      "type": "string"
                    },
                    "FullNameIndexed": {
                      "title": "FullNameIndexed",
                      "type": "string"
                    },
                    "_LanguageAndScriptCode": {
                      "title": "_LanguageAndScriptCode",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "uiSchema": {
            "uuid": {
              "ui:disabled": true
            },
            "PartyName": {
              "ui:widget": "table",
              "colHeadings": [
                "FullName",
                "FullNameIndexed",
                "Language"
              ]
            }
          }
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "partyList"
        }
      ]
    },
    "configs/editRelease.json": {
      "title": "Edit release",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "form",
          "label": "Save",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "uuid": {
                "title": "uuid",
                "type": "string"
              },
              "ReleaseType": {
                "title": "ReleaseType",
                "type": "string"
              },
              "DisplayTitleText": {
                "title": "DisplayTitleText",
                "type": "string"
              },
              "ReleaseId": {
                "title": "Release ID",
                "type": "object",
                "properties": {
                  "ProprietaryId": {
                    "type": "object",
                    "properties": {
                      "_Namespace": {
                        "title": "_Namespace",
                        "type": "string"
                      },
                      "__text": {
                        "title": "__text",
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "ReleaseLabelReference": {
                "title": "ReleaseLabelReference",
                "type": "object",
                "properties": {
                  "_ApplicableTerritoryCode": {
                    "title": "_ApplicableTerritoryCode",
                    "type": "string"
                  },
                  "__text": {
                    "title": "__text",
                    "type": "string"
                  }
                }
              },
              "Genre": {
                "title": "Genre",
                "type": "object",
                "properties": {
                  "_ApplicableTerritoryCode": {
                    "title": "_ApplicableTerritoryCode",
                    "type": "string"
                  },
                  "GenreText": {
                    "title": "__text",
                    "type": "string"
                  }
                }
              },
              "resource_uuid": {
                "title": "resource_uuid",
                "type": "string"
              },
              "ResourceGroup": {
                "title": "ResourceGroup",
                "type": "array",
                "items": {
                  "//title": "Resource",
                  "type": "object",
                  "properties": {
                    "linked_resource_uuid": {
                      "title": "Linked resource",
                      "type": "string"
                    },
                    "AdditionalTitle": {
                      "type": "object",
                      "properties": {
                        "TitleText": {
                          "title": "Additional title",
                          "type": "string"
                        }
                      }
                    },
                    "ResourceGroupContentItem": {
                      "title": "Resources",
                      "type": "array",
                      "items": {
                        "title": "ResourceGroupContentItem",
                        "type": "object",
                        "properties": {
                          "resource_uuid": {
                            "title": "Resource",
                            "type": "string"
                          },
                          "SequenceNumber": {
                            "title": "SequenceNumber",
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "uiSchema": {
            "uuid": {
              "ui:disabled": true
            },
            "resource_uuid": {
              "ui:widget": "blocks",
              "blocksConfig": {
                "blocks": [
                  {
                    "type": "init"
                  },
                  {
                    "type": "db",
                    "operation": "get",
                    "adapterName": "ddexErn4",
                    "schema": "resource"
                  },
                  {
                    "type": "reference",
                    "fieldLabel": "Resource",
                    "labelField": "DisplayTitleText",
                    "valueField": "uuid"
                  }
                ]
              }
            },
            "ResourceGroup": {
              "//ui:widget": "table",
              "//colHeadings": [
                "Linked resource",
                "Additional title",
                "Resources"
              ],
              "//blocks": [
                {
                  "type": "actions",
                  "buttons": [
                    {
                      "label": "Edit",
                      "blocks": [
                        {
                          "type": "launch",
                          "adapter": "ddexErn4",
                          "workflowId": "editResource",
                          "context": {
                            "uuid": "data.linked_resource_uuid"
                          }
                        }
                      ]
                    }
                  ]
                }
              ],
              "items": {
                "linked_resource_uuid": {
                  "ui:widget": "blocks",
                  "blocksConfig": {
                    "blocks": [
                      {
                        "type": "init"
                      },
                      {
                        "type": "db",
                        "operation": "get",
                        "adapterName": "ddexErn4",
                        "schema": "resource"
                      },
                      {
                        "type": "reference",
                        "fieldLabel": "Linked resource",
                        "//labelField": "DisplayTitleText",
                        "labelGetter": "DisplayTitleText || join(`: `, [Type, uuid])",
                        "valueField": "uuid"
                      }
                    ]
                  }
                },
                "ResourceGroupContentItem": {
                  "ui:widget": "table",
                  "colHeadings": [
                    "Resource",
                    "Sequence number"
                  ],
                  "blocks": [
                    {
                      "type": "actions",
                      "buttons": [
                        {
                          "label": "Edit",
                          "blocks": [
                            {
                              "type": "launch",
                              "adapter": "ddexErn4",
                              "workflowId": "editResource",
                              "context": {
                                "uuid": "data.resource_uuid"
                              }
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "items": {
                    "resource_uuid": {
                      "ui:widget": "blocks",
                      "blocksConfig": {
                        "blocks": [
                          {
                            "type": "init"
                          },
                          {
                            "type": "db",
                            "operation": "get",
                            "adapterName": "ddexErn4",
                            "schema": "resource"
                          },
                          {
                            "type": "reference",
                            "fieldLabel": "Linked resource",
                            "//labelField": "DisplayTitleText",
                            "labelGetter": "DisplayTitleText || join(`: `, [Type, uuid])",
                            "valueField": "uuid"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "releaseList"
        }
      ]
    },
    "configs/editResource.json": {
      "title": "Edit resource",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "fetch",
          "uuidGetter": "context.queryParams.uuid"
        },
        {
          "type": "mapping",
          "mapping": "data[0]"
        },
        {
          "type": "form",
          "label": "Save",
          "jsonSchema": {
            "type": "object",
            "properties": {
              "uuid": {
                "title": "uuid",
                "type": "string"
              },
              "Type": {
                "title": "Type",
                "type": "string"
              },
              "ResourceId": {
                "type": "object",
                "properties": {
                  "ISRC": {
                    "title": "ISRC",
                    "type": "string"
                  }
                }
              },
              "DisplayTitleText": {
                "title": "DisplayTitleText",
                "type": "string"
              },
              "DisplayTitle": {
                "title": "DisplayTitle",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "TitleText": {
                      "title": "TitleText",
                      "type": "string"
                    },
                    "_ApplicableTerritoryCode": {
                      "title": "_ApplicableTerritoryCode",
                      "type": "string"
                    },
                    "_LanguageAndScriptCode": {
                      "title": "_LanguageAndScriptCode",
                      "type": "string"
                    },
                    "_IsDefault": {
                      "title": "_IsDefault",
                      "type": "string"
                    }
                  }
                }
              },
              "DisplayArtistName": {
                "title": "DisplayArtistName",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "__text": {
                      "title": "__text",
                      "type": "string"
                    },
                    "_ApplicableTerritoryCode": {
                      "title": "_ApplicableTerritoryCode",
                      "type": "string"
                    },
                    "_LanguageAndScriptCode": {
                      "title": "_LanguageAndScriptCode",
                      "type": "string"
                    },
                    "_IsDefault": {
                      "title": "_IsDefault",
                      "type": "string"
                    }
                  }
                }
              },
              "TechnicalDetails": {
                "title": "Technical details",
                "type": "object",
                "properties": {
                  "File": {
                    "type": "object",
                    "properties": {
                      "URI": {
                        "title": "URI",
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "DisplayArtist": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "artist_uuid": {
                      "type": "string"
                    },
                    "DisplayArtistRole": {
                      "type": "string"
                    }
                  }
                }
              },
              "Contributor": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "contributor_uuid": {
                      "type": "string"
                    },
                    "Role": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "uiSchema": {
            "uuid": {
              "ui:disabled": true
            },
            "DisplayTitle": {
              "ui:widget": "table",
              "colHeadings": [
                "Display Title",
                "Territory",
                "Language",
                "Is default?"
              ]
            },
            "DisplayArtistName": {
              "ui:widget": "table",
              "colHeadings": [
                "Display Artist Name",
                "Territory",
                "Language",
                "Is default?"
              ]
            },
            "DisplayArtist": {
              "ui:widget": "table",
              "colHeadings": [
                "Artist",
                "Role"
              ],
              "items": {
                "artist_uuid": {
                  "ui:widget": "blocks",
                  "blocksConfig": {
                    "blocks": [
                      {
                        "type": "init"
                      },
                      {
                        "type": "db",
                        "operation": "get",
                        "adapterName": "ddexErn4",
                        "schema": "party"
                      },
                      {
                        "type": "reference",
                        "fieldLabel": "Artist",
                        "labelGetter": "PartyReference || uuid",
                        "valueField": "uuid"
                      }
                    ]
                  }
                }
              },
              "blocks": [
                {
                  "type": "actions",
                  "buttons": [
                    {
                      "label": "Edit",
                      "blocks": [
                        {
                          "type": "launch",
                          "adapter": "ddexErn4",
                          "workflowId": "editParty",
                          "context": {
                            "uuid": "data.artist_uuid"
                          }
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            "Contributor": {
              "ui:widget": "table",
              "colHeadings": [
                "Contributor",
                "Role"
              ],
              "items": {
                "contributor_uuid": {
                  "ui:widget": "blocks",
                  "blocksConfig": {
                    "blocks": [
                      {
                        "type": "init"
                      },
                      {
                        "type": "db",
                        "operation": "get",
                        "adapterName": "ddexErn4",
                        "schema": "party"
                      },
                      {
                        "type": "reference",
                        "fieldLabel": "Contributor",
                        "labelGetter": "PartyReference || uuid",
                        "valueField": "uuid"
                      }
                    ]
                  }
                }
              },
              "blocks": [
                {
                  "type": "actions",
                  "buttons": [
                    {
                      "label": "Edit",
                      "blocks": [
                        {
                          "type": "launch",
                          "adapter": "ddexErn4",
                          "workflowId": "editParty",
                          "context": {
                            "uuid": "data.contributor_uuid"
                          }
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          }
        },
        {
          "type": "launch",
          "adapter": "ddexErn4",
          "workflowId": "resourceList"
        }
      ]
    },
    "configs/ern4-import.json": {
      "title": "DDEX Electronic Release Notification Import",
      "blocks": [
        {
          "type": "file-input",
          "label": "Load ERN",
          "accept": [
            "xml"
          ]
        },
        {
          "type": "parse-data",
          "csvOptions": {
            "header": true,
            "skipEmptyLines": true
          },
          "xmlOptions": {
            "arrayAccessFormPaths": [
              "NewReleaseMessage.PartyList.Party",
              "NewReleaseMessage.ResourceList.SoundRecording",
              "NewReleaseMessage.ResourceList.Image",
              "NewReleaseMessage.ReleaseList.Release",
              "NewReleaseMessage.ReleaseList.TrackRelease",
              "NewReleaseMessage.DealList.ReleaseDeal"
            ]
          }
        },
        {
          "type": "mapping",
          "mapping": "data.NewReleaseMessage"
        },
        {
          "type": "multi",
          "batches": [
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.PartyList.Party"
                },
                {
                  "type": "message",
                  "title": "Party List"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "PartyReference"
                    },
                    {
                      "headerName": "Name",
                      "field": "PartyName.FullName"
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.ResourceList.SoundRecording"
                },
                {
                  "type": "message",
                  "title": "Sound Recordings"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "ResourceReference"
                    },
                    {
                      "headerName": "Title",
                      "field": "DisplayTitleText"
                    },
                    {
                      "headerName": "Duration",
                      "field": "Duration"
                    },
                    {
                      "headerName": "Language",
                      "field": "LanguageOfPerformance"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.ResourceList.Image"
                },
                {
                  "type": "message",
                  "title": "Images"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "ResourceReference"
                    },
                    {
                      "headerName": "Type",
                      "field": "Type"
                    },
                    {
                      "headerName": "File",
                      "field": "TechnicalDetails.File.URI"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.ReleaseList.Release"
                },
                {
                  "type": "message",
                  "title": "Releases"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "ReleaseReference"
                    },
                    {
                      "headerName": "Type",
                      "field": "ReleaseType"
                    },
                    {
                      "headerName": "Title",
                      "field": "DisplayTitleText"
                    },
                    {
                      "headerName": "Artist",
                      "valueGetter": "DisplayArtistName[].__text"
                    },
                    {
                      "headerName": "Duration",
                      "field": "Duration"
                    },
                    {
                      "headerName": "Genre",
                      "field": "Genre.GenreText"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.ReleaseList.TrackRelease"
                },
                {
                  "type": "message",
                  "title": "Tracks"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "ReleaseReference"
                    },
                    {
                      "headerName": "Resource Reference",
                      "field": "ReleaseResourceReference"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.DealList.ReleaseDeal"
                },
                {
                  "type": "message",
                  "title": "Deals"
                },
                {
                  "type": "grid",
                  "columnDefs": [
                    {
                      "headerName": "Reference",
                      "field": "DealReleaseReference"
                    },
                    {
                      "headerName": "Deal Terms",
                      "field": "Deal"
                    },
                    {
                      "headerName": "Operations",
                      "cellRenderer": "workflowRenderer",
                      "cellRendererParams": {
                        "blocks": [
                          {
                            "type": "actions",
                            "buttons": [
                              {
                                "label": "View",
                                "blocks": [
                                  {
                                    "type": "dialog",
                                    "blocks": [
                                      {
                                        "type": "debug"
                                      },
                                      {
                                        "type": "actions",
                                        "buttons": [
                                          {
                                            "label": "OK",
                                            "blocks": [
                                              {
                                                "type": "init"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "id": "ern4Import"
    },
    "configs/importDdexErn4.json": {
      "title": "DDEX Electronic Release Notification Import",
      "blocks": [
        {
          "type": "file-input",
          "label": "Load ERN",
          "accept": [
            "xml"
          ]
        },
        {
          "type": "parse-data",
          "csvOptions": {
            "header": true,
            "skipEmptyLines": true
          },
          "xmlOptions": {
            "arrayAccessFormPaths": [
              "NewReleaseMessage.PartyList.Party",
              "NewReleaseMessage.PartyList.Party.PartyName",
              "NewReleaseMessage.ResourceList.SoundRecording",
              "NewReleaseMessage.ResourceList.SoundRecording.DisplayArtist",
              "NewReleaseMessage.ResourceList.SoundRecording.Contributor",
              "NewReleaseMessage.ResourceList.Image",
              "NewReleaseMessage.ReleaseList.Release",
              "NewReleaseMessage.ReleaseList.Release.DisplayArtist",
              "NewReleaseMessage.ReleaseList.Release.ResourceGroup",
              "NewReleaseMessage.ReleaseList.Release.ResourceGroup.ResourceGroupContentItem",
              "NewReleaseMessage.ReleaseList.TrackRelease"
            ]
          }
        },
        {
          "type": "mapping",
          "mapping": "data.NewReleaseMessage"
        },
        {
          "type": "debug"
        },
        {
          "type": "mapping",
          "//mapping": "data.{ PartyList: PartyList.Party[].merge(@, { uuid: uuid() }), ResourceList: ResourceList.[SoundRecording[], Video[], Image[]][][].merge(@, { uuid: uuid() }) }",
          "mapping": {
            "data": {
              ".": {
                "PartyList": "PartyList.Party[].merge(@, { uuid: uuid() })",
                "ResourceList": {
                  "ResourceList.": [
                    {
                      "[": [
                        "SoundRecording[]",
                        "Video[]",
                        "Image[]"
                      ]
                    },
                    "[][]",
                    {
                      ".": {
                        "(": [
                          "merge",
                          "@",
                          {
                            "{": {
                              "uuid": "uuid()"
                            }
                          }
                        ]
                      }
                    }
                  ]
                },
                "ReleaseList": {
                  "ReleaseList.": [
                    {
                      "[": [
                        "Release[]",
                        "TrackRelease[]"
                      ]
                    },
                    "[][]",
                    {
                      ".": {
                        "(": [
                          "merge",
                          "@",
                          {
                            "{": {
                              "uuid": "uuid()"
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        {
          "type": "debug"
        },
        {
          "type": "multi",
          "batches": [
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.PartyList"
                },
                {
                  "type": "debug"
                },
                {
                  "type": "batch",
                  "blocks": [
                    {
                      "type": "db",
                      "operation": "add",
                      "adapterName": "ddexErn4",
                      "schema": "party",
                      "skipFirst": false
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "data.ResourceList[].compact(merge(@, { Contributor: Contributor[].merge(@, { contributor_uuid: find(_(&data.PartyList), 'PartyReference', ContributorPartyReference).uuid }), DisplayArtist: DisplayArtist[].merge(@, { artist_uuid: find(_(&data.PartyList), 'PartyReference', ArtistPartyReference).uuid }) }))"
                },
                {
                  "type": "debug"
                },
                {
                  "type": "batch",
                  "blocks": [
                    {
                      "type": "db",
                      "operation": "add",
                      "adapterName": "ddexErn4",
                      "schema": "resource",
                      "skipFirst": false
                    }
                  ]
                }
              ]
            },
            {
              "blocks": [
                {
                  "type": "mapping",
                  "//mapping": "data.ReleaseList[].compact(merge(@, { Contributor: Contributor[].merge(@, { contributor_uuid: find(_(&data.PartyList), 'PartyReference', ContributorPartyReference).uuid }) }))",
                  "mapping": {
                    "data.ReleaseList[]": {
                      ".": {
                        "(": [
                          "compact",
                          {
                            "(": [
                              "merge",
                              "@",
                              {
                                "{": {
                                  "resource_uuid": "find(_(&data.ResourceList), 'ResourceReference', ReleaseResourceReference).uuid",
                                  "ResourceGroup": {
                                    "ResourceGroup[].": {
                                      "(": [
                                        "merge",
                                        "@",
                                        {
                                          "{": {
                                            "linked_resource_uuid": "find(_(&data.ResourceList), 'ResourceReference', LinkedReleaseResourceReference).uuid",
                                            "ResourceGroupContentItem": {
                                              "ResourceGroupContentItem[].": {
                                                "(": [
                                                  "merge",
                                                  "@",
                                                  {
                                                    "{": {
                                                      "resource_uuid": "find(_(&data.ResourceList), 'ResourceReference', ReleaseResourceReference).uuid"
                                                    }
                                                  }
                                                ]
                                              }
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                }
                              }
                            ]
                          }
                        ]
                      }
                    }
                  }
                },
                {
                  "type": "debug"
                },
                {
                  "type": "batch",
                  "blocks": [
                    {
                      "type": "db",
                      "operation": "add",
                      "adapterName": "ddexErn4",
                      "schema": "release",
                      "skipFirst": false
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "type": "debug"
        }
      ],
      "id": "importDdexErn4"
    },
    "configs/partyList.json": {
      "title": "DDEX PartyList",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "get",
          "adapterName": "ddexErn4",
          "schema": "party"
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 15,
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "width": 50,
              "resizable": false,
              "checkboxSelection": true,
              "headerCheckboxSelection": true
            },
            {
              "headerName": "PartyReference",
              "field": "PartyReference"
            },
            {
              "headerName": "PartyName",
              "valueGetter": "PartyName[].FullName"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "editParty",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Delete",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "deleteParty",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ],
      "id": ""
    },
    "configs/releaseList.json": {
      "title": "DDEX Releases",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "get",
          "adapterName": "ddexErn4",
          "schema": "release"
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 15,
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "width": 50,
              "resizable": false,
              "checkboxSelection": true,
              "headerCheckboxSelection": true
            },
            {
              "headerName": "Release ID",
              "field": "ReleaseId.ProprietaryId.__text"
            },
            {
              "headerName": "Release Type",
              "field": "ReleaseType"
            },
            {
              "headerName": "Genre",
              "field": "Genre.GenreText"
            },
            {
              "headerName": "Label Ref",
              "field": "ReleaseLabelReference.__text"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "editRelease",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Delete",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "deleteRelease",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ],
      "id": ""
    },
    "configs/resourceList.json": {
      "title": "DDEX Resources",
      "blocks": [
        {
          "type": "init"
        },
        {
          "type": "db",
          "operation": "get",
          "adapterName": "ddexErn4",
          "schema": "resource"
        },
        {
          "type": "grid",
          "gridOptions": {
            "pagination": true,
            "paginationPageSize": 15,
            "rowSelection": "multiple"
          },
          "columnDefs": [
            {
              "width": 50,
              "resizable": false,
              "checkboxSelection": true,
              "headerCheckboxSelection": true
            },
            {
              "headerName": "Title",
              "field": "DisplayTitleText"
            },
            {
              "headerName": "Type",
              "field": "Type"
            },
            {
              "headerName": "Language",
              "field": "LanguageOfPerformance"
            },
            {
              "headerName": "Operations",
              "cellRenderer": "workflowRenderer",
              "cellRendererParams": {
                "blocks": [
                  {
                    "type": "actions",
                    "buttons": [
                      {
                        "label": "View",
                        "blocks": [
                          {
                            "type": "dialog",
                            "blocks": [
                              {
                                "type": "debug"
                              },
                              {
                                "type": "actions",
                                "buttons": [
                                  {
                                    "label": "OK",
                                    "blocks": [
                                      {
                                        "type": "init"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "label": "Edit",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "editResource",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      },
                      {
                        "label": "Delete",
                        "blocks": [
                          {
                            "type": "launch",
                            "adapter": "ddexErn4",
                            "workflowId": "deleteResource",
                            "context": {
                              "uuid": "data.uuid"
                            }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          ]
        },
        {
          "type": "mapping",
          "mapping": "{ records: data }"
        },
        {
          "type": "actions",
          "buttons": [
            {
              "label": "Delete",
              "color": "warn",
              "blocks": [
                {
                  "type": "dialog",
                  "blocks": [
                    {
                      "type": "message",
                      "message": "Are you sure you want to delete {{records.length}} items?"
                    },
                    {
                      "type": "actions",
                      "buttons": [
                        {
                          "label": "Delete",
                          "color": "warn",
                          "blocks": [
                            {
                              "type": "mapping",
                              "mapping": "data.records"
                            },
                            {
                              "type": "batch",
                              "blocks": [
                                {
                                  "type": "db",
                                  "operation": "delete",
                                  "uuidGetter": "data.uuid",
                                  "skipFirst": false
                                }
                              ]
                            },
                            {
                              "type": "dispatch",
                              "action": "refreshWorkflow"
                            }
                          ]
                        },
                        {
                          "label": "Cancel",
                          "blocks": [
                            {
                              "type": "init"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "label": "Export",
              "blocks": [
                {
                  "type": "mapping",
                  "mapping": "{ mapping: 'Default', records: data.records }"
                },
                {
                  "type": "dialog",
                  "blocks": [
                    {
                      "type": "form",
                      "label": "Run mapping",
                      "jsonSchema": {
                        "type": "object",
                        "properties": {
                          "mapping": {
                            "title": "Output mapping",
                            "type": "string",
                            "enum": [
                              "Default"
                            ]
                          }
                        }
                      },
                      "uiSchema": {}
                    },
                    {
                      "type": "mapping",
                      "mapping": "data.records"
                    },
                    {
                      "type": "serialize",
                      "hasFormatSelection": true,
                      "formats": [
                        "json",
                        "csv",
                        "xml"
                      ]
                    },
                    {
                      "type": "file-export",
                      "label": "Export",
                      "fileName": "exported"
                    },
                    {
                      "type": "actions",
                      "buttons": [
                        {
                          "label": "Close",
                          "blocks": [
                            {
                              "type": "init"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "id": ""
    }
  }
}