Product Generator Centralization Guide


By default, all products and templates are stored locally on the user's computer. However, if you have access to a webserver, it is possible for you to send all products to the webserver and access them from any device. This also allows you to assemble a team of forecasters who can all issue the same products for a common organization. Setting this up will involve the following steps:

Step 1: Write a script on your webserver that can process the forecast product data (see the bottom of the page for examples). When you click the "send product" button, an XMLHttpRequest will be sent to the URL specified in the parent template (if it is not blank), which will look like:

{Template.URL}?action={Product.action}&name={Product.name}&type={Template.name}&index={Product.templateIndex}&ID={Product.ID}&category={Product.category}&issued={Product.issued}&expire={Product.expire}&point={Product.geometry}&text={Product.text}&forecaster={Product.forecaster}&password={Product.password}&variable=Product.variable&{Template.variable[0].name}={Product.variable[0]}&{Template.variable[1].name}={Product.variable[1]}...

Example (PLEASE DO NOT OPEN THIS LINK):

https://myawesomewebsite.com/receiveProduct.php?action=NEW&name=Mesoscale%20Discussion%20%231&type=Mesoscale%20Discussion&index=0&ID=1&category=Severe%20Weather&issued=20250826T2104Z&expire=20250826T2255Z&point=-102.31581115722574%2C36.13892655139096%2C-100.74090385436966%2C37.329691226397294%2C-98.98558044433595%2C37.8893455072144%2C-96.49013900756903%2C37.887652051901654%2C-95.68976783752528%2C37.42654238606554%2C-95.370735168458%2C36.6615288819445%2C-95.23709678650003%2C35.86282538910454%2C-95.44888401031447%2C35.50259990434861%2C-95.92354917526195%2C35.101805860149454%2C-96.96591997146548%2C34.67166503971144%2C-99.52219390869126%2C34.192559296161384%2C-100.64215564727708%2C34.076544552150416%2C-101.46565818786554%2C34.11215449570834%2C-102.08423995971599%2C34.40686889372425%2C-102.53658914565956%2C34.838105861764014%2C-102.65170955657875%2C35.54674802504743&text=...Summary...%0A%0A%0A%0A...Discussion...&forecaster=Stang&password=test&Concerning=Severe%20Potential...Watch%20needed%20soon&Watch%20Probability=95%20%25&Watch=N%2FA


The Product Generator will expect all products to be saved as a JSON format that looks like this (3 different products are presented in this example):

[
{"product": {"name": "Fire Weather Outlook #1", "type": "Fire Weather Outlook", "ID": 1, "index": 3, "category": "Elevated", "issued": "20250904T1524Z", "expire": "20250905T1525Z", "point": "[{\"value\": \"Elevated\", \"points\": \"-104.88987350463711,38.02577748390436,-105.5579795837385,39.98211362488716,-104.94463348388514,41.50754403015572,-103.36191558837776,42.15550916811696,-102.3860206603995,41.75939924849259,-101.57303237914971,40.393621696627896,-91.76752471923756,39.28262449038855,-93.2388343811024,38.0328087658416\", \"closed\": true}]", "forecaster": "Stang", "text": "...Summary...\n\n\n...Discussion...", "show": true, "variable": []}},
{"product": {"name": "Fire Weather Outlook #2", "type": "Fire Weather Outlook", "ID": 1, "index": 3, "category": "Elevated", "issued": "20250904T1524Z", "expire": "20250905T1525Z", "point": "[{\"value\": \"Elevated\", \"points\": \"-103.88987350463711,38.02577748390436,-104.5579795837385,39.98211362488716,-103.94463348388514,41.50754403015572,-102.36191558837776,42.15550916811696,-101.3860206603995,41.75939924849259,-100.57303237914971,40.393621696627896,-100.76752471923756,39.28262449038855,-102.2388343811024,38.0328087658416\", \"closed\": true}]", "forecaster": "Stang", "text": "...Summary...\n\n\n...Discussion...", "show": true, "variable": []}},
{"product": {"name": "Mesoscale Discussion #2", "type": "Mesoscale Discussion", "ID": 2, "index": 0, "category": "Severe Weather", "issued": "20250904T1640Z", "expire": "20250904T1810Z", "point": "-99.13269424438474,35.47911886520474,-98.90919113159183,38.10848748609885,-97.25574874877975,40.12074175661406,-93.86045837402482,39.54375947050068,-93.99418258667126,37.242623278456925,-96.01738357544025,35.42150537256911,-97.44697952270549,34.753032184005505", "forecaster": "Stang", "text": "...Summary...\n\n\n\n...Discussion...", "show": true, "variable": ["Severe Potential...Watch possible","60 %","N/A"]}}
]


Most of the information passed through the XMLHttpRequest can be translated to the JSON file exactly as it appears. However, when creating the JSON data, the following parameters do NOT have quotation marks included, but require quotation marks in the JSON output: Product.name (name), Template.name (type), Product.category (category), Product.issued (issued), Product.expire (expire), Product.point (point), Product.forecaster (forecaster), Product.text (text). If using a JSON library, this conversion should happen automatically, but keep this in mind if you plan to have your script generate the JSON output manually.

Note that the parameter 'show' is NOT included in the XMLHttpRequest form. By default, the 'show' parameter should be set to true when a new product is issued. It should only be set to false if a product should be hidden from view, but the original data should be preserved (such as canceling, but not deleting a product).

I would personally recommend using Python to write the server side script since it is easier to handle JSON data and files in Python. However, any server-side language capable of handling JSON data and reading/writing to files can be used (e.g. PHP, which comes standard on many webservers).

I would also recommend having the server side script check for a password before it modifies the product data in the JSON file. Otherwise, anyone with a URL leading to the script would be able to send information to it, and an attacker could sabotage your operation or fill your webserver up with unwanted garbage.

Step 2: Create a set of templates you plan to use and download the templates to a file by clicking the "Download Template Data" button. Be sure the "Export URL" of each template leads to the script created in Step 1.

Step 3: Transfer the file from Step 2 to your webserver. Make sure it is in a directory that is accessible from the world wide web.

Step 4: Click the "Manage Products" button under the "Products" tab. This will bring up another panel with different options on the left-hand side. Click on "centralize operations".

Step 5: Type/paste a URL leading to the template file created in Step 2 in the box labeled "Templates".

Step 6: Type/paste a URL leading to the JSON file containing all products in the box labeled "Products".

Assuming the server side processes run correctly, everything should now be configured on one device. To configure other devices, start with Step 4 and continue until Step 6 is completed.

IMPORTANT NOTES:

If you want to add/edit templates, you'll need to clear the "template box" mentioned in Step 5. This will transfer operations back to your local machine where templates can be edited. Once you're finished adding/editing templates, repeat Step 2 and Step 3, then put the URL back in the "template box". Making significant edits to templates that have been used in active products may cause weird behavior.

Both the "template box" and the "product box" must have a URL. If one box is missing a URL, the product generator will continue to operate locally, because it must be able to match products with their parent templates to function properly.


Example Server Side Scripts

PHP
Python