Package org.mycore.oai
Class MCROAISetManager
java.lang.Object
org.mycore.oai.MCROAISetManager
Manager class to handle OAI-PMH set specific behavior.
For a data provider instance, set support is optional and must be configured as described below.
Typically, sets are mapped to categories of a classification in MyCoRe. The set specifications are read from one or
more URIs using MCRURIResolver. This allows for sets that are typically built by applying an xsl stylesheet to the
output of the classification URI resolver, but also for other ways to dynamically create set specifications, or for
a static set specification that is read from an xml file.
Example:
MCR.OAIDataProvider.OAI.Sets.OA=webapp:oai/open_access.xml MCR.OAIDataProvider.OAI.Sets.DDC=xslStyle:classification2sets:classification:DDCThe first line reads a set specification from a static xml file stored in the web application. The DINI certificate demands that there always is a set open_access that contains all public Open Access documents. Since this set always exists, its set specification can be read from a static file. The second line uses the classification resolver to read in a classification, then transforms the xml to build set specifications from the listed categories. It is recommended not to list sets that are completely empty, to simplify harvesting. The fastest way to accomplish this is to somehow ensure that no set specifications from empty sets are delivered from the URIs, which means that the classification resolver filters out empty categories, or the xsl stylesheet somehow decides to filter empty sets. Another way to filter out empty sets can be activated by setting a property:
MCR.OAIDataProvider.OAI.FilterEmptySets=true
When set to true, the MCRSetManager handler filters out
empty sets itself after reading in the URIs. This is done by constructing a query for each set and looking for
matching hits. Set queries are built using the OAI Adapter's buildSetCondition method. Filtering empty sets this way
may be useful for some implementations, but it is slower and should be avoided for large set hierarchies.- Author:
- Frank Lützenkirchen, Matthias Eichner
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true if setList contains a set with specified setSpec.protected org.mycore.oai.pmh.OAIDataList<MCRSet>
org.mycore.oai.pmh.OAIDataList<MCRSet>
get()
Returns a list of OAI-PMH sets defined by MyCoRe.static <T extends org.mycore.oai.pmh.Set>
TReturns the set with the specified setSpec from the set list or null, if no set with that setSpec is found.<Q,
R, K> MCROAISetConfiguration<Q, R, K> Returns theMCROAISetConfiguration
for the given set id.org.mycore.oai.pmh.OAIDataList<MCRSet>
void
protected void
-
Field Details
-
LOGGER
-
configPrefix
-
setConfigurationMap
-
classLastModified
protected long classLastModifiedTime in milliseconds when the classification changed. -
cacheMaxAge
protected int cacheMaxAgeTime in minutes. -
cachedSetList
-
-
Constructor Details
-
MCROAISetManager
public MCROAISetManager()
-
-
Method Details
-
init
-
updateURIs
protected void updateURIs() -
getDefinedSetIds
-
get
Returns a list of OAI-PMH sets defined by MyCoRe.- Returns:
- list of oai sets
-
getDirectList
-
getConfig
Returns theMCROAISetConfiguration
for the given set id.- Type Parameters:
Q
- value of the configurationR
- Result collection typeK
- Key value type for a single hit- Parameters:
setId
- the set identifier- Returns:
- the configuration for this set
-
createSetList
-
get
public static <T extends org.mycore.oai.pmh.Set> T get(String setSpec, org.mycore.oai.pmh.OAIDataList<T> setList) Returns the set with the specified setSpec from the set list or null, if no set with that setSpec is found.- Parameters:
setSpec
- identifier of the setsetList
- list of sets- Returns:
- the set with setSpec
-
contains
public static boolean contains(String setSpec, org.mycore.oai.pmh.OAIDataList<? extends org.mycore.oai.pmh.Set> setList) Returns true if setList contains a set with specified setSpec.- Parameters:
setSpec
- identifier of the setsetList
- list of sets- Returns:
- true if the list contains the set
-