#2314 closed defect (fixed)

Problems with annotations containing special characters

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.19.10
Component: web Version:
Keywords: Cc:

Description

Create an annotation type that is an enum with the following options: <A>, <B> and <C>.

On the information page the values are displayed as &lt;A&gt;, &lt;B&gt; and &lt;C&gt;. The same happens when trying to annotate an item.

And the annotation is not accepted: Value '<A>' is not among the list of allowed values for annotation type: XYZ.

There may be more issues so this need to be investigate.

Change History (7)

comment:1 by Nicklas Nordborg, 12 months ago

In 8177:

References #2314: Problems with annotations containing special characters

The FormatterFactory.getTypeFormatter() method returns a formatter that already encode the values, so the problem was double encoding. Added a new method to the FormatterFactory that can return a formatter that doesn't encode the strings. It is better to do that on the JSP in this case.

comment:2 by Nicklas Nordborg, 12 months ago

In 8178:

References #2314: Problems with annotations containing special characters

The JSON created by AnnotationUtil.createJsonForAnnotationTypeAndAnnotation() show not contain encoded values. This seems to fix the problem with annotating items.

Also noticed that the annotation categories where joined two times which created a list with lots of duplicate entries. This has been fixed.

comment:3 by Nicklas Nordborg, 12 months ago

In 8179:

References #2314: Problems with annotations containing special characters

There is a major problem with filtering if an enum option starts with '>', '<' or '=', since that is interpreted as operators by the filtering system and the value used for filtering is then the rest of the value which is not one of the options. There is also a problem if the enum option contains a '%' which triggers a LIKE search.

This was solved by introducing a new operator '=!' and redefining the '!=' to allow lists of values but not wildcards.

This also requires that enum-values are not HTML-encoded so each list page needs also need an update. This is currently fixed on the biosources list page.

comment:4 by Nicklas Nordborg, 12 months ago

In 8180:

References #2314: Problems with annotations containing special characters

Moved functionality to Base.getAnnotationTypeEnum() and updated all list pages.

comment:5 by Nicklas Nordborg, 12 months ago

In 8181:

References #2314: Problems with annotations containing special characters

Exported values are no longed HTML-encoded.

comment:6 by Nicklas Nordborg, 12 months ago

In 8182:

References #2314: Problems with annotations containing special characters

Removed double encoding when inheriting annotations.

comment:7 by Nicklas Nordborg, 11 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.