### Manually start application Source: https://itsm365.com/smp/Content/admin_sd/on_off_sd.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____3 Start the application manually as a specific user. This is not recommended for systems where the application is installed as a service. ```bash su - nausd4 /opt/naumen/nausd4/tomcat/bin/startup.sh ``` -------------------------------- ### Get Active Intervals of Time Counter Source: https://itsm365.com/smp/Content/script/api_timing.htm?TocPath=%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+SMP%7C%D0%A1%D0%BA%D1%80%D0%B8%D0%BF%D1%82%D0%BE%D0%B2%D1%8B%D0%B5+%D1%81%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D0%B8%7C%D0%9C%D0%B5%D1%82%D0%BE%D0%B4%D1%8B+API.+SMP%7C_____44 Retrieves a list of active intervals for a time counter. Requires the object with the time counter attribute and the attribute code. Example shows how to get intervals and access their start and end times. ```groovy def intervals = api.timing.getActiveIntervals('serviceCall$1234', 'timeAllowanceTimer') def interval = intervals.get(0) interval.getBegin() // начало интервала interval.getEnd() // конец интервала ``` -------------------------------- ### IIS Installation Steps Source: https://itsm365.com/smp/Content/admin_instal/IIS.htm Follow these steps to install IIS using Server Manager. Ensure ISAPI Filters are selected if configuring Tomcat with AJP. ```powershell # No specific code block provided in the text for installation, only steps. ``` -------------------------------- ### Create Application Deployment Directory and Copy WAR File Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____2 Prepare the deployment directory structure and copy the application's WAR file to the specified dated directory. This is a prerequisite for installation. ```bash mkdir -p /opt/naumen/nausd4/deploy/2020-01-24 mv ./sdng-war-*.war /opt/naumen/nausd4/deploy/2020-01-24 ``` -------------------------------- ### jsApi.requests.json GET Request Example Source: https://itsm365.com/smp/Content/applications/JSAPI_metods.htm?TocPath=%D0%92%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5+%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F%7C%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+%D0%B2%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D1%85+%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B9%7C%D0%9C%D0%B5%D1%82%D0%BE%D0%B4%D1%8B+JS%C2%A0API%7C_____1 Use this snippet for GET requests where the response is expected to be JSON. The response is automatically parsed. ```javascript const appRestBaseUrl = jsApi.getAppRestBaseUrl(); const subjectUuid = jsApi.extractSubjectUuid(); const url = `${appRestBaseUrl}/get/${subjectUuid}?attrs=title,UUID`; jsApi.requests.json({url}) .then(response => { console.log(response); return void 0; }).catch(error => { console.error(error); }); ``` -------------------------------- ### Configure and List Objects Source: https://itsm365.com/smp/Content/script/api.htm?TocPath=%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+SMP%7C%D0%A1%D0%BA%D1%80%D0%B8%D0%BF%D1%82%D0%BE%D0%B2%D1%8B%D0%B5+%D1%81%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D0%B8%7C_____4 Basic setup for defining list parameters and executing the list retrieval. ```Groovy builder.setDaysToLive(2); //builder.setSimple(); api.web.list(builder); ``` -------------------------------- ### Get Start of Working Day Source: https://itsm365.com/smp/Content/script/api.htm Retrieves the start of the working day for a given date, considering service time and time zone. ```APIDOC ## POST /api/timing/getStartOfWorkingDay ### Description Retrieves the first working second of a specified day, considering service time and time zone. ### Method POST ### Endpoint /api/timing/getStartOfWorkingDay ### Parameters #### Request Body - **date** (Date) - Optional - The date for which to find the start of the working day. If null, the current date is used. - **serviceTime** (ServiceTimeObject) - Required - The service time object from the 'Service Classes' directory. - **timeZone** (TimeZoneObject) - Optional - The time zone object from the 'Time Zones' directory. If null, the server's time zone is used. ### Request Example ```json { "date": "2024-04-23", "serviceTime": {"id": "someServiceTimeId"}, "timeZone": {"id": "someTimeZoneId"} } ``` ### Response #### Success Response (200) - **startOfWorkingDay** (DateTime) - The first working second of the specified day. Returns null if the day is not a working day. #### Response Example ```json { "startOfWorkingDay": "2024-04-23T09:00:00Z" } ``` ``` -------------------------------- ### Configure Tomcat Auto-start for init.d Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm Commands to make the init.d Tomcat script executable and register it with the system's service management for automatic startup on boot. Includes separate instructions for Red Hat and Debian-based systems. ```bash # chmod +x /etc/init.d/tomcat # chkconfig --add tomcat # chkconfig tomcat on ``` ```bash # chmod +x /etc/init.d/tomcat ``` -------------------------------- ### Create Deployment Directories Source: https://itsm365.com/smp/Content/admin/ops_nix_rdbms.htm Create the necessary directory structure for storing update and backup files. ```bash mkdir -p ~/deploy/$(date +'%F')/{update,backup} ``` -------------------------------- ### Get Start of Working Month Source: https://itsm365.com/smp/Content/script/api_timing.htm Retrieves the start of the working month for a given date, considering service time and time zone. ```APIDOC ## POST /api/timing/getStartOfWorkingMonth ### Description Retrieves the first working second of a given month, considering service time and time zone. ### Method POST ### Endpoint /api/timing/getStartOfWorkingMonth ### Parameters #### Request Body - **date** (string) - Optional - The date for which to find the start of the working month. If null, the current date is used. - **serviceTime** (object) - Required - The service time object from the 'Service Classes' dictionary. - **timeZone** (object) - Optional - The time zone object from the 'Time Zones' dictionary. If null, the server's time zone is used. ### Request Example ```json { "date": "2024-04-15", "serviceTime": { "id": "some-service-time-id" }, "timeZone": { "id": "UTC" } } ``` ### Response #### Success Response (200) - **startOfWorkingMonth** (string) - The start of the working month in ISO 8601 format. #### Response Example ```json { "startOfWorkingMonth": "2024-04-01T09:00:00Z" } ``` ``` -------------------------------- ### Configure Tomcat Autostart with init.d Script Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____2 Provides a sample init.d script for Apache Tomcat to manage its startup and shutdown. This script is intended for older Linux systems or those not using systemd. ```bash #!/bin/bash # # Startup script for the Apache Tomcat server # # chkconfig: - 85 15 # description: tomcat # processname: tomcat # config: PREFIX="/opt/naumen/nausd4/tomcat/bin" NAUUSER="nausd4" STRTCMD="startup.sh" STPCMD="shutdown.sh 60 -force" case "$1" in start) echo "Starting up NAUMEN SD 4" su - ${NAUUSER} -c ${PREFIX}/${STRTCMD} ;; stop) echo "Shutting down NAUMEN SD 4" su - ${NAUUSER} -c ${PREFIX}/${STPCMD} ;; *) echo "Usage: nausd4 start|stop" ;; esac exit 0 ``` -------------------------------- ### jsApi.requests.make GET Request Example Source: https://itsm365.com/smp/Content/applications/JSAPI_metods.htm?TocPath=%D0%92%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5+%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F%7C%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+%D0%B2%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D1%85+%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B9%7C%D0%9C%D0%B5%D1%82%D0%BE%D0%B4%D1%8B+JS%C2%A0API%7C_____1 Use this snippet to perform a GET request. The response is initially a string and needs to be parsed if JSON is expected. ```javascript const appRestBaseUrl = jsApi.getAppRestBaseUrl(); const subjectUuid = jsApi.extractSubjectUuid(); const url = `${appRestBaseUrl}/get/${subjectUuid}?attrs=title,UUID`; jsApi.requests.make({url}) .then(stringifiedResponse => { const response = JSON.parse(stringifiedResponse); console.log(response); return void 0; }).catch(error => { console.error(error); }); ``` -------------------------------- ### Start Tomcat using init.d script Source: https://itsm365.com/smp/Content/admin_sd/on_off_sd.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____3 Use this command to start the Tomcat service on Linux systems that use the /sbin/init initialization script. ```bash /etc/init.d/tomcat start ``` -------------------------------- ### GET api.libraries.getLibraryNames Source: https://itsm365.com/smp/Content/script/api_libraries.htm Retrieves a collection of names for all installed additional libraries. ```APIDOC ## GET api.libraries.getLibraryNames ### Description Returns a collection of names of all installed additional libraries. ### Method GET ### Endpoint api.libraries.getLibraryNames() ### Response #### Success Response (200) - **result** (Collection) - A collection of strings representing the names of installed libraries. ``` -------------------------------- ### Perform REST Call as JSON (GET Example) Source: https://itsm365.com/smp/Content/applications/JSAPI_metods.htm Executes a GET request to the SMP server and automatically parses the response as JSON. Handles potential errors. ```javascript const subjectUuid = jsApi.extractSubjectUuid(); const contentCode = jsApi.findContentCode(); const url = `exec/?func=modules.testModule.testMethod¶ms='${subjectUuid}', '${contentCode}'`; jsApi.restCallAsJson(url, {}) ``` -------------------------------- ### Start PostgreSQL Service on Ubuntu Source: https://itsm365.com/smp/Content/admin/ops_nix_rdbms.htm Use this command to start the PostgreSQL service on Ubuntu systems. Ensure the service name is correct. ```bash sudo systemctl start postgresql ``` -------------------------------- ### Create Tomcat Instance Directory Structure Source: https://itsm365.com/smp/Content/admin/nix-app-tomcat.htm Set up the necessary directory structure for a Tomcat instance where the SMP application will be deployed. ```bash mkdir -p /opt/naumen/nausd4/tomcat/{conf/Catalina/localhost,bin,lib,logs,webapps/ROOT,temp} ``` -------------------------------- ### Get Start of Working Month Source: https://itsm365.com/smp/Content/script/api_timing.htm?TocPath=%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+SMP%7C%D0%A1%D0%BA%D1%80%D0%B8%D0%BF%D1%82%D0%BE%D0%B2%D1%8B%D0%B5+%D1%81%D1%86%D0%B5%D0%BD%D0%B0%D1%80%D0%B8%D0%B8%7C%D0%9C%D0%B5%D1%82%D0%BE%D0%B4%D1%8B+API.+SMP%7C_____44 Retrieves the start of the working month for a given date. If the date is null, it uses the current date. Requires serviceTime and timeZone objects. ```Groovy api.timing.getStartOfWorkingMonth(date, serviceTime, timeZone) ``` -------------------------------- ### Start SMP Application Source: https://itsm365.com/smp/Content/admin/ops_nix_app_tomcat.htm Use this command to start the Tomcat service, which in turn starts the SMP application. Ensure Artemis is started first if external queue broker is configured. ```bash sudo systemctl start tomcat ``` -------------------------------- ### Perform REST Call (GET Example) Source: https://itsm365.com/smp/Content/applications/JSAPI_metods.htm Executes a GET request to the SMP server. Parses the string response into a JSON object. Handles potential errors during the call. ```javascript const subjectUuid = jsApi.extractSubjectUuid(); const contentCode = jsApi.findContentCode(); const url = `exec/?func=modules.testModule.testMethod¶ms='${subjectUuid}', '${contentCode}'`; jsApi.restCall(url, {}) .then(stringifiedResponse => { const response = JSON.parse(stringifiedResponse); console.log(response); return void 0; }).catch(error => { console.error(error); }); ``` -------------------------------- ### Add init.d Script to Autostart (Red Hat) Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____2 Configures the init.d Tomcat script to be executable and adds it to the system's runlevels for automatic startup on Red Hat-based systems. ```bash # chmod +x /etc/init.d/tomcat # chkconfig --add tomcat # chkconfig tomcat on ``` -------------------------------- ### Get Start of Working Day Source: https://itsm365.com/smp/Content/script/api_timing.htm Retrieves the start of the working day for a given date, considering service time and time zone. Returns null if the day is not a working day. ```APIDOC ## POST /api/timing/getStartOfWorkingDay ### Description Retrieves the first working second of a given day, considering service time and time zone. Returns null if the specified day is not a working day. ### Method POST ### Endpoint /api/timing/getStartOfWorkingDay ### Parameters #### Request Body - **date** (string) - Optional - The date for which to find the start of the working day. If null, the current date is used. - **serviceTime** (object) - Required - The service time object from the 'Service Classes' dictionary. - **timeZone** (object) - Optional - The time zone object from the 'Time Zones' dictionary. If null, the server's time zone is used. ### Request Example ```json { "date": "2024-04-23", "serviceTime": { "id": "some-service-time-id" }, "timeZone": { "id": "MSK" } } ``` ### Response #### Success Response (200) - **startOfWorkingDay** (string) - The start of the working day in ISO 8601 format, or null if the day is not a working day. #### Response Example ```json { "startOfWorkingDay": "2024-04-23T09:00:00+03:00" } ``` ``` -------------------------------- ### Add init.d Script to Autostart (Debian) Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____2 Makes the init.d Tomcat script executable for automatic startup on Debian-based systems. Further configuration might be needed depending on the specific Debian version. ```bash # chmod +x /etc/init.d/tomcat ``` -------------------------------- ### Create Exclusion Example Source: https://itsm365.com/smp/Content/RESTful/REST_API_method.htm?TocPath=%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0+SMP%7CREST-%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B%7C_____2 Example of creating an exclusion for a service class using a GET request. Ensure to replace and with actual values. The response will be the created object or an error description. ```HTTP /services/rest/create-excl/servicetime$2204/{"endTime":54000000,"startTime":28800000,"exclusionDate":"2010-10-04"}?accessKey= ``` -------------------------------- ### IIS Configuration: GUID Lookup Source: https://itsm365.com/smp/Content/admin/x509.htm Example configuration for IIS where certificate verification is handled by IIS. User lookup is based on the GUID from the Subject Alternative Names field and mapped to a custom 'employeeGUID' attribute. ```properties ru.naumen.core.authentication.authenticators=X509,INTERNAL ru.naumen.core.authentication.x509-authenticator.certificate-header=X-ARR-ClientCert ru.naumen.core.authentication.x509-authenticator.certificate-attribute=SANGUID ru.naumen.core.authentication.x509-authenticator.auth-attribute=employeeGUID ``` -------------------------------- ### Start Tomcat Service Source: https://itsm365.com/smp/Content/admin_instal/instal_SD_Linux.htm?TocPath=%D0%90%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+inHouse%7C%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE+%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B0%7C_____2 Start the Tomcat service using the system's service management command or by executing the startup script. Allow a few minutes for the application to initialize. ```bash # как сервис: service tomcat start ``` ```bash # с помощью скриптов tomcat: su - nausd4 /opt/naumen/nausd4/tomcat/bin/startup.sh ``` -------------------------------- ### Install and Enable WAL Cleanup Systemd Timer Source: https://itsm365.com/smp/Content/admin/ops_nix_rdbms.htm Commands to install systemd units and activate the WAL cleanup timer. ```bash sudo cp ~/deploy/$(date +'%F')/update/wal_cleaning.service /etc/systemd/system/ sudo cp ~/deploy/$(date +'%F')/update/wal_cleaning.timer /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable wal_cleaning.timer sudo systemctl start wal_cleaning.timer ``` -------------------------------- ### Perform HTTP requests with jsApi.requests.make Source: https://itsm365.com/smp/Content/applications/JSAPI_metods.htm Examples of executing GET and POST requests where the response is handled as a string. ```javascript const appRestBaseUrl = jsApi.getAppRestBaseUrl(); const subjectUuid = jsApi.extractSubjectUuid(); const url = `${appRestBaseUrl}/get/${subjectUuid}?attrs=title,UUID`; jsApi.requests.make({url})     .then(stringifiedResponse => {         const response = JSON.parse(stringifiedResponse);         console.log(response);         return void 0;     }).catch(error => {         console.error(error);     }); ``` ```javascript const appRestBaseUrl = jsApi.getAppRestBaseUrl(); const subjectUuid = jsApi.extractSubjectUuid(); const url = `${appRestBaseUrl}/edit/${subjectUuid}`; const options = {     body: JSON.stringify({         title: 'new title'     }),     method: 'POST',     url }; jsApi.requests.make(options)     .then(response => {         console.log(response);         return void 0;     }).catch(error => {         console.error(error);     }); ```