Welcome! In Part I we discussed the ability to display custom content in the “What's New” section of the Stat Web Client. This is the area on the lower left side of the Stat Web Client window.
Here's a screen shot of where we left off on Part I:
If you have not read Part I of this blog series I would recommend doing so, or the below may not make a lot of sense.
To quickly review, there are two files that we need to modify in order to get our custom “What's New” section to work properly. These Two Files Are:
1. Stat.Properties: The setting in this file tells Stat where to look for the custom content or better stated as our custom Include.txt files location. In this version of the Blog we will be calling our custom Include file: Cust_IMG_Include.txt
This file is where our custom text and image information is stored.
These two files are typically located in the Stat Central Agent's directory structure.
The stat.properties has a section within it that tells the Stat Central Agent where to look for a retrieve the custom information we want displayed in the “What’s New” section of our Stat Web Client. This file is located within the Stat Central Agent's directory structure under the “\config” directory. This location is also known as the “STAT_HOME” directory.
Therefore, my STAT_HOME is equal to “S:\Stat_561_Cntrl_Agnt”. The stat.properties file is therefore located in the Subdirectory “\config”.
The summation of this is that the file I need to work with is located in: S:\Stat_561_Cntrl_Agnt\config\stat.properties.
First and foremost, take a backup of the existing stat.properties file and relocate it to a safe place. If we load the stat.properties file into a text editor we see the following section:
Stat.properties File Contents: ...#========================================================================================# Client Global Properties## Valid "whats.new.include" parameters: (See http://www.cs.tut.fi/~jkorpela/fileurl.html)# 1. relative to distribution (default) = ../include.txt# 2. absolute file Windows (i.e. c:\Temp\...) = file:///c:/temp/readme.txt# 3. web http URL = https://www.quest.com#========================================================================================
# WRH Original: whats.new.include=../include.txt (Next Line is Location of my Custom Include.txt file.)
Within our stat.properties file, set a pointer to where you want to place your Custom “Include.txt” file as the above shows. As you can see there are several examples provided within the stat.properties file. In addition, you can name the file whatever you'd like.
The second file is the custom Include.txt file. This is where all the magic happens. Below is an example of my “Cust_IMG_Include.txt” file: The below includes our added image display code highlighted:
<ul><li><i><B>Welcome!</B></i><br><B>Everyone</B> <br> to your Quest Stat Demo!<br></li>
<P><hr/><img alt = "No Show" src=file:///S:/Stat_561_Cntrl_Agnt/WRHCOA.gif>
<hr/><li>Use This Space To Keep Your Team Up To Date On Things Happening!<br></li></P>
<P> <li>This area can be updated <B>daily</B> from a <B>Text File</B>or why not
<a href="www.Quest.com" ><B><i>Add Your Own Links!</i></a></B><br></li></P>
<P><li>Or... Drive Your Acct. Mgr. Crazy With 500 Automated Emails:<B>Per Day!</B></li></P>
<a href="www.Quest.com" ><B><i>Add Links to Your Internal Resource Sites/Help Desks.</i></a></B><br></li></P><hr/><a href="www.Quest.com" ><B><i>Add Links to This & That.</i></a></B><br></li></P><hr/></ul>
Here’s what this will look like on our screen at run time:
Let's break the above “Cust_IMG_include.txt” file down into its different components:
Blue = HTML formatting language.
Red = Text I want displayed to the user.
<ul><li><i><B>Welcome!</B></i><br><B>Everyone</B><br> to your Quest Stat Demo!<br></li><P><hr/><img alt = "No Show" src=file:///S:/Stat_561_Cntrl_Agnt/WRHCOA.gif><hr/><li>Use This Space To Keep Your Team Up To Date On Things Happening!<br></li></P><P> <li>This area can be updated <B>daily</B> from a <B>Text File</B> or why not<a href="www.Quest.com" ><B><i> Add Your Own Links! Or...</i></a></B><br></li></P><P> <li> Drive Your Acct. Mgr. Crazy With 500 Automated Emails: <B> Per Day!</B></li></P><a href="www.Quest.com" ><B><i> Add Links to Your Internal Resource Sites/Help Desks. </i></a></B><br></li></P>
<hr/><a href="www.Quest.com"><B><i>Add Links to This & That.</i></a></B><br></li></P><hr/></ul>
What a great suggestion! Let's see if we can make that happen.
The logic and code: Let's say we want to display a colored image or logo based on the status of the system or the number of cases that are currently open. Based on the amount of open cases, or level of importance, we want to display a different color image.
Green = All is fine.
Red = Multiple critical cases are open.
Blue = Low Level or System Unchanged.
Yellow = A few critical cases are open.
There are numerous ways we could determine which icon or image we want to use. One of the ways we could make this work is by using the Stat Web Services features within Stat 5.5.0 and above.
We could run some Web Service calls to get the amount of tickets open where the CSR Type is “Emergency Fix” and react to that value.
However, we determine the image to display; the key to this is to display the image we want.
Let's say that everything is fine and we want to display the Green Icon indicator. We will update either the image name or the pointer to the image we want within our “Cust_IMG_Include.txt”.
<hr/><img alt = "Status = Blue" src=file:///S:/Stat_561_Cntrl_Agnt/Shield_Blue.ico height="42" width="42" align="middle"/><hr/>
Below is a combined screenshot using the different icons based on the current status of our system:
Do not forget about your Alternative Text as well.
You will also notice three other values included. Those are Height, Width and Align. Most browsers will interpret the image properly, but it's never a bad idea to include these values if you have them. Use different alignments to have images sit alone on their own lines or to the left or right of your custom text strings.
Here are a few examples of what that may look like:
align=”left”: align=”middle”: align=”right”:
As you can see from the above example, there are lots of things you can do with images and a bit of logic.
You do not have to stop and start the Stat Central Agent each time you update either the stat.properties or your include.txt file. Simply go to the Stat Web Client and hit the F5 key, or refresh the page.
Blank Web Page? As you make changes to your custom include.txt files and test them, it's expected that you will occasionally have HTML errors you need to correct. You'll know this right away when you refresh the page and nothing loads but the menus on the left hand side. If you see this, then you know you have an error in your Stat.Properties setting. You are pointing to the wrong location, file name, or the file did not get to the target location.
Mozilla's Firefox, depending on the version you are using, may have trouble displaying these images. Therefore, in your HTML <img> code, be sure to include the “alt = text” section so that something is displayed in the place of the image if it cannot be shown as intended.
For Example: <img alt = "No Show" src=file:///S:/Stat_561_Cntrl_Agnt/WRHCOA.gif>.
You can see below what happens if the image cannot be found or displayed for any reason, the alternative text will be shown in its place:
Thank you for taking the time to read this blog, I hope you found it useful in your daily use of Stat.
Thanks for reading!
William R. Hart
Quest Software, Inc