Skip to content

Commit

Permalink
feat: make word exports of data access requests configurable (#4464)
Browse files Browse the repository at this point in the history
* feat: added default export-word json config files

* feat: array as table (default) or indented list

* feat: render html in word

* feat: word export styling

* feat: added word table style
  • Loading branch information
ymarcon authored Oct 28, 2024
1 parent e7294b6 commit 46e2ff6
Show file tree
Hide file tree
Showing 12 changed files with 939 additions and 58 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ else if ("latest".equals(revision))
return d;
}

public JSONObject getExportWordConfig() {
try {
String exportWordJson = getDefaultDataAccessFormResourceAsString("export-word.json");
return new JSONObject(exportWordJson);
} catch (JSONException e) {
return new JSONObject();
}
}

private void validateJsonObject(String json) {
try {
new JSONObject(json);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "000000"
},
"array": {
"layout": "table"
},
"documentTitle": {
"font": {
"family": "Arial",
"size": 20,
"italic": false,
"bold": true,
"color": "000000"
}
},
"h1": {
"font": {
"family": "Arial",
"size": 18,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h2": {
"font": {
"family": "Arial",
"size": 16,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h3": {
"font": {
"family": "Arial",
"size": 14,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h4": {
"font": {
"family": "Arial",
"size": 12,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h5": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": true,
"color": "757575"
}
},
"h6": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"field": {
"font": {
"family": "Courier",
"size": 10,
"italic": false,
"bold": true,
"color": "000000"
}
},
"title": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"help": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"value": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "000000"
}
},
"emptyValue": {
"visible": false,
"nullText": "N/A",
"font": {
"family": "Arial",
"size": 8,
"italic": true,
"bold": false,
"color": "666666"
}
},
"footer": {
"font": {
"family": "Arial",
"size": 8,
"italic": false,
"bold": false,
"color": "757575"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "000000"
},
"array": {
"layout": "table"
},
"documentTitle": {
"font": {
"family": "Arial",
"size": 20,
"italic": false,
"bold": true,
"color": "000000"
}
},
"h1": {
"font": {
"family": "Arial",
"size": 18,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h2": {
"font": {
"family": "Arial",
"size": 16,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h3": {
"font": {
"family": "Arial",
"size": 14,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h4": {
"font": {
"family": "Arial",
"size": 12,
"italic": false,
"bold": true,
"color": "0070c0"
}
},
"h5": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": true,
"color": "757575"
}
},
"h6": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"field": {
"font": {
"family": "Courier",
"size": 10,
"italic": false,
"bold": true,
"color": "000000"
}
},
"title": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"help": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "757575"
}
},
"value": {
"font": {
"family": "Arial",
"size": 10,
"italic": false,
"bold": false,
"color": "000000"
}
},
"emptyValue": {
"visible": false,
"nullText": "N/A",
"font": {
"family": "Arial",
"size": 8,
"italic": true,
"bold": false,
"color": "666666"
}
},
"footer": {
"font": {
"family": "Arial",
"size": 8,
"italic": false,
"bold": false,
"color": "757575"
}
}
}
Loading

0 comments on commit 46e2ff6

Please sign in to comment.