remove old files

This commit is contained in:
Efstratios Giannopoulos 2024-03-11 18:32:06 +02:00
parent 3fc805ab85
commit a399b183f6
10 changed files with 4 additions and 247 deletions

View File

@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>gr.cite.opendmp</groupId> <groupId>gr.cite.opendmp</groupId>
<artifactId>file-transformer-base</artifactId> <artifactId>file-transformer-base</artifactId>
<version>0.0.5</version> <version>0.0.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>gr.cite</groupId> <groupId>gr.cite</groupId>

View File

@ -199,9 +199,6 @@ public class StorageFileProperties {
public static class StaticFilesConfig{ public static class StaticFilesConfig{
private String externalUrls; private String externalUrls;
private String semantics; private String semantics;
private String h2020Template;
private String h2020DescriptionTemplate;
private String pidLinks;
public String getExternalUrls() { public String getExternalUrls() {
return externalUrls; return externalUrls;
@ -219,29 +216,6 @@ public class StorageFileProperties {
this.semantics = semantics; this.semantics = semantics;
} }
public String getH2020Template() {
return h2020Template;
}
public void setH2020Template(String h2020Template) {
this.h2020Template = h2020Template;
}
public String getH2020DescriptionTemplate() {
return h2020DescriptionTemplate;
}
public void setH2020DescriptionTemplate(String h2020DescriptionTemplate) {
this.h2020DescriptionTemplate = h2020DescriptionTemplate;
}
public String getPidLinks() {
return pidLinks;
}
public void setPidLinks(String pidLinks) {
this.pidLinks = pidLinks;
}
} }
} }

View File

@ -33,12 +33,6 @@ public interface StorageFileService extends ApplicationListener<ApplicationReady
byte[] getSemanticsFile(); byte[] getSemanticsFile();
byte[] getPidLinksFile();
byte[] getH2020TemplateFile();
byte[] getH2020DescriptionTemplateFile();
byte[] getSupportiveMaterial(SupportiveMaterialFieldType type, String language); byte[] getSupportiveMaterial(SupportiveMaterialFieldType type, String language);
byte[] getUserGuide(String language); byte[] getUserGuide(String language);

View File

@ -334,38 +334,7 @@ public class StorageFileServiceImpl implements StorageFileService {
} }
@Override
public byte[] getPidLinksFile() {
try {
return this.readFileBytes(this.config.getStaticFiles().getPidLinks());
}
catch (Exception ex) {
logger.warn("problem reading PidLinks file", ex);
return null;
}
}
@Override
public byte[] getH2020TemplateFile() {
try {
return this.readFileBytes(this.config.getStaticFiles().getH2020Template());
}
catch (Exception ex) {
logger.warn("problem reading H2020Template file", ex);
return null;
}
}
@Override
public byte[] getH2020DescriptionTemplateFile() {
try {
return this.readFileBytes(this.config.getStaticFiles().getH2020DescriptionTemplate());
}
catch (Exception ex) {
logger.warn("problem reading H2020DescriptionTemplate file", ex);
return null;
}
}
//endregion //endregion
//region materials //region materials

View File

