This solution was developed taking into account the absence of a web API for the Manitou application as well as the fact that it is easier to use data from a database than a batch of XML files.
This solution:
- Expects XML files (i.e., data/input/xml/*.xml), manually extracted from the Manitou application (i.e., Log In → General → Export data (beta));
- Reads the said files;
- Converts them to the JSON data format;
- Imports the data to Azure SQL Database;
- Which can then be used by solutions such as Power BI.
To do:
- Manitou should include access to live data and its statistics, through to a web API, with secure authentication (i.e., OAuth 2.0);
- Manitou data should be segregated (i.e. one database per customer) and fully accessible by its owner, in order to comply with the Act to modernize legislative provisions as regards the protection of personal information, which will come into force on 2023-09-22, in the province of Quebec;
- Manitou data should be segregated so that a superuser account is not required to export basic information;
- Manitou should include a reporting module (i.e., Power BI);
- Manitou data export module must be automatic, recurring and its data must be live (i.e., based on a replication of the production database, via a queuing mechanism).
flowchart TD
A[Manitou] -- Daily extraction, at 22 h --> B[XML]
B[XML] -- Convert --> C[JSON]
C[JSON] -- Import --> D[Azure SQL Database]
D[Azure SQL Database] -- Refresh --> E[Power BI]
- Download and extract the project from GitHub (e.g., Code → Download ZIP → go to This PC → Downloads → select file → context menu → Extract All... to
C:\temp\manitou
); - Run Windows PowerShell as an administrator;
- Execute:
& "C:\temp\manitou\install.ps1"
; - Copy
"conf/sql_template.json"
to"conf/sql.json"
and contact your system administrator for assistance in completing the Azure SQL Database configuration.
- Log in to Manitou, with a superuser account;
- Go to General → Functions → Export data (beta);
- Click + Add, select a Start of extraction (i.e., 2022 January), enter a Number of periods to export (i.e., 6 (months, including the selected Start of extraction)) and select a Requestor (i.e., yourself);
- Wait after 22 h that night for the query to run;
- Click on the corresponding Consult button (paperclip icon) to download the archive;
- Right-click the archive → Extract All... → Select a destination folder (i.e.,
C:\temp\manitou\data\input\xml
) → Extract;
- Run Windows PowerShell;
- Execute
python "mdc.py" --input "data/input/xml/*.xml" --output "data/output/json" --convert --sql --verbose
.
Execution example:
[2022-08-09 13:21:22] Deleted 15 JSON files in data/output/json.
[2022-08-09 13:21:22] Found 35 XML files in data/input/xml.
[2022-08-09 13:21:22] Wrote 235 documents to data/output/json/absences.json.
[...]
[2022-08-09 13:21:30] Importing JSON data to 15 tables in Azure SQL Database...
[2022-08-09 13:21:30] Dropped 3 tables.
[2022-08-09 13:21:40] Imported 424 documents to absences.
[...]
[2022-08-09 13:59:16] Creating columns and indexes...
[2022-08-09 13:59:16] Created index_absences_absenceId on absences.absenceId.
[...]
[2022-08-09 13:59:42] ** DONE **
For help, use: python "mdc.py" --help
.
The data will be imported, as JSON, into the "value" field, of the following tables, in a database named "manitoudb", in an Azure SQL Database instance.
- absences;
- activitiesTransfer;
- billedIncomes;
- CRMAccounts;
- employees;
- employeeSalaries;
- projectActivities;
- projectAssignments;
- projectContracts;
- projectDeliverables;
- projects;
- subcontractors;
- summaryDayAssignments;
- summaryDayEmployees;
- timeMoneyAdjustments.
- Run Windows PowerShell;
- Execute
python "mdc.py" --output "data/output/html" --export --verbose
; - Find the resulting HTML files in the output subdirectory.
- Install Power BI;
- Run Power BI.
- File → Get Data → Get data to get started → JSON → Connect;
- Select the first file → Open;
- Home → New Source → JSON → JSON;
- Select next file → Open;
- Repeat steps 5 and 6 for each file.
- Close & Apply;
- File → Save → File name:
"C:\temp\manitou\data\manitou.pbix"
.
- Repeat export and convert steps;
- Refresh data in Power BI, using Home → Refresh;
- Save Power BI file, using File → Save.
- Application: Manitou;
- Developer: Manitou Solution;
- Address: 412-825, Lebourgneuf Boulevard, Quebec, QC, G2J 0B9;
- Technologies: APEX, JS, PHP, WordPress;
- Web server: Nginx;
- Web API: Oracle REST Data Services (ORDS).
- Dynamics 365;
- JIRA;
- Nethris;
- Sage.
© Simon Charest | Forensik | In Fidem | Atos. All rights reserved.
- Azure SQL Database;
- Git (optional);
- GitHub (optional);
- Manitou;
- SQL Server Management Studio (optional);
- Power BI (optional);
- PowerShell;
- PyCharm (optional);
- Python;
Mr. Simon Charest, Software Developer and CEO at SLCIT Inc.