Add default-link-category hook and load-time macro substitution - #134
Open
bgajria wants to merge 1 commit into
Open
Add default-link-category hook and load-time macro substitution#134bgajria wants to merge 1 commit into
bgajria wants to merge 1 commit into
Conversation
…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.
Member
Author
|
Companion PR (required together): VEuPathDB/ApiCommonModel#223 |
2 tasks
jbrestel
reviewed
Aug 19, 2026
| } | ||
|
|
||
| if (datasetInjector.getCategoryOverride() != null) { | ||
| for (HyperLink link : defaultHyperLinks.getHyperLinksFromCategory(datasetInjector.getCategoryOverride())) |
Member
There was a problem hiding this comment.
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?
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.
Summary
DatasetInjector.getDefaultLinkCategory()— a new, narrow hook subclasses can override to name a default-hyperlink category (fromdatasetLinks.xml) that auto-loads when no explicitcategoryOverrideis set. Deliberately separate fromcategoryOverrideitself, which is also read byloadDatasetPresenterto setDatasetDatasource.category(used broadly by search/facet filters) — this hook affects only which default hyperlinks load, nothing else.DatasetPresenterSetLoader.loadDatasetInjector: the category-default-link loading path inserted link text/url verbatim with no macro substitution, so anydatasetLinks.xmltemplate containingDEFAULT_PROJECT/DEFAULT_DATASET_NAME/DEFAULT_ORG_ABBREV/DEFAULT_SEQUENCEwould load broken literal placeholder text. AddedloadSubstitutedLink, which resolves these at load time (newapidb.Organism/webready.GenomicSeqAttributes_plookups, small per-taxon caches) without mutating the shared, parsed-onceHyperLinktemplate objects.ChIPSeq.javaoverriding 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/DatasetPresenterbuilds cleanpresenterWriteToDb -reportdry run, then a realDatasetPresentertuning-table rebuild on a dev instance, confirmsapidb.DatasetHyperlinkgets a fully-substituted (noDEFAULT_*tokens) row for a ChIP-seq datasetapidb.DatasetDatasource.categoryis unchanged for those same datasets (regression check that the new hook does not leak into search/facet behavior)🤖 Generated with Claude Code