Implementation of a definition browser
parent
f9566efe53
commit
2428dcbf58
|
|
@ -9,9 +9,28 @@ The prototype is able to:
|
|||
* Initialise by creating a config file
|
||||
* Create a JSON **martiLQ** definition file based on files in a directory
|
||||
|
||||
|
||||
## Client
|
||||
|
||||
__TO COME__
|
||||
|
||||
Publish of Golan package is yet to occur. A binary executable will also be
|
||||
Publish of Golang package is yet to occur. A binary executable will also be
|
||||
published for Linux and Windows of the prototype.
|
||||
|
||||
This will occur after merge of code into ``main`` branch.
|
||||
|
||||
## Server
|
||||
|
||||
A web UI exists as a functionnal demonstration to view a collection of
|
||||
**martiLQ** definition files.
|
||||
|
||||
## Docker
|
||||
|
||||
```
|
||||
|
||||
go env -w GOOS=linux
|
||||
go env -w GOARCH=386
|
||||
go build ./main.go
|
||||
|
||||
docker build -t martilq-go-server:latest .
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
FROM busybox
|
||||
|
||||
LABEL version="202111A"
|
||||
LABEL description="matiLQ Go web UI by Meerkat Manor "
|
||||
LABEL authors="meerkat@merebox.com"
|
||||
|
||||
COPY ./static /home/static
|
||||
COPY ./main /home/main
|
||||
COPY ./docs /home/docs
|
||||
COPY ./data /data
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT exec /home/main -p 8080 -s /home/static -data /data/ -docs /home/docs
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
{
|
||||
"content-type": "application/vnd.martilq.json",
|
||||
"title": "Conversion from CKAN",
|
||||
"uid": "ab7eddce-84df-4098-bc8f-500d0d9776d1",
|
||||
"description": "This data has been converted from DATA GOV AU CKAN data source with URL 'https://data.gov.au/api/3/action/package_show?id=ab7eddce-84df-4098-bc8f-500d0d9776d1'",
|
||||
"issued": "2021-11-06T13:48:28",
|
||||
"modified": "2021-11-06T13:48:28",
|
||||
"expires": "",
|
||||
"tags": [
|
||||
"document",
|
||||
"marti",
|
||||
"ckan",
|
||||
"gov",
|
||||
"au"
|
||||
],
|
||||
"publisher": "Australian Securities and Investments Commission (ASIC)",
|
||||
"contactPoint": "Access.Request@asic.gov.au",
|
||||
"accessLevel": "Confidential",
|
||||
"rights": "Restricted",
|
||||
"license": "cc-by",
|
||||
"state": "active",
|
||||
"batch": 1.0,
|
||||
"describedBy": "",
|
||||
"landingPage": "https://data.gov.au/dataset/ds-dga-ab7eddce-84df-4098-bc8f-500d0d9776d1/details?q=AFS%20Licensee%20Dataset%20extract%20as",
|
||||
"theme": "",
|
||||
"resources": [
|
||||
{
|
||||
"title": "AFS Licensee Dataset - Current",
|
||||
"uid": "d98a113d-6b50-40e6-b65f-2612efc877f4",
|
||||
"documentName": "afs_lic_202111.csv",
|
||||
"issuedDate": "2016-03-10T12:15:49.07712",
|
||||
"modified": "2021-11-01T03:46:03.958513",
|
||||
"state": "active",
|
||||
"author": "Australian Securities and Investments Commission (ASIC)",
|
||||
"length": 9328930,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "307d8972c10a0723af7bfa5f03c56c36",
|
||||
"signed": false
|
||||
},
|
||||
"description": "AFS Licensee Dataset extract as at 01/11/2021 14:33",
|
||||
"url": "https://data.gov.au/data/dataset/ab7eddce-84df-4098-bc8f-500d0d9776d1/resource/d98a113d-6b50-40e6-b65f-2612efc877f4/download/afs_lic_202111.csv",
|
||||
"version": "1.1.0",
|
||||
"format": "CSV",
|
||||
"compression": "",
|
||||
"encryption": ""
|
||||
},
|
||||
{
|
||||
"title": "AFS Licensee - Help File",
|
||||
"uid": "2e831e8d-f9d7-4de2-9482-0597f4f6abf9",
|
||||
"documentName": "australian-financial-services-licensee-help-file.pdf",
|
||||
"issuedDate": "2016-03-10T12:32:04.564184",
|
||||
"modified": "2017-05-29T00:09:40.392458",
|
||||
"state": "active",
|
||||
"author": "Australian Securities and Investments Commission (ASIC)",
|
||||
"length": null,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "",
|
||||
"signed": false
|
||||
},
|
||||
"description": "Help File as at 10/03/2016",
|
||||
"url": "https://data.gov.au/data/dataset/ab7eddce-84df-4098-bc8f-500d0d9776d1/resource/2e831e8d-f9d7-4de2-9482-0597f4f6abf9/download/australian-financial-services-licensee-help-file.pdf",
|
||||
"version": "1.1.0",
|
||||
"format": "PDF",
|
||||
"compression": "",
|
||||
"encryption": ""
|
||||
},
|
||||
{
|
||||
"title": "AFS Licensee Dataset - National Map",
|
||||
"uid": "197ae0f5-121f-4ded-87f7-a54ff76f9471",
|
||||
"documentName": "afs_lic_202111.csv-geo-au",
|
||||
"issuedDate": "2016-03-10T14:31:00.013256",
|
||||
"modified": "2021-11-01T03:46:09.778434",
|
||||
"state": "active",
|
||||
"author": "Australian Securities and Investments Commission (ASIC)",
|
||||
"length": 9179162,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "",
|
||||
"signed": false
|
||||
},
|
||||
"description": "The following changes were made to align with national map: - Delimiter changed to comma (,) - Latitude and longitude field names changed to lat and lon",
|
||||
"url": "https://data.gov.au/data/dataset/ab7eddce-84df-4098-bc8f-500d0d9776d1/resource/197ae0f5-121f-4ded-87f7-a54ff76f9471/download/afs_lic_202111.csv-geo-au",
|
||||
"version": "1.1.0",
|
||||
"format": "CSV-GEO-AU",
|
||||
"compression": "",
|
||||
"encryption": ""
|
||||
},
|
||||
{
|
||||
"title": "AFS Licensee Dataset - Current",
|
||||
"uid": "710d69b2-05cc-473e-94ae-075766081d49",
|
||||
"documentName": "afs_lic_202111.xlsx",
|
||||
"issuedDate": "2016-04-06T13:55:16.278489",
|
||||
"modified": "2021-11-01T03:46:11.303206",
|
||||
"state": "active",
|
||||
"author": "Australian Securities and Investments Commission (ASIC)",
|
||||
"length": 707842,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "",
|
||||
"signed": false
|
||||
},
|
||||
"description": "AFS Licensee Dataset extract as at 01/11/2021 14:30",
|
||||
"url": "https://data.gov.au/data/dataset/ab7eddce-84df-4098-bc8f-500d0d9776d1/resource/710d69b2-05cc-473e-94ae-075766081d49/download/afs_lic_202111.xlsx",
|
||||
"version": "1.1.0",
|
||||
"format": "XLSX",
|
||||
"compression": "",
|
||||
"encryption": ""
|
||||
},
|
||||
{
|
||||
"title": "AFS Licensee Dataset - Current",
|
||||
"uid": "1fc2b334-74ae-4588-85aa-83e3a8c9f2cc",
|
||||
"documentName": "afs_lic_202111.tsv",
|
||||
"issuedDate": "2016-11-30T08:55:39.249263",
|
||||
"modified": "2021-11-01T03:46:12.987395",
|
||||
"state": "active",
|
||||
"author": "Australian Securities and Investments Commission (ASIC)",
|
||||
"length": 9170476,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "",
|
||||
"signed": false
|
||||
},
|
||||
"description": "AFS Licensee Dataset extract as at 01/11/2021 14:30",
|
||||
"url": "https://data.gov.au/data/dataset/ab7eddce-84df-4098-bc8f-500d0d9776d1/resource/1fc2b334-74ae-4588-85aa-83e3a8c9f2cc/download/afs_lic_202111.tsv",
|
||||
"version": "1.1.0",
|
||||
"format": "TSV",
|
||||
"compression": "",
|
||||
"encryption": ""
|
||||
}
|
||||
],
|
||||
"custom": [
|
||||
{
|
||||
"extension": "software",
|
||||
"softwareName": "MartiReference",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"extension": "template",
|
||||
"renderer": "MartiReference:Mustache",
|
||||
"url": "data/martilq_ckan.must"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
"document",
|
||||
"marti"
|
||||
],
|
||||
"publisher": "VCOFF\\meerkat",
|
||||
"publisher": "Australian Securities and Investments Commission (ASIC)",
|
||||
"contactPoint": "Access.Request@asic.gov.au",
|
||||
"accessLevel": "Confidential",
|
||||
"rights": "Restricted",
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"state": "active",
|
||||
"batch": 1.0,
|
||||
"describedBy": "",
|
||||
"landingPage": "",
|
||||
"landingPage": "https://data.gov.au/dataset/ds-dga-f2b7c2c1-f4ef-4ae9-aba5-45c19e4d3038/details?q=Adviser",
|
||||
"theme": "",
|
||||
"resources": [
|
||||
{
|
||||
|
|
@ -91,6 +91,11 @@
|
|||
"softwareName": "MartiReference",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
{
|
||||
"extension": "template",
|
||||
"renderer": "MartiReference:Mustache",
|
||||
"url": "data/martilq_ckan.must"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,564 @@
|
|||
{
|
||||
"content-type": "application/vnd.martilq.json",
|
||||
"title": "Australian BSB source",
|
||||
"uid": "ae5d4d4b-5a7f-494d-8629-a0ced5bc7ba0",
|
||||
"description": "The original files are published on the APN FTP site and have been copied to a web server",
|
||||
"modified": "2021-11-05",
|
||||
"publisher": "Australian Payment Network",
|
||||
"contactPoint": "",
|
||||
"accessLevel": "Confidential",
|
||||
"rights": "Restricted",
|
||||
"tags": [],
|
||||
"license": "",
|
||||
"state": "active",
|
||||
"batch": 1.0,
|
||||
"describedBy": "",
|
||||
"landingPage": "https://bsb.auspaynet.com.au/public/BSB_DB.NSF/publicBSB.xsp",
|
||||
"theme": "",
|
||||
"resources": [
|
||||
{
|
||||
"title": "BSBDirectoryOct21-307",
|
||||
"uid": "0c2ee577-3fbb-46b9-bcc6-40eae069569c",
|
||||
"documentName": "BSBDirectoryOct21-307.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-11-01T09:00:45",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1352205,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "dd01585bed7a0b6da5d4deb5dff70a4b8ccfee873cf0454f2a46910c3275f03e",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15054
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectorySep21-306",
|
||||
"uid": "900e815a-e052-4198-9d92-e0f1aac07616",
|
||||
"documentName": "BSBDirectorySep21-306.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-10-01T09:00:48",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1351281,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "4f5c97799f6006247fad64f9a5acc425e79f31342cbbbdaaba2995af16ac56b4",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15050
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryAug21-305",
|
||||
"uid": "2ebda69a-8eef-4eb4-817d-a78e38bf5141",
|
||||
"documentName": "BSBDirectoryAug21-305.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-09-01T09:00:43",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1352016,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "26e40760989ff8a314cda70628c38b66d0d565ea8ad677b81b83780e33984104",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15055
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryJul21-304",
|
||||
"uid": "1af01fb4-003e-4179-bb26-e74a543bc837",
|
||||
"documentName": "BSBDirectoryJul21-304.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-08-05T09:00:46",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1351065,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "5306b8baaafaf60600b645f3514dde3f654ac2b0bdbae96b0d0501b18488b1b5",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15044
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryJun21-303",
|
||||
"uid": "e37d8ab5-e733-458d-a0b5-72368a8e201a",
|
||||
"documentName": "BSBDirectoryJun21-303.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-07-01T09:00:48",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1350547,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "77a1274fe6d7d239540b434b26e57c41a9d5a38b86bdb9f7e86a7874af5e8fef",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15042
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryMay21-302",
|
||||
"uid": "69681b42-2950-4878-a932-cbda107677ec",
|
||||
"documentName": "BSBDirectoryMay21-302.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-06-01T09:00:52",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1350255,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "f978eeb1a8939206a2794eccabd54f1285edb77fd5d1994b42b24fb813a21a77",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15040
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryApr21-301",
|
||||
"uid": "8f10458d-6256-457f-ae90-77b8286b88ba",
|
||||
"documentName": "BSBDirectoryApr21-301.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-05-03T09:00:51",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1352037,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "9b170364f544e6fa92ed1abe40d726d1d43685fe61dd3e4796ed0b48a47644a8",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15064
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "BSBDirectoryMar21-300",
|
||||
"uid": "b5d88aa6-1b40-49eb-93c1-98a6e7d06007",
|
||||
"documentName": "BSBDirectoryMar21-300.csv",
|
||||
"issuedDate": "2021-11-05T20:58:03",
|
||||
"modified": "2021-04-01T09:00:55",
|
||||
"expires": "",
|
||||
"state": "active",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"length": 1353104,
|
||||
"hash": {
|
||||
"algo": "SHA256",
|
||||
"value": "8a566fb97e800b05dd5dec9cfd030f4f1fb10259714d33b22aaeb22788a6d19a",
|
||||
"signed": false
|
||||
},
|
||||
"description": "",
|
||||
"url": "",
|
||||
"version": "",
|
||||
"content-type": "text/csv",
|
||||
"encoding": null,
|
||||
"compression": null,
|
||||
"encryption": null,
|
||||
"attributes": [
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "header",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "footer",
|
||||
"function": "count",
|
||||
"comparison": "NA",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "separator",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "format",
|
||||
"name": "columns",
|
||||
"function": "value",
|
||||
"comparison": "NA",
|
||||
"value": ","
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "records",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 15065
|
||||
},
|
||||
{
|
||||
"category": "dataset",
|
||||
"name": "columns",
|
||||
"function": "count",
|
||||
"comparison": "EQ",
|
||||
"value": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"custom": [
|
||||
{
|
||||
"extension": "software",
|
||||
"softwareName": "MARTILQREFERENCE",
|
||||
"author": "Meerkat@merebox.com",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
<p>This <strong>martiLQ</strong> definition has been generated from CKAN data source <a href="{{item.landingPage}}">{{item.landingPage}}</a></p>
|
||||
<p>The publisher is {{item.publisher}} and the contact is {{item.contactPoint}}</p>
|
||||
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<tr><th>Title</th><td>{{item.title}}</td></tr>
|
||||
<tr><th>UID</th><td>{{item.uid}}</td></tr>
|
||||
<tr><th>Description</th><td>{{{describe}}}</td></tr>
|
||||
<tr><th>State</th><td>{{{item.state}}}</td></tr>
|
||||
<tr><th>Issued</th><td>{{item.issued}}</td></tr>
|
||||
<tr><th>Modified</th><td>{{item.modified}}</td></tr>
|
||||
<tr><th>Expires</th><td>{{item.expires}}</td></tr>
|
||||
<tr><th>Tags</th><td>{{item.tags}}</td></tr>
|
||||
<tr><th>Access Level</th><td>{{item.accessLevel}}</td></tr>
|
||||
<tr><th>Rights</th><td>{{item.rights}}</td></tr>
|
||||
<tr><th>License</th><td>{{item.license}}</td></tr>
|
||||
</table>
|
||||
|
||||
{{#item}}
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<th>Title</th><th>Document</th><th>Size</th><th>Issued</th><th>Modified</th><th>Format</th><th>State</th><th>Version</th>
|
||||
<thead>
|
||||
<tbody>
|
||||
{{#resources}}
|
||||
<tr>
|
||||
<td>{{title}}</td>
|
||||
<td><a href="{{url}}">{{documentName}}</a></td>
|
||||
<td>{{length}}</td>
|
||||
<td>{{issuedDate}}</td>
|
||||
<td>{{modified}}</td>
|
||||
<td>{{format}}</td>
|
||||
<td>{{state}}</td>
|
||||
<td>{{version}}</td>
|
||||
</tr>
|
||||
{{/resources}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/item}}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
<p>This is a custom template file</p>
|
||||
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<tr><th>Title</th><td>{{item.title}}</td></tr>
|
||||
<tr><th>UID</th><td>{{item.uid}}</td></tr>
|
||||
<tr><th>Description</th><td>{{{describe}}}</td></tr>
|
||||
<tr><th>Issued</th><td>{{item.issued}}</td></tr>
|
||||
<tr><th>Modified</th><td>{{item.modified}}</td></tr>
|
||||
<tr><th>Access Level</th><td>{{item.accessLevel}}</td></tr>
|
||||
<tr><th>Rights</th><td>{{item.rights}}</td></tr>
|
||||
</table>
|
||||
|
||||
{{#item}}
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<th>Title</th><th>Document</th><th>Size</th><th>Issued</th><th>Modified</th><th>Expires</th><th>State</th><th>Version</th>
|
||||
<thead>
|
||||
<tbody>
|
||||
{{#resources}}
|
||||
<tr>
|
||||
<td>{{title}}</td>
|
||||
<td><a href="{{url}}">{{documentName}}</a></td>
|
||||
<td>{{length}}</td>
|
||||
<td>{{issuedDate}}</td>
|
||||
<td>{{modified}}</td>
|
||||
<td>{{expires}}</td>
|
||||
<td>{{state}}</td>
|
||||
<td>{{version}}</td>
|
||||
</tr>
|
||||
{{/resources}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/item}}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<tr><th>Title</th><td>{{item.title}}</td></tr>
|
||||
<tr><th>UID</th><td>{{item.uid}}</td></tr>
|
||||
<tr><th>Description</th><td>{{{describe}}}</td></tr>
|
||||
<tr><th>State</th><td>{{{item.state}}}</td></tr>
|
||||
<tr><th>Issued</th><td>{{item.issued}}</td></tr>
|
||||
<tr><th>Modified</th><td>{{item.modified}}</td></tr>
|
||||
<tr><th>Expires</th><td>{{item.expires}}</td></tr>
|
||||
<tr><th>Tags</th><td>{{item.tags}}</td></tr>
|
||||
<tr><th>Access Level</th><td>{{item.accessLevel}}</td></tr>
|
||||
<tr><th>Rights</th><td>{{item.rights}}</td></tr>
|
||||
<tr><th>License</th><td>{{item.license}}</td></tr>
|
||||
</table>
|
||||
|
||||
{{#item}}
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<th>Title</th><th>Document</th><th>Size</th><th>Issued</th><th>Modified</th><th>Format</th><th>State</th><th>Version</th>
|
||||
<thead>
|
||||
<tbody>
|
||||
{{#resources}}
|
||||
<tr>
|
||||
<td>{{title}}</td>
|
||||
<td><a href="{{url}}">{{documentName}}</a></td>
|
||||
<td>{{length}}</td>
|
||||
<td>{{issuedDate}}</td>
|
||||
<td>{{modified}}</td>
|
||||
<td>{{format}}</td>
|
||||
<td>{{state}}</td>
|
||||
<td>{{version}}</td>
|
||||
</tr>
|
||||
{{/resources}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/item}}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"content-type": "application/vnd.martilq.json",
|
||||
"title": "",
|
||||
"title": "Sample martiLQ generatd framework file",
|
||||
"uid": "c525f5c5-ce87-4688-aa36-d0aa59d1e939",
|
||||
"description": "Sample execution",
|
||||
"description": "Sample execution of martiLQ execution",
|
||||
"issued": "2021-11-21T16:57:37",
|
||||
"modified": "2021-11-21T16:57:37",
|
||||
"expires": "",
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
"document",
|
||||
"marti"
|
||||
],
|
||||
"publisher": "VCOFF\\meerkat",
|
||||
"publisher": "meerkat",
|
||||
"contactPoint": "",
|
||||
"accessLevel": "Confidential",
|
||||
"rights": "Restricted",
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
web:
|
||||
hostname: martilq-web
|
||||
image: martilq-go-server:latest
|
||||
container_name: matilq-web
|
||||
|
||||
ports:
|
||||
- 8080:8080
|
||||
|
||||
volumes:
|
||||
- ./data:/home/data
|
||||
- ../../../docs:/home/docs
|
||||
Binary file not shown.
|
|
@ -11,43 +11,62 @@ import (
|
|||
|
||||
func main() {
|
||||
port := flag.String("p", "8080", "Http listen port")
|
||||
directory := flag.String("d", "static", "Static directory content")
|
||||
staticDirectory := flag.String("s", "static", "Static directory content")
|
||||
docsDirectory := flag.String("docs", "", "Docs directory content")
|
||||
dataDirectory := flag.String("data", "", "Data directory content")
|
||||
trace := flag.Bool("trace", false, "Produce trace logs")
|
||||
flag.Parse()
|
||||
|
||||
if *trace == true {
|
||||
log.Printf("static folder: %s\n", *staticDirectory)
|
||||
log.Printf("data folder: %s\n", *dataDirectory)
|
||||
log.Printf("docs folder: %s\n", *docsDirectory)
|
||||
}
|
||||
|
||||
http.HandleFunc("/data/", func( res http.ResponseWriter, req *http.Request ) {
|
||||
//log.Printf("Data file %s \n", req.URL.Path)
|
||||
http.ServeFile(res, req, req.URL.Path[1:]);
|
||||
safePath := ValidatePath(filepath.FromSlash(req.URL.Path[1:]))
|
||||
if (*dataDirectory != "") {
|
||||
safePath = filepath.FromSlash(filepath.Join(*dataDirectory, strings.Replace(safePath, "data/", "", 1)))
|
||||
}
|
||||
http.ServeFile(res, req, safePath)
|
||||
})
|
||||
|
||||
http.HandleFunc("/docs/", func( res http.ResponseWriter, req *http.Request ) {
|
||||
localPath := ""
|
||||
if (*docsDirectory == "") {
|
||||
temp := "../../.."
|
||||
docsDirectory = &temp
|
||||
localPath = ValidatePath(filepath.FromSlash(*docsDirectory+req.URL.Path))
|
||||
} else {
|
||||
localPath = ValidatePath(filepath.FromSlash(*docsDirectory+strings.Replace(req.URL.Path, "docs/", "", 1)))
|
||||
}
|
||||
if *trace == true {
|
||||
log.Printf("fetch docs: \"%s\"", localPath)
|
||||
}
|
||||
//log.Printf("Docs file %s \n", req.URL.Path)
|
||||
localPath := filepath.FromSlash(*docsDirectory+req.URL.Path)
|
||||
f, err := os.Open(localPath)
|
||||
if err != nil {
|
||||
http.ServeFile(res, req, filepath.FromSlash(*directory + "/404.html"));
|
||||
log.Printf("fetch docs error: \"%s\" with %s", localPath, err)
|
||||
http.ServeFile(res, req, filepath.FromSlash(*staticDirectory + "/404.html"));
|
||||
} else {
|
||||
s, err := f.Stat()
|
||||
if err != nil || s.IsDir() {
|
||||
http.ServeFile(res, req, filepath.FromSlash(*directory + "/404.html"));
|
||||
log.Printf("fetch docs stat error: \"%s\"", localPath)
|
||||
http.ServeFile(res, req, filepath.FromSlash(*staticDirectory + "/404.html"))
|
||||
} else {
|
||||
http.ServeFile(res, req, localPath);
|
||||
http.ServeFile(res, req, localPath)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
fileServer := http.FileServer(FileSystem{http.Dir(*directory)})
|
||||
fileServer := http.FileServer(FileSystem{http.Dir(*staticDirectory)})
|
||||
http.Handle("/", fileServer)
|
||||
|
||||
log.Printf("Serving \"%s\" on HTTP port: %s\n", *directory, *port)
|
||||
log.Printf("Serving on HTTP port: %s\n", *port)
|
||||
log.Fatal(http.ListenAndServe(":"+*port, nil))
|
||||
}
|
||||
|
||||
|
||||
|
||||
type FileSystem struct {
|
||||
fs http.FileSystem
|
||||
}
|
||||
|
|
@ -59,7 +78,6 @@ func (fs FileSystem) Open(path string) (http.File, error) {
|
|||
}
|
||||
|
||||
s, err := f.Stat()
|
||||
//log.Printf("File %s \n", path)
|
||||
if s.IsDir() {
|
||||
index := strings.TrimSuffix(path, "/") + "/index.html"
|
||||
if _, err := fs.fs.Open(index); err != nil {
|
||||
|
|
@ -68,4 +86,11 @@ func (fs FileSystem) Open(path string) (http.File, error) {
|
|||
}
|
||||
|
||||
return f, nil
|
||||
}
|
||||
|
||||
func ValidatePath(path string) string {
|
||||
|
||||
safePath := path
|
||||
|
||||
return safePath
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Hugo 0.88.1">
|
||||
<title>MartiLQ Definition</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="assets/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link href="css/dashboard.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="https://github.com/meerkat-manor/marti">MartiLQ</a>
|
||||
<input class="form-control form-control-dark w-100" type="text" placeholder="Load definition" aria-label="Load" id="loaddefinition">
|
||||
<button class="w-50 btn btn-primary" type="submit" id="loadBtn">Load</button>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
|
||||
<h2>MartiLQ definition</h2>
|
||||
<div class="table-responsive">
|
||||
<div class="output"></div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="bg-dark flex-md-nowrap p-0 shadow">
|
||||
|
||||
</footer>
|
||||
|
||||
<script src="assets/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>
|
||||
<script src="js/martilq_app.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -6,10 +6,10 @@
|
|||
<meta name="description" content="">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Hugo 0.88.1">
|
||||
<title>MartiLQ Dashboard</title>
|
||||
<title>MartiLQ Definition</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="assets/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="assets/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.bd-placeholder-img {
|
||||
|
|
@ -26,17 +26,12 @@
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="css/dashboard.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#">Meerkat Manor</a>
|
||||
<input class="form-control form-control-dark w-100" type="text" placeholder="Load definition" aria-label="Load" id="loaddefinition">
|
||||
<button class="w-50 btn btn-primary" type="submit" id="loadBtn">Load</button>
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="https://github.com/meerkat-manor/marti">MartiLQ</a>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
|
@ -46,21 +41,48 @@
|
|||
|
||||
<h2>MartiLQ definition</h2>
|
||||
<div class="table-responsive">
|
||||
<div class="output"></div>
|
||||
|
||||
<p>The following <string>martiLQ</string> definitions are provided as samples</p>
|
||||
<p>The <a href="https://github.com/meerkat-manor/marti">server code</a> for this is available and the code can be changed to reflect your actual or sample definitions</p>
|
||||
|
||||
<br>
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<th>Definition</th><th>Description</th>
|
||||
<thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td><a href="browse.html?martilq=martilq_afsl.json">martilq_afsl.json</a></td>
|
||||
<td>Australian Financial Services License sample</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="browse.html?martilq=martilq_asic.json">martilq_asic.json</a></td>
|
||||
<td>Australian Securities and Incetsments Commission adviser sample</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="browse.html?martilq=martilq_bsb.json">martilq_bsb.json</a></td>
|
||||
<td>Australian Payment Network BSB sample</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="browse.html?martilq=martilq_docs.json">martilq_docs.json</a></td>
|
||||
<td>MartiLQ documentation folder sample</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="bg-dark flex-md-nowrap p-0 shadow">
|
||||
<div class="row">
|
||||
<a target="_blank" href="https://icons8.com/icon/64141/internet">Internet</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
|
||||
<script src="assets/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/feather.min.js" integrity="sha384-uO3SXW5IuS1ZpFPKugNNWqTZRRglnUJK6UAZ/gxOX80nxEkN9NcGZTftn6RzhGWE" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js" integrity="sha384-zNy6FEbO50N+Cg5wap8IKA4M/ZnLJgzc6w2NqACZaK0u0FXfOWRRJOnQtpZun8ha" crossorigin="anonymous"></script>
|
||||
<script src="js/app.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,103 +0,0 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const output = document.querySelector(".output");
|
||||
var localJsonFile = "data/marti_test_asic.json";
|
||||
|
||||
var btn = document.getElementById("loadBtn");
|
||||
btn.onclick = dataLoadFunction;
|
||||
|
||||
function dataLoadFunction() {
|
||||
var loadDef = document.getElementById("loaddefinition")
|
||||
fetchData("data/"+loadDef.value);
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has('martilq')) {
|
||||
var loadDef = urlParams.get('martilq');
|
||||
fetchData("data/"+ loadDef);
|
||||
var ld = document.getElementById("loaddefinition")
|
||||
ld.value = loadDef
|
||||
} else {
|
||||
output.textContent = "Please supply a MartiLQ definition to load, such as \"marti_test_asic.json\"";
|
||||
}
|
||||
});
|
||||
|
||||
function fetchData(dataFile) {
|
||||
output.textContent = "Loading....";
|
||||
|
||||
fetch(dataFile)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
output.innerHTML = "";
|
||||
|
||||
var hdr = itemHeader(data)
|
||||
output.append(hdr);
|
||||
|
||||
const br = document.createElement("br");
|
||||
output.append(br);
|
||||
|
||||
const tble = document.createElement("table");
|
||||
tble.classList.add("table");
|
||||
tble.classList.add("table-striped");
|
||||
tble.classList.add("table-sm");
|
||||
|
||||
var thd = document.createElement("thead");
|
||||
var th = document.createElement("tr");
|
||||
//scope="col"
|
||||
th.innerHTML = "<th>Title</th><th>Document</th><th>Size</th><th>Issued</th><th>Modified</th><th>Expires</th><th>State</th><th>Version</th>";
|
||||
thd.append(th);
|
||||
tble.append(thd);
|
||||
|
||||
var tby = document.createElement("tbody");
|
||||
data.resources.forEach((el) => {
|
||||
//console.log(el);
|
||||
jsonList(tby, el);
|
||||
});
|
||||
tble.append(tby);
|
||||
output.append(tble);
|
||||
});
|
||||
}
|
||||
|
||||
function jsonList(tble, item) {
|
||||
const tr = document.createElement("tr");
|
||||
tr.innerHTML = itemRow(item);
|
||||
tble.append(tr);
|
||||
}
|
||||
|
||||
|
||||
function itemHeader(item) {
|
||||
|
||||
const hdr = document.createElement("table");
|
||||
hdr.classList.add("table");
|
||||
hdr.classList.add("table-striped");
|
||||
hdr.classList.add("table-sm");
|
||||
|
||||
var describe = item.description.replace(/\r\n/g, "<br>");
|
||||
var rows = `<tr><th>Title</th><td>${item.title}</td></tr>`;
|
||||
rows = rows+ `<tr><th>UID</th><td>${item.uid}</td></tr>`;
|
||||
rows = rows+ `<tr><th>Description</th><td>${describe}</td></tr>`;
|
||||
rows = rows+ `<tr><th>Issued</th><td>${item.issued}</td></tr>`;
|
||||
rows = rows+ `<tr><th>Modified</th><td>${item.modified}</td></tr>`;
|
||||
rows = rows+ `<tr><th>Access Level</th><td>${item.accessLevel}</td></tr>`;
|
||||
rows = rows+ `<tr><th>Rights</th><td>${item.rights}</td></tr>`;
|
||||
hdr.innerHTML = rows;
|
||||
|
||||
return hdr
|
||||
}
|
||||
|
||||
|
||||
function itemRow(item) {
|
||||
|
||||
var row = `<td>${item.title}</td>`;
|
||||
row = row + `<td><a href="${item.url}">${item.documentName}</a></td>`;
|
||||
row = row + `<td>${item.length}</td>`;
|
||||
row = row + `<td>${item.issuedDate}</td>`;
|
||||
row = row + `<td>${item.modified}</td>`;
|
||||
row = row + `<td>${item.expires}</td>`;
|
||||
row = row + `<td>${item.state}</td>`;
|
||||
row = row + `<td>${item.version}</td>`;
|
||||
|
||||
return row
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const output = document.querySelector(".output");
|
||||
var localJsonFile = "data/marti_test_asic.json";
|
||||
|
||||
var btn = document.getElementById("loadBtn");
|
||||
btn.onclick = dataLoadFunction;
|
||||
|
||||
function dataLoadFunction() {
|
||||
var loadDef = document.getElementById("loaddefinition")
|
||||
if (loadDef.value.startsWith("http://") || loadDef.value.startsWith("https://")) {
|
||||
fetchData(loadDef.value);
|
||||
} else {
|
||||
fetchData("data/"+ loadDef.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var definition_must = "";
|
||||
var jdata = {};
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has('martilq')) {
|
||||
var loadDef = urlParams.get('martilq');
|
||||
if (loadDef.startsWith("http://") || loadDef.startsWith("https://")) {
|
||||
fetchData(loadDef);
|
||||
} else {
|
||||
fetchData("data/"+ loadDef);
|
||||
}
|
||||
var ld = document.getElementById("loaddefinition")
|
||||
ld.value = loadDef
|
||||
} else {
|
||||
output.innerHTML = "Please supply a MartiLQ definition to load, such as \"<a href=\"?martilq=martilq_asic.json\">martilq_asic.json</a>\"";
|
||||
}
|
||||
});
|
||||
|
||||
function fetchData(dataFile) {
|
||||
output.textContent = "Loading....";
|
||||
|
||||
fetch(dataFile)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
|
||||
var template = "data/martilq_def.must";
|
||||
jdata["item"] = data;
|
||||
jdata["describe"] = data.description.replace(/\r\n/g, "<br>");
|
||||
|
||||
if (data["custom"]) {
|
||||
data.custom.forEach((el) => {
|
||||
if (el.extension == "template" && el.renderer == "MartiReference:Mustache") {
|
||||
template = el.url;
|
||||
}
|
||||
});
|
||||
}
|
||||
// Use the template
|
||||
fetchMust(template);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function fetchMust(mustTemplateFile) {
|
||||
|
||||
fetch(mustTemplateFile)
|
||||
.then((response) => response.text())
|
||||
.then((data) => {
|
||||
definition_must = data
|
||||
|
||||
const dMust = document.createElement("div");
|
||||
dMust.innerHTML = Mustache.render(definition_must, jdata);
|
||||
output.innerHTML = "";
|
||||
output.append(dMust);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ $oMarti.tags += "ckan"
|
|||
$oMarti.tags += "gov"
|
||||
$oMarti.tags += "au"
|
||||
$oMarti.publisher = "Australian Securities and Investments Commission (ASIC)"
|
||||
$oMarti.landingPage = "https://data.gov.au/dataset/ds-dga-ab7eddce-84df-4098-bc8f-500d0d9776d1/details?q=AFS%20Licensee%20Dataset%20extract%20as"
|
||||
$x = ConvertTo-Json -InputObject $oMarti -Depth 5
|
||||
Set-Content -Path $outFile -Value $x
|
||||
Write-Host "Wrote converted definition to: $outFile"
|
||||
|
|
|
|||
Loading…
Reference in New Issue