Modules: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
Modules are the basic building blocks of CumulusUtils. Identifying modules on the commandline they become synonym with commands to CumulusUtils.
Modules are the basic building blocks of CumulusUtils. Identifying modules on the commandline they become synonym with commands to CumulusUtils and can be used in a users own website. The [[Website Generator|website]] is not seen as a module but it is the CUtils own aggregate of the modules.

When using the Website Generator, all modules are used implicitly. Modules, with some exceptions, can be used standalone in any website by including the output of CumulusUtils in that website. When using the standalone mode you need to be aware of the [[cumulusutils.ini|inifile parameters]] (section general) ''GeneratejQueryInclude'' and ''DoLibraryIncludes''.

#GeneratejQueryInclude will - if true - generate the required jQuery library reference line on top of the module.
#DoLibraryIncludes will - if true - generate the required library references (e.g. HighCharts, Leaflet etc...) on top of the module.

If you manage these libraries in your website yourself set these parameter values to false.
If the modules don't work and you have no idea what this is about, set these values to true.


== The list of modules ==
== The list of modules ==
CumulusUtils offers the following modules (which can be used as commands):
CumulusUtils offers the following modules (which can be used as commands):
#[[SysInfo]]
#[[SysInfo]]
#[[Forecast]]
#[[StationMap]]
#[[UserReports]]
#[[pwsFWI]]
#[[pwsFWI]]
#[[Records - Top10|Top10]]
#[[Extra Sensors|ExtraSensors]]
#[[Custom Logs]]
#[[Graphs]]
#[[Graphs]]
#[[Yadr]]
#[[Yadr]]
#[[Records]]
#[[Records]]
#[[NOAA]]
#[[NOAA]]
#[[Forecast]]
#[[StationMap]]
#[[UserReports]]
#[[Records - Top10|Top10]]
#[[Records - DayRecords|DayRecords]]
#[[Records - DayRecords|DayRecords]]
#[[AirQuality]]
#[[AirLink]] (before version 6.1 this was [[AirQuality]])
#[[ChartsCompiler]]
#[[MeteoCam]]
#[[Diary]]
#[[UserAskedData]]


== The multiple module commands ==
== The multiple module commands ==
In addition to the true modules which are equivalent to commands, there are commands which are strictly spoken not modules because they do not comprise a single functionality:
In addition to the true modules which are equivalent to commands, there are commands which are strictly spoken not modules because they do not comprise a single functionality:
#[[Website Generator|Website]] => generates the website which consists of all modules, the inclusion of the libraries is embedded in website's index.html.
#[[Website Generator|Website]] => generates the website which consists of all modules, the inclusion of the libraries is embedded in website's index.html.
#[[UserAskedData]] => a specific command used for generating JSON datafiles when required by other modules (e.g. ''AirLink'', ''Extra Sensors'' and ''CustomLogs'')
#[[All]] => generates all modules without the context of the website, the inclusion of the libraries is embedded in the generated files.
#[[UserAskedData]] => a specific command used for generating JSON datafiles when required by other modules (Compiler and/or AirQuality)
#[[ChartsCompiler|CompileOnly]] => a command which activates the compiler only. This is a very specific command with more than one effect. Please check out its own page.
#[[ChartsCompiler|CompileOnly]] => a command which activates the compiler only. This is a very specific command with more than one effect. Please check out its own page.

If you use modules but want the resulting server location outside of your main website location (e.g. in a subdirectory CUtils) then please create that directory and set your uploads for CUtils accordingly. To have your website find the specific realtime values (the JSON files) specifically generated for CUtils, than run the [[UserAskedData]] command and set the parameter where to locate those data. In the case as above:
DoModular=true
ModulePath=<path>
''DoModular'' and the command ''Website'' are incompatibe


== Javascript libraries ==
== Javascript libraries ==
The usage of javascript libraries like jQuery, Highcharts or Leaflet is controlled by the user who already may have these libraries included in his website on another level. In that case a second inclusion is not wanted. Therefore two explicit parameters exist which govern these situations: ''GeneratejQueryInclude'' and ''DoLibraryIncludes''.
When using the [[Website Generator]], all modules are used implicitly. Modules, with some exceptions, can be used standalone in any website by including the output of CumulusUtils in that website. When using the standalone mode you need to be aware of the [[cumulusutils.ini|inifile parameters]] (section general) ''GeneratejQueryInclude'' and ''DoLibraryIncludes''.


