MaatDeamon
MaatDeamon

Reputation: 9771

Faking item changes in Dspace

I have a particular situation with the dspace I am running. I need to fake that some update have happen on an item so this would trigger a re-harvesting via the OAI protocol.

What would be the best way to do that ? Shall I reach the database directly and change the last modified value myself or can i do a context commit on an object without doing anything on it.

I just want to make sure that an external repository that consume item from an internal dspace repo, get to do it automatically periodically on all the item of the internal repo even if no changes have happened.

Upvotes: 1

Views: 215

Answers (1)

terrywb
terrywb

Reputation: 3956

To prepare a collection for the initial harvest, you need to ensure that the collection items are available to the OAI service.

If you change an item (by any method), run

.../bin/dspace oai import
.../bin/dspace oai clean-cache

The commands listed above should be scheduled in your cron.

For testing purposes, run the following to force everything to refresh

.../bin/dspace oai import -c
.../bin/dspace oai clean-cache

In the OAI SOLR repository, the item will look like this.

  {
    "item.id": 858,
    "item.public": true,
    "item.handle": "10822/761511",
    "item.lastmodified": "2016-04-15T23:25:13.321Z",
    "item.submitter": "[email protected]",
    "item.deleted": false,
    "item.collections": [
      "col_10822_552792"
    ],
    "item.communities": [
      "com_10822_707896",
      "com_10822_707878",
      "com_10822_1"
    ],
    ...
}

To harvest updates from your collection

Once you have established a harvested collection, the harvester will continue to poll the source collection for updates.

These updates are based on the item.lastmodified date. You must trigger an update to the item.lastmodified date to trigger the re-harvesting of an item.

Upvotes: 1

Related Questions