This Tesselet component is a reference implementation that uses data returned by HOPAGetSpots4ObjectXml.asp
function.
It can be customized by providing configuration parameters and used on external website without any coding. Main goal of this viewer is to easily show all spots / views for given object(s).
Additionally, this Tesselet provides two printing buttons:
Print Current Document
– that will result in single-page printoutPrint All Documents
– that will result in multi-page printout
Requirements:
A website on a server
Working HIS/HOPA 4.95 installation
Installation
Add tessel javascript to your web page:
<meta http-equiv="X-UA-Compatible" content="IE9" /> <script src="http://<server_name>/HIS_name/TesselDisplaySpotsWidget/tessel_display_spots_widget.js" type="text/javascript"></script> <link type="text/css" rel="stylesheet" href="http://<server_name>/HIS_name/TesselDisplaySpotsWidget/css/tessel_display_spots_widget.css"/>
Your Add-in by default installs to Tessel Software Line\HyperDoc\ASPPages\TesselDisplaySpotsWidget folder.
Customize widget with your particular HOPA call. To do so, add to your html
head
area following script:<script type="text/javascript"> var customer_configuration = { hostName:"http://<server_name>/HIS_name", hopaFunctionName: "HOPAgetview4object.asp", hopaGetSpotsFunctionName: "HOPAgetspots4objectxml.asp", hopaParams: "ObjClass=Rooms&SF=Room_Status&SV=Free", hopaPrintParams: "PT=Print_Template_A4&O=L&MM1=1&SMP1=100&UV1=1&SM1=2&DFS2=1&SMP2=120&UV2=0&SM2=1&DFO3=1", printDocumentText: "Print Document", printAllDocumentsText: "Print All Documents" image_width:"700", image_height: "500" }; tessel_display_spots_widget.TSL_addLoadEvent(); </script>
Warning
Do not modify last line:
tessel_display_spots_widget.TSL_addLoadEvent();
Add div containing widget to your web page in a following way (do not change it's
id
):<div id="tessel_display_spots_widget"></div>
Parameters detailed description
Following parameters need to be set in order to receive positive results in Tesslet utilization:
hostName
: server that contains javascript widget and also contains css stylesheet and working HOPA installation.hopaFunctionName
: HOPA function that returns desired view of spots ex."HOPAGetView4Object.asp".hopaGetSpotsFunctionName
: HOPA function that returns collection of spots, ex. "HOPAGetSpots4ObjectXML.asp".hopaParams
: string containing HOPA parameters for particular HOPA function call.hopaPrintParams
: string containing HOPA parameters to be added to HOPA call after clicking on one of Tesslet buttons.Important
Do not add
SI
andMUM
parameters here, they will be added automatically for multipage print-outs.image_width
: the width of html main Tesslet image.image_height
: the height of html main Tesslet image.printDocumentText
: localization text forprint current document
button. If there is no text the button will not display.printAllDocumentsText
:localization text forprint all documents
button. If there is no text the button will not display.
Customer server configuration
To change layout of widget, you may redefine stylesheet: tessel_display_spots_widget.css.
Important
Please remember:
not to include clientFunc parameter in hopaParams field,
that in call HopaGetPrint4Object.asp, parameter
SpotIDs=all
will be added for multipage print-outs,that in call HopaGetPrint4Object.asp, parameter
MultiMatch=1
will be added for multipage print-outs,
PrintAllDocuments
option detailed description
This function depends on whether GetSpots4objectXML
was started with set 'Search Field
' and 'Search Value
' as input parameters.
If so, 'Print All Spots
' link will be prepared with utilization of 'MultiMatch
' paramreter with value 1
(MUM=1
).
Otherwise, link will be prepared by utilization of 'SpotIDs
' parameter with value 'all
' (SI=all
).
Example of utilizing getSpots4objectXml function
HOPAgetspots4objectxml.asp&ObjClass1=Rooms&SF1=Room_Status&SV1=Rented&ObjClass2=Rooms&SF2=Room_Status&SV2=Free" &ObjClass2=Rooms&SF2=Room_Status&SV2=Free ObjClass=Floors&ID=Floor002
Sample HOPA Get Spots calls:
http://<server_name>/<HIS_name>/HOPAgetspots4objectxml.asp?ObjClass=Floors&ID=Floor002&ClientFunc=processData
http://<server_name>/<HIS_name>/HOPAgetspots4objectxml.asp?ObjClass1=Rooms&SF1=Room_Status&SV1=Rented&ObjClass2=Rooms&SF2=Room_Status&SV2=Free&ClientFunc=processData
Note
Sample webpage with sample configuration can be found with HIS
installation in Tessel Software Line\HyperDoc\ASPPages\TesselDisplaySpotsWidget folder.
Following applet functions are disposed as public API.
Please note that due to utilizing object oriented programming pattern in JavaScript, each function call should be prefixed with widget's object name 'tessel_display_spots_widget
':
processData(data) - function that calls server for spot parameters
reload() - function that reloads tesslet data function with new values, input in 'customer_configuration' javascript object.
TSL_addLoadEvent() - function that adds widget initialization function as an on load event for the page tesslet is appended to. Used for appending 'initialize' function to 'onload' events.
Example of utilizing reload() function under a hyperlink
<a href="#" onclick=' return tessel_display_spots_widget.reload();'>Reload tesslet</a>