8ddabffbe58063f2094af1d0fdb45721afcec97c angie Wed Mar 4 13:21:47 2015 -0800 Moved the smarts about changing clade/org/db out of cartJson.c & hgAi.c and into CladeOrgDbMixin.js & hgAiModel.js. Now the CGI sends the full tree of clades, genomes and dbs, and the model instantaneously updates when the user changes clade, org or db, and tells the CGI exactly what info it needs instead of relying on the CGI to send a special mix. refs #14579 diff --git src/hg/inc/cartJson.h src/hg/inc/cartJson.h index 6f7a356..a13fd35 100644 --- src/hg/inc/cartJson.h +++ src/hg/inc/cartJson.h @@ -6,54 +6,42 @@ #include "cart.h" #include "hash.h" #include "jsonWrite.h" #define CARTJSON_COMMAND "cjCmd" struct cartJson // Use the cart to perform commands dispatched from handlerHash; print results with jsonWrite. { struct cart *cart; struct hash *handlerHash; struct jsonWrite *jw; }; struct cartJson *cartJsonNew(struct cart *cart); -/* Allocate and return a cartJson object with default handlers. */ +/* Allocate and return a cartJson object with default handlers. + * cart must have "db" set already. */ typedef void CartJsonHandler(struct cartJson *cj, struct hash *paramHash); /* Implementation of some command; paramHash associates parameter names with * jsonElement values. */ char *cartJsonOptionalParam(struct hash *paramHash, char *name); /* Convenience function for a CartJsonHandler function: Look up name in paramHash. * Return the string contained in its jsonElement value, or NULL if not found. */ char *cartJsonRequiredParam(struct hash *paramHash, char *name, struct jsonWrite *jw, char *context); /* Convenience function for a CartJsonHandler function: Look up name in paramHash. * If found, return the string contained in its jsonElement value. * If not, write an error message (using context) and return NULL. */ void cartJsonRegisterHandler(struct cartJson *cj, char *command, CartJsonHandler *handler); /* Associate handler with command; when javascript sends command, handler will be executed. */ void cartJsonExecute(struct cartJson *cj); /* Get commands from cgi, print Content-type, execute commands, print results as JSON. */ void cartJsonFree(struct cartJson **pCj); /* Close **pCj's contents and nullify *pCj. */ -void cartJsonChangeDb(struct cartJson *cj, struct hash *paramHash); -/* Change db to new value, update cart and print JSON of new position & gene suggest track. */ - -void cartJsonChangeOrg(struct cartJson *cj, struct hash *paramHash); -/* Change org to new value, update cart and print JSON of new db menu, new position etc. */ - -void cartJsonChangeClade(struct cartJson *cj, struct hash *paramHash); -/* Change clade to new value, update cart, and print JSON of new org & db menus, new position etc */ - -void cartJsonGetGroupedTrackDb(struct cartJson *cj, struct hash *paramHash); -/* Translate trackDb list (only a subset of the fields) into JSON array of track group objects; - * each group contains an array of track objects that may have subtracks. */ - #endif /* CARTJSON_H */