Changeset 7618


Ignore:
Timestamp:
Mar 4, 2019, 7:46:01 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2149: Batch item importers should be able to use an annotation for item identification

Added column mapping for the "Is identifier" flag to the annotation type importer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/AnnotationTypeImporter.java

    r7331 r7618  
    114114
    115115  /**
     116    Column mapping parameter for "Is identifier" flag.
     117  */
     118  private static final PluginParameter<String> isIdentifierColumnMapping =
     119    new PluginParameter<String>(
     120      "isIdentifierColumnMapping",
     121      "Is identifier",
     122      "Mapping that picks the 'Is identifier' flag from the data columns. " +
     123      "Example: \\Is identifier\\",
     124      optionalColumnMapping
     125    );
     126
     127  /**
    116128    Column mapping parameter for "Required for MIAME" flag.
    117129  */
     
    314326  private Mapper multiplicityMapper;
    315327  private Mapper defaultValueMapper;
     328  private Mapper isIdentifierMapper;
    316329  private Mapper miameMapper;
    317330  private Mapper protocolParameterMapper;
     
    366379    parameters.add(multiplicityColumnMapping);
    367380    parameters.add(defaultValueColumnMapping);
     381    parameters.add(isIdentifierColumnMapping);
    368382    parameters.add(miameColumnMapping);
    369383    parameters.add(protocolParameterColumnMapping);
     
    405419    defaultValueMapper = getMapper(ffp, (String)job.getValue("defaultValueColumnMapping"),
    406420        cropStrings ? AnnotationType.MAX_DEFAULT_VALUE_LENGTH : null, null);
     421    isIdentifierMapper = getMapper(ffp, (String)job.getValue("isIdentifierColumnMapping"), null, null);
    407422    miameMapper = getMapper(ffp, (String)job.getValue("miameColumnMapping"), null, null);
    408423    protocolParameterMapper = getMapper(ffp, (String)job.getValue("protocolParameterColumnMapping"), null, null);
     
    444459    if (multiplicityMapper != null) at.setMultiplicity(multiplicityMapper.getInt(data));
    445460    if (defaultValueMapper != null) at.setDefaultValue(defaultValueMapper.getValue(data));
     461    if (isIdentifierMapper != null) at.setIdentifier(Values.getBoolean(isIdentifierMapper.getValue(data)));
    446462    if (miameMapper != null) at.setRequiredForMiame(Values.getBoolean(miameMapper.getValue(data)));
    447463    if (protocolParameterMapper != null) at.setProtocolParameter(Values.getBoolean(protocolParameterMapper.getValue(data)));
Note: See TracChangeset for help on using the changeset viewer.