Changeset 7861


Ignore:
Timestamp:
Oct 21, 2020, 7:39:15 AM (13 months ago)
Author:
Nicklas Nordborg
Message:

References #2224: Files should be annotatable

Adding file loading from protocol nodes and validation to the "Item overview".

Location:
trunk/src/core/net/sf/basedb/util/overview
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java

    r7813 r7861  
    100100            Validator.MISSING_DERIVEDBIOASSAY, Validator.MISSING_ARRAYDESIGN, Validator.MISSING_PROTOCOL,
    101101            Validator.MISSING_HARDWARE, Validator.MISSING_SOFTWARE, Validator.MISSING_TAG,
    102             Validator.MISSING_KIT,
     102            Validator.MISSING_KIT, Validator.MISSING_FILE,
    103103            Validator.MISSING_ARRAYSLIDE, Validator.MISSING_ARRAYBATCH, Validator.MISSING_ANYTOANY
    104104          })
     
    112112            Validator.INCORRECT_DERIVEDBIOASSAY_TYPE, Validator.INCORRECT_PROTOCOLTYPE,
    113113            Validator.INCORRECT_HARDWARETYPE, Validator.INCORRECT_SOFTWARETYPE,
    114             Validator.INCORRECT_TAGTYPE, Validator.INCORRECT_KITTYPE
     114            Validator.INCORRECT_TAGTYPE, Validator.INCORRECT_KITTYPE, Validator.INCORRECT_FILETYPE
    115115          })
    116116        );
  • trunk/src/core/net/sf/basedb/util/overview/Validator.java

    r7005 r7861  
    103103 
    104104  /**
     105    Validator rule that checks for denied access to (data) files.
     106    Default severity level is WARNING.
     107    @since 3.17
     108  */
     109  public static final Validator MISSING_FILE = new Validator(
     110      "missing.file", "Missing file",
     111      "Checks if a file has been specified for items that should have a file",
     112      "Missing file", Severity.WARNING
     113    );
     114
     115 
     116  /**
    105117    Validator rule that checks for denied access to data file types.
    106118    Default severity level is WARNING.
     
    584596    );
    585597
     598  /**
     599    Validator rule that checks if the file attached to an item
     600    has a correct file type. Default severity level is WARNING.
     601    @since 3.17
     602  */
     603  public static final Validator INCORRECT_FILETYPE = new Validator(
     604      "subtype.file", "Incorrect file subtype",
     605      "Checks if the file attached to an item has a correct file type.",
     606      "Incorrect file subtype", Severity.WARNING
     607    );
     608 
    586609  /**
    587610    Validator that checks if the parent biosource of a sample
  • trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java

    r7513 r7861  
    247247    registerCheckedNodeLoader(Item.FILESETMEMBER, DataFileLoader.class);
    248248    registerCheckedNodeLoader(Item.ANYTOANY, AnyToAnyLoader.class);
     249    registerCheckedNodeLoader(Item.FILE, FileLoader.class);
    249250   
    250251  }
  • trunk/src/core/net/sf/basedb/util/overview/loader/ProtocolLoader.java

    r6959 r7861  
    110110  protected void loadPropertyChildNodes(DbControl dc, OverviewContext context, Node protocolNode)
    111111  {
     112    getNodeLoader(context, Item.FILE).createPropertyNode(dc, context, protocolNode);
    112113    getNodeLoader(context, Item.ANNOTATION).createPropertyNode(dc, context, protocolNode);
    113114    getNodeLoader(context, "PROTOCOL.PARAMETER").createPropertyNode(dc, context, protocolNode);
  • trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r7513 r7861  
    219219    registerCheckedNodeValidator(Item.FILESETMEMBER, DataFileValidator.class);
    220220    registerCheckedNodeValidator(Item.ANYTOANY, AnyToAnyValidator.class);
     221    registerCheckedNodeValidator(Item.FILE, FileValidator.class);
    221222  }
    222223
Note: See TracChangeset for help on using the changeset viewer.