Fixes bug on DMP and Dataset export name.

This commit is contained in:
gkolokythas 2019-07-04 12:43:48 +03:00
parent 953e1e70b0
commit f5458de003
4 changed files with 4 additions and 5 deletions

View File

@ -248,7 +248,7 @@ public class DataManagementPlanManager {
});
String fileName = dmpEntity.getLabel();
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
File exportFile = new File(environment.getProperty("configuration.exportUrl") + fileName + ".docx");
File exportFile = new File(fileName + ".docx");
FileOutputStream out = new FileOutputStream(exportFile);
document.write(out);
out.close();

View File

@ -250,7 +250,7 @@ public class DatasetManager {
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
String label = datasetEntity.getLabel().replaceAll("[^a-zA-Z0-9+ ]", "");
File exportFile = new File(environment.getProperty("configuration.exportUrl") + label + ".docx");
File exportFile = new File(label + ".docx");
FileOutputStream out = new FileOutputStream(exportFile);
document.write(out);
out.close();
@ -291,7 +291,7 @@ public class DatasetManager {
byte[] queueResult = new RestTemplate().postForObject(environment.getProperty("pdf.converter.url") + "convert/office"
, requestEntity, byte[].class);
File resultPdf = new File(environment.getProperty("configuration.exportUrl") + label + ".pdf");
File resultPdf = new File(label + ".pdf");
FileOutputStream output = new FileOutputStream(resultPdf);
IOUtils.write(queueResult, output);
output.close();

View File

@ -60,7 +60,7 @@ public class DocumentManager {
visibilityRuleService.setProperties(properties);
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
File exportFile = new File(environment.getProperty("configuration.exportUrl") + dataset.getLabel() + ".docx");
File exportFile = new File(dataset.getLabel() + ".docx");
FileOutputStream out = new FileOutputStream(exportFile);
document.write(out);
out.close();

View File

@ -18,7 +18,6 @@ pdf.converter.url=http://localhost:88/
configuration.externalUrls=/tmp/ExternalUrls.xml
configuration.dynamicProjectUrl=/tmp/ProjectConfiguration.xml
configuration.h2020template=C:\\Users\\gkolokythas\\Documents\\openDmp\\dmp-backend\\web\\src\\main\\resources\\documents\\h2020.docx
configuration.exportUrl=C:\\Users\\gkolokythas\\Documents\\openDmp\\dmp-backend\\web\\src\\main\\exportFiles\\
#############TWITTER LOGIN CONFIGURATIONS#########
twitter.login.redirect_uri=http://127.0.0.1:4200/login/twitter