Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Friday, 2 September 2022

Maximo Script to Remove HTML Tags Using Regular Expression

 There are times when you need to send long description to external system. But the problem occurs when the Long Description is rich text enabled and contains html tags. Below script uses regular expression to remove the HTML tags.

print ("***********Start of the Script************")
from java.util.regex import Pattern
item_long = mbo.getString("DESCRIPTION_LONGDESCRIPTION")
print (item_long)
match_v1 = Pattern.compile('\\<.*?\\>').matcher(item_long).replaceAll('')
print (match_v1)
print ("************End of the Script**************")

Result

**********Start of the Script************
<div>dasdasd</div><div>sdasd </div><div>asdasd </div><div>asdasdasd </div><div>sdasdas <br /></div><!-- RICH TEXT -->
dasdasdsdasd asdasd asdasdasd sdasdas 
************End of the Script**************

Tuesday, 2 April 2019

Table Type Presentation in Communication Template

There are instance where we would send mail through communication template. It is important to make sure that the information in the mail is more precise and conveys all details that are necessary. I feel that giving data in tabular format achieves the purpose. So lets see how to send data in tabular format in communication template in Maximo 7.6.

Click on Go To--> System Configuration --> Platform configuration --> Communication Templates.

Then click on the "View HTML Source " icon. As show in the screen shot below.


Enter the following HTML codes in the code snippet field.