fix(print): Print always renders live; snapshot mint + mail attachment language is declarative (#6491) - #6492
Merged
Merged
Conversation
…t language is declarative, never a hardcoded en (#6491) The Print button no longer redirects to the stored Snapshot copy (the #6359 guardrail hid the language flow entirely once a document was issued): it always runs the dynamic flow - fetch the CMS languages, one prints directly, several pop the picker. The immutable issued copy stays first-class on its own surface: the read-only Snapshot files panel gains a per-version inline Open action (the generated download route honors ?disposition=inline) next to Download. The generated <Entity>SnapshotGenerator and the attach: print mail feeders stop hardcoding "en": a function: Snapshot child accepts language: <code> or languageFrom: <master relation>.<string field> (cross-model targets resolve like every other cross-model reference; a bad path fails the glue pass loudly), and the notify block gains the same languageFrom next to its existing language:. Absent both, the render falls back at run time to the first entry of the tenant-resolved DIRIGIBLE_APPLICATION_LANGUAGES via the new sdk.print.Print .defaultLanguage(). The glue pre-renders the language as a Java expression (the expansions convention); the templates stay shape-only. Covered by SnapshotLanguageIntentTest (parser), GlueSendDocumentTest (glue expressions + languageFrom load), IntentEngineIT (generated delegate emission + the always-live document page), the IntentEmissionCoverageIT fixture (transition notify languageFrom, compiled and published end-to-end), and PrintRenderIT (defaultLanguage resolves the tenant-configured bg over HTTP). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6491.
What
Print always renders LIVE. The stored-copy redirect (#6359) is removed from the generated Harmonia document and manage pages: the Print button unconditionally runs the dynamic flow — fetch the CMS print languages, one prints directly, several pop the picker (Region & Language pre-sorts the suggested default). The immutable issued copy stays first-class on its own surface: the read-only Snapshot files panel keeps Download and gains a per-version inline Open action (
detailPanel.openHref→ the generated download route with?disposition=inline, which the controller template now honors).The mint/attachment language is declarative. Nothing hardcodes
"en"anymore:function: Snapshotchild acceptslanguage: <code>(fixed) orlanguageFrom: <master relation>.<string field>(per record — the counterparty decides the document's language; cross-model targets resolve through the owner's model like every other cross-model reference, and a path that stops resolving fails the glue pass loudly instead of minting wrong-language copies).attach: printgains the samelanguageFromnext to its existinglanguage:(all four call sites: notifications, schedules, transitions, process-step sends). An unresolvable path is reported as a generate warning and the mail is dropped, per the notify conventions.DIRIGIBLE_APPLICATION_LANGUAGESvia the newsdk.print.Print.defaultLanguage()— so a bg-configured tenant mints bg copies with no intent change.The glue (
SnapshotSupport,NotifySupport) pre-renders the language as a Java expression plus an optionallanguageSource/attachLanguageSourcerelation load (the expansions convention); the Velocity templates stay shape-only. The parser validates the knobs (Snapshot-only at entity level,attach: print-only on notify blocks, mutual exclusivity, one-hop path to a string field).Tests
SnapshotLanguageIntentTest— 9 parser cases (valid shapes + every misuse).GlueSendDocumentTest— the pre-rendered language expressions (literal / fallback) + thelanguageFromload coordinates.IntentEngineIT— the generatedOrderSnapshotGeneratorresolveslanguageFrom: customer.locale(master load → FK → locale → fallback) and renders with the resolved language; the document page contains no stored-copy redirect and the files panel offers the inline Open action.IntentEmissionCoverageIT— the transition notify carrieslanguageFrom: Person.locale; the generated sender loads the language source off the record's FK and falls back to the application language set. The fixture is compiled and published end-to-end, so the new generated code paths run through realjavac.PrintRenderIT.defaultLanguageRenderPicksTheConfiguredLanguage— the outermost runtime proof of the fallback: withDIRIGIBLE_APPLICATION_LANGUAGES=bg,enand ONLY a bg template seeded, a render throughPrint.defaultLanguage()returns a PDF over HTTP in tenant scope — resolving any other language would fail loudly (no such template), never return a wrong-language PDF.Unit suite: engine-intent 295/295 green; formatter + release-profile javadoc validated on the touched modules.
🤖 Generated with Claude Code