Book a Demo

Author Topic: Search Fails finding escaped characters &, <, >  (Read 5596 times)

JayBee

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Search Fails finding escaped characters &, <, >
« on: June 12, 2012, 11:55:52 pm »
I have a class that has an & in the Notes. When I peform a search using the string containing the & the class is not found. It is found, however, if I escape the &  as &amp; . In t_object the class notes are persisted with the escaped format.
This is not correct behavior as far as I'm concerned considering when I view the class notes I am presented with a non-escaped & . I should be able to simply cut and paste that string into the search and find the exact same class.
A typical user would have no idea the & is escaped and would be confused as to why they can't find what they are looking for (my tests show < and > act the same way).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search Fails finding escaped characters &,  <,
« Reply #1 on: June 13, 2012, 12:47:04 am »
I remember having encountered this behavior as well but did not report it. However, you should send a bug report.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Search Fails finding escaped characters &,  
« Reply #2 on: June 13, 2012, 05:41:45 pm »
This class of problem ALSO affects spell checking (even with ignore HTML set in the registry).

Now that EA supports HTML notes, it needs to provide a transparent mechanism (in the API also) to view and act upon both the adorned and unadorned text...

ALL entry points that DO NOT use HTML text should process against the unadorned (simple Unicode) version of the Notes, and vice versa.

This is, surely, Design 101?!

I would suggest a button on the Notes window(s) to switch between the adorned and unadorned versions.  It would also seem a good idea to provide a tagged value with the unadorned notes - kept in sync with the adorned notes.

My AU$0.05

Paolo
(I haven't reported the spelling bugs yet as there's a number of them and I'm too busy)
[size=0]©2012 Paolo Cantoni, Semantica[/size]
« Last Edit: June 13, 2012, 05:42:41 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Search Fails finding escaped characters &,  <,
« Reply #3 on: June 19, 2012, 04:30:25 pm »
Paolo,

The API provides operations to get both the plain text as the HTML (and RTF) version of the notes.
I've used this quite often in my code, so I know that that part at least works fine.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search Fails finding escaped characters &,  <,
« Reply #4 on: June 19, 2012, 06:20:17 pm »
Sure that works. But the whole handling leads to such curious behavior as described by JayBee. Instead of using this "internal format" it would have been "consistent" to introduce html formatting at a time and to stick to that all over. But now we have this salsa.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Search Fails finding escaped characters &,  <,
« Reply #5 on: June 22, 2012, 10:56:04 am »
Quote
Paolo,

The API provides operations to get both the plain text as the HTML (and RTF) version of the notes.
I've used this quite often in my code, so I know that that part at least works fine.

Geert
I had a quick look and I couldn't find them...  I was looking in the Element package, Element Class.  Can you point me at them, please?

However, that wasn't the point of my comment.  The UI should be fixed...

If I use formatting (for example in a terminological model) to define the acronym "EA" as Enterprise Architecture (to emphasise the location of the acronym letters), the spell checker telling me it can't find the words "nterprise" and "rchitecture" is a BUG.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Search Fails finding escaped characters &,  <,
« Reply #6 on: June 22, 2012, 12:59:24 pm »
Gosh, this takes me back, and reminds me of the bug reports I have submitted over the years.

See for example 856 spell check issues: html tags

and the related Unicode support in EA
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Search Fails finding escaped characters &,  
« Reply #7 on: June 22, 2012, 07:55:21 pm »
Quote
Gosh, this takes me back, and reminds me of the bug reports I have submitted over the years.

See for example 856 spell check issues: html tags

and the related Unicode support in EA
Hi Skiwi,

The standard HTML markup tags can be handled by a "Secret" registry setting for the Wintertree Spelling engine: in the [HKEY_CURRENT_USER\Software\Sparx Systems\EA400\SSCE]
section, ensure that "IgnoreHTMLMarkups"=dword:00000001

Why that isn't set by default - seeing as Notes are now HTML is (as usual) beyond me.

HTH,
Paolo
« Last Edit: June 22, 2012, 09:21:18 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search Fails finding escaped characters &,  <,
« Reply #8 on: June 22, 2012, 11:31:22 pm »
Quote
I had a quick look and I couldn't find them...  I was looking in the Element package, Element Class.  Can you point me at them, please?

Quote
string GetFieldFromFormat (string Format,string Text) — Converts the value Text from the Format ‘HTML’, ‘RTF’ or ‘TXT’ to Enterprise Architect’s internal format.
Use this to convert strings before placing them into arbitrary Note fields of EA’s objects.

string GetFormatFromField (string Format, string Text) — The reverse for the previous method.
Use this to convert strings from arbitrary Note fields of EA’s objects into the desired formats.

From my book.

q.