[WIP] refactor dmp export following the blueprint schema
This commit is contained in:
parent
cd80e78e40
commit
6073c4cd85
|
@ -50,8 +50,8 @@ import eu.eudat.models.data.dmp.*;
|
||||||
import eu.eudat.models.data.doi.DepositRequest;
|
import eu.eudat.models.data.doi.DepositRequest;
|
||||||
import eu.eudat.models.data.doi.Doi;
|
import eu.eudat.models.data.doi.Doi;
|
||||||
import eu.eudat.models.data.dynamicfields.DynamicFieldWithValue;
|
import eu.eudat.models.data.dynamicfields.DynamicFieldWithValue;
|
||||||
import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.DataManagementPlanProfile;
|
import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.*;
|
||||||
import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.Field;
|
import eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.types.FieldCategory;
|
||||||
import eu.eudat.models.data.funder.FunderDMPEditorModel;
|
import eu.eudat.models.data.funder.FunderDMPEditorModel;
|
||||||
import eu.eudat.models.data.grant.GrantDMPEditorModel;
|
import eu.eudat.models.data.grant.GrantDMPEditorModel;
|
||||||
import eu.eudat.models.data.helpermodels.Tuple;
|
import eu.eudat.models.data.helpermodels.Tuple;
|
||||||
|
@ -1251,116 +1251,271 @@ public class DataManagementPlanManager {
|
||||||
// wordBuilder.addParagraphContent("Datasets", document, ParagraphStyle.HEADER1, BigInteger.ZERO);
|
// wordBuilder.addParagraphContent("Datasets", document, ParagraphStyle.HEADER1, BigInteger.ZERO);
|
||||||
// // Space below Datasets.
|
// // Space below Datasets.
|
||||||
// XWPFParagraph parBreakDatasets = document.createParagraph();
|
// XWPFParagraph parBreakDatasets = document.createParagraph();
|
||||||
final Boolean isFinalized = dmpEntity.getStatus() == DMP.DMPStatus.FINALISED.getValue();
|
|
||||||
final Boolean isPublic = dmpEntity.isPublic();
|
|
||||||
dmpEntity.getDataset().stream()
|
|
||||||
.filter(item -> item.getStatus() != Dataset.Status.CANCELED.getValue())
|
|
||||||
.filter(item -> item.getStatus() != Dataset.Status.DELETED.getValue())
|
|
||||||
.filter(item -> !isPublic && !isFinalized || item.getStatus() == Dataset.Status.FINALISED.getValue())
|
|
||||||
.sorted(Comparator.comparing(Dataset::getCreated))
|
|
||||||
.forEach(datasetEntity -> {
|
|
||||||
Map<String, Object> properties = new HashMap<>();
|
|
||||||
if (datasetEntity.getProperties() != null) {
|
|
||||||
//ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
try {
|
|
||||||
properties = objectMapper.readValue(datasetEntity.getProperties(), LinkedHashMap.class);
|
|
||||||
} catch (IOException e) {
|
|
||||||
logger.error(e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
/*JSONObject jObject = new JSONObject(datasetEntity.getProperties());
|
|
||||||
properties = jObject.toMap();*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// Custom style for the Dataset title.
|
DMPProfile dmpProfile = dmpEntity.getProfile();
|
||||||
//wordBuilder.addParagraphContent("Title: " + datasetEntity.getLabel(), document, ParagraphStyle.HEADER1, BigInteger.ZERO);
|
DataManagementPlanBlueprintListingModel dmpBlueprintModel = new DataManagementPlanBlueprintListingModel();
|
||||||
XWPFParagraph datasetLabelParagraph = document.createParagraph();
|
dmpBlueprintModel.fromDataModel(dmpProfile);
|
||||||
// datasetLabelParagraph.setStyle("Heading2");
|
DataManagementPlanBlueprint dmpBlueprint = dmpBlueprintModel.getDefinition();
|
||||||
datasetLabelParagraph.setSpacingBetween(1.0);
|
for(Section section: dmpBlueprint.getSections()){
|
||||||
XWPFRun runDatasetTitle1 = datasetLabelParagraph.createRun();
|
wordBuilder.addParagraphContent("Section " + section.getOrdinal(), document, ParagraphStyle.HEADER1, BigInteger.ZERO, 0);
|
||||||
runDatasetTitle1.setText("Title: ");
|
XWPFParagraph sectionInfoParagraph = document.createParagraph();
|
||||||
runDatasetTitle1.setColor("000000");
|
sectionInfoParagraph.setSpacingBetween(1.0);
|
||||||
//runDatasetTitle1.setBold(true);
|
XWPFRun runSectionTitle = sectionInfoParagraph.createRun();
|
||||||
//runDatasetTitle1.setFontSize(12);
|
runSectionTitle.setText("Title: ");
|
||||||
XWPFRun runDatasetTitle = datasetLabelParagraph.createRun();
|
runSectionTitle.setColor("000000");
|
||||||
runDatasetTitle.setText(datasetEntity.getLabel());
|
XWPFRun runSectionTitleText = sectionInfoParagraph.createRun();
|
||||||
runDatasetTitle.setColor("116a78");
|
runSectionTitleText.setText(section.getLabel());
|
||||||
//runDatasetTitle.setBold(true);
|
runSectionTitleText.setColor("116a78");
|
||||||
//runDatasetTitle.setFontSize(12);
|
XWPFParagraph sectionDescriptionParagraph = document.createParagraph();
|
||||||
|
XWPFRun runSectionDescription = sectionDescriptionParagraph.createRun();
|
||||||
|
runSectionDescription.setText("Description: ");
|
||||||
|
runSectionDescription.setColor("000000");
|
||||||
|
XWPFRun runSectionDescriptionText = sectionDescriptionParagraph.createRun();
|
||||||
|
runSectionDescriptionText.setText(section.getDescription());
|
||||||
|
runSectionDescriptionText.setColor("116a78");
|
||||||
|
|
||||||
XWPFParagraph datasetTemplateParagraph = document.createParagraph();
|
wordBuilder.addParagraphContent("Section Fields", document, ParagraphStyle.HEADER2, BigInteger.ZERO, 0);
|
||||||
// datasetTemplateParagraph.setStyle("Heading3");
|
section.getFields().sort(Comparator.comparingInt(FieldModel::getOrdinal));
|
||||||
XWPFRun runDatasetTemplate1 = datasetTemplateParagraph.createRun();
|
for(FieldModel field: section.getFields()){
|
||||||
runDatasetTemplate1.setText("Template: ");
|
if(field.getCategory() == FieldCategory.SYSTEM){
|
||||||
runDatasetTemplate1.setColor("000000");
|
SystemField systemField = field.toSystemField();
|
||||||
//runDatasetTemplate1.setBold(true);
|
XWPFParagraph systemFieldParagraph = document.createParagraph();
|
||||||
//runDatasetTemplate1.setFontSize(12);
|
systemFieldParagraph.setSpacingBetween(1.0);
|
||||||
XWPFRun runDatasetTemplate = datasetTemplateParagraph.createRun();
|
XWPFRun runSyStemFieldTitle = systemFieldParagraph.createRun();
|
||||||
runDatasetTemplate.setText(datasetEntity.getProfile().getLabel());
|
runSyStemFieldTitle.setText("Title: ");
|
||||||
runDatasetTemplate.setColor("116a78");
|
runSyStemFieldTitle.setColor("000000");
|
||||||
//runDatasetTemplate.setBold(true);
|
XWPFRun runSystemFieldTitleText = systemFieldParagraph.createRun();
|
||||||
//runDatasetTemplate.setFontSize(12);
|
runSystemFieldTitleText.setText(systemField.getLabel());
|
||||||
|
runSystemFieldTitleText.setColor("116a78");
|
||||||
|
if(systemField.getDescription() != null && !systemField.getDescription().isEmpty()){
|
||||||
|
XWPFParagraph systemFieldDescription = document.createParagraph();
|
||||||
|
systemFieldDescription.setSpacingBetween(1.0);
|
||||||
|
XWPFRun runSyStemFieldDescription = systemFieldDescription.createRun();
|
||||||
|
runSyStemFieldDescription.setText("Description: ");
|
||||||
|
runSyStemFieldDescription.setColor("000000");
|
||||||
|
XWPFRun runSystemFieldDescriptionText = systemFieldDescription.createRun();
|
||||||
|
runSystemFieldDescriptionText.setText(systemField.getDescription());
|
||||||
|
runSystemFieldDescriptionText.setColor("116a78");
|
||||||
|
}
|
||||||
|
XWPFParagraph systemFieldInput = document.createParagraph();
|
||||||
|
systemFieldInput.setSpacingBetween(1.0);
|
||||||
|
XWPFRun runInput = systemFieldInput.createRun();
|
||||||
|
runInput.setText("Input: ");
|
||||||
|
runInput.setColor("000000");
|
||||||
|
switch (systemField.getType()) {
|
||||||
|
case TEXT:
|
||||||
|
XWPFRun runTitle = systemFieldInput.createRun();
|
||||||
|
runTitle.setText(dmpEntity.getLabel());
|
||||||
|
runTitle.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case HTML_TEXT:
|
||||||
|
XWPFRun runDescription = systemFieldInput.createRun();
|
||||||
|
runDescription.setText(dmpEntity.getDescription());
|
||||||
|
runDescription.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case RESEARCHERS:
|
||||||
|
for(Researcher researcher: dmpEntity.getResearchers()){
|
||||||
|
XWPFRun runResearcher = systemFieldInput.createRun();
|
||||||
|
runResearcher.setText("• " + researcher.getLabel());
|
||||||
|
runResearcher.setColor("116a78");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ORGANIZATIONS:
|
||||||
|
for(Organisation organisation: dmpEntity.getOrganisations()){
|
||||||
|
XWPFRun runOrganisation = systemFieldInput.createRun();
|
||||||
|
runOrganisation.setText("• " + organisation.getLabel());
|
||||||
|
runOrganisation.setColor("116a78");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LANGUAGE:
|
||||||
|
XWPFRun runLanguage = systemFieldInput.createRun();
|
||||||
|
runLanguage.setText(objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class).get("language").toString());
|
||||||
|
runLanguage.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case CONTACT:
|
||||||
|
XWPFRun runContact = systemFieldInput.createRun();
|
||||||
|
runContact.setText(dmpEntity.getCreator().getName());
|
||||||
|
runContact.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case FUNDER:
|
||||||
|
XWPFRun runFunder = systemFieldInput.createRun();
|
||||||
|
runFunder.setText(dmpEntity.getGrant().getFunder().getLabel());
|
||||||
|
runFunder.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case GRANT:
|
||||||
|
XWPFRun runGrant = systemFieldInput.createRun();
|
||||||
|
runGrant.setText(dmpEntity.getGrant().getLabel());
|
||||||
|
runGrant.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case PROJECT:
|
||||||
|
XWPFRun runProject = systemFieldInput.createRun();
|
||||||
|
runProject.setText(dmpEntity.getProject().getLabel());
|
||||||
|
runProject.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case LICENSE:
|
||||||
|
XWPFRun runLicense = systemFieldInput.createRun();
|
||||||
|
runLicense.setText(objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class).get("license").toString());
|
||||||
|
runLicense.setColor("116a78");
|
||||||
|
break;
|
||||||
|
case ACCESS_RIGHTS:
|
||||||
|
XWPFRun runAccessRights = systemFieldInput.createRun();
|
||||||
|
runAccessRights.setText(objectMapper.readValue(dmpEntity.getExtraProperties(), HashMap.class).get("visible").toString());
|
||||||
|
runAccessRights.setColor("116a78");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
document.createParagraph();
|
||||||
|
}
|
||||||
|
else if(field.getCategory() == FieldCategory.EXTRA){
|
||||||
|
ExtraField extraField = field.toExtraField();
|
||||||
|
XWPFParagraph extraFieldParagraph = document.createParagraph();
|
||||||
|
extraFieldParagraph.setSpacingBetween(1.0);
|
||||||
|
XWPFRun runExtraFieldLabel = extraFieldParagraph.createRun();
|
||||||
|
runExtraFieldLabel.setText(extraField.getLabel());
|
||||||
|
runExtraFieldLabel.setColor("116a78");
|
||||||
|
if(extraField.getDescription() != null && !extraField.getDescription().isEmpty()){
|
||||||
|
XWPFRun runExtraFieldDescription = extraFieldParagraph.createRun();
|
||||||
|
runExtraFieldDescription.setText(extraField.getDescription());
|
||||||
|
runExtraFieldDescription.setColor("116a78");
|
||||||
|
}
|
||||||
|
XWPFRun runExtraFieldInput = extraFieldParagraph.createRun();
|
||||||
|
runExtraFieldInput.setText(extraField.getLabel());
|
||||||
|
runExtraFieldInput.setColor("116a78");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.createParagraph();
|
if(!section.getDescriptionTemplates().isEmpty()){
|
||||||
|
wordBuilder.addParagraphContent("Section descriptions", document, ParagraphStyle.HEADER2, BigInteger.ZERO, 0);
|
||||||
|
wordBuilder.addParagraphContent("Description Templates", document, ParagraphStyle.HEADER4, BigInteger.ZERO, 0);
|
||||||
|
for(eu.eudat.models.data.entities.xmlmodels.dmpprofiledefinition.DescriptionTemplate descriptionTemplate: section.getDescriptionTemplates()){
|
||||||
|
XWPFParagraph templateParagraph = document.createParagraph();
|
||||||
|
XWPFRun runTemplateLabel = templateParagraph.createRun();
|
||||||
|
runTemplateLabel.setText("• " + descriptionTemplate.getLabel());
|
||||||
|
runTemplateLabel.setColor("116a78");
|
||||||
|
}
|
||||||
|
|
||||||
// /*XWPFParagraph externalReferencesParagraph = document.createParagraph();
|
final Boolean isFinalized = dmpEntity.getStatus() == DMP.DMPStatus.FINALISED.getValue();
|
||||||
// externalReferencesParagraph.setStyle("Heading3");
|
final Boolean isPublic = dmpEntity.isPublic();
|
||||||
// XWPFRun externalReferencesRun = externalReferencesParagraph.createRun();
|
dmpEntity.getDataset().stream()
|
||||||
// externalReferencesRun.setText("External References");
|
.filter(item -> item.getStatus() != Dataset.Status.CANCELED.getValue())
|
||||||
// externalReferencesRun.setColor("2E75B6");
|
.filter(item -> item.getStatus() != Dataset.Status.DELETED.getValue())
|
||||||
// externalReferencesRun.setBold(true);
|
.filter(item -> !isPublic && !isFinalized || item.getStatus() == Dataset.Status.FINALISED.getValue())
|
||||||
// externalReferencesRun.setFontSize(12);
|
.filter(item -> item.getDmpSectionIndex().equals(section.getOrdinal() - 1))
|
||||||
|
.sorted(Comparator.comparing(Dataset::getCreated))
|
||||||
|
.forEach(datasetEntity -> {
|
||||||
|
Map<String, Object> properties = new HashMap<>();
|
||||||
|
if (datasetEntity.getProperties() != null) {
|
||||||
|
//ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
try {
|
||||||
|
properties = objectMapper.readValue(datasetEntity.getProperties(), LinkedHashMap.class);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
/*JSONObject jObject = new JSONObject(datasetEntity.getProperties());
|
||||||
|
properties = jObject.toMap();*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Dataset Description custom style.
|
||||||
|
XWPFParagraph datasetDescriptionParagraph = document.createParagraph();
|
||||||
|
datasetDescriptionParagraph.setStyle("Heading4");
|
||||||
|
datasetDescriptionParagraph.setSpacingBetween(1.5);
|
||||||
|
XWPFRun datasetDescriptionRun = datasetDescriptionParagraph.createRun();
|
||||||
|
datasetDescriptionRun.setText("Dataset Description");
|
||||||
|
//datasetDescriptionRun.setColor("2E75B6");
|
||||||
|
//datasetDescriptionRun.setBold(true);
|
||||||
|
datasetDescriptionRun.setFontSize(15);
|
||||||
|
|
||||||
|
|
||||||
|
// Custom style for the Dataset title.
|
||||||
|
//wordBuilder.addParagraphContent("Title: " + datasetEntity.getLabel(), document, ParagraphStyle.HEADER1, BigInteger.ZERO);
|
||||||
|
XWPFParagraph datasetLabelParagraph = document.createParagraph();
|
||||||
|
// datasetLabelParagraph.setStyle("Heading2");
|
||||||
|
datasetLabelParagraph.setSpacingBetween(1.0);
|
||||||
|
XWPFRun runDatasetTitle1 = datasetLabelParagraph.createRun();
|
||||||
|
runDatasetTitle1.setText("Title: ");
|
||||||
|
runDatasetTitle1.setColor("000000");
|
||||||
|
//runDatasetTitle1.setBold(true);
|
||||||
|
//runDatasetTitle1.setFontSize(12);
|
||||||
|
XWPFRun runDatasetTitle = datasetLabelParagraph.createRun();
|
||||||
|
runDatasetTitle.setText(datasetEntity.getLabel());
|
||||||
|
runDatasetTitle.setColor("116a78");
|
||||||
|
//runDatasetTitle.setBold(true);
|
||||||
|
//runDatasetTitle.setFontSize(12);
|
||||||
|
|
||||||
|
XWPFParagraph datasetTemplateParagraph = document.createParagraph();
|
||||||
|
// datasetTemplateParagraph.setStyle("Heading3");
|
||||||
|
XWPFRun runDatasetTemplate1 = datasetTemplateParagraph.createRun();
|
||||||
|
runDatasetTemplate1.setText("Template: ");
|
||||||
|
runDatasetTemplate1.setColor("000000");
|
||||||
|
//runDatasetTemplate1.setBold(true);
|
||||||
|
//runDatasetTemplate1.setFontSize(12);
|
||||||
|
XWPFRun runDatasetTemplate = datasetTemplateParagraph.createRun();
|
||||||
|
runDatasetTemplate.setText(datasetEntity.getProfile().getLabel());
|
||||||
|
runDatasetTemplate.setColor("116a78");
|
||||||
|
//runDatasetTemplate.setBold(true);
|
||||||
|
//runDatasetTemplate.setFontSize(12);
|
||||||
|
|
||||||
|
// /*XWPFParagraph externalReferencesParagraph = document.createParagraph();
|
||||||
|
// externalReferencesParagraph.setStyle("Heading3");
|
||||||
|
// XWPFRun externalReferencesRun = externalReferencesParagraph.createRun();
|
||||||
|
// externalReferencesRun.setText("External References");
|
||||||
|
// externalReferencesRun.setColor("2E75B6");
|
||||||
|
// externalReferencesRun.setBold(true);
|
||||||
|
// externalReferencesRun.setFontSize(12);
|
||||||
//
|
//
|
||||||
// wordBuilder.addParagraphContent("Data Repositories", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
// wordBuilder.addParagraphContent("Data Repositories", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
||||||
// if (datasetEntity.getDatasetDataRepositories().size() > 0) {
|
// if (datasetEntity.getDatasetDataRepositories().size() > 0) {
|
||||||
// wordBuilder.addParagraphContent(datasetEntity.getDatasetDataRepositories().stream().map(DatasetDataRepository::getDataRepository).map(DataRepository::getLabel).collect(Collectors.joining(", "))
|
// wordBuilder.addParagraphContent(datasetEntity.getDatasetDataRepositories().stream().map(DatasetDataRepository::getDataRepository).map(DataRepository::getLabel).collect(Collectors.joining(", "))
|
||||||
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
||||||
// }
|
// }
|
||||||
// wordBuilder.addParagraphContent("External Datasets", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
// wordBuilder.addParagraphContent("External Datasets", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
||||||
// if (datasetEntity.getDatasetExternalDatasets().size() > 0) {
|
// if (datasetEntity.getDatasetExternalDatasets().size() > 0) {
|
||||||
// wordBuilder.addParagraphContent(datasetEntity.getDatasetExternalDatasets().stream().map(DatasetExternalDataset::getExternalDataset).map(ExternalDataset::getLabel).collect(Collectors.joining(", "))
|
// wordBuilder.addParagraphContent(datasetEntity.getDatasetExternalDatasets().stream().map(DatasetExternalDataset::getExternalDataset).map(ExternalDataset::getLabel).collect(Collectors.joining(", "))
|
||||||
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
||||||
// }
|
// }
|
||||||
// wordBuilder.addParagraphContent("Registries", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
// wordBuilder.addParagraphContent("Registries", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
||||||
// if (datasetEntity.getRegistries().size() > 0) {
|
// if (datasetEntity.getRegistries().size() > 0) {
|
||||||
// wordBuilder.addParagraphContent(datasetEntity.getRegistries().stream().map(Registry::getLabel).collect(Collectors.joining(", "))
|
// wordBuilder.addParagraphContent(datasetEntity.getRegistries().stream().map(Registry::getLabel).collect(Collectors.joining(", "))
|
||||||
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
||||||
// }
|
// }
|
||||||
// wordBuilder.addParagraphContent("Services", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
// wordBuilder.addParagraphContent("Services", document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
||||||
// if (datasetEntity.getServices().size() > 0) {
|
// if (datasetEntity.getServices().size() > 0) {
|
||||||
// wordBuilder.addParagraphContent(datasetEntity.getServices().stream().map(DatasetService::getService).map(Service::getLabel).collect(Collectors.joining(", "))
|
// wordBuilder.addParagraphContent(datasetEntity.getServices().stream().map(DatasetService::getService).map(Service::getLabel).collect(Collectors.joining(", "))
|
||||||
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
// , document, ParagraphStyle.TEXT, BigInteger.ZERO);
|
||||||
// }
|
// }
|
||||||
// *//*wordBuilder.addParagraphContent("Tags", document, ParagraphStyle.HEADER3, BigInteger.ZERO);
|
// *//*wordBuilder.addParagraphContent("Tags", document, ParagraphStyle.HEADER3, BigInteger.ZERO);
|
||||||
// if (datasetEntity.().size() > 0) {
|
// if (datasetEntity.().size() > 0) {
|
||||||
// wordBuilder.addParagraphContent(datasetEntity.getServices().stream().map(DatasetService::getService).map(Service::getLabel).collect(Collectors.joining(", "))
|
// wordBuilder.addParagraphContent(datasetEntity.getServices().stream().map(DatasetService::getService).map(Service::getLabel).collect(Collectors.joining(", "))
|
||||||
// , document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
// , document, ParagraphStyle.HEADER4, BigInteger.ZERO);
|
||||||
// }*/
|
// }*/
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
wordBuilder.addParagraphContent(datasetEntity.getDescription(), document, ParagraphStyle.HTML, BigInteger.ZERO, 0);
|
|
||||||
|
|
||||||
// Dataset Description custom style.
|
XWPFParagraph datasetDescParagraph = document.createParagraph();
|
||||||
XWPFParagraph datasetDescriptionParagraph = document.createParagraph();
|
XWPFRun runDatasetDescription1 = datasetDescParagraph.createRun();
|
||||||
datasetDescriptionParagraph.setStyle("Heading4");
|
runDatasetDescription1.setText("Description: ");
|
||||||
datasetDescriptionParagraph.setSpacingBetween(1.5);
|
runDatasetDescription1.setColor("000000");
|
||||||
XWPFRun datasetDescriptionRun = datasetDescriptionParagraph.createRun();
|
XWPFRun runDatasetDescription = datasetDescParagraph.createRun();
|
||||||
datasetDescriptionRun.setText("Dataset Description");
|
runDatasetDescription.setText(datasetEntity.getProfile().getLabel());
|
||||||
//datasetDescriptionRun.setColor("2E75B6");
|
runDatasetDescription.setColor("116a78");
|
||||||
//datasetDescriptionRun.setBold(true);
|
//wordBuilder.addParagraphContent(datasetEntity.getDescription(), document, ParagraphStyle.HTML, BigInteger.ZERO, 0);
|
||||||
datasetDescriptionRun.setFontSize(15);
|
|
||||||
|
|
||||||
PagedDatasetProfile pagedDatasetProfile = datasetManager.getPagedProfile(dataset, datasetEntity);
|
document.createParagraph();
|
||||||
visibilityRuleService.setProperties(properties);
|
|
||||||
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
|
PagedDatasetProfile pagedDatasetProfile = datasetManager.getPagedProfile(dataset, datasetEntity);
|
||||||
try {
|
visibilityRuleService.setProperties(properties);
|
||||||
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
|
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
|
||||||
} catch (IOException e) {
|
try {
|
||||||
logger.error(e.getMessage(), e);
|
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
|
||||||
}
|
} catch (IOException e) {
|
||||||
// Page break at the end of the Dataset.
|
logger.error(e.getMessage(), e);
|
||||||
XWPFParagraph parBreakDataset = document.createParagraph();
|
}
|
||||||
parBreakDataset.setPageBreak(true);
|
// Page break at the end of the Dataset.
|
||||||
});
|
XWPFParagraph parBreakDataset = document.createParagraph();
|
||||||
|
parBreakDataset.setPageBreak(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // Removes the top empty headings.
|
// // Removes the top empty headings.
|
||||||
// for (int i = 0; i < 6; i++) {
|
// for (int i = 0; i < 6; i++) {
|
||||||
|
|
Loading…
Reference in New Issue