I and several others in OSIsoft (chiefly among them Jason Jian-Hao Lu and Akane Takezaki) are currently working on localizing the AF Example kits and I promised a series of blog post to document the process.

To get myself started, please allow me to start with a post that is totally orthogonal to the whole process of translating this kit and simply highlight a new feature of AF 2016 I and Jason that we played with adding to the Asset Based PI Example Kit for Utilities Cost Management namely adding a URI Builder data reference.


The Utilities Cost Management uses Table Lookups to display latitude and longitude information of where a factory is located. This information was maybe hard to make use of directly into PI System Explorer in versions before 2016, but in 2016 we can now create URLs base on attributes. As we have latitude and longitude, the first thing that comes to mind is displaying this on a map, let's do so using Google Maps.


A typical Google Maps URL that uses latitude and longitude information looks like: https://www.google.co.jp/maps/@37.72229,-122.1628,14z. The numbers that are listed, in order, are the latitude, longitude and the zoom level. In the kit there is already information regarding latitude and longitude, to hold the zoom level, the integer 14, we create a child attribute of the URI builder attribute that we are making. In our template, this looks like the following. The Zoom Level is a hidden configuration item as it is not typically required to be seen on clients.

Now the configuration of the Map URI (as seen on an element so that we may have data to fill the view):


The various parameters are as follows. The scheme is https and address is www.google.com (or in my case: www.google.co.jp) as there aren’t any other choices for the matter. The query field is used for URL parameters that appears URL in the form of: ?key=value&key2=value2 and fragment is for postfix of the form #id. As the Google Map URL uses neither of those features, they are both blank. We only have to fill the Path parameter. This is parameter is filled using string substitution for the value of the longitude, latitude and zoom level attributes. In the preview field at the bottom of the pane shows the exact same URL we started with, thus looks quite good. What we are left to do is to click on the URL and see our results in our browser of choice!