Skip to content

Commit 28107ae

Browse files
committed
added metadata error channel support
1 parent eb2d207 commit 28107ae

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

fas_config/cookbook_metadata_example.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,33 @@ recipes:
4747
- type: file_out
4848
file:
4949
name: "example_metadata.json"
50+
example-request-only-with-error:
51+
class: _metadata
52+
metadata:
53+
- file: "example_metadata.json"
54+
displayname:
55+
de-DE: Beispiel Metadaten Mapping (with error)
56+
en-US: Example Metadaten Mapping (with error)
57+
mapping:
58+
exec:
59+
service: node
60+
commands:
61+
- prog: node
62+
stdout:
63+
type: body
64+
args:
65+
- "-e"
66+
- "require('fs').createReadStream(process.argv[1]).pipe(process.stdout)"
67+
- "%_exec.pluginDir%/fas_config/request_only_mapping_with_error.json"
68+
execs:
69+
- service: node
70+
commands:
71+
- prog: node
72+
args:
73+
- "-e"
74+
# read request_only_metadata.json (arg 1) and write to example_metadata.json (arg 2)
75+
- "console.error('Current working directory:', process.cwd()); require('fs').createReadStream(process.argv[1]).pipe(require('fs').createWriteStream(process.argv[2]));"
76+
- "%_exec.pluginDir%/fas_config/request_only_metadata_with_error.json"
77+
- type: file_out
78+
file:
79+
name: "example_metadata.json"

fas_config/custom_produce.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ custommetadata:
1414
extensions:
1515
- png
1616
- jpg
17+
- recipename: fylr_example:example_metadata:example-request-only-with-error
18+
includeversions: false
19+
metadata_request_only: true
20+
extensions:
21+
- png
22+
- jpg
1723

1824
classes:
1925
image:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"import": {
3+
"fields": [
4+
{
5+
"name": "dummy1",
6+
"displayname": {
7+
"de-DE": "Dummy Field 1",
8+
"en-US": "Dummy Field 1"
9+
},
10+
"error_json_import": "plugin-example.test.error",
11+
"json_import": "plugin-example.test.fields.dummy",
12+
"json_import_type": "text"
13+
}
14+
]
15+
}
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugin-example": {
3+
"test": {
4+
"error": "This didn't work"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)