Add a removed records index#429
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
twagoo
left a comment
There was a problem hiding this comment.
It looks good. I wasn't able to easily test it locally, as this requires records that are more than a day old (if maxDaysInSolr==0 then nothing is purged, as this would just delete everything, so the minimal is 1). However, I did notice that the importer 'hangs' in the end, the process doesn't terminate. If you can reproduce this, can you have a look at this? If not, we need to see if there are any specific conditions that may cause this.
|
If I'm not mistaken, the |
|
And I believed that we agreed in the end about the 404 status code for the morgue record page. I believe this still needs to be implemented? I was thinking of perhaps splitting this up, but this may need further discussion:
Some notes on that:
|
|
I should have addressed all your comments - kindly help me with a rereview @twagoo |
twagoo
left a comment
There was a problem hiding this comment.
Some wicket things to look at, otherwise all looks good to me!
| * resolved from the morgue, in which case a "tombstone" view is shown | ||
| * in place of the regular record details (under the same record URL). | ||
| */ | ||
| private boolean removed = false; |
There was a problem hiding this comment.
Page state must be kept in a model object in Wicket, so correct would be to change this to private IModel<Boolean> removed and set it on initialisation.
| if (!docIdParam.isEmpty()) { | ||
| final Optional<SolrDocument> removedDocument = morgueDocumentService.getById(docIdParam.toString()); | ||
| if (removedDocument.isPresent()) { | ||
| setModel(Model.of(removedDocument.get())); |
There was a problem hiding this comment.
Probably better to use SolrDocumentModel than the generic model, as it has logic to load from the index, and does not store the actual full document (which may cause serialization problems as well)
| add(new Label("removedDate", removedDateModel).add(new InvisibleIfNullBehaviour<>(removedDateModel))); | ||
|
|
||
| // if the removed record referenced a landing page, surface it prominently | ||
| final IModel<String> landingPageModel = new SolrFieldStringModel(getModel(), |
There was a problem hiding this comment.
Landingpage does not contain a URL, but a json structure that needs to be unwrapped. If I'm not mistaken, this can be done with ResourceInfoModel, for a usage example RecordDetailsResourceInfoPanel, in particular:
final IModel<String> linkModel = new PropertyModel<>(landingPageResourceInfoModel, "href");

Add a separate removed records index that allows delivering partial information of deleted records. Addresses #396