From 70890e7dfb2a27b562e5c3f7de77b24f0c5bb2c9 Mon Sep 17 00:00:00 2001 From: Rodrigo Goncalves <rodrigo.g@ufsc.br> Date: Tue, 17 Sep 2024 11:16:55 +0000 Subject: [PATCH] Documentation on how to extend/modify the TikiWiki import process --- ingress/README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ingress/README.md b/ingress/README.md index 0d779a0..1edf3b4 100644 --- a/ingress/README.md +++ b/ingress/README.md @@ -50,8 +50,26 @@ For each domain to be imported, an entry should be created in the ./config/tikiw * The certificate to access the SmartData API should be stored in the config directory and described in the configuration. * The tracker properties defines the name of the trackers (as stored in the TikiWiki) to retrieve the data. * The api property defines the base url for the API (such as https://iot.lisha.ufsc.br) +* The Trackers element contains a mapping where the mapped value (right) is the name of the Tracker in TikiWiki from which to extract the data. + +### Basic information +The import process from the TikiWiki currently assumes that a domain contains three Trackers: +Vehicles, VehicleMaintenancePlan, VehicleMaintenanceReport and VehicleMaintenanceReportErrorCodes. +The first three trackers are specific for each domain. The last one can be shared between different +domains since it a list of standard error codes. + +### Extending/modifying the current import process + +To modify/extend the current process the class app/command/tikiwiki/ImportCommand.php must be changed. +The process method is responsible for calling the required functions and execute the import process for each domain. +Thus, to add a new Tracker or edit the process of current ones, the necessary methods in this class should be modified. + +The class contains several helpers methods to facilitate the conversion process - such as unit conversions and +dynamic TikiWiki Tracker field mappings. The existing methods serve as good guideline on how to implement/extend the +existing code. # Pipeline development * Create a new Command (./app/command) following the syntax of existing commands (such as tikiwiki/ImportCommand.php) -* Register the new Command at ./setup.php \ No newline at end of file +* Register the new Command at ./setup.php + -- GitLab