diff --git a/oaipmh-core/pom.xml b/oaipmh-core/pom.xml index 1eaad533fe55aaee06906fa364068a1036ac4f8d..5f80738521af0be7fd90a05b16231f56d4c19351 100644 --- a/oaipmh-core/pom.xml +++ b/oaipmh-core/pom.xml @@ -38,11 +38,8 @@ <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>${cxf.version}</version> </dependency> - <!-- dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http</artifactId> - <version>${cxf.version}</version> - </dependency--> + <!-- dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> + <version>${cxf.version}</version> </dependency --> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> @@ -91,22 +88,14 @@ <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> - <!-- dependency> + <dependency> <groupId>org.classicmayan.tools</groupId> <artifactId>metsModsMapping</artifactId> <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.jena</groupId> - <artifactId>jena-core</artifactId> - <version>3.4.0</version> - </dependency> - <dependency> - <groupId>org.apache.jena</groupId> - <artifactId>jena-arq</artifactId> - <version>3.6.0</version> - </dependency--> + <!-- <dependency> <groupId>org.apache.jena</groupId> <artifactId>jena-core</artifactId> + <version>3.4.0</version> </dependency> <dependency> <groupId>org.apache.jena</groupId> + <artifactId>jena-arq</artifactId> <version>3.6.0</version> </dependency --> </dependencies> <build> @@ -204,7 +193,7 @@ for https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-80. --> <goals> <goal>xjc</goal> </goals> - <configuration> + <configuration> <schemaFile>oai_dc.xsd</schemaFile> <packageName>info.textgrid.middleware.oaidc</packageName> <schemaDirectory>src/main/xsd</schemaDirectory> diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java index dcdc3b9338e17994420ba9b612dfb7d8a814fdee..76a3413d6d044db430c32c07c6643b6f0dacade6 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIDIOM.java @@ -2,92 +2,88 @@ package info.textgrid.middleware; import org.apache.commons.logging.LogFactory; -import org.classicmayan.tools.ClassicMayanMetsMods; -import org.elasticsearch.action.get.GetRequestBuilder; - import info.textgrid.middleware.oaipmh.GetRecordType; import info.textgrid.middleware.oaipmh.HeaderType; import info.textgrid.middleware.oaipmh.MetadataType; -import info.textgrid.middleware.oaipmh.OaiDcType; -import info.textgrid.middleware.oaipmh.ObjectFactory; import info.textgrid.middleware.oaipmh.RecordType; public class RecordDelivererIDIOM extends RecordDelivererAbstract { - - private String[] fields; - private String[] workFields; - private String dateOfObjectCreation; - private String repositoryObjectURIPrefix; - - - private static org.apache.commons.logging.Log log = LogFactory.getLog(RecordDelivererDC.class); - - - - /** - * @param textgrid - * @param dariah - */ - public RecordDelivererIDIOM(boolean textgrid, boolean dariah) { - super(textgrid, dariah); - } - - /* - * (non-Javadoc) - * - * @see info.textgrid.middleware.RecordDelivererInterface#getRecordById(java.lang.String) - */ - public GetRecordType getRecordById(String id) { - System.out.println("Enter idiom"); - - System.out.println("ID: " + id); - - GetRecordType grt = new GetRecordType(); - RecordType record = new RecordType(); - - record.setMetadata(idiomMets()); - grt.setRecord(record); - - return grt; - } - - public MetadataType idiomMets() { - MetadataType metadataMets = new MetadataType(); - - ClassicMayanMetsMods metsmods = new ClassicMayanMetsMods("textgrid:2557q", "2016-02-18T11:15:19.899+01:00", "2018-02-02T12:12:34.113+01:00"); - System.out.println(metsmods.getMets()); - //metadataMets.setAny(metsmods); - - return metadataMets; - } - - // ** - // PRIVATE METHODS - // ** - - /** - * @param dateOfCreation - * @param identifier - * @param record - * @return - */ - private static RecordType setRecordHeader(String dateOfCreation, String identifier, - RecordType record) { - - HeaderType recordHeader = new HeaderType(); - recordHeader.setIdentifier(identifier); - recordHeader.setDatestamp(dateOfCreation); - //record.setMetadata(); - record.setHeader(recordHeader); - - return record; - } - - /** - * @param id - * @return - */ + + private String[] fields; + private String[] workFields; + private String dateOfObjectCreation; + private String repositoryObjectURIPrefix; + + + private static org.apache.commons.logging.Log log = LogFactory.getLog(RecordDelivererDC.class); + + + + /** + * @param textgrid + * @param dariah + */ + public RecordDelivererIDIOM(boolean textgrid, boolean dariah) { + super(textgrid, dariah); + } + + /* + * (non-Javadoc) + * + * @see info.textgrid.middleware.RecordDelivererInterface#getRecordById(java.lang.String) + */ + public GetRecordType getRecordById(String id) { + System.out.println("Enter idiom"); + + System.out.println("ID: " + id); + + GetRecordType grt = new GetRecordType(); + RecordType record = new RecordType(); + + record.setMetadata(idiomMets()); + grt.setRecord(record); + + return grt; + } + + public MetadataType idiomMets() { + MetadataType metadataMets = new MetadataType(); + + ClassicMayanMetsMods metsmods = new ClassicMayanMetsMods("textgrid:2557q", + "2016-02-18T11:15:19.899+01:00", "2018-02-02T12:12:34.113+01:00"); + System.out.println(metsmods.getMets()); + // metadataMets.setAny(metsmods); + + return metadataMets; + } + + // ** + // PRIVATE METHODS + // ** + + /** + * @param dateOfCreation + * @param identifier + * @param record + * @return + */ + private static RecordType setRecordHeader(String dateOfCreation, String identifier, + RecordType record) { + + HeaderType recordHeader = new HeaderType(); + recordHeader.setIdentifier(identifier); + recordHeader.setDatestamp(dateOfCreation); + // record.setMetadata(); + record.setHeader(recordHeader); + + return record; + } + + /** + * @param id + * @return + */