Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1642 closed enhancement (fixed)

Add support for column mapping that selects a project default item in batch item importers

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: BASE 3.1
Component: coreplugins Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

If a property is not mapped to a column in the batch item importers and project default item exists for the property (eg. a sampling protocol) the core will automatically set that property when creating new items.

Note that this is a feature of the core and that the batch importers doesn't care about project default items at all.

But, we would like to change this so that a column mapping could, for example, be an expression that select a project default item. Since there is already support for the JEP parser in column mappings the functionality can be provided by defining a set of new JEP functions. For example:

=default()  // Get the project default value
=default(col('column')) // Get the value from the 'column', 
                   // but use the project default item for empty values

This would allow the batch importers to use project defaults with both new and existing items.

For background information see: http://www.mail-archive.com/basedb-users@lists.sourceforge.net/msg02048.html

Change History (4)

comment:1 Changed 10 years ago by Nicklas Nordborg

Description: modified (diff)

comment:2 Changed 10 years ago by Nicklas Nordborg

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:3 Changed 10 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [5899]) Fixes #1642: Add support for column mapping that selects a project default item in batch item importers

Use =default() as column mapping to assign the project default value to all items, or =default(col('foo')) to use the value from column 'foo' if it is not empty and the project default value otherwise.

comment:4 Changed 10 years ago by Nicklas Nordborg

Description: modified (diff)
Note: See TracTickets for help on using tickets.