Webtags (preserving history): Difference between revisions

m
(10 intermediate revisions by the same user not shown)
=What this article covers =
 
#At the last count, a 3.5.x version of MX produces ''nine and a half million'' '''web tags'''! But the file mentioned in previous section contains just 717 items (later versions of MX raise this count by another forty tags or so). How come this discrepancy?
# Those millions of web tags can actually produce billions of different outputs!
#But the file mentioned in previous section contains just 717 items (at 3.5.0, later versions of MX raise this count by another forty tags or so).
#How come this discrepancy?
 
*Well each web tag has the general format <tt><#tag_name optional_input_parameter optional_output_parameter></tt> and it is adding thesethe optional input parameters that allow 717 tag names to define 9½ million values!
*Adding all possible different output parameters generates the billions of different outputs!
 
Consequently, this article describes:
*Over 7 hundred web tags -'''THIS ARTICLE MAY NOT CONTAIN ALL WEB TAGS AVAILABLE IN LATEST VERSION - It depends on someone updating this article if the developer does not have time to do so'''
*Over 7 hundred web tags
*A score of input parameters that modify some of those tags (meaning some web tags can represent 12 different months for example)
*The components that make up output parameters that(a modifyguide almostto allhow webyou tags that report amodify timethe and/oroutput dateformat)
** some control number of decimal places
*The way that some of those date modifiers are used for naming NOAA reports
** one controls whether decimal comma (if used) is replaced by decimal point (useful for some script languages)
**the majority modify the output from almost all web tags that report a time and/or date (there are so many ways to represent times and dates this multiples up the available output considerably)
*The way that some of those date modifiers are used for naming NOAA reports (a simple, but useful table)
 
 
The tables below are not able to indicate which of the billions of combinations possible are valid or invalid for youparticular tag names nor for particular release versions..
 
==Applicability by version and build==
 
The tip at the start of this article tells you how to check which tags are available in whatever build of Cumulus you are actually using. Given how often a new release alters either what web tags are available or what parameters can be used with particular web tags, it is not possible for the tables below todo tellnot youlist precisely how you useall web tags at any version, and the tables can't say which modifiers are available at your version.
 
Because Cumulus 2 is no longer available, it has been ignored in the tables below. It never really worked for web page generation, so if you happen to have installed Cumulus 2 from when it was available, you probably don't care which web tags it supports.
 
[[File:Badge v1.png]]This badge is used to highlight text that applies to Cumulus 1.
===Inconsistency in use of "T"===
 
*SomeThe newer web tags for '''today''' include a "T" as a suffix, somethe older ones do not.
**The lack of a "T" isin usedsome intoday combinationtags withcauses thesome webconfusion tagwith nameall-time forrecord atags as value,they sohave a similar namenaming isstructure usedto forthese theolder time-stamptoday web tags.
**This is particularly confusing and is why you must look up today, and all-time, tags in the tables in this article.
*The time-stamp tags add a "T" to the corresponding web tag for the value, but in an inconsistent way:
**the T is a prefix sometimes and
**the T is a suffix sometimes
**This is particularly confusing and is why you must look up time-stamp tags in the tables in this article.
 
===Choosing script variable names derived from tag names===
|-
|(not available)
| zzz
|0zzz
|Displays the offset of any time from UTC in hours and minutes
| e.g.-07:00
|-
*The jQuery get request takes the api URL as first parameter and the function to deal with the returned result as third parameter
*The middle parameter is irrelevant in this context as only one object instance is returned, but if the qet was returning multiple results, "limit=1" would only return the first result
*The function takes as its sole parameter an Object (a JavaScript Object is a collection of properties), this is what is returned by the api, thean selected nameobject can be given any variable name
*In JavaScript if a variable is defined outside the function, then given a value inside the function, that value can be accessed by later code outside the function (in my case by code within the other functions for calculating each derived value)
*We are only interested in 3 of the '''property_name = property_value''' items in the Object.
*The object returned has 3 parameters each in '''attribute=value''' format
*WeThe JavaScript '''refinement''' syntax (starts with a dot) can be used to find the value infor any parameter bywe usingname. We assign the '''object.attribute'''variable syntaxalready defined to the object and assignits itrefinement to(that specifies the variableattribute alreadywe definedwant).
*The console.log command simply outputs all the items in the list within the brackets into the browser console that in many browsers is displayed by selecting '''F12''' on the keyboard. I included this instead of the lengthy rest of my code that uses the units to do the various calculations correctly.
 
== "POST" approach ==
 
The word "Post" in a computer environment means that the Hypertext Transfer Protocol (HTTP) used by the internet is being asked to transfer information enclosed in the body of the request message. Put slightly less technically in this approach you produce a text file with the details of what tags you want and send it to the api server. I suppose it is a bit like sending an email, its header (subject, author, date sent) is easy to view, but you need to open it to see what text is in the body.
 
You may have used POST as an attribute when defining the action of a HTML form. In that context the form is sent as the contents of a message to whatever web page is going to process the contents of that form.
 
The post approach has a few advantages over get:
*The parameters are not shown in theany query-string, so are not obvious to the person looking over your shoulder, nor do they appear in a history list of sites that the browser has visited.
*If you fill out a form online, the post approach will be used as the content needs to be kept secure. The get approach may be seen when you are navigating through a web site, and a selection is being remembered.
**The get approach may be seen when you are navigating through a web site, and a selection is being remembered.
*A URL with query-string is restricted in total length (the restriction is dependent on a number of other factors, but might be at something like 1000 characters in total), so GET comes with a restriction on how many parameters can be specified; POST can handle much longer requests.
*The POST approach can handle very long requests and return a lot of information.
*A*In contrast, a URL with query-string is restricted in total length (the restriction is dependent on a number of other factors, but might be at something like 1000 characters in total), so GET comes with a restriction on how many parameters can be specified; POST can handle much longer requests.
 
See https://cumulus.hosiene.co.uk/viewtopic.php?p=145050#p145050 for post example
here is an example text file with some web tags in it, let us store it in '''process.txt''':
<pre><#time format="yyyy-MM-dd hh:mm:ss">,<#temp rc=y>,<#hum>,<#dew rc=y>,<#RecentFeelsLike rc=y d=1></pre>
 
The command '''http: //localhost:8998/api/tags/process.txt''' would send that text file to the api server, and you would get back the date and time in ISO format, the current temperature with decimal point, the current humidity, the current dew point with decimal point, and what the feels like temperature was one day ago at this time again with decimal point.
 
=The Web Tags for Cumulus =
5,838

edits