Opened 18 years ago

Closed 18 years ago

#642 closed enhancement (fixed)

Add method that finds an enumerated annotation value that can ignore case and whitespace

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: trivial Milestone: BASE 2.4
Component: core Version:
Keywords: Cc:

Description

Dominic Oyeniran wrote:

Having an annotation type cell type with allowed values: b cell, barrier epithelial cell etc.

On setting annotation -B cell, obtained from an import file, for cell type using this code:

annotatable.getAnnotationSet().getAnnotation(AnnotationType).setValue(value);

I get an InvalidDataException. I found out that this is because of the mismatch between B cell and b cell. once I changed either of them, it works fine.

Can an ignorecase equality be done in the base 2 code that does the setting of annotation values. May be a trim would also be reasonable.

It might be possible but I am a bit worried that it may break existing data. What I can do is to add a utility method in AnnotationType. Something like this:

AnnotationType.findValue(String value, boolean ignoreCase, boolean trim);

The method would return the string that is stored as one of the allowed values if it finds a match or null if it can't find a value.

Change History (4)

comment:1 by Nicklas Nordborg, 18 years ago

Component: webcore
Milestone: BASE 2.4

comment:2 by Nicklas Nordborg, 18 years ago

Priority: majortrivial

comment:3 by Nicklas Nordborg, 18 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:4 by Nicklas Nordborg, 18 years ago

Resolution: fixed
Status: assignedclosed

(In [3527]) Fixes #642: Add method that finds an enumerated annotation value that can ignore case and whitespace

Note: See TracTickets for help on using tickets.