Skip to content

Nested Documents UI — Phase 4: i18n and Integration Tests #3664

@luis100

Description

@luis100

Overview

Ensure all new labels are fully internationalised and that the end-to-end nested document flow is covered by integration tests.

Part of: #3382
Depends on: #3660, #3661, #3662, #3663 (all previous phases must be complete)


i18n Requirements

All new labels introduced across Phases 0–3 must be added to every locale .properties file under roda-ui/roda-wui/src/main/resources/config/i18n/. After adding to ServerMessages.properties, submit to Transifex per documentation/Translation_Guide.md.

Full list of required i18n keys

Phase 0 — EmailArchive metadata type

# ServerMessages.properties
ui.browse.metadata.descriptive.type.emailarchive = Email Archive

Phase 1 — Nested filter group labels

# ServerMessages.properties
ui.search.fields.IndexedAIP.email_nested_group            = Contains Email where...
ui.search.fields.IndexedAIP.email_nested_group.email_subject  = Subject
ui.search.fields.IndexedAIP.email_nested_group.email_sender   = Sender
ui.search.fields.IndexedAIP.email_nested_group.email_sentDate = Sent Date

Phase 2 — Virtual catalogue dropdown and column headers

# ServerMessages.properties
ui.catalogue.Search_emails.label             = Emails
ui.lists.Search_emails.columns.subject_txt   = Subject
ui.lists.Search_emails.columns.sender_s      = From
ui.lists.Search_emails.columns.sentDate_dt   = Sent Date

Integration Test Scenarios

Tests live in roda-core/roda-core-tests/ and use TestNG (@Test(groups = "travis")).

Note

All tests require Docker services running (Solr, PostgreSQL, ZooKeeper). Run with:

RODA_CORE_SOLR_TYPE=CLOUD SIEGFRIED_MODE=standalone \
  mvn -Dtestng.groups="travis" -Denforcer.skip=true clean test

Test 1 — Nested document indexing

  1. Ingest a test AIP with an emailarchive.xml descriptive metadata file (containing 3 email child records)
  2. Assert: Solr query content_type:email returns 3 documents
  3. Assert: each child document has subject_txt, sender_s, sentDate_dt fields populated
  4. Assert: each child UUID matches the pattern {parentAIPUUID}/emails#{index}

Test 2 — ChildOfFilterParameter returns children as IndexedAIP

Using /api/v2/aips/find with:

{
  "filter": {
    "parameters": [{
      "type": "ChildOfFilterParameter",
      "childrenOfFilter": {
        "type": "SimpleFilterParameter",
        "name": "content_type",
        "value": "emailarchive"
      }
    }]
  }
}

Assert: totalCount = 3, each result has fields.subject_txt populated, mandatory IndexedAIP fields (permissions, ghost, etc.) are present (inherited from parent).

Test 3 — ParentWhichFilterParameter returns parent AIP

Using /api/v2/aips/find with:

{
  "filter": {
    "parameters": [{
      "type": "ParentWhichFilterParameter",
      "parentFilter": {
        "type": "SimpleFilterParameter",
        "name": "content_type",
        "value": "emailarchive"
      },
      "childrenFilter": {
        "type": "SimpleFilterParameter",
        "name": "subject_txt",
        "value": "quarterly"
      }
    }]
  }
}

Assert: result is the parent mailbox AIP (not the child), totalCount = 1.

Test 4 — Permission enforcement

  1. Ingest AIP with emailarchive metadata; restrict READ permission to group archivists
  2. Query /api/v2/aips/find with ChildOfFilterParameter as a user NOT in archivists
  3. Assert: totalCount = 0 (children are not returned when parent is not accessible)

Files to Change

File Action
roda-ui/.../resources/config/i18n/ServerMessages.properties Edit — add all keys from all phases
All other locale .properties files (PT, SV, HU, ES, HR, DE-AT…) Edit — add translations (or English fallback)
New test class in roda-core-tests CreateNestedDocumentsTest.java

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions