Merge branch 'Development' of code-repo.d4science.org:MaDgiK-CITE/argos into Development
This commit is contained in:
commit
90b49194ac
|
@ -82,8 +82,11 @@ public class RemoteFetcherUtils {
|
|||
if (jarr.get(0) instanceof String) {
|
||||
return jarr.get(0).toString();
|
||||
} else {
|
||||
return ((Map<String, String>)jarr.get(0)).get("content");
|
||||
|
||||
for (Object o : jarr) {
|
||||
if ((o instanceof Map) && ((Map) o).containsKey("content")) {
|
||||
return ((Map<String, String>) o).get("content");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (value instanceof Map) {
|
||||
return ((Map<String, String>)value).get("content");
|
||||
|
|
|
@ -248,7 +248,7 @@ public class WordBuilder {
|
|||
if (field.getValue() != null && !field.getValue().toString().isEmpty()) {
|
||||
this.indent = indent;
|
||||
String format = this.formatter(field);
|
||||
if(format != null){
|
||||
if(format != null && !format.isEmpty()){
|
||||
if(format.charAt(0) == '['){
|
||||
format = format.substring(1, format.length() - 1).replaceAll(",", ", ");
|
||||
}
|
||||
|
@ -310,6 +310,9 @@ public class WordBuilder {
|
|||
|
||||
private String formatter(Field field) throws IOException {
|
||||
String comboboxType = null;
|
||||
if (field.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
switch (field.getViewStyle().getRenderStyle()) {
|
||||
case "researchers":
|
||||
case "projects":
|
||||
|
@ -388,12 +391,15 @@ public class WordBuilder {
|
|||
case "datepicker":
|
||||
case "datePicker":{
|
||||
Instant instant;
|
||||
try {
|
||||
instant = Instant.parse((String) field.getValue());
|
||||
} catch (DateTimeParseException ex) {
|
||||
instant = Instant.from(DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).parse((String)field.getValue()));
|
||||
if (!((String)field.getValue()).isEmpty()) {
|
||||
try {
|
||||
instant = Instant.parse((String) field.getValue());
|
||||
} catch (DateTimeParseException ex) {
|
||||
instant = Instant.from(DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).parse((String) field.getValue()));
|
||||
}
|
||||
return field.getValue() != null ? DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(instant) : "";
|
||||
}
|
||||
return field.getValue() != null ? DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(instant) : "";
|
||||
return (String) field.getValue();
|
||||
}
|
||||
case "freetext":
|
||||
case "textarea":
|
||||
|
|
Loading…
Reference in New Issue