@ -199,7 +199,7 @@
<dependency> <dependency>
<groupId>gr.cite.opendmp</groupId> <groupId>gr.cite.opendmp</groupId>
<artifactId>file-transformer-base</artifactId> <artifactId>file-transformer-base</artifactId>
<version>0.0.5</version> <version>0.0.6</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -1,6 +1,5 @@
package eu.eudat.logic.managers; package eu.eudat.logic.managers;
import eu.eudat.logic.proxy.config.configloaders.ConfigLoader;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -18,12 +17,11 @@ public class DatasetProfileManager {
private static final Logger logger = LoggerFactory.getLogger(DatasetProfileManager.class); private static final Logger logger = LoggerFactory.getLogger(DatasetProfileManager.class);
private static final List<String> cache = new ArrayList<>(); private static final List<String> cache = new ArrayList<>();
private final ConfigLoader configLoader;
// private final RemoteFetcherService remoteFetcherService; // private final RemoteFetcherService remoteFetcherService;
@Autowired @Autowired
public DatasetProfileManager(ConfigLoader configLoader) { public DatasetProfileManager() {
this.configLoader = configLoader;
} }
private static String parseItem(Object item) { private static String parseItem(Object item) {
if (item instanceof String) { if (item instanceof String) {

View File

@ -1,8 +0,0 @@
package eu.eudat.logic.proxy.config.configloaders;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
public interface ConfigLoader {
XWPFDocument getDocument();
}

View File

@ -1,67 +0,0 @@
package eu.eudat.logic.proxy.config.configloaders;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.eudat.service.storage.StorageFileService;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.ByteArrayInputStream;
import java.util.LinkedList;
import java.util.List;
@Service("configLoader")
public class DefaultConfigLoader implements ConfigLoader {
private static final Logger logger = LoggerFactory.getLogger(DefaultConfigLoader.class);
private static final ObjectMapper mapper = new ObjectMapper();
private XWPFDocument document;
@Autowired
private StorageFileService storageFileService;
private void setDocument() {
byte[] bytes = this.storageFileService.getH2020TemplateFile();
try {
this.document = new XWPFDocument(new ByteArrayInputStream(bytes));
} catch (Exception ex) {
logger.error("Cannot find resource", ex);
}
}
public XWPFDocument getDocument() {
this.setDocument();
return document;
}
private List<String> getXmlValuesFromXPath(Document doc, String expression) {
XPath xPath = XPathFactory.newInstance().newXPath();
NodeList nodeList = null;
List<String> values = new LinkedList<>();
try {
nodeList = (NodeList) xPath.compile(expression).evaluate(doc, XPathConstants.NODESET);
} catch (XPathExpressionException e) {
logger.error(e.getMessage(), e);
}
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.hasChildNodes()) {
values.add(nodeList.item(i).getChildNodes().item(0).getNodeValue());
}
}
}
return values;
}
}

View File

@ -13,9 +13,6 @@ storage:
static-files: static-files:
externalUrls: dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml externalUrls: dmp-backend/web/src/main/resources/externalUrls/ExternalUrls.xml
semantics: dmp-backend/web/src/main/resources/Semantics.json semantics: dmp-backend/web/src/main/resources/Semantics.json
h2020Template: documents/h2020.docx
h2020DescriptionTemplate: documents/h2020_dataset.docx
pidLinks: pidLinks.json
material-files: material-files:
userGuide: dmp-backend/web/src/main/resources/material/user-guide/ userGuide: dmp-backend/web/src/main/resources/material/user-guide/
about: dmp-backend/web/src/main/resources/material/about/ about: dmp-backend/web/src/main/resources/material/about/

View File

@ -1,100 +0,0 @@
{
"pidLinks": [
{
"pid": "doi",
"link": "https://doi.org/{pid}"
},
{
"pid": "uniprot",
"link": "https://uniprot.org/uniprotkb/{pid}"
},
{
"pid": "handle",
"link": "https://hdl.handle.net/{pid}"
},
{
"pid": "arxiv",
"link": "https://arxiv.org/abs/{pid}"
},
{
"pid": "ascl",
"link": "https://ascl.net/{pid}"
},
{
"pid": "orcid",
"link": "https://orcid.org/{pid}"
},
{
"pid": "pmid",
"link": "https://pubmed.ncbi.nlm.nih.gov/{pid}"
},
{
"pid": "ads",
"link": "https://ui.adsabs.harvard.edu/#abs/{pid}"
},
{
"pid": "pmcid",
"link": "https://ncbi.nlm.nih.gov/pmc/{pid}"
},
{
"pid": "gnd",
"link": "https://d-nb.info/gnd/{pid}"
},
{
"pid": "urn",
"link": "https://nbn-resolving.org/{pid}"
},
{
"pid": "sra",
"link": "https://ebi.ac.uk/ena/data/view/{pid}"
},
{
"pid": "bioproject",
"link": "https://ebi.ac.uk/ena/data/view/{pid}"
},
{
"pid": "biosample",
"link": "https://ebi.ac.uk/ena/data/view/{pid}"
},
{
"pid": "ensembl",
"link": "https://ensembl.org/id/{pid}"
},
{
"pid": "refseq",
"link": "https://ncbi.nlm.nih.gov/entrez/viewer.fcgi?val={pid}"
},
{
"pid": "genome",
"link": "https://ncbi.nlm.nih.gov/assembly/{pid}"
},
{
"pid": "geo",
"link": "https://ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={pid}"
},
{
"pid": "arrayexpress_array",
"link": "https://ebi.ac.uk/arrayexpress/arrays/{pid}"
},
{
"pid": "arrayexpress_experiment",
"link": "https://ebi.ac.uk/arrayexpress/experiments/{pid}"
},
{
"pid": "hal",
"link": "https://hal.archives-ouvertes.fr/{pid}"
},
{
"pid": "swh",
"link": "https://archive.softwareheritage.org/{pid}"
},
{
"pid": "ror",
"link": "https://ror.org/{pid}"
},
{
"pid": "viaf",
"link": "https://viaf.org/viaf/{pid}"
}
]
}