Skip to content

buildNodeUrl gaps a link component cannot work around #756

Description

@romain-pm

Part of #749. Five holes in the URL tier, each found by a real call site.

  • nt:file is lost on the manual branch. buildNodeUrl has two paths (urlBuilder.ts:80-104 vs :106-112). The /files/<workspace>/<canonicalPath> split lives in JCRNodeWrapperImpl.getUrl(), called only on the second. Pass any of mode, language or extension and the first path hand-concatenates a render URL for a binary: <JLink node={pdf} language="fr"> yields /cms/render/live/fr/sites/x/files/doc.pdf.html. Either reproduce the split on the manual branch or make file targets always take the getUrl() path.
  • absolute option. Jahia/luxe-jahia-demo's og:url and og:image drop out of the JS API and call the Java JCRNodeWrapper.getAbsoluteUrl(request). Note a cross-site absolute URL needs the target site's server name, not the request's.
  • View/template segment (<path>.<view>.html). Core's jnt:componentLink and jnt:siteLink both need it; today the only route is extension: ".myView.html" as a string hack.
  • mode: "edit" emits /cms/edit/…. The page builder is served from /cms/editframe/…. Jahia/jahia.com already patches this by hand: buildNodeUrl(target).replace("/cms/edit/", "/cms/editframe/") (src/templates/NavBar.tsx:83), with a comment. /cms/edit/ works only because EditModeFilter rewrites it — and the same filter deletes or staples on target while it is there.
  • args JSDoc. JCRNodeWrapperImpl.getUrl(List<String>) returns getUrl() — core discards the arguments on a plain node. The JSDoc documents a silent no-op as a feature. Same fix shape as Fix misleading args JSDoc; document getThumbnailUrl #736.

Also worth a line in the guide: an href built with a literal default workspace survives into a live page, because the live outbound rules only match /cms/render/live/….

Metadata

Metadata

Assignees

No one assigned

    Labels

    featA new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions