Introduction

This section describes how to maintain the the Print Inspection Template accessed from the Inspection Detail page to provide a detailed snapshot of an Inspection. This functionality was introduced in SP13 and in accessible via the Inspection sub tab in the Core Settings are of BlueWorx administration. Details on the output are defined in the article Print Inspection Definition.

Business and SAP Context

The template provided gives an extensive view of an Inspection. It's intended to optionally provide:

  • A check point reference for Inspection configurators to ensure that they have delivered against the business requirements/ converted properly from paper based forms
  • A soft, or hard copy through conversion of HTML output to PDF, for potential business sign-off/ storage as part of an engineering change management solution - as part of a manual workflow process

The template as provided is extensive in the detail it provides. For example in the full definition of the Question configuration fields. Some organisations may want to simplify the output and reduce the information shown. Other organisations may wish to disregard the generic sign-off section or adapt them to better represent their business processes. That's why we have delivered maintenance functionality.

Important Information

The template is written using HTML. It requires good general knowledge of HTML and CSS and we strongly recommend using a suitably experienced developer to maintain it. It's not a place to 'have a go'. But for those that get it wrong, we have provided an export of the delivered content in sections so that you can correct any problems.


HTML Sanitization

Due to the security risks involved with letting users write HTML. BlueWorx now uses DOMPurify to sanitize all html content.


DOMPurify is the recommended sanitizer by the Open WorldWide Application Security Project(OWASP). The sanitization will remove any html tags or attributes that could be used maliciously (e.g. scripts, onclick etc...). 


BlueWorx will be using the default settings of DOMPurify, as well as manually including the "comments", and "head" tags.


If a user wants to further customize what can and can't be included in the html editor, they can simply have a developer extend the sanitizeHTML.js file.

Maintain Template

The following is an illustration of this dialog: 

The following screen fields and controls are defined, where not documented they are considered self explanatory or are explained elsewhere:

Field/ FunctionDescription/ Usage
SegmentThe content is divided into segments that together create a properly formed html page
SequenceUsed to denote the processing order of the segments
LanguageThe language for the segment. Only English is provided in the sample data
TableThe table used by the program to replace the placeholder content in the HTML content
HTML ContentThe HTML content. Place Holder value are used in this content that represent fields in the Table. Field placeholders are defined using percentage signs - for example %example% 

How it works

The SAP Class that uses this content is /SOLTIUS/PM_INSPECTION_PRINT. Developers can review the Class to better understand its logic, however in simple terms it:

  • Selects the template in Sequence using the Users logon language. So if you want to maintain the template in another language then all of the segments that are intended to be called by the Class, need to be duplicated i.e. have the same segment value, same sequence value, same table value and a different Language
  • It then loops over a series of methods that builds up the HTML content. As it does this it loops over retrieved tables of values from the selected Inspection and adds data from those tables using the field Place Holder values. In some cases this action may provide an expression of a value and also include a <a> link attribute so that the user can navigate in the page to see more details about a value
  • The Class only need to be extended if you have additional data requirements