cf924d2aa402c655a84131bbcb689bfc3d5307aa angie Fri Nov 20 16:21:13 2015 -0800 Data Integrator UI for adding related SQL tables and fields for SQL-based tracks using all.joiner. This is only the UI -- the implementation will be in a subsequent commit. Main changes: - cartJson interface between hgIntegrator.c and hgIntegratorModel.js: - new command getRelatedTables - the getFields command used to expect a simple comma-sep list of tracks. Now it expects a list of ';'-sep track blobs, each of which may include multiple comma-sep tables (track plus related tables). - UI state interface between hgIntegrator.jsx and hgIntegratorModel.js: - fieldSelect now supports multiple tables per track - js/react/hgIntegrator/hgIntegrator.jsx: new subsections of 'Choose fields...' dialog (FieldSelect) for adding related tables and showing their available fields w/checkboxes; corresponding new UI state and events. - js/model/hgIntegrator/hgIntegratorModel.js: - new handlers for UI events and cartJson data for related tables/fields - hgIntegrator.c: new code to return information about what tables (if any) are related to each selected track, and what fields are in selected related tables. Other changes: - hgIntegratorModel.js: - split monolithic handleCartVar into separate handlers - add new 'hgi_uiChoices' cart var to remember things that may not pertain to the current query, such as a user's related tables/fields selections for a table that is not included in the current query. - convert between hgi_querySpec and internal UI state representation (querySpecUpdateUiChoices, toQuerySpecJS) - cart.js: added uiChoices convenience functions, stringifying of cartSet val - cartJson interface between hgIntegrator.c and hgIntegratorModel.js: - new command getQueryState: bundle querySpec and uiChoices from the cart since they need to be processed together - UI state interface between hgIntegrator.jsx and hgIntegratorModel.js: - split UI state's querySpec object into separate dataSources and outFileOptions objects (no point in bundling those in the UI) Thanks to Kate and Matt for helpful suggestions about the UI. refs #15544 diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h index 39e52e7..b421291 100644 --- src/hg/inc/hdb.h +++ src/hg/inc/hdb.h @@ -215,30 +215,35 @@ char *hReplaceGbdbSeqDir(char *path, char *db); /* similar to hReplaceGbdb, but accepts a nib or 2bit "directory" (basename) under * gbdb, like /gbdb/hg19 (for jkLib that means /gbdb/hg19/hg19.2bit). */ char* hReplaceGbdbMustDownload(char* path); /* given a location in /gbdb, rewrite it to the new location using gbdbLoc1 and download it * if needed from gbdbLoc2. */ void hParseTableName(char *db, char *table, char trackName[HDB_MAX_TABLE_STRING], char chrom[HDB_MAX_CHROM_STRING]); /* Parse an actual table name like "chr17_random_blastzWhatever" into * the track name (blastzWhatever) and chrom (chr17_random). */ +void hParseDbDotTable(char *dbIn, char *dbDotTable, char *dbOut, size_t dbOutSize, + char *tableOut, size_t tableOutSize); +/* If dbDotTable contains a '.', then assume it is db.table and parse out into dbOut and tableOut. + * If not, then it's just a table; copy dbIn into dbOut and dbDotTable into tableOut. */ + int hChromSize(char *db, char *chromName); /* Return size of chromosome. */ struct chromInfo *hGetChromInfo(char *db, char *chrom); /* Get chromInfo for named chromosome (case-insens.) from db. * Return NULL if no such chrom. */ struct dnaSeq *hFetchSeq(char *fileName, char *seqName, int start, int end); /* Fetch sequence from file. If it is a .2bit file then fetch the named sequence. If it is .nib then just ignore seqName. */ struct dnaSeq *hFetchSeqMixed(char *fileName, char *seqName, int start, int end); /* Fetch mixed case sequence. */ struct dnaSeq *hChromSeq(char *db, char *chrom, int start, int end);