production configuration changes

This commit is contained in:
Diamantis Tziotzios 2018-10-08 10:04:59 +03:00
parent e0c302e67e
commit 9444d07833
7 changed files with 2379 additions and 2395 deletions

View File

@ -79,7 +79,7 @@ public class DatasetWizardController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = {"/getPDF/{id}"}) @RequestMapping(method = RequestMethod.GET, value = {"/getPDF/{id}"})
public @ResponseBody public @ResponseBody
ResponseEntity<byte[]> getWordDocument(@PathVariable String id) throws IllegalAccessException, IOException, InstantiationException, InterruptedException { ResponseEntity<byte[]> getWordDocument(@PathVariable String id) throws IllegalAccessException, IOException, InstantiationException, InterruptedException {
File file = new DatasetManager().getWordDocument(this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetDao(), id, this.getApiContext().getUtilitiesService().getVisibilityRuleService()); File file = new DatasetManager().getWordDocument(this.environment, this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetDao(), id, this.getApiContext().getUtilitiesService().getVisibilityRuleService());
File pdffile = new DatasetManager().convertToPDF(file, environment, file.getName()); File pdffile = new DatasetManager().convertToPDF(file, environment, file.getName());
InputStream resource = new FileInputStream(pdffile); InputStream resource = new FileInputStream(pdffile);
System.out.println("Mime Type of " + file.getName() + " is " + System.out.println("Mime Type of " + file.getName() + " is " +

View File

@ -120,7 +120,7 @@ public class DatasetManager {
return pagedDatasetProfile; return pagedDatasetProfile;
} }
public File getWordDocument(DatasetDao datatasetRepository, String id, VisibilityRuleService visibilityRuleService) throws InstantiationException, IllegalAccessException, IOException { public File getWordDocument(Environment environment, DatasetDao datatasetRepository, String id, VisibilityRuleService visibilityRuleService) throws InstantiationException, IllegalAccessException, IOException {
WordBuilder wordBuilder = new WordBuilder(); WordBuilder wordBuilder = new WordBuilder();
DatasetWizardModel dataset = new DatasetWizardModel(); DatasetWizardModel dataset = new DatasetWizardModel();
eu.eudat.data.entities.Dataset datasetEntity = datatasetRepository.find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class)); eu.eudat.data.entities.Dataset datasetEntity = datatasetRepository.find(UUID.fromString(id), HintedModelFactory.getHint(DatasetWizardModel.class));
@ -132,7 +132,7 @@ public class DatasetManager {
PagedDatasetProfile pagedDatasetProfile = getPagedProfile(dataset, datasetEntity); PagedDatasetProfile pagedDatasetProfile = getPagedProfile(dataset, datasetEntity);
visibilityRuleService.setProperties(properties); visibilityRuleService.setProperties(properties);
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules()); visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
File file = wordBuilder.build(pagedDatasetProfile, datasetEntity.getLabel(), visibilityRuleService); File file = wordBuilder.build(environment, pagedDatasetProfile, datasetEntity.getLabel(), visibilityRuleService);
return file; return file;
} }

View File

@ -14,12 +14,12 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLvl; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLvl;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat; import org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat;
import org.springframework.core.env.Environment;
import java.io.File; import java.io.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger; import java.math.BigInteger;
import java.net.URL;
import java.nio.file.Paths;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -89,8 +89,10 @@ public class WordBuilder {
}); });
} }
public File build(PagedDatasetProfile pagedDatasetProfile, String label, VisibilityRuleService visibilityRuleService) throws IOException { public File build(Environment environment, PagedDatasetProfile pagedDatasetProfile, String label, VisibilityRuleService visibilityRuleService) throws IOException {
XWPFDocument document = new XWPFDocument(new FileInputStream((WordBuilder.class.getClassLoader().getResource("documents/h2020.docx")).getFile())); String fileUrl = environment.getProperty("configuration.h2020template");
InputStream is = new URL(Paths.get(fileUrl).toUri().toURL().toString()).openStream();
XWPFDocument document = new XWPFDocument(is);
this.buildOptions(); this.buildOptions();
createPages(pagedDatasetProfile.getPages(), document, true, visibilityRuleService); createPages(pagedDatasetProfile.getPages(), document, true, visibilityRuleService);
XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum); XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum);

View File

@ -18,6 +18,7 @@ production.database.password=dmpt00lu$r
eu.eudat.logic.proxy.allowed.host=https://eestore.paas2.uninett.no eu.eudat.logic.proxy.allowed.host=https://eestore.paas2.uninett.no
configuration.externalUrls=/tmp/ExternalUrls.xml configuration.externalUrls=/tmp/ExternalUrls.xml
configuration.dynamicProjectUrl=/tmp/ProjectConfiguration.xml configuration.dynamicProjectUrl=/tmp/ProjectConfiguration.xml
configuration.h2020template=/tmp/h2020.docx
####################################################### #######################################################
########################/Email############################# ########################/Email#############################
@ -60,7 +61,7 @@ b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2acc
b2access.externallogin.clientid=eudatdmptool b2access.externallogin.clientid=eudatdmptool
b2access.externallogin.clientSecret=A3b*1*92 b2access.externallogin.clientSecret=A3b*1*92
################################################################################# #################################################################################
pdf.converter.url=http://localhost:81/ pdf.converter.url=http://docsbox-web/
files.storage.temp = temp files.storage.temp = temp
files.storage.final = final files.storage.final = final
################################################################################# #################################################################################
@ -70,10 +71,10 @@ project.configuration.grant.name = Grant
################################################################################# #################################################################################
http-logger.initial-delay = 0 http-logger.initial-delay = 0
http-logger.delay = 10 http-logger.delay = 10
http-logger.server-address = http://localhost:31311 http-logger.server-address = http://logstash:31311
#############################Elastic Search###################################### #############################Elastic Search######################################
elasticsearch.host = localhost elasticsearch.host = tags-elastic-search
elasticsearch.port = 9201 elasticsearch.port = 9200
############################ ############################
# Number of ms to wait before throwing an exception if no connection is available. # Number of ms to wait before throwing an exception if no connection is available.
spring.datasource.maxIdle: 10 spring.datasource.maxIdle: 10

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
export const environment = { export const environment = {
production: true, production: true,
Server: 'http://opendmp.eu:8080/api/', Server: 'https://devel.opendmp.eu/srv/api/',
App: 'http://opendmp.eu/', App: 'https://devel.opendmp.eu/',
HelpServiceUrl: 'http://opendmp.eu:5555/', HelpServiceUrl: 'https://devel.opendmp.eu/content-service/',
defaultCulture: "en-US" defaultCulture: 'en-US'
}; };

View File

@ -8,5 +8,5 @@ export const environment = {
Server: 'http://devel-21.local.cite.gr:8080/api/', Server: 'http://devel-21.local.cite.gr:8080/api/',
App: 'http://localhost:4200/', App: 'http://localhost:4200/',
HelpServiceUrl: 'localhost:5000/', HelpServiceUrl: 'localhost:5000/',
defaultCulture: "en-US" defaultCulture: 'en-US'
}; };