WME Comenzi Online (WMECOL) - WME Online Orders

This is a module of WinMENTOR ENTERPRISE.
The WMECOL module creates a web interface for operations specific to WME users, intended for sales agents.

Technical details
===============
WMECOL is made up of three main components:
--server.exe - provides the communication environment between the client applications and the WME database.
--WME AGENTI ONLINE.exe (or MONITOR) - client application that can be used to initialize server.exe, monitor server.exe
and debugging
--folder /WMECOL/Data/client, sources for setting up the web page that will serve as the interface for the application's users

WMECOL uses two web communication protocols: HTTP for initializing the client page and uploading source files
and WS for web page communication with server.exe.

Requirements
=======

-installation/pre-configuration of an HTTP server (example: Apache);
-configuration in the local network of the ports accessed from outside (port forwarding): 80 (default port for http access) and 9090 (default in the application;
can be modified in /WMECOL/Data/app.ini), for ws access.

Installation
=========
1) Copy the WMECOL directory to the desired location on the disk, where you want to install the application

The application directory has the following structure

/[WMECOL] - root dir
-WME AGENTS ONLINE.exe
-server.exe
/[Date] -dir
-app.ini
/[client] -dir
...

2) Application configuration
- open the app.ini file in a text editor, and modify the default settings if necessary, following the instructions.
- [database] : database instance used by the application, value 'database'
- if you use a PostgreSQL database, set the parameter PG = 1 and fill in the values for pg_host, pg_port and pg_dbname
- [ports]: the access ports in the network and on the server through the web-socket(ws) protocol, the 'APP_PORT' and 'EXT_PORT' values
(No configuration is required in the application for the access port through the http protocol, where the default is port 80; However, the configuration of
network for remote access. (See Requirements.)
- [HOST] : value 'HOST_NAME'
- [PATH] : value 'CLIENT_DIR'

3) Network configuration (required only for remote access;)
- see Requirements and Installation 6.b.

4) Web server configuration:
(Apache)
-Set the <DocumentRoot> value (in httpd.conf), the path to /WMECOL/Data/client/
- Start the server

5) Starting the application
-Start the WME AGENTI ONLINE.exe application, and wait a few seconds
- Select the 'Start AppServer' button or directly launch the executable WMEServerCO*
(On the WMEOL MONITOR window you will be able to follow the communication between the server and the connected clients.)
-If messages from the server appear in the WMEOL MONITOR window, you can proceed to the next step.
(After starting the server, the WMEOL MONITOR window can be closed;
To stop the server, restart WME AGENTI ONLINE.exe, wait a few seconds,
and press the Stop AppServer button;)

6) Access
Application users can connect in two ways:
a) Local: from the car on which the application was installed
- Open a modern web browser, capable of web-socket connections (Google Chrome, Mozilla Firefox, etc.).
- Access http://localhost
If the connection has been established, the authentication form will appear on the page.

b) Remote: from another device, via the Internet
- Open a modern web browser, capable of web-socket connections (Google Chrome, Mozilla Firefox, etc.).
-Access http://[HOST_NAME], where [HOST_NAME] represents the value set in /WMECOL/Data/app.ini
If the connection has been established, the authentication form will appear on the page.


--------------

For Oracle version:

If you get an error like
Unable to load dynamic library ...php_oci8_11g.dll, Oracle instant client version 11 must be installed
You can find it at https://www.oracle.com/database/technologies/instant-client/microsoft-windows-32-downloads.html at Version 11.2.0.4.0 basic; it must be downloaded, unzipped in C and the path to the folder must be added to the system path.

For Postgresql version:

If you get an error like
Unable to load dynamic library ...php_pgsql.dll and you have Postgresql installed, probably a dependent dll is missing, such as php5ts.dll

Download and install Xampp from the address https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.19/ and then add in System, Advanced System Settings, Environment Variables, System variables, to Path a new line with the path to the php folder in Xampp, for example C:\xampp\php

If you receive the error at login:

pg_connect(): Unable to connect to PostgreSQL server: authentication method 10 not supported on file

the md5 method must be put instead of scram-sha-256, in pg_hba.conf, in the table at the end, on each line; a new line must be added before the others:

host all all 0.0.0.0/0 md5

and the password of the user you connect with must be updated, so that it is encrypted with md5:

alter system set password_encryption = 'md5';
select pg_reload_conf();
alter role user_name with password 'user_password';
select rolpassword from pg_authid where rolname = 'user_name';

Now the encrypted password should start with md5.

-----------------

The server can be installed as a service using the utility
nssm.exe (http://nssm.cc)

run

nssm install service_name

and choose the path to server.exe in the window that opens.

Then you can run

nssm start service_name
nssm stop service_name

to start the service (it should appear with the name specified in Task manager, Services) and stop it.

To uninstall the service, use

nssm remove service_name.