Welcome to Questions - Ask OpenNMS, where you can ask questions and receive answers from other members of the community.

How could I show HTML Text in fields of "Asset-Info" ?

0 votes
362 views

I´d like to show HTML Text like links, bold / colored text etc. in fields ob the asset-Info. I enabled follwing line in my opennms.properties

# This example would allow HTML markup in the Comments and Description fields.
opennms.assets.allowHtmlFields = comments, description

but nothing happened. Still no html.

Any ideas?

Best regards,
Thorben

 

OpenNMS version
asked Jan 3, 2014 by Pennywise (540 points)
What way are you using to get the asset values set?
Are you using a requisition?
Are you using the webui-editor for the assets?

1 Answer

+1 vote

I just tested a requisition like the following one, created in the manage-requisition-ui:

<requisitions xmlns="http://xmlns.opennms.org/xsd/config/model-import" count="1">
<script/>
<model-import date-stamp="2014-02-17T12:09:48.080+01:00" foreign-source="Test" last-import="2014-02-17T12:30:34.906+01:00">
<node building="Test" foreign-id="1392635958942" node-label="New Node">
<asset name="comment" value="<b>Comment</b> <i>Comment</i> Comment"/>
<asset name="description" value="<b>Test</b> <i>Test</i> Test"/>
</node>
</model-import>
</requisitions>
I also set in opennms.properties:
opennms.opennms.assets.allowHtmlFields = comments, description
I'm not sure if it's required, by I restarted OpenNMS.
With this setup I'll get markuped Test-Date at the top-box of the node-page.
answered Feb 17, 2014 by DerTak (5,420 points)
Hi Markus!

I used the WebUI-Editor (no requisition).
The field description now works fine, but comments doesn´t work

When I use follwing code:

<h1>Bold text</h1>

the codes changes to:

&lt;h1&gt;Bold text&lt;/h1&gt;

after saving.
Hey Thorben,

that behavior is a bug then...
please open an issue for that.
Thanks
...