1. export redesign: multiplicity #ref 7834, multiple select #ref 7836
2. fix bug in license api export
This commit is contained in:
parent
3433f58506
commit
73be5d9a98
|
@ -167,7 +167,16 @@ public class PrefillingMapper {
|
|||
List<LicenseModel> licenses = licenseManager.getLicenses("", "");
|
||||
String finalParsedValue = parsedValue;
|
||||
licenses = licenses.stream().filter(license -> license.getPid().equals(finalParsedValue)).collect(Collectors.toList());
|
||||
properties.put(id, licenses);
|
||||
boolean isMultiAutocomplete = node.isArray() ? node.get(0).get("data").get("multiAutoComplete").booleanValue() : node.get("data").get("multiAutoComplete").booleanValue();
|
||||
if(isMultiAutocomplete){
|
||||
List<String> lic = new ArrayList<>();
|
||||
for(LicenseModel license: licenses){
|
||||
lic.add(mapper.writeValueAsString(license));
|
||||
}
|
||||
properties.put(id, mapper.writeValueAsString(lic));
|
||||
} else {
|
||||
properties.put(id, mapper.writeValueAsString(licenses.get(0)));
|
||||
}
|
||||
}
|
||||
catch (NoURLFound | HugeResultSet e){
|
||||
properties.put(id, parsedValue);
|
||||
|
|
|
@ -279,6 +279,7 @@ public class WordBuilder {
|
|||
for (FieldSet compositeField: compositeFields) {
|
||||
if (visibilityRuleService.isElementVisible(compositeField.getId()) && hasVisibleFields(compositeField, visibilityRuleService)) {
|
||||
char c = 'a';
|
||||
boolean hasMultiplicityItems = false;
|
||||
int paragraphPos = -1;
|
||||
if (compositeField.getTitle() != null && !compositeField.getTitle().isEmpty() && !createListing) {
|
||||
XWPFParagraph paragraph = addParagraphContent(page + "." + section + "." + (compositeField.getOrdinal() +1) + " " + compositeField.getTitle(), mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||
|
@ -286,10 +287,11 @@ public class WordBuilder {
|
|||
number.setVal(BigInteger.valueOf(indent));
|
||||
paragraphPos = mainDocumentPart.getPosOfParagraph(paragraph);
|
||||
if(compositeField.getMultiplicityItems() != null && !compositeField.getMultiplicityItems().isEmpty()){
|
||||
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||
addParagraphContent(c + ". ", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||
hasMultiplicityItems = true;
|
||||
}
|
||||
}
|
||||
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||
hasValue = createFields(compositeField.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService, hasMultiplicityItems);
|
||||
if(hasValue){
|
||||
returnedValue = true;
|
||||
}
|
||||
|
@ -298,9 +300,10 @@ public class WordBuilder {
|
|||
for (FieldSet multiplicityFieldset : list) {
|
||||
if(!createListing){
|
||||
c++;
|
||||
addParagraphContent(c + ".\n", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||
addParagraphContent(c + ". ", mainDocumentPart, ParagraphStyle.HEADER6, numId);
|
||||
hasMultiplicityItems = true;
|
||||
}
|
||||
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService);
|
||||
hasValue = createFields(multiplicityFieldset.getFields(), mainDocumentPart, 3, createListing, visibilityRuleService, hasMultiplicityItems);
|
||||
if(hasValue){
|
||||
returnedValue = true;
|
||||
}
|
||||
|
@ -319,19 +322,10 @@ public class WordBuilder {
|
|||
return returnedValue;
|
||||
}
|
||||
|
||||
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService) {
|
||||
private Boolean createFields(List<Field> fields, XWPFDocument mainDocumentPart, Integer indent, Boolean createListing, VisibilityRuleService visibilityRuleService, boolean hasMultiplicityItems) {
|
||||
if (createListing) this.addListing(mainDocumentPart, indent, false, false);
|
||||
boolean hasValue = false;
|
||||
List<Field> tempFields = fields.stream().sorted(Comparator.comparingInt(Field::getOrdinal)).collect(Collectors.toList());
|
||||
List<Field> formats = tempFields.stream().filter(f -> {
|
||||
try {
|
||||
String fTemp = this.formatter(f);
|
||||
return fTemp != null && !fTemp.isEmpty();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
for (Field field: tempFields) {
|
||||
if (visibilityRuleService.isElementVisible(field.getId()) && field.getExport()) {
|
||||
if (!createListing) {
|
||||
|
@ -346,13 +340,16 @@ public class WordBuilder {
|
|||
}
|
||||
}
|
||||
if(isImage){
|
||||
if (!field.getValue().toString().isEmpty()) {
|
||||
if (field.getValue() != null && !field.getValue().toString().isEmpty()) {
|
||||
XWPFParagraph paragraph = addParagraphContent(mapper.convertValue(field.getValue(), Map.class), mainDocumentPart, ParagraphStyle.IMAGE, numId);
|
||||
if (paragraph != null) {
|
||||
CTDecimalNumber number = paragraph.getCTP().getPPr().getNumPr().addNewIlvl();
|
||||
number.setVal(BigInteger.valueOf(indent));
|
||||
hasValue = true;
|
||||
}
|
||||
if(hasMultiplicityItems){
|
||||
hasMultiplicityItems = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -365,13 +362,19 @@ public class WordBuilder {
|
|||
format = getCommaSeparatedFormatsFromJson(format, "label");
|
||||
}
|
||||
if(format != null && !format.isEmpty()){
|
||||
if(format.charAt(0) == '['){
|
||||
format = format.substring(1, format.length() - 1).replaceAll(",", ", ");
|
||||
}
|
||||
if(formats.size() > 1){
|
||||
format = "\t• " + format;
|
||||
}
|
||||
Object hasMultiAutoComplete = mapper.convertValue(field.getData(), Map.class).get("multiAutoComplete");
|
||||
boolean isMultiAutoComplete = hasMultiAutoComplete != null && (boolean)hasMultiAutoComplete;
|
||||
boolean arrayStringFormat = format.charAt(0) == '[';
|
||||
if(arrayStringFormat || isMultiAutoComplete){
|
||||
List<String> values = (arrayStringFormat) ? Arrays.asList(format.substring(1, format.length() - 1).split(",[ ]*")) : Arrays.asList(format.split(",[ ]*"));
|
||||
if(values.size() > 1) {
|
||||
for (String val : values) {
|
||||
format = "• " + val;
|
||||
if(hasMultiplicityItems){
|
||||
mainDocumentPart.getLastParagraph().createRun().setText(format);
|
||||
hasMultiplicityItems = false;
|
||||
}
|
||||
else{
|
||||
XWPFParagraph paragraph = addParagraphContent(format, mainDocumentPart, field.getViewStyle().getRenderStyle().equals("richTextarea") ? ParagraphStyle.HTML : ParagraphStyle.TEXT, numId);
|
||||
if (paragraph != null) {
|
||||
CTDecimalNumber number = paragraph.getCTP().getPPr().getNumPr().addNewIlvl();
|
||||
|
@ -379,6 +382,27 @@ public class WordBuilder {
|
|||
hasValue = true;
|
||||
}
|
||||
}
|
||||
format = null;
|
||||
}
|
||||
}
|
||||
else if(values.size() == 1){
|
||||
format = values.get(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasMultiplicityItems){
|
||||
mainDocumentPart.getLastParagraph().createRun().setText(format);
|
||||
hasMultiplicityItems = false;
|
||||
}
|
||||
else{
|
||||
XWPFParagraph paragraph = addParagraphContent(format, mainDocumentPart, field.getViewStyle().getRenderStyle().equals("richTextarea") ? ParagraphStyle.HTML : ParagraphStyle.TEXT, numId);
|
||||
if (paragraph != null) {
|
||||
CTDecimalNumber number = paragraph.getCTP().getPPr().getNumPr().addNewIlvl();
|
||||
number.setVal(BigInteger.valueOf(indent));
|
||||
hasValue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
|
|
|
@ -27,27 +27,9 @@
|
|||
},
|
||||
{
|
||||
"enabled": false,
|
||||
"type": "",
|
||||
"type": "saml2",
|
||||
"configurableLoginId": "",
|
||||
"name": "",
|
||||
"spEntityId": "",
|
||||
"idpEntityId": "",
|
||||
"idpUrl": "",
|
||||
"idpArtifactUrl": "",
|
||||
"idpMetadataUrl": "",
|
||||
"assertionEncrypted": null,
|
||||
"keyFormat": "",
|
||||
"keyAlias": "",
|
||||
"credentialPath": "",
|
||||
"archivePassword": "",
|
||||
"keyPassword": "",
|
||||
"responseSigned": null,
|
||||
"assertionSigned": null,
|
||||
"usingFormat": "",
|
||||
"configurableUserFromAttributes": null,
|
||||
"attributeTypes": null,
|
||||
"binding": "",
|
||||
"logoUrl": ""
|
||||
"name": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue