The default generation model for wview is to generate a weather Web site based on a series of HTML file templates and images. For any template file named example.[ext]x and listed in html-templates.conf, wview will generate a file named example.[ext]. Thus, myscript.phpx listed in html-templates.conf and found in $prefix/var/wview/html will have all wview tags replaced, and the resulting file will be named myscript.php. For any template file named example.htmx and listed in html-templates.conf, wview will generate a file named example.htm. The resulting files are stored at the location specified on the wviewmgmt File Generation page: “Generation Target Path”.
Changing HTML templates in $prefix/etc/wview/html does not require you to restart wview. The changes you make will take effect at the next htmlgend (HTML generation dæmon) generation cycle. Changing the config files images.conf, html-templates.conf and (if supported) forecast.conf does not require restarting wview, but it does require an HUP signal to be sent to htmlgend to cause these files to be reread. Do this as follows (this also will toggle log verbosity):
$ sudo kill -s HUP `cat $prefix/var/wview/htmlgend.pid`
wview supports template macro file inclusion in template files. The meta-tag is <!--include filename.xxx-->. Any template macro file that is to be included in one or more template files should be listed before any templates including it in the $prefix/etc/wview/html-templates.conf configuration file. There is no restriction on the levels of inclusion, just be sure you specify macro templates early in the html-templates.conf file. The wview default Web site templates utilize several header macro files.
HTML template files (in $prefix/etc/wview/html) can be customized to your language and design preferences. The configuration file html-templates.conf specifies the template files to be used for generation. You may add or remove from this list as needed. Weather image captions can be edited in the $prefix/etc/wview/images.conf file for your language preferences. The configuration parameter on the File Generation Page “Enable Metric Units For Generation?” allows for configuration of metric units. If set to “yes”, it causes wview to output all images (buckets and charts) as well as all values for HTML tags in metric units. The file images.conf can be edited to translate the English labels, titles and units to any language. By editing this file and the HTML template files, any language can be supported by wview. In fact, you easily can switch back and forth between US and metric units by toggling this configuration parameter and restarting wview.
wview provides a number of features that allow advanced use of the weather data collected from your station. Alarms may be defined such that if an upper or lower bound is exceeded, a user-defined script will be executed. These scripts may send a notification e-mail or trigger an external application. It's also possible to connect to the wview server via TCP/IP socket and receive an unsolicited, periodic data feed of weather data. By using the “Virtual” station type, you can connect to another wview server remotely and receive the station data as if it were connected directly to the station hardware.
Mark Teel is the Software Engineering Manager for a major supplier of display and control systems for mass transit and commercial airline systems. He is also an advocate of open-source software development and has contributed to several projects, including CodeAnalyzer (a Java-based source code analyzer), radlib (Rapid Application Development Library) and wview.
|A Project to Guarantee Better Security for Open-Source Projects||Aug 27, 2015|
|Concerning Containers' Connections: on Docker Networking||Aug 26, 2015|
|My Network Go-Bag||Aug 24, 2015|
|Doing Astronomy with Python||Aug 19, 2015|
|Build a “Virtual SuperComputer” with Process Virtualization||Aug 18, 2015|
|Firefox Security Exploit Targets Linux Users and Web Developers||Aug 17, 2015|
- A Project to Guarantee Better Security for Open-Source Projects
- Concerning Containers' Connections: on Docker Networking
- Problems with Ubuntu's Software Center and How Canonical Plans to Fix Them
- My Network Go-Bag
- Doing Astronomy with Python
- Firefox Security Exploit Targets Linux Users and Web Developers
- Build a “Virtual SuperComputer” with Process Virtualization
- August 2015 Issue of Linux Journal: Programming
- Three More Lessons
- diff -u: What's New in Kernel Development