Skip to content

3289 harvest via oai pmh of rein d space fails#3321

Open
lbownik wants to merge 33 commits into
developfrom
3289_Harvest_via_OAI_PMH_of_REIN_DSpace_fails
Open

3289 harvest via oai pmh of rein d space fails#3321
lbownik wants to merge 33 commits into
developfrom
3289_Harvest_via_OAI_PMH_of_REIN_DSpace_fails

Conversation

@lbownik

@lbownik lbownik commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@lbownik lbownik requested a review from rscipien July 2, 2026 11:16
if(this.protocol == null || this.authority == null || this.identifier == null) {
return "";
} else if(HTTP_PROTOCOL.equals(this.protocol) || HTTPS_PROTOCOL.equals(this.protocol)) {
return this.protocol + ':' + this.protocol + "://" + this.authority + this.identifier;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two time this.protocol this was intended?

public GlobalId(final String identifierString) {
final int index1 = identifierString.indexOf(':');
if (index1 > 0) { // ':' found with one or more characters before it
if(identifierString.startsWith(HTTPS_PROTOCOL)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between if (

} catch (final MalformedURLException e) {
throw new IllegalArgumentException(e);
}
} else if(identifierString.startsWith(HTTP_PROTOCOL)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between if {

Comment on lines +114 to +122
final ArrayList<Node> identifiers = getNodes(document, "identifier");
if(identifiers.isEmpty()) {
throw new EJBException("Missing dc:identifier xml element");
}
for(final Node node : identifiers) {
version.addField(newField(otherId, null).
addChild(newField(otherIdValue, node.getTextContent())));
}
dataset.setGlobalId(createGlobalId(identifiers));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this code could be moved where title is parsed. Both are required fields so maybe could be in the same place

if (harvestingClient == null || harvestingClient.getDataverse() == null) {
public Dataset doImportHarvestedDataset(final DataverseRequest request,
final HarvestingClient client, final String identifier,
final HarvestImporterType importType, final String xml) throws ImportException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not change last parameter from metadata -> xml. In OAI-PMH specification content is called metadata


private GlobalId createGlobalId(final ArrayList<Node> identifierNodes) {

final List<String> identifiers = identifierNodes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If in this code we are only interested in first id, maybe just get first id and the do the logic without without for each type? final Optional<GlobalId> doi = identifiers .stream() .filter(GlobalId::isDOI) .findFirst()

@rscipien rscipien assigned lbownik and unassigned rscipien Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants