Skip to content

refactor(templates): extract the identity layer to templates.core.identity (PartyIdentity)#250

Merged
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-identity
Jun 28, 2026
Merged

refactor(templates): extract the identity layer to templates.core.identity (PartyIdentity)#250
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-identity

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

A masthead is the same shape in every document family — a name, an optional
tagline, a contact block, and a set of links — but the contract and the widgets
that draw it lived in cv.v2 and were person-shaped (CvName, CvIdentity).
Extracting a family-neutral PartyIdentity contract plus the header widgets into
templates.core.identity lets invoice / proposal reuse them with their own org
record. Retyping public widgets is a binary break, so this lands on the 2.0 line.

What changed

  • New core.identity.PartyIdentitydisplayName() / tagline() /
    contact() / links().
  • Moved to core.identity: the header widgets Headline, ContactLine,
    Masthead, Subheadline, SvgGlyph, plus the Contact (was CvContact) and
    Link (was CvLink) records. Added core/identity/package-info.java.
  • Retyped: Headline now renders a String name (it only ever rendered
    name.full()); ContactLine / Masthead accept a PartyIdentity and read
    displayName() / tagline() / contact() / links().
  • Stayed in cv.v2.data: CvName (person first/middle/last) and CvIdentity
    — now implements PartyIdentity (displayName() = name().full(),
    tagline() = jobTitle()).
  • Call sites: mostly unchanged — a CvIdentity is-a PartyIdentity, so
    ContactLine/Masthead callers don't change; Headline callers pass
    name().full(). The Gen-2 cv presets that reached into cv.v2.widgets.SvgGlyph
    are repointed to core.identity.SvgGlyph.

Naming note: core.identity.Link coexists with the internal
engine.components.renderable.Link — different layers, no single file imports
both, so there is no clash.

Lane: templates (canonical). Target: 2.0-dev. Pure move/rename/extract —
no behavioural change.

Deferred to the docs refresh: .md mentions of the old FQNs.

Verification

  • ./mvnw test -pl .Tests run: 1607, Failures: 0, Errors: 0 — zero snapshot
    updates → render is byte-identical.
  • ./mvnw -P japicmp verify -pl . → BUILD SUCCESS; javadoc gate clean; japicmp
    runs report-only and its report documents the move.
  • examples test-compile + GenerateAllExamples → every example PDF regenerates.

@DemchaAV DemchaAV force-pushed the feat/templates-core-identity branch from 1cdb588 to 00572ac Compare June 28, 2026 07:08
…ntity

Introduce a family-neutral PartyIdentity contract (displayName / tagline /
contact / links) in com.demcha.compose.document.templates.core.identity and move
the shared header widgets (Headline, ContactLine, Masthead, Subheadline,
SvgGlyph) plus the Contact (was CvContact) and Link (was CvLink) records there.
Headline now renders a String name and ContactLine / Masthead accept a
PartyIdentity, so any family can reuse them. CvName and CvIdentity stay in
cv.v2.data, with CvIdentity implementing PartyIdentity, so most call sites are
unchanged (a CvIdentity is a PartyIdentity); Headline callers pass name().full().
Render is byte-identical (1607 tests, zero snapshot updates); the move is a
deliberate binary break on the 2.0 line (japicmp report-only). Markdown docs
follow in the docs refresh.
@DemchaAV DemchaAV force-pushed the feat/templates-core-identity branch from 00572ac to 995d4ca Compare June 28, 2026 07:23
@DemchaAV DemchaAV merged commit 62805ed into 2.0-dev Jun 28, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/templates-core-identity branch June 28, 2026 07:32
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.

1 participant