Skip to content

Add default-link-category hook and load-time macro substitution - #134

Open
bgajria wants to merge 1 commit into
masterfrom
fix/chipseq-jbrowse-references-link
Open

Add default-link-category hook and load-time macro substitution#134
bgajria wants to merge 1 commit into
masterfrom
fix/chipseq-jbrowse-references-link

Conversation

@bgajria

@bgajria bgajria commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds DatasetInjector.getDefaultLinkCategory() — a new, narrow hook subclasses can override to name a default-hyperlink category (from datasetLinks.xml) that auto-loads when no explicit categoryOverride is set. Deliberately separate from categoryOverride itself, which is also read by loadDatasetPresenter to set DatasetDatasource.category (used broadly by search/facet filters) — this hook affects only which default hyperlinks load, nothing else.
  • Fixes a real gap in DatasetPresenterSetLoader.loadDatasetInjector: the category-default-link loading path inserted link text/url verbatim with no macro substitution, so any datasetLinks.xml template containing DEFAULT_PROJECT/DEFAULT_DATASET_NAME/DEFAULT_ORG_ABBREV/DEFAULT_SEQUENCE would load broken literal placeholder text. Added loadSubstitutedLink, which resolves these at load time (new apidb.Organism/webready.GenomicSeqAttributes_p lookups, small per-taxon caches) without mutating the shared, parsed-once HyperLink template objects.
  • This is the companion piece for the ApiCommonModel fix (ChIPSeq.java overriding the new hook) that restores the "View/Download this Data Set in the Genome Browser" link on ChIP-seq dataset pages — see companion PR.

Test plan

  • bld EbrcModelCommon/DatasetPresenter builds clean
  • presenterWriteToDb -report dry run, then a real DatasetPresenter tuning-table rebuild on a dev instance, confirms apidb.DatasetHyperlink gets a fully-substituted (no DEFAULT_* tokens) row for a ChIP-seq dataset
  • Confirm apidb.DatasetDatasource.category is unchanged for those same datasets (regression check that the new hook does not leak into search/facet behavior)
  • Browser check on a dataset record page

🤖 Generated with Claude Code

…default hyperlinks

DatasetInjector subclasses can now name a default hyperlink category
(as declared in datasetLinks.xml) that auto-loads when no explicit
categoryOverride is set, without touching categoryOverride itself
(which also drives DatasetDatasource.category / search facets, and
must stay untouched here).

The category-default hyperlink loading path in
DatasetPresenterSetLoader.loadDatasetInjector previously inserted
link text/url verbatim with no macro substitution, so any template
containing DEFAULT_PROJECT/DEFAULT_DATASET_NAME/DEFAULT_ORG_ABBREV/
DEFAULT_SEQUENCE placeholders would load broken literal text. Added
loadSubstitutedLink to resolve these at load time via new organism
and default-top-level-sequence lookups (small per-taxon caches).

Companion fix in ApiCommonModel: ChIPSeq.java overrides the new hook
to restore a working JBrowse link in the dataset References table
for ChIP-seq datasets, a mechanism that regressed when datasetLinks.xml
migrated its selector scheme from type/subtype to category in 2025
without anyone wiring up the corresponding categoryOverride.
@bgajria

bgajria commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Companion PR (required together): VEuPathDB/ApiCommonModel#223

}

if (datasetInjector.getCategoryOverride() != null) {
for (HyperLink link : defaultHyperLinks.getHyperLinksFromCategory(datasetInjector.getCategoryOverride()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to better understand why we are asking about the "categoryOverride" here and not just the "category". ie. the category can come from the dataset class (prop files) OR it can be overridden in the Presenter xml (should be the rare case). Don't we already have a category set for ChipSeq? and if not why not just add to the datasetClassCategories?

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.

2 participants