Commit d7166829 authored by Ricco Førgaard's avatar Ricco Førgaard

Ignore non-existing fields in DDI.

This may lead to creating documents that don't comply with the OAI-PMH
spec.
parent af0f8683
......@@ -12,10 +12,6 @@ import nesstar.api.common.EGMSResource;
import org.apache.log4j.Logger;
import com.nesstar.oaipmh.NesstarServer;
import com.nesstar.oaipmh.NesstarServerSingleton;
import com.nesstar.oaipmh.exceptions.IdDoesNotExistException;
import com.nesstar.api.ComplexDdiElement;
import com.nesstar.api.DdiElement;
import com.nesstar.api.DdiList;
......@@ -24,6 +20,8 @@ import com.nesstar.api.NotAuthorizedException;
import com.nesstar.api.SimpleDdiElement;
import com.nesstar.api.Study;
import com.nesstar.api.impl.SimpleDdiElementImpl;
import com.nesstar.oaipmh.NesstarServerSingleton;
import com.nesstar.oaipmh.exceptions.IdDoesNotExistException;
public class GetRecordResult extends OAIResult {
private static Logger logger = Logger.getLogger(GetRecordResult.class);
......@@ -161,6 +159,9 @@ public class GetRecordResult extends OAIResult {
}
protected void addContentFromChildren(ComplexDdiElement element, StringBuilder builder) throws NotAuthorizedException, XPathExpressionException, IOException {
if (element == null) {
return;
}
DdiElement children = element.getElement("node()");
if (children instanceof DdiList) {
for (DdiElement child : (DdiList<DdiElement>) children) {
......
Manifest-Version: 1.0
Class-Path: activation-1.1.jar commons-beanutils-1.8.0.jar commons-cod
ec-1.4.jar commons-collections-3.2.1.jar commons-httpclient-3.1.jar c
ommons-io-1.4.jar commons-lang-2.5.jar commons-logging-1.1.1.jar ezmo
rph-1.0.6.jar jaxb-api-2.2.2.jar jaxb-impl-2.2.2.jar log4j-1.2.16.jar
nesstar_legacy_api-4.0.2.jar nesstar_public_api-1.0-SNAPSHOT.jar rdf
_parser-1.0.jar stax-api-1.0-2.jar xercesImpl-2.10.0.jar xml-apis-1.4
.01.jar
Class-Path: activation-1.1.jar classworlds-1.1-alpha-2.jar commons-bea
nutils-1.8.0.jar commons-codec-1.4.jar commons-collections-3.2.1.jar
commons-httpclient-3.1.jar commons-io-1.4.jar commons-lang-2.5.jar co
mmons-logging-1.1.1.jar derby-10.8.2.2.jar ezmorph-1.0.6.jar java-cup
-11a.jar jaxb-api-2.2.2.jar jaxb-impl-2.2.2.jar jflex-1.4.3.jar log4j
-1.2.16.jar maven-artifact-2.0.4.jar maven-artifact-manager-2.0.4.jar
maven-jflex-plugin-1.4.3.jar maven-model-2.0.4.jar maven-plugin-api-
2.0.jar maven-profile-2.0.4.jar maven-project-2.0.4.jar maven-reposit
ory-metadata-2.0.4.jar maven-settings-2.0.4.jar nesstar-api-0.2.jar n
esstar-legacy-api-4.0.5b2.jar plexus-container-default-1.0-alpha-9.ja
r plexus-utils-1.1.jar rdf_parser-1.0.jar stax-api-1.0-2.jar wagon-pr
ovider-api-1.0-alpha-6.jar xercesImpl-2.10.0.jar xml-apis-1.4.01.jar
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment