Author Topic: Tamplate Fragment - select element Note produces HTML source code  (Read 3424 times)

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Hello,
In a template fragment I am selecting elements of a certain types in the current package using #PACKAGEID# (see select clause below).
I use that fragment only to be able to sort elements by a certain tagged value in a package.

The select clause collects notably the element Note.
The fragment also formats the resulting values in a table.

Problem: The generated Note field value, referred as {Note} in the document, shows the source HTML text including <LI> etc...

Any idea how to fix this problem?

Cheers,
Alain

SELECT
Perspective = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Perspective'),
Code = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Code'),
t_object.Name as Name, t_object.Note,
Implications = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Implications'),
Rationale = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Rationale')
FROM t_object
where t_object.stereotype = 'NMBS_Principle'
and t_object.package_id = #PACKAGEID#
order by Code


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Tamplate Fragment - select element Note produces HTML source code
« Reply #1 on: May 10, 2018, 01:29:25 am »
I guess you need something like t_object.not as notes.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tamplate Fragment - select element Note produces HTML source code
« Reply #2 on: May 10, 2018, 02:45:30 am »
You have to mark it as formatted text.
Use t_object.Note-Formatted in the query and {Note.Formatted} in the template.

See https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_publishing/custom_sql_fragments.html

Geert

adepreter

  • EA User
  • **
  • Posts: 187
  • Karma: +10/-9
    • View Profile
Re: Tamplate Fragment - select element Note produces HTML source code
« Reply #3 on: May 14, 2018, 08:51:19 pm »
That works fine. Thank you Geert!

Result is:

{Note.Formatted}

referring to the following query:

SELECT
Perspective = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Perspective'),
Code = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Code'),
t_object.Name as Name, t_object.Note as "Note.Formatted",
Implications = (select tv.notes from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Implications'),
Rationale = (select tv.notes from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Rationale')
FROM t_object
where t_object.stereotype = 'NMBS_Principle'
and t_object.package_id = #PACKAGEID#
order by Code