extensions/net.sf.basedb.meludi/trunk/src/net/sf/basedb/meludi/dao/Consent.java

Code
Comments
Other
Rev Date Author Line
4773 20 Apr 18 olle 1 package net.sf.basedb.meludi.dao;
4773 20 Apr 18 olle 2
4773 20 Apr 18 olle 3 import net.sf.basedb.core.DbControl;
4773 20 Apr 18 olle 4 import net.sf.basedb.core.Sample;
4773 20 Apr 18 olle 5 import net.sf.basedb.meludi.Meludi;
4773 20 Apr 18 olle 6 //import net.sf.basedb.meludi.projectarchive.ProjectArchiveService;
4773 20 Apr 18 olle 7
4773 20 Apr 18 olle 8 /**
4773 20 Apr 18 olle 9   Class for handling information related to consent information.
4773 20 Apr 18 olle 10   
4773 20 Apr 18 olle 11   @author nicklas
4773 20 Apr 18 olle 12   @since 2.2
4773 20 Apr 18 olle 13 */
4773 20 Apr 18 olle 14 public class Consent 
4773 20 Apr 18 olle 15 {
4773 20 Apr 18 olle 16
4773 20 Apr 18 olle 17   /**
4773 20 Apr 18 olle 18     Load all consent-related annotations for the given item.
4773 20 Apr 18 olle 19   */
4773 20 Apr 18 olle 20   public static void loadConsentAnnotations(DbControl dc, MeludiItem<?> item)
4773 20 Apr 18 olle 21   {
4773 20 Apr 18 olle 22     item.loadAnnotations(dc, "consent", Annotationtype.CONSENT, null);
4773 20 Apr 18 olle 23     item.loadAnnotations(dc, "consentDate", Annotationtype.CONSENT_DATE, Meludi.CONVERTER_DATE_TO_STRING);
4773 20 Apr 18 olle 24   }
4773 20 Apr 18 olle 25
4773 20 Apr 18 olle 26   
4773 20 Apr 18 olle 27   /**
4773 20 Apr 18 olle 28     Copy all consent-related annotations from one item to the other.
4773 20 Apr 18 olle 29   */
4773 20 Apr 18 olle 30   public static void copyConsentAnnotations(DbControl dc, Sample from, Sample to)
4773 20 Apr 18 olle 31   {
4773 20 Apr 18 olle 32     Annotationtype.CONSENT.copyAnnotationValues(dc, from, to, false);
4773 20 Apr 18 olle 33     Annotationtype.CONSENT_DATE.copyAnnotationValues(dc, from, to, false);
4773 20 Apr 18 olle 34     //ProjectArchiveService.getInstance().setForceCheck();
4773 20 Apr 18 olle 35   }
4773 20 Apr 18 olle 36   
4773 20 Apr 18 olle 37   /**
4773 20 Apr 18 olle 38     Flag value for the {@link Annotationtype#FLAG} annotation when an
4773 20 Apr 18 olle 39     item has been flagged to be connected to a retracted consent,
4773 20 Apr 18 olle 40     or having been erroneously included, without a consent.
4773 20 Apr 18 olle 41     @since 2.17
4773 20 Apr 18 olle 42    */
4773 20 Apr 18 olle 43   public static final String FLAG_RETRACTED = "Retracted";
4773 20 Apr 18 olle 44
4773 20 Apr 18 olle 45 }