Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated indexing of the hidden Item for the OAI-PMH #650

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dspace-api/src/main/java/org/dspace/content/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ public boolean isDiscoverable() {
public boolean isHidden() {
String valueOfHidden = getItemService().getMetadataFirstValue(this, "local",
"hidden", null, Item.ANY);
if (Objects.nonNull(valueOfHidden) && valueOfHidden.equalsIgnoreCase("hidden")) {

if (Objects.nonNull(valueOfHidden) && valueOfHidden.equalsIgnoreCase("hidden")) {
return true;
}
return false;
Expand Down
8 changes: 7 additions & 1 deletion dspace-oai/src/main/java/org/dspace/xoai/app/XOAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,14 @@ private SolrInputDocument index(Item item)
* because this will override the item.public flag.
*/

boolean discoverable = item.isDiscoverable();
// The Item is not deleted when it has local metadata `local.hidden = hidden`.
// Without this, the item is not discoverable and harvestable; however, it should be harvestable via OAI-PMH.
if (!discoverable && item.isHidden()) {
discoverable = true;
}
doc.addField("item.deleted",
(item.isWithdrawn() || !item.isDiscoverable() || (isEmbargoed ? isPublic : false)));
(item.isWithdrawn() || (!discoverable) || (isEmbargoed ? isPublic : false)));

/*
* An item that is embargoed will potentially not be harvested by incremental
Expand Down
Loading