ce5fb4ee78a01179f2f53114b6eb52ca77811eb6
kate
  Wed Jan 23 10:08:41 2013 -0800
1. hgFileUi now only prints data restriction warning if the composite has a restricted object. 2. Add -cv option to mdbPrint to allow alternate CV file.  2. 3. A step toward modularizing restriction timestamp handling.  #10006  Mute File UI loud warnings when they are not applicable.
diff --git src/hg/inc/mdb.h src/hg/inc/mdb.h
index 1989182..2eeadb4 100644
--- src/hg/inc/mdb.h
+++ src/hg/inc/mdb.h
@@ -117,30 +117,32 @@
 #define MDB_VAR_FILENAME        "fileName"
 #define MDB_VAR_MD5SUM          "md5sum"
 #define MDB_VAR_FILEINDEX       "fileIndex"
 #define MDB_VAR_DCC_ACCESSION   "dccAccession"
 #define MDB_VAR_PROJECT         "project"
 #define MDB_VAR_REPLICATE       "replicate"
 #define MDB_VAR_LAB_VERSION     "labVersion"
 #define MDB_VAR_SOFTWARE_VERSION "softwareVersion"
 #define MDB_VAR_SUBMIT_VERSION  "submittedDataVersion"
 
 // ENCODE Specific (at least for now)
 #define MDB_VAL_ENCODE_PROJECT  "wgEncode"
 #define MDB_VAR_ENCODE_SUBID    "subId"
 #define MDB_VAR_ENCODE_EDVS     "expVars"
 #define MDB_VAR_ENCODE_EXP_ID   "expId"
+#define MDB_VAR_ENCODE_DATE_UNRESTRICTED   "dateUnrestricted"
+#define MDB_ENCODE_DATE_FORMAT      "%F"
 #define MDB_VAL_ENCODE_EDV_NONE "None"
 
 
 // The mdb holds metadata primarily for tables.
 //   Many types of objects could be supported, though currently files are the only other type.
 // It is easy to imagine using the current mdb to support hierarchical trees of metadata.
 // For example a composite type object called "myComposte" could have metadata that is valid for
 // all tables that have the var=composite val=myComposte metadata defined.
 //
 // There are 2 ways to look at the metadata: By Obj: obj->[var=val] and By Var: var->[val->[obj]].
 // By Obj: an object has many var/val pairs but only one val for each unique var.  Querying by
 //         object creates a single (2 level) one to many structure.
 // By Var: a variable has many possible values and each value may be defined for more than one obj
 //         Therefore, querying by var results in a (3 level) one to many to many structure.
 
@@ -466,30 +468,33 @@
 
 struct mdbObj *mdbObjsEncodeExperimentify(struct sqlConnection *conn,char *db,char *tableName,
                                           char *expTable,struct mdbObj **pMdbObjs,int warn,
                                           boolean createExpIfNecessary,boolean updateAccession);
 // Organizes objects into experiments and validates experiment IDs.
 // Will add/update the ids in the structures.
 // If warn=1, then prints to stdout all the experiments/obs with missing or wrong expIds;
 //    warn=2, then print line for each obj with expId or warning.
 // createExpIfNecessary means add expId to encodeExp table. updateAccession too if necessary.
 // Returns a new set of mdbObjs that is what can (and should)
 //         be used to update the mdb via mdbObjsSetToDb().
 
 boolean mdbObjIsEncode(struct mdbObj *mdbObj);
 // Returns TRUE if MDB object is an ENCODE object (project=wgEncode)
 
+boolean mdbObjEncodeIsUnrestricted(struct mdbObj *mdb);
+// Return true if this object is still within data restriction time period 
+
 boolean mdbObjInComposite(struct mdbObj *mdb, char *composite);
 // Returns TRUE if metaDb object is in specified composite.
 // If composite is NULL, always return true
 // FIXME: KATE Why return true if composite not defined???
 
 // -- Requested by Kate? --
 //struct encodeExp *encodeExps(char *composite,char *expTable);
 //struct mdbObjs *mdbObjsForDefinedExpId(int expId);
 // Returns the mdb objects belonging to a single encode experiment defined in the encodExp table
 
 
 // --------------- Free at last ----------------
 void mdbObjsFree(struct mdbObj **mdbObjsPtr);
 // Frees one or more metadata objects and any contained mdbVars.  Will free any hashes as well.
 #define mdbObjFree(mdbObjPtr) mdbObjsFree(mdbObjPtr)