Update citation author/editor handling to use JSON fields with ORCID and ROR links#59
Conversation
…and ROR links Replaces flattened citation metadata fields with JSON-based extraction to preserve nested relationships between authors/editors, affiliations, and organizations. Adds clickable links for ORCID identifiers on person names and ROR identifiers on organization names to enable direct access to contributor profiles and institutional information. Changes: - Remove deprecated flattened field constants from Constants.java - Add new JSON field constants for citation_author/editor_person/organization_json - Replace getAuthorEditorBlock() with processJsonField(), formatPerson(), formatOrganization() - Parse JSON to extract nested Person and Organization structures with Affiliations - Generate HTML links for person_orcid (ORCID) and organization_rorid (ROR) identifiers - Handle both single and array affiliations per person Related to NASA-PDS/registry-legacy-solr#237
|
| if (person.has("person_orcid")) { | ||
| String orcidUrl = person.getString("person_orcid"); | ||
| sb.append("<a href=\"").append(orcidUrl).append("\" target=\"_blank\">"); | ||
| sb.append(personName); |
There was a problem hiding this comment.
Is there any chance the upstream source could contain malicious data?
For example, suppose the personName contains <script src='https://my.hackers.org/exploit/v1'>. For this case, using an HTML element tree might be safer.
Yes, I can be a bit paranoid 😆
There was a problem hiding this comment.
Approved but do see my question about HTML injection 😉
Also, 🎉
[INFO] Tests run: 36, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
|
@nutjob4life fix completed to sanitize these URLs. is this sufficient or should we take this a step further as use something like JSoup to actually build the HTML?
|
|
@jordanpadams good question; soup's good but maybe overkill? I don't know. Then again, AI might be able to write it up pretty fast too. |
|
@nutjob4life true. but with the lack of a test suite here, I am worried about ripping apart the code and trying to test it. let's table that for now. |



🗒️ Summary
Replaces flattened citation metadata fields with JSON-based extraction to preserve nested relationships between authors/editors, affiliations, and organizations. Adds clickable links for ORCID identifiers on person names and ROR identifiers on organization names to enable direct access to contributor profiles and institutional information.
Changes:
⚙️ Test Data and/or Report
♻️ Related Issues
🤓 Reviewer Checklist
Reviewers: Please verify the following before approving this pull request.
Security & Quality
Testing & Validation
Documentation
Maintenance