Webtags: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
457 bytes added ,  13:18, 24 September 2022
m
Line 30: Line 30:


= Using Webtags =  
= Using Webtags =  
There are basically two main 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 both of which will be discussed below (or in a sub-page). The two 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 GET method.  
#Getting the value by using the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_GET|GET method]].  
In the first case you use <span style="font-family:Courier"><#temp></span> in the file which will then show up as <span style="font-family:Courier">17.1</span> in the output file.  
#Getting the values through the local interface [[Cumulus_MX_Local_API#General_API_-_HTTP_POST|POST method]]
 
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 two bonus methods for getting values out of the CMX database:
#Getting [[Cumulus_MX_Local_API#Predetermined_Data|predetermined data]]
#Using MySQL through the Custom Upload feature
 
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.<br/>
The predetermined methods and the SQL methods are really for programmers.
 
The local API methods are described on [[Cumulus_MX_Local_API|their own page]].
 
== 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 for that webtag and the complete description, including the brackets have then disappeared.
 
The configuration should look like the screenshot below:
[[File:Extra Webfiles config.jpg|center]]


In the second case you use the URL in your browser: <span style="font-family:Courier">http://<ip-address>:8998/api/tags/process.json?temp</span> which returns <span style="font-family:Courier">{"temp":"12,7"}</span>.


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.
The second method can give you a quick view of a value from the browser but its principal use is to be used programmatically from anywhere you can reach the CumulusMX machine.


In addition, there are two other methods to retrieve the value of the webtag:
#Getting the values through the HTTP POST method
#Using MySQL through the Custom Upload feature


All methods are described in the [[Using Webtags]] page.
== MySQL ==

Navigation menu