a4ec09b5bbfbaf7c4f40053b24f42f075a5b6b85 chmalee Tue Nov 12 14:23:32 2024 -0800 Lots of changes after meeting, mostly to accomadate hubtools uploads: allow parentDir in upload request, make batch change dropdowns have the right options. TODO: remove type selection all together from UI, make hub name generation not be hardcoded in ui diff --git src/hg/hgHubConnect/trackHubWizard.c src/hg/hgHubConnect/trackHubWizard.c index efcbb27..1a025fc 100644 --- src/hg/hgHubConnect/trackHubWizard.c +++ src/hg/hgHubConnect/trackHubWizard.c @@ -101,62 +101,62 @@ fflush(stderr); // check if this hub already exists, must have a directory and hub.txt already: char *path = prefixUserFile(userName, encodedName); if (isDirectory(path)) { // can't make a hub that already exists! fprintf(stdout, "Status: 400 Bad Request\n\n"); fprintf(stdout, "Hub already exists, select hub from dropdown or try a different name"); fflush(stdout); exit(1); } else { // good we can make a new directory and stuff a hub.txt in it // the directory needs to be 777, so ignore umask for now - writeHubText(path, userName, encodedName, name, db); + writeHubText(path, userName, encodedName, db); // TODO: add a row to the hubspace table for the hub.txt //addHubTxtToTable(userName, path, name, db); // return json to fill out the table jsonWriteString(cj->jw, "hubName", name); jsonWriteString(cj->jw, "db", db); time_t now = time(NULL); jsonWriteString(cj->jw, "creationTime", sqlUnixTimeToDate(&now, FALSE)); } } } static void outFilesForUser() /* List out the currently stored files for the user and their sizes */ { char *userName = getUserName(); struct jsonWrite *jw = jsonWriteNew(); // the JSON to return for the client javascript jsonWriteObjectStart(jw, NULL); if (userName) { // the url for this user: jsonWriteString(jw, "userUrl", webDataDir(userName)); jsonWriteListStart(jw, "fileList"); struct hubSpace *file, *fileList = listFilesForUser(userName); for (file = fileList; file != NULL; file = file->next) { jsonWriteObjectStart(jw, NULL); cgiDecodeFull(file->fileName, file->fileName, strlen(file->fileName)); jsonWriteString(jw, "fileName", file->fileName); jsonWriteNumber(jw, "fileSize", file->fileSize); jsonWriteString(jw, "fileType", file->fileType); - jsonWriteString(jw, "hub", file->hubNameList); + jsonWriteString(jw, "hub", file->fileName); jsonWriteString(jw, "genome", file->db); jsonWriteString(jw, "lastModified", file->lastModified); jsonWriteString(jw, "uploadTime", file->creationTime); jsonWriteObjectEnd(jw); } jsonWriteListEnd(jw); /* jsonWriteListStart(jw, "hubList"); struct userHubs *hub, *hubList = listHubsForUser(userName); for (hub = hubList; hub != NULL; hub = hub->next) { jsonWriteObjectStart(jw, NULL); cgiDecodeFull(hub->hubName, hub->hubName, strlen(hub->hubName)); jsonWriteString(jw, "hubName", hub->hubName); jsonWriteString(jw, "genome", hub->genome);