May be it works the same in older versions too. I have not checked.
I want to exclude from OAI the items under two collections and one
community.
I have in xoai.xml filter and condition:
------------------------------------------------------------------------------------
<!-- Default filter for records returned by OAI-PMH.
By default, return an Item record:
* If it is publicly accessible
* OR it has been withdrawn (in order to display a tombstone
record).
This filter is used by the default context ([oai]/request).
-->
<Filter id="defaultFilter">
<Definition>
<And>
<LeftCondition>
<Or>
<LeftCondition>
<Custom ref="itemAccessCondition"/>
</LeftCondition>
<RightCondition>
<Custom ref="itemWithdrawnCondition"/>
</RightCondition>
</Or>
</LeftCondition>
<RightCondition>
<Not>
<Condition>
<Custom ref="onepageCondition"/>
</Condition>
</Not>
</RightCondition>
</And>
</Definition>
</Filter>
------------------------------------------------------------------------------------
<!-- This condition determines if an Item is in one of the
collections.
-->
<CustomCondition id="onepageCondition">
<Class>org.dspace.xoai.filter.ColComFilter</Class>
<Configuration>
<list name="collections">
<string>col_nls_87</string>
<string>col_nls_25523</string>
<string>com_nls_22332</string>
</list>
</Configuration>
</CustomCondition>
------------------------------------------------------------------------------------
and the main part of ColComFilter.java is:
public boolean isShown(DSpaceItem item) {
if (collectionSpecs == null) {
getCollectionSpecs();
}
for (ReferenceSet rs : item.getSets()) {
if (collectionSpecs.contains(rs.getSetSpec())) {
return true;
}
}
return false;
}
------------------------------------------------------------------------------------
This works fine for the two collections:
http://dspace6:8080/oai/request?verb=ListIdentifiers&metadataPrefix=oai_dc&set=col_nls_87
http://dspace6:8080/oai/request?verb=ListIdentifiers&metadataPrefix=oai_dc&set=col_nls_25523
return <error code="noRecordsMatch"
But it works differently for the community:
http://dspace6:8080/oai/request?verb=ListIdentifiers&metadataPrefix=oai_dc&set=com_nls_22332
returns a lot of identifiers:
completeListSize="3731" (which is the size of the community)
and many entries like:
<header>
<identifier>oai:dspace6:nls/27837</identifier>
<datestamp>2017-12-14T09:52:31Z</datestamp>
<setSpec>com_nls_22332</setSpec>
<setSpec>com_nls_94</setSpec>
<setSpec>col_nls_26938</setSpec>
</header>
But for everyone of the identifiers in the list (I tried 20) the request
http://dspace6:8080/oai/request?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:dspace6:nls/27837
returns <error code="idDoesNotExist"
So that first OAI returns the ID in the list and second it says "the ID
does not exist". The second part I expected because I want to exclude all
items under this community. But the first part - the non empty list of IDs
was unexpected.
Is there an explanation of this or is this a defect in OAI?
--
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.