コード例 #1
0
ファイル: pfam.c プロジェクト: blumroy/kentUtils
void setupColumnPfam(struct column *col, char *parameters)
/* Setup Pfam column. */
{
setupColumnAssociation(col, parameters);
col->table = cloneString(parameters);
if ((col->protDb = columnSetting(col, "protDb", NULL)) == NULL)
    errAbort("Missing required protDb field in column %s", col->name);
col->advFilter = pfamAdvFilter;
col->filterControls = pfamFilterControls;
}
コード例 #2
0
ファイル: gisaidTable.c プロジェクト: davidhoover/kent
void lookupAdvFilterControls(struct column *col, struct sqlConnection *conn)
/* Print out controls for advanced filter on lookup column. */
{
char *fileName = advFilterVal(col, "keyFile");
hPrintf("%s search (including * and ? wildcards):", col->shortLabel);
advFilterRemakeTextVar(col, "wild", 18);
hPrintf("<BR>\n");
hPrintf("Include if ");
advFilterAnyAllMenu(col, "logic", TRUE);
hPrintf("words in search term match.<BR>");
if (!columnSetting(col, "noKeys", NULL))
    {
    hPrintf("Limit to items (no wildcards) in list: ");
    advFilterKeyPasteButton(col);
    hPrintf(" ");
    advFilterKeyUploadButton(col);
    hPrintf(" ");
    if (fileName != NULL)
        {
        if (fileExists(fileName))
            {
            int count = countQuotedWordsInFile(fileName);
            advFilterKeyClearButton(col);
            hPrintf("<BR>\n");
            if (count == 1)
                hPrintf("(There is currently 1 item in the list.)");
            else
                hPrintf("(There are currently %d items in the list.)", count);
            }
        else
            {
            cartRemove(cart, advFilterName(col, "keyFile"));
            }
       }
    }
if (col->filterDropDown)
    showListOfFilterValues(col, conn);

}
コード例 #3
0
void setupColumnAssociation(struct column *col, char *parameters)
/* Set up a column that looks for an association table 
 * keyed by the geneId. */
{
if ((col->queryFull = columnSetting(col, "queryFull", NULL)) == NULL)
    errAbort("Missing required queryFull field in column %s", col->name);
if ((col->queryOne = columnSetting(col, "queryOne", NULL)) == NULL)
    errAbort("Missing required queryOne field in column %s", col->name);
if ((col->invQueryOne = columnSetting(col, "invQueryOne", NULL)) == NULL)
    errAbort("Missing required invQueryOne field in column %s", col->name);
col->protKey = (columnSetting(col, "protKey", NULL) != NULL);
col->weedDupes = (columnSetting(col, "weedDupes", NULL) != NULL);
col->tablesUsed = cloneString(parameters);
col->exists = associationExists;
col->filterControls = associationFilterControls;
col->advFilter = associationAdvFilter;
col->cellVal = associationCellVal;
col->cellPrint = associationCellPrint;
if (columnSetting(col, "search", NULL))
    col->simpleSearch = associationSimpleSearch;
}
コード例 #4
0
ファイル: search.c プロジェクト: elmargb/kentUtils
static void searchAllColumns(struct sqlConnection *conn, 
	struct column *colList, char *search)
/* Call search on each column. */
{
struct column *col;
struct searchResult *srList, *sr;
struct columnSearchResults *csrList = NULL, *csr;
int totalCount = 0;
struct searchResult *srOne = NULL;

for (col = colList; col != NULL; col = col->next)
    {
    if (col->simpleSearch)
	 {
         srList = col->simpleSearch(col, conn, search);
	 if (showOnlyCanonical() && srList != NULL)
	     {
	     transformToCanonical(srList, conn);
	     srList = removeDupes(srList);
	     }
	 if (srList != NULL)
	     {
	     srOne = srList;
	     fillInMissingLabels(conn, colList, srList);
	     AllocVar(csr);
	     csr->label = columnSetting(col, "searchLabel", col->longLabel);
	     csr->results = srList;
	     slAddTail(&csrList, csr);
	     totalCount += slCount(srList);
	     }
	 }
    }
if (totalCount == 0)
    {
    displayData(conn, colList, NULL);
    if (anyWild(search))
        warn("Sorry, the search box doesn't take wildcards, "
	     "though in most cases it will find things without "
	     "them.  Try entering your search without * or ? "
	     "characters.");
    else
	warn("Sorry, couldn't find '%s'", search);
    }
else if (totalCount == 1 || allSame(csrList))
// else if (totalCount == 1)
    displayData(conn, colList, &srOne->gp);
else
    {
    makeTitle("Simple Search Results", NULL);
    for (csr = csrList; csr != NULL; csr = csr->next)
        {
	hPrintf("<H2>%s</H2>\n", csr->label);
	slSort(&csr->results, searchResultCmpShortLabel);
	for (sr = csr->results; sr != NULL; sr = sr->next)
	    {
	    selfAnchorSearch(&sr->gp);
	    if (sr->matchingId != NULL)
		hPrintf("%s (%s)", sr->matchingId, sr->shortLabel);
	    else
		hPrintf("%s", sr->shortLabel);
	    hPrintf("</A> - %s<BR>\n", sr->longLabel);
	    }
	}
    }
}