#GeneratejQueryInclude will - if true - generate the required jQuery library reference line on top of the module.
As [https://jquery.com/ jQuery] is a requirement for almost all modules (with menu's), CumulusUtils has provided a parameter ''GeneratejQueryInclude'' in the section [General] which the user can set to true or false. If his site has already a general inclusion of this library or another version, set it to false. If you have no idea what this is about, set it to true or start reading about javascript libraries.
#DoLibraryIncludes will - if true - generate the required library references (e.g. HighCharts, Leaflet etc...) on top of the module.


If you manage these libraries in your website yourself set these parameter values to false.
Libraries for Highcharts or Leaflet are included when required in a specific module IF the inifile parameter ''DoLibraryIncludes'' is true (default). Set to false if you already use the libraries on another level. If you have no idea what this is about, set it to true or start reading about javascript libraries.
If the modules don't work and you have no idea what this is about, set these values to true.


If you use the [[Website Generator]], '''set both parameters to false'''.
If you use the [[Website Generator]], '''set both parameters to false'''.

== Commandline parameters (v7 and up) ==


To have modules work properly with the commandline parameters introduced in version 7 of CUtils, you need to use the runtime library for ''CumulusUtils''
<pre>
<script src='lib/cumulusutils.js'></script>
</pre>
This library is generated with the website command separately with the ''CUlib'' command. <br>
It has it's [[CumulusUtils Runtime Library|own entry in the wiki]].

You can also use - i.s.o. the library above - a script in your own HTML file:
<pre>
<script>
const urlParams = new URLSearchParams(window.location.search);
</script>
</pre>


[[Category:CumulusUtils]]
[[Category:CumulusUtils]]

Latest revision as of 13:43, 5 December 2024

Introduction

Modules are the basic building blocks of CumulusUtils. Identifying modules on the commandline they become synonym with commands to CumulusUtils and can be used in a users own website. The website is not seen as a module but it is the CUtils own aggregate of the modules.

The list of modules

CumulusUtils offers the following modules (which can be used as commands):

  1. SysInfo
  2. pwsFWI
  3. ExtraSensors
  4. Custom Logs
  5. Graphs
  6. Yadr
  7. Records
  8. NOAA
  9. Forecast
  10. StationMap
  11. UserReports
  12. Top10
  13. DayRecords
  14. AirLink (before version 6.1 this was AirQuality)
  15. ChartsCompiler
  16. MeteoCam
  17. Diary
  18. UserAskedData

The multiple module commands

In addition to the true modules which are equivalent to commands, there are commands which are strictly spoken not modules because they do not comprise a single functionality:

  1. Website => generates the website which consists of all modules, the inclusion of the libraries is embedded in website's index.html.
  2. UserAskedData => a specific command used for generating JSON datafiles when required by other modules (e.g. AirLink, Extra Sensors and CustomLogs)
  3. CompileOnly => a command which activates the compiler only. This is a very specific command with more than one effect. Please check out its own page.

If you use modules but want the resulting server location outside of your main website location (e.g. in a subdirectory CUtils) then please create that directory and set your uploads for CUtils accordingly. To have your website find the specific realtime values (the JSON files) specifically generated for CUtils, than run the UserAskedData command and set the parameter where to locate those data. In the case as above:

DoModular=true
ModulePath=<path>

DoModular and the command Website are incompatibe

Javascript libraries

When using the Website Generator, all modules are used implicitly. Modules, with some exceptions, can be used standalone in any website by including the output of CumulusUtils in that website. When using the standalone mode you need to be aware of the inifile parameters (section general) GeneratejQueryInclude and DoLibraryIncludes.

  1. GeneratejQueryInclude will - if true - generate the required jQuery library reference line on top of the module.
  2. DoLibraryIncludes will - if true - generate the required library references (e.g. HighCharts, Leaflet etc...) on top of the module.

If you manage these libraries in your website yourself set these parameter values to false. If the modules don't work and you have no idea what this is about, set these values to true.

If you use the Website Generator, set both parameters to false.

Commandline parameters (v7 and up)

To have modules work properly with the commandline parameters introduced in version 7 of CUtils, you need to use the runtime library for CumulusUtils

 <script src='lib/cumulusutils.js'></script>

This library is generated with the website command separately with the CUlib command.
It has it's own entry in the wiki.

You can also use - i.s.o. the library above - a script in your own HTML file:

 <script>
  const urlParams = new URLSearchParams(window.location.search);
 </script>