io.gdcc.xoai.xml.WriterContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xoai-common Show documentation
Show all versions of xoai-common Show documentation
OAI-PMH base functionality used for both data and service providers.
package io.gdcc.xoai.xml;
import io.gdcc.xoai.model.oaipmh.Granularity;
import io.gdcc.xoai.services.api.ResumptionTokenFormat;
import io.gdcc.xoai.services.impl.SimpleResumptionTokenFormat;
public interface WriterContext {
default Granularity getGranularity() {
return Granularity.Second;
}
default ResumptionTokenFormat getResumptionTokenFormat() {
return new SimpleResumptionTokenFormat().withGranularity(getGranularity());
}
/**
* This is used for Dataverse 4/5 backward compatibility, because they added an attribute to the
* <record><metadata>
element, containing the API URL of a record in
* their special metadata format "dataverse_json".
*
* The data provider repository configuration uses this to make the behaviour configurable.
*
* @deprecated Remove when Dataverse 6 is old enough that no ones uses this workaround anymore.
* @return true when {@link io.gdcc.xoai.model.oaipmh.results.Record} should add attributes to
* <metadata>
, false otherwise (default)
*/
@Deprecated(since = "5.0")
default boolean isMetadataAttributesEnabled() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy