use of org.orcid.jaxb.model.record.summary_rc3.Educations in project ORCID-Source by ORCID.
the class ConvertVrc1ToVrc2Test method upgradeEducationsToVrc2Test.
@Test
public void upgradeEducationsToVrc2Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Educations.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc2.Educations.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc1Stream = ConvertVrc1ToVrc2Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc1.xml");
InputStream rc2Stream = ConvertVrc1ToVrc2Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc2.xml");
Educations rc1Educations = (Educations) jaxbUnmarshaller.unmarshal(rc1Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc2.Educations rc2Educations1 = (org.orcid.jaxb.model.record.summary_rc2.Educations) jaxbUnmarshaller.unmarshal(rc2Stream);
V2Convertible result = versionConverterV2_0_rc1ToV2_0_rc2.upgrade(new V2Convertible(rc1Educations, "v2_rc1"));
org.orcid.jaxb.model.record.summary_rc2.Educations rc2Educations2 = (org.orcid.jaxb.model.record.summary_rc2.Educations) result.getObjectToConvert();
assertEquals(rc2Educations1.getLastModifiedDate(), rc2Educations2.getLastModifiedDate());
}
use of org.orcid.jaxb.model.record.summary_rc3.Educations in project ORCID-Source by ORCID.
the class ConvertVrc2ToVrc3Test method upgradeEducationsToVrc3Test.
@Test
public void upgradeEducationsToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Educations.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc3.Educations.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc2Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc2.xml");
InputStream rc3Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc3.xml");
Educations rc2Educations = (Educations) jaxbUnmarshaller.unmarshal(rc2Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc3.Educations rc3Educations1 = (org.orcid.jaxb.model.record.summary_rc3.Educations) jaxbUnmarshaller.unmarshal(rc3Stream);
V2Convertible result = versionConverterV2_0_rc2ToV2_0_rc3.upgrade(new V2Convertible(rc2Educations, "v2_rc2"));
org.orcid.jaxb.model.record.summary_rc3.Educations rc3Educations2 = (org.orcid.jaxb.model.record.summary_rc3.Educations) result.getObjectToConvert();
assertEquals(rc3Educations1, rc3Educations2);
}
use of org.orcid.jaxb.model.record.summary_rc3.Educations in project ORCID-Source by ORCID.
the class ConvertVrc3ToVrc4Test method upgradeEducationsToVrc3Test.
@Test
public void upgradeEducationsToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Educations.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc4.Educations.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc3Stream = ConvertVrc3ToVrc4Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc3.xml");
InputStream rc4Stream = ConvertVrc3ToVrc4Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc4.xml");
Educations rc4Educations = (Educations) jaxbUnmarshaller.unmarshal(rc3Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc4.Educations rc4Educations1 = (org.orcid.jaxb.model.record.summary_rc4.Educations) jaxbUnmarshaller.unmarshal(rc4Stream);
V2Convertible result = versionConverterV2_0_rc3ToV2_0_rc4.upgrade(new V2Convertible(rc4Educations, "v2_rc3"));
org.orcid.jaxb.model.record.summary_rc4.Educations rc4Educations2 = (org.orcid.jaxb.model.record.summary_rc4.Educations) result.getObjectToConvert();
assertEquals(rc4Educations1, rc4Educations2);
}
use of org.orcid.jaxb.model.record.summary_rc3.Educations in project ORCID-Source by ORCID.
the class ConvertV2ToV2_1Test method upgradeEducationsToV21Test.
@Test
public void upgradeEducationsToV21Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Educations.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(Educations.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream v20Stream = ConvertV2ToV2_1Test.class.getClassLoader().getResourceAsStream("test-educations-2.0.xml");
InputStream v21Stream = ConvertV2ToV2_1Test.class.getClassLoader().getResourceAsStream("test-educations-2.1.xml");
Educations v20Educations = (Educations) jaxbUnmarshaller.unmarshal(v20Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
Educations v21Educations1 = (Educations) jaxbUnmarshaller.unmarshal(v21Stream);
V2Convertible result = versionConverterV2_0ToV2_1.upgrade(new V2Convertible(v20Educations, "v2.1"));
Educations v21Educations2 = (Educations) result.getObjectToConvert();
assertEquals(v21Educations1, v21Educations2);
}
use of org.orcid.jaxb.model.record.summary_rc3.Educations in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorImpl method viewEducations.
@Override
public Response viewEducations(String orcid) {
List<EducationSummary> educations = affiliationsManagerReadOnly.getEducationSummaryList(orcid, getLastModifiedTime(orcid));
Educations publicEducations = new Educations();
for (EducationSummary summary : educations) {
if (Visibility.PUBLIC.equals(summary.getVisibility())) {
ActivityUtils.setPathToActivity(summary, orcid);
sourceUtilsReadOnly.setSourceName(summary);
publicEducations.getSummaries().add(summary);
}
}
Api2_0_LastModifiedDatesHelper.calculateLastModified(publicEducations);
ActivityUtils.setPathToEducations(publicEducations, orcid);
return Response.ok(publicEducations).build();
}
Aggregations