Skip to content

Commit

Permalink
Merge branch 'release-2.4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Jun 22, 2022
2 parents 1421c1a + 8497e24 commit 4f2a97e
Show file tree
Hide file tree
Showing 106 changed files with 14,800 additions and 46 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- develop
- release-2.2.x
- release-*

jobs:
build:
Expand All @@ -27,23 +27,17 @@ jobs:
with:
fetch-depth: '10'
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Install Samtools
run: sudo apt-get install samtools
- name: Run tests with Maven
run: mvn -T 2 clean install

deploy:
deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
secrets:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,17 @@ jobs:
with:
fetch-depth: '10'
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Install Samtools
run: sudo apt-get install samtools
- name: Run tests with Maven
run: mvn -T 2 clean install

deploy:
deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
secrets:
Expand All @@ -56,4 +50,4 @@ jobs:

release:
uses: opencb/java-common-libs/.github/workflows/release-github-workflow.yml@develop
needs: deploy
needs: deploy-maven
8 changes: 1 addition & 7 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ jobs:
with:
fetch-depth: '10'
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Install Samtools
run: sudo apt-get install samtools
- name: Run tests with Maven
Expand Down
3 changes: 1 addition & 2 deletions biodata-external/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
<parent>
<artifactId>biodata</artifactId>
<groupId>org.opencb.biodata</groupId>
<version>2.3.0</version>
<version>2.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>biodata-external</artifactId>
<version>${biodata.version}</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
3 changes: 1 addition & 2 deletions biodata-formats/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
<parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>biodata-formats</artifactId>
<version>${biodata.version}</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.opencb.biodata.formats.pubmed;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import java.io.*;
import java.util.zip.GZIPInputStream;

public class PubMedParser {


public final static String PUBMED_CONTEXT = "org.opencb.biodata.formats.pubmed.v233jaxb";

public static void saveXMLInfo(Object obj, String filename) throws FileNotFoundException, JAXBException {
JAXBContext jaxbContext;
jaxbContext = JAXBContext.newInstance(PUBMED_CONTEXT);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.marshal(obj, new FileOutputStream(filename));
}

/**
* Checks if XML info path exists and loads it
*
* @throws javax.xml.bind.JAXBException
* @throws java.io.IOException
*/
public static Object loadXMLInfo(String filename) throws JAXBException, IOException {
System.setProperty("javax.xml.accessExternalDTD", "all");

Object obj = null;
JAXBContext jaxbContext = JAXBContext.newInstance(PUBMED_CONTEXT);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

if (filename.endsWith("gz")) {
FileInputStream fis = new FileInputStream(filename);
GZIPInputStream gis = new GZIPInputStream(fis);
obj = unmarshaller.unmarshal(gis);
} else {
obj = unmarshaller.unmarshal(new File(filename));
}


return obj;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0.1
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2022.05.23 at 12:52:46 PM UTC
//


package org.opencb.biodata.formats.pubmed.v233jaxb;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;


/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{}AbstractText" maxOccurs="unbounded"/&gt;
* &lt;element ref="{}CopyrightInformation" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"abstractText",
"copyrightInformation"
})
@XmlRootElement(name = "Abstract")
public class Abstract {

@XmlElement(name = "AbstractText", required = true)
protected List<AbstractText> abstractText;
@XmlElement(name = "CopyrightInformation")
protected String copyrightInformation;

/**
* Gets the value of the abstractText property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the abstractText property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAbstractText().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AbstractText }
*
*
*/
public List<AbstractText> getAbstractText() {
if (abstractText == null) {
abstractText = new ArrayList<AbstractText>();
}
return this.abstractText;
}

/**
* Gets the value of the copyrightInformation property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCopyrightInformation() {
return copyrightInformation;
}

/**
* Sets the value of the copyrightInformation property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCopyrightInformation(String value) {
this.copyrightInformation = value;
}

}
Loading

0 comments on commit 4f2a97e

Please sign in to comment.