TMS mycluddata SDK TMS mycluddata SDK February 2017 Cpyright 2017 by tmssftware.cm bvba Web: http://www.tmssftware.cm Email: inf@tmssftware.cm 1
TMS mycluddata SDK Index Availability... 3 Online references... 4 Terms f use... 5 Limited warranty... 7 Main features... 8 mycluddata install prcedure... 9 Starting the server applicatin... 14 Initialize the default admin accunt... 14 2
TMS mycluddata SDK Availability TMS mycluddata SDK v1.0 is available fr Windws and Linux nde.js based web servers. It supprts MS SQL r MySQL database supprt n Windws and MySQL supprt n Linux. TMS mycluddata SDK ffers seamless REST enabled access t structured clud data strage. With the SDK user based CRUD permissin settings are pssible as well as user based table sharing. Rich meta data can be used fr enhanced and autmatic client data entry frms. As the data can be accessed via a REST API, access frm varius perating systems using different prgramming languages is pssible. Frm TMS, libraries are ffered fr access frm.net cde, Delphi, C++Builder, Pascal r Javascript. Requirements Sftware - nde.js server v6.9.1 r newer - MS SQL 2014 r newer - MySQL v5.6 r newer TMS mycluddata SDK uses fllwing nde.js packages: - cnfig-js - hapi - inert - mysql (Fr use with MySQL nly) - tedius (Fr use with MS SQL nly) - tedius-cnnectin-pl (Fr use with MS SQL nly) - request (Fr use with Ggle recaptcha nly) Certificates Fr use via HTTPS, a certificate needs t be btained. 3
TMS mycluddata SDK Online references TMS sftware website: http://www.tmssftware.cm TMS mycluddata SDK prduct page: https://www.tmssftware.cm/site/mycluddatasdk.asp TMS mycluddata libraries: http://www.mycluddata.net/#/dcumentatin/libraries 4
TMS mycluddata SDK Terms f use With the purchase f TMS mycluddata SDK, yu are entitled t deply the SDK n yur server fr use frm ne dmain. There is n limit n the number f users that can access the structured clud data. With the purchase f the TMS mycluddata SDK cmes als ur supprt services and free SDK updates during the perid f ne year after purchase date. It is nt permitted t: 1) use the SDK n multiple dmains. Per dmain a license is required. 2) resell / sell accunts n the mycluddata SDK based service. 3) make the surce cde f the SDK publicly available 4) use f the mycluddata name when ffering services t 3 rd parties 5) use TMS CludData SDK n multiple dmains with ne purchased license License LICENSOR: tmssftware.cm bvba LICENSEE: cmpany r persn wh purchased the license t TMS mycluddata SDK By using the TMS mycluddata SDK yu are agreeing t be bund by the terms f this Agreement. If yu d nt agree then please uninstall the TMS mycluddata SDK. 1. GRANT OF LICENCE. In cnsideratin f yur agreement t abide by the terms and cnditins f this licence the LICENSOR grants t yu the LICENSEE the nn-exclusive right t use the TMS mycluddata SDK n ne dmain. 2. OWNERSHIP OF TMS mycluddata SDK. An express cnditin f this licence is that the LICENSOR retains title and wnership f the TMS mycluddata SDK and all cpyrights. 3. COPYING OF TMS mycluddata SDK. Yu may make unlimited cpies f the TMS mycluddata SDK fr yur persnal use. 4. USE RESTRICTIONS. Yu may nt mdify, adapt, translate, reverse engineer, decmpile, disassemble, r create derivative wrks based n the TMS mycluddata SDK. 5. DISTRIBUTION RESTRICTIONS. Yu may nt distribute cpies f the mycluddata SDK t thers. 5
TMS mycluddata SDK 6. TERMINATION. This licence remains effective until terminated. This licence will terminate autmatically withut ntice frm the LICENSOR if yu fail t cmply with any prvisin f this Licence. Upn terminatin yu shall destry all cpies f the TMS mycluddata SDK. 6
TMS mycluddata SDK Limited warranty a) Except as specifically stated in this agreement, the TMS mycluddata SDK is prvided and licensed 'AS IS' withut warranty f any kind, either express r implied, including, but nt limited t the implied warranties f merchantability and fitness fr a particular purpse. b) The LICENSOR des nt warrant that the functins cntained in the TMS mycluddata SDK will meet yur requirements r that peratin f the TMS mycluddata SDK will be either errr free r appear precisely as described in the dcumentatin. NO LIABILITY FOR CONSEQUENTIAL DAMAGES. T the maximum legal extent by applicable law, the LICENSOR shall nt be liable fr any damages whatsever (including, withut limitatin, damages fr lss f business prfits, business interruptin, lss f business infrmatin, r ther pecuniary lss) arising ut f the use r inability t use this TMS mycluddata SDK, even if the LICENSOR has been advised f the pssibility f such damages. 7
TMS mycluddata SDK Main features The TMS mycluddata SDK enables REST API (HTTP r HTTPS) based access t structured clud data strage. - Can be deplyed n a nde.js based web server - Supprts a MS SQL r MySQL database - Can be used n Micrsft Windws r Linux perating system - An unlimited number f data access users can be defined - Allws t use an unlimited number f tables, fields - Per user CRUD based permissins can be defined fr tables - Rich meta data can be cnfigured per table field - Permissin based sharing f data between users can be cnfigured - Accessible via REST API frm any prgramming envirnment supprting REST - Structured table based data strage - Tables can have fllwing field types: string, int, flat, blean, date, time, datetime, blb - Via metadata, typed fields can be defined + field lkup relatinships 8
TMS mycluddata SDK mycluddata install prcedure Install and cnfigure a database server Bth MySQL server and Micrsft SQL server are supprted. MySQL: - Install MySQL Server Linux minimum required versin: v5.6 Windws minimum required versin: v5.7 - Create a database schema called "restdb" - Imprt the file "MYSQL_RESTDB.sql" t create all required tables and fields. - Create a user called "RESTDB" and enter a passwrd MS SQL: - Install SQL Server Minimum required versin: SQL Server 2014 - Make sure the SQL Server is cnfigured t accept SQL Server Authenticatin: In the SQL Server Management Studi, right click the SQL Server and select Prperties Select the Security tab Make sure SQL Server and Windws Authenticatin mde is active - Create a database schema called "restdb" - Execute the file "MSSQL_RESTDB.sql" t create all required tables and fields. - Create a user called "RESTDB" and enter a passwrd. Make sure the user has access t the restdb database. Install NdeJS and NPM NdeJS minimum required versin: v6.9.1 9
TMS mycluddata SDK Install NdeJS mdules Navigate t the flder where the server.js file is lcated. The required NdeJS mdules and required versin number: - cnfig-js@1.1.9 - hapi@9.3.0 - inert@3.2.0 When using MySQL server the fllwing mdule is als required: - mysql@2.11.1 When using MSSQL server the fllwing mdules are als required: - tedius@1.12.3 - tedius-cnnectin-pl@0.3.9 When using the Ggle recaptcha the fllwing mdule is als required: - request@2.69.0 Uplad flder When using blb fields, a specific flder is required where files can be upladed befre they are inserted in a blb field f the database. Nte that upladed files are deleted autmatically after they have been inserted in the database. MySQL - When using Linux: Create a subflder called uplads in the fllwing flder: /var/lib/mysql/ Make sure the MySQL server has full wnership and permissins fr the files in the uplads flder by executing the fllwing cmmands: chwn mysql:mysql /var/lib/mysql/uplads/ chmd g+rw /var/lib/mysql/uplads/ - When using Windws: 10
TMS mycluddata SDK Make sure a flder called uplads exists in the fllwing flder: /PrgramData/MySQL/MySQL Server 5.7/ MSSQL Create a subflder called uplads in the mycluddata SDK install flder. The API Cnfiguratin settings The API settings can be fund in the file called cfg.js. Cnfiguratin file structure: - masterpasswrd (string): This is the master passwrd which is used t encrypt the user passwrds in the database. It is highly recmmended t change the default value befre adding users t the system (including admin accunt initializatin described belw). Nte: the value f the master passwrd cannt be changed after ne r mre users have been added t the system therwise the user passwrds will becme invalid and it will n lnger be pssible t lgin r authenticate. - islcal (blean): Indicates if the server will run lcal r remte. If remte, the server will nly allw strictly cntrl panel related API calls frm the dmain value as indicated in the dmain prperty. - dmain (string): Defines the dmain hst name fr remte servers. Only required if islcal is set t false. - apivhst (string array): Defines the hst names fr which the API must be accessible. - sitevhst (string array): Defines the hst names fr which the cntrl panel website must be accessible. - database (string): Defines which type f database cnnectin will be used. Accepted values are MSSQL r MYSQL. - upladpath (string): Defines the path where files can be upladed befre they are inserted in a blb field f the database. Nte: upladed files are deleted autmatically after they have been inserted in the database. - server: 11
TMS mycluddata SDK enablehttp (blean): Indicates if the server will be accessible via HTTP. enablehttps (blean): Indicates if the server will be accessible via HTTPS. prthttp (integer): Defines the prt number t use fr HTTP access. Default value is 80. prthttps (integer): Defines the prt number t use fr HTTPS access. Default value is 443. hsthttps (string): The IP address where the server is running n. Only required if enablehttps is true. - tls: The required files t enable a valid and secure HTTPS cnnectin. Only required if enablehttps is true. key (string): Path and filename where the privatekey.key file is lcated. cert (string): Path and filename where the dmain certificate file is lcated. ca (string array): Path and filenames where the certificate authrity files are lcated. - mssql: The MS SQL database cnnectin settings. Only required if a MS SQL database server is used. username (string): Defines the username fr the database cnnectin. passwrd (string): Defines the passwrd fr the database cnnectin. server (string): Defines the server fr the database cnnectin. Default value is lcalhst. - mysql: The MySQL database cnnectin settings. Only required if a MySQL database server is used. username (string): Defines the username fr the database cnnectin. 12
TMS mycluddata SDK passwrd (string): Defines the passwrd fr the database cnnectin. server (string): Defines the server fr the database cnnectin. Default value is lcalhst. database (string): Defines the database name fr the database cnnectin. - captcha: The captcha settings. Only required if the cntrl panel is cnfigured t display a captcha n the frm f the Accunt Details page. enable (blean): Indicates if the serverside captcha check shuld be enabled. secret (string): Defines the secret value assciated with the captcha. This value must be btained frm the Ggle recaptcha cntrl panel. The Cntrl Panel cnfiguratin settings The API settings can be fund in the file called site/assets/scripts/cnfig.js. Cnfiguratin file structure: - APIBase (string): The base URL value (including prt number) where the API can be accessed. The default value is http://lcalhst/. Nte that if the prthttp r prthttps values are different frm their default value, the prt number shuld als be included in this value. Example: http://lcalhst:8888/ - captcha: The captcha settings. Nte that in the API cnfiguratin settings the captcha shuld be enabled and a valid secret value shuld be prvided if the captcha is enabled here. enable (blean): Indicates if the captcha is displayed n the frm f the Accunt Details page. key (string): Defines the key value assciated with the captcha. This value must be btained frm the Ggle recaptcha cntrl panel. 13
TMS mycluddata SDK Starting the server applicatin Navigate t the mycluddata SDK flder and execute the fllwing cmmand: "nde server.js" If the server start was successful a message will appear that the server is running. Initialize the default admin accunt The default admin accunt allws t manage (add, update, delete) the users wh have access t the mycluddata cntrl panel and API. T autmatically generate the default admin accunt navigate t the fllwing endpint in yur brwser: mydmain:prtnumber/v2/init If the initializatin was successfull yu are redirected t the cntrl panel page, if nt, an errr message is displayed. The default admin accunt credentials are: - Lgin/email: mycluddata@mycluddata.net - Passwrd: passwrd It is highly recmmended t change the admin passwrd after lgging in t the cntrl panel. T change the admin passwrd: - Navigate t the cntrl panel in yur brwser - Lg in with the default admin user credentials - Click the Manage yur tables buttn - Click the ACCOUNT DETAILS menu item - The admin user accunt details are displayed 14
TMS mycluddata SDK - Enter the default passwrd in the Old Passwrd field - Enter the new passwrd in the New Passwrd and Cnfirm Passwrd fields - Update the admin accunt details Nw yu are ready t start using the mycluddata SDK. - T pen the cntrl panel in yur brwser navigate t: mydmain:prtnumber - T test if the API is running in yur brwser navigate t: mydmain:prtnumber/versin If the API versin number is displayed, the API server is running as expected. 15