NOAAs National Weather Service Velocity Templates Site Support

  • Slides: 8
Download presentation
NOAA’s National Weather Service Velocity Templates Site Support Team Office of Operational Services May,

NOAA’s National Weather Service Velocity Templates Site Support Team Office of Operational Services May, 23 2008 NOAA’s National Weather Service

What is Velocity? Velocity is a Java-based template engine. Templates contain Text, Variables (references)

What is Velocity? Velocity is a Java-based template engine. Templates contain Text, Variables (references) and Velocity Template Language (VTL). Text is output unchanged. Variables can be Java Objects. VTL is a scripting language.

Warn. Gen GUI The Warngen GUI is driven by: §config. xml § java code

Warn. Gen GUI The Warngen GUI is driven by: §config. xml § java code §<template>. cfg files. The <template>. cfg files control many parameters about warnings <template>. cfg Values in GUI

Warn. Gen Templates §The Warngen Templates are the <template>. vm files §The <template>. vm

Warn. Gen Templates §The Warngen Templates are the <template>. vm files §The <template>. vm files are processed when “CREATE TEXT” button is pressed. §The Velocity Engine inserts the variables and processes the logic in the templates. §The result is a text warning product.

Simple Template THIS IS A TEST #set( $office = "MANHATTAN, KANSAS" ) THE NATIONAL

Simple Template THIS IS A TEST #set( $office = "MANHATTAN, KANSAS" ) THE NATIONAL WEATHER SERVICE IN $office HAS DONE NOTHING. The VLT command sets the variable $office which is then replaced into subsequent instances of the variable The output : THIS IS A TEST THE NATIONAL WEATHER SERVICE IN MANHATTAN, KANSAS HAS DONE NOTHING.

Tricky Template ${office. Long} HAS ISSUED A * ${test. Message}TORNADO WARNING FOR. . .

Tricky Template ${office. Long} HAS ISSUED A * ${test. Message}TORNADO WARNING FOR. . . #foreach (${area} in ${areas}) ## #if(${area. part. Of. Area}) #area. Format(${area. part. Of. Area} 0) ## #end $office. Long is a variable from a config. xml file $test. Message comes from the GUI settings $Areas is an array of JAVA area objects from the code #area. Format is a VTL Macro ( in VM_global_library) ${area. part. Of. Area} is a method in the JAVA area object

Launch Warngen <template>. cfg Read <te, mplate>. cfg file Warngen loaded with Values from

Launch Warngen <template>. cfg Read <te, mplate>. cfg file Warngen loaded with Values from Config. xml Default Parameters Set from <template>. cfg file Set Warning Polygon and storm track <template>. vm Select Create Text Button Prodcut Loads into Text Editor Geo. Spatiial Data Generated From Polygon Drawn on screen Java Objects, VTL Code and Text processed by velocity engine Edit Window Launched with product

References Velocity Template User Guide Velocity Reference Guide Velocity VTL Reference Velocity Examples Document

References Velocity Template User Guide Velocity Reference Guide Velocity VTL Reference Velocity Examples Document http: //www. nws. noaa. gov/ost/SEC/AE/Site_Migration. htm