Webtags: Difference between revisions

46 bytes added ,  15:50, 4 October 2022
m
Line 48: Line 48:


= Using Webtags =  
= Using Webtags =  
There are the following methods to ask CMX to do this translation both of which will be discussed below (or in a sub-page). The two methods are:
There are the following methods to ask CMX to do this translation all of which will be discussed below (or in a sub-page). The methods are:
#Processing files through the running instance of CumulusMX
#Processing files through the running instance of CumulusMX
#Getting the value by using the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_GET|GET method]].  
#Getting the value by using the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_GET|GET method]].  
#Getting the values through the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_POST|POST method]]
#Getting the values through the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_POST|POST method]]


The first method is used in files used as input for the Extra Web Files in CMX which are then processed by CMX if you tick ''process'' The output file then contains the value.<br/>
The first method is used in files used as input for the Extra Web Files in CMX which are then processed by CMX if you tick ''process''. The output file then contains the value.<br/>
The second and third method's principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.
The second and third method's principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.


'''NOTE''': it is not possible to give Webtag modifiers by using the get method but it is in the POST method. Check out the differences in the above links.
'''NOTE''': it is not possible to give Webtag modifiers by using the GET method, but it is in the POST method. Check out the differences in the above links.


There are three bonus methods for getting values out of the CMX database:
There are three bonus methods for getting values out of the CMX database:
#Getting [[Cumulus_MX_Local_API#Predetermined_Data|predetermined data]] (not really with Webtags)
#Getting [[Cumulus_MX_Local_API#Predetermined_Data|predetermined data]] (not really with Webtags but useful in this context)
#Using MySQL through the Custom Upload feature
#Using MySQL through the Custom Upload feature
#Using the ''Custom Logs'' feature of CMX (from 3.22 and up) through which you get a timeseries of one or more Webtag(s)
#Using the ''Custom Logs'' feature of CMX (from 3.22 and up) through which you get a timeseries of one or more Webtag(s)
Line 91: Line 91:


== Processing files ==
== Processing files ==
The oldest, most common and possibly the easiest method for using webtags is processing a file (e.g. a HTML web page or a PHP script) which contains a webtag description like <#temp rc=y>. After processing the output file then contains the value (e.g. 17.1) for that webtag and the complete description, including the brackets have then disappeared.  
The oldest, most common and probably the easiest method for using webtags is processing a file (e.g. a HTML web page or a PHP script) which contains a webtag description like <#temp rc=y>. After processing the output file then contains the value (e.g. 17.1) for that webtag and the complete description, including the brackets have then disappeared.  


The configuration should look like the screenshot below:
The configuration should look like the screenshot below:
Line 98: Line 98:


== MySQL ==
== MySQL ==
In the MySQL settings of the Interface there exists the possibility to create Custom Upload queries. This is n ot the place to treat the use of MySQL extensively, but CumulusMX offers the possibility to use Webtags in such a Custom Upload query definition. The example below should clarify:
In the MySQL settings of the Interface there exists the possibility to create Custom Upload queries. This is not the place to treat the use of MySQL extensively and the custom queries, but CumulusMX offers the possibility to use Webtags in such a Custom Upload query definition. The example below should clarify:


   <span style="font-family:Courier">INSERT IGNORE INTO `test_daily_summary` (`MaxRainRate`, `LogDate`, `RollOver`)
   <span style="font-family:Courier">INSERT IGNORE INTO `test_daily_summary` (`MaxRainRate`, `LogDate`, `RollOver`)