7dd415b92afc397bf46af8b1fbb8f9e9778cfdba tdreszer Fri Jan 14 16:26:39 2011 -0800 Really must stop trying things and wait for feedback diff --git src/hg/lib/fileUi.c src/hg/lib/fileUi.c index 6dc1561..1d8bbff 100644 --- src/hg/lib/fileUi.c +++ src/hg/lib/fileUi.c @@ -167,45 +167,47 @@ if(setting) { sortOrder = needMem(sizeof(sortOrder_t)); sortOrder->setting = cloneString(setting); carveSetting = sortOrder->setting; } else { if (mdbObjs != NULL) { struct dyString *dySortFields = dyStringNew(512); struct mdbObj *commonVars = mdbObjsCommonVars(mdbObjs); // Problem with making common fieds as sorable is that it REQUIRES a fixed sort order char *sortables[] = {"grant","lab","dataType","cell","strain","age","obtainedBy", "rnaExtract","localization","phase","treatment","antibody","protocol", "labProtocolId","restrictionEnzyme","control","replicate","expId","labExpId","setType","view","submittedDataVersion","subId", - "dateSubmitted","dateResubmitted","dateUnrestricted","dataVersion"};//"labVersion","softwareVersion", + "dateSubmitted","dateResubmitted","dateUnrestricted","dataVersion","origAssembly"};//"labVersion","softwareVersion", // Not included: no:not searchable // accession no, annotation no, bioRep no, composite no, controlId no, dccInternalNotes no, fileIndex no, fileName no, // fragSize no, fragLength no, freezeDate no, geoSample, geoSeries, insertLength no, labVersion, level no, - // mapAlgorithm, origAssembly, privacy no, rank no, readType, seqPlatform, sex, - // size no, softwareVersion, tableName no, uniqueness no + // mapAlgorithm, privacy no, rank no, readType, seqPlatform, sex, size no, softwareVersion, + // tableName no, uniqueness no int ix = 0, count = sizeof(sortables)/sizeof(char *); for (ix=0;ix<count;ix++) { // If sortables[ix] is in common vars then then add it to the settings field if (mdbObjContains(commonVars,sortables[ix],NULL)) { - if (mdbRemoveCommonVar(mdbObjs, sortables[ix])) // Don't bother if all the vals are the same - continue; + // TODO: This would be good, but valuable information slips away. This is especially true in fileSearch + // Maybe another whiteList? + //if (mdbRemoveCommonVar(mdbObjs, sortables[ix])) // Don't bother if all the vals are the same + // continue; dyStringPrintf(dySortFields,"%s=%s ",sortables[ix],strSwapChar(cloneString(cvLabel(sortables[ix])),' ','_')); } } if (dyStringLen(dySortFields)) { dyStringAppend(dySortFields,"fileSize=Size fileType=File_Type"); setting = dyStringCannibalize(&dySortFields); } else dyStringFree(&dySortFields); mdbObjsFree(&commonVars); } if(setting == NULL) // Must be in trackDb or not a sortable list of files { #define FILE_SORT_ORDER_DEFAULT "cell=Cell_Line lab=Lab view=View replicate=Rep fileSize=Size fileType=File_Type dateSubmitted=Submitted dateUnrestricted=RESTRICTED<BR>Until" @@ -744,25 +746,27 @@ if (slCount(fileList) == 0) { printf("<DIV id='filesFound'><BR>No files found.<BR></DIV><BR>\n"); return 0; // No files so nothing to do. } // TODO Could sort on varValPairs by creating a sortOrder struct of them //// Now update all files with their sortable fields and sort the list sortOrder_t *sortOrder = fileSortOrderGet(NULL,NULL,mdbFiles); // No cart, no tdb if (sortOrder != NULL) { // Fill in and sort fileList fileDbSortList(&fileList,sortOrder); } +mdbObjRemoveVars(mdbFiles,"tableName"); // Remove this from mdb now so that it isn't displayed in "extras' + //jsIncludeFile("hui.js",NULL); //jsIncludeFile("ajax.js",NULL); // Print table int filesCount = filesPrintTable(db,NULL,fileList,sortOrder); //fileDbFree(&fileList); // Why bother on this very long running cgi? return filesCount; }