Pocket Query zeigt HTML als plaintext an.

Hallo Atlassian Team,

 

ich habe ein Problem mit der Darstellung eines SQL Querys über das Plugin Pocket Query im Confluence.

Das Query zeigt eine mehrzeilige Spalte als HTML Text an und das nicht formatiert. Weiß leider nicht was ich noch tun soll.

SQL Statement:

SELECT

j5.isys_purpose__title AS 'Einsatzzweck',

j1.isys_sla_service_level__title AS 'SLA Service Level',

j2.isys_catg_sla_list__reaction_time AS 'Reaktionszeit',

j2.isys_catg_sla_list__recovery_time AS 'Wiederherstellungszeit',

j2.isys_catg_sla_list__description AS 'Beschreibung'

 

FROM isys_obj AS obj_main

INNER JOIN isys_cmdb_status AS obj_main_status ON obj_main_status.isys_cmdb_status__id = obj_main.isys_obj__isys_cmdb_status__id

LEFT JOIN isys_catg_sla_list AS j2 ON j2.isys_catg_sla_list__isys_obj__id = obj_main.isys_obj__id

LEFT JOIN isys_sla_service_level AS j1 ON j1.isys_sla_service_level__id = j2.isys_catg_sla_list__isys_sla_service_level__id

LEFT JOIN isys_catg_global_list AS j6 ON j6.isys_catg_global_list__isys_obj__id = obj_main.isys_obj__id

LEFT JOIN isys_purpose AS j5 ON j5.isys_purpose__id = j6.isys_catg_global_list__isys_purpose__id

LEFT JOIN isys_obj_type AS j9 ON j9.isys_obj_type__id = obj_main.isys_obj__isys_obj_type__id

 

WHERE TRUE

 

 AND  ( (j9.isys_obj_type__id = '45' )) AND ( (obj_main.isys_obj__title = 'Mailoptimizer' ))  ORDER BY obj_main.isys_obj__id ASC;

 

Ausgabe IST:

Einsatzzweck
SLA Service Level
Reaktionszeit
Wiederherstellungszeit
Beschreibung
Produktion + Demo + Referenz98%124<p>Verf&uuml;gbarkeit pro Quartal.</p> <p>Reaktions- und Behebungszeit f&uuml;r &quot;critical&quot; F&auml;lle

 

Ausgabe SOLL:

Einsatzzweck
SLA Service Level
Reaktionszeit
Wiederherstellungszeit
Beschreibung
Produktion + Demo + Referenz98%124

Verfügbarkeit pro Quartal.

Reaktions- und Behebungszeit für critical Fälle

 

Über eure Hilfe wäre ich sehr froh.

 

Mit freundlichen Grüßen,

Stephan Mallmann

3 answers

Hi Stephan,

Thank you for your interest in PocketQuery! Can you please try if it works if you create the below custom template and assign it to your query? Please let me know the result.

&lt;table class="aui confluenceTable pocketquery-table"&gt;
	&lt;thead&gt;
		&lt;tr&gt;
		#foreach ($column in $columns)
			&lt;th class="col-$velocityCount"&gt;$!column&lt;/th&gt;
		#end
		&lt;/tr&gt;
	&lt;/thead&gt;
	
	&lt;tbody&gt;
		#foreach ($row in $result)
			&lt;tr class="#if($velocityCount % 2 != 0)odd#{else}even#end"&gt;
			#foreach ($column in $row)
				#set($pqTextWithHtml = false)
				#set($pqTextWithHtml = $!column)
				&lt;td class="col-$velocityCount"&gt;$pqTextWithHtml&lt;/td&gt;
			#end
			&lt;/tr&gt;
		#end
	&lt;/tbody&gt;
&lt;/table&gt;

Regards, Felix (Scandio)

YOU ARE GREAT!!!

 

Thank you very much!

It's a convention in the Velocity templating language that variables that contain HTML code will only be rendered properly if the variable name ends with "Html". Really funny. Anyway, glad it works! By the way: if you like PocketQuery, would you consider leaving a review at the marketplace?

Hello again,

i used your template in Jun. and it works very well.
But now i have the problem that the table looks like this.

Service
Einsatzzweck
Servicelevel
Reaktionszeit
Wiederherstellungszeit
Montag
Dienstag
Mittwoch
Donnerstag
Freitag
Samstag
Sonntag
Beschreibung
Abit ScoringProduktion + Test98,5%00[B@1e353b9d[B@38dccfe9[B@28d5e729[B@733b49b0[B@3962fcea[B@11ca8415[B@6a587d3 
BraFoProduktion + TestProduktion + Test00[B@1a34f8b8[B@bb50579[B@197a50f0[B@2d57c9a1[B@5e768048[B@35e0276b[B@f3bfd6f 
Configuration ManagementLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTIONLC__CMDB__CATG__PURPOSE_PRODUCTION
EasyjobProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + TestProduktion + Test
FilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemakerFilemaker
FTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPIFTAPI

 

The Problem is that the cell with the "LC__CMDB__CATG__PURPOSE_PRODUCTION" isn't load correctly.
If a cell is empty, the template copy the content from the previous cell.
The content of the cell with "[B@1e353b9d" must actually looks like this "09:00:00 - 17:00:00" why is the encoding so different?

 

Best regards,

Stephan

Hi Stephan! Sorry for the late reply, somehow we missed this. So is this actually two different issues? One is the column LC__CMDB__CATG__PURPOSE_PRODUCTION whose table name is displayed instead of its contents - and one is the issue with "[B@1e353b9d"?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

377 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you