TEST: Difference between revisions

From Calidus HUB
No edit summary
(#tagtest)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
Add Multiple Photos to Export.
= 325145 Device Audit Log Improvements =


== Requirements ==
* Send the device audit log through a new web service method, rather than through email.
* Request that the device send through the audit log by making a setting on the server.
* Allow configuration of the audit log:
** Per device and default for the system.
** What is to be audited (types of audit log messages).
** Number of records to store on the audit log.
* Admin screen available to OBSL users only, to configure audit logs and request them to be sent (Devices screen).


Requirement:


Since the product development of multiple photo capture within the processing of a job, the export process does not include these any more. The export must be modified to include these in a new structure under EPOD_JOB.
== Overview of Solution ==
=== Device Audit Log Web Service Method ===
The PDA Audit Log screen will be modified to build a message onto the pending queue, containing all the logged data.


A new message request will be created for this (AUDIT_LOG).


Solution:
Structure to be defined, but it is assumed this will follow the structure of the existing XF_AUDIT device table.


A new XML tag will be added to the export - EPOD_PHOTOS. This will contain a collection of EPOD_PHOTO tags. This tag will contain all photos related to the job of any type.
The server PDA web service will be modified to receive this message and save this to a file in a server-side folder. The folder will be defined as a system web configuration parameter. The name to be confirmed, but will likely comprise:
* "AUDIT_LOG_"
* device_id
* date
* time
* ".XML"


    <EPOD_PHOTO>
        <EPL_PHOTO_ID></EPL_PHOTO_ID>
        <EPL_DESCRIPTION></EPL_DESCRIPTION>
        <EPL_PHOTO></EPL_PHOTO>
        <EPL_LAST_CHANGED_DATE></EPL_LAST_CHANGED_DATE>
        <EPL_LAST_CHANGED_TIME></EPL_LAST_CHANGED_TIME>
        <EPL_SITE_ID></EPL_SITE_ID>
        <EPL_IMAGE_TYPE></EPL_IMAGE_TYPE>
        <EPL_KEYVAL_1></EPL_KEYVAL_1>
        <EPL_KEYVAL_2></EPL_KEYVAL_2>
        <EPL_KEYVAL_3></EPL_KEYVAL_3>
        <EPL_KEYVAL_4></EPL_KEYVAL_4>
        <EPL_KEYVAL_5></EPL_KEYVAL_5>
    </EPOD_PHOTO>


The details are:
=== Request Device Audit Log ===
* EPL_PHOTO_ID - a unique identifier of the photo.
The EPOD_DEVICE table will be modified to add the following fields:
* EPL_DESCRIPTION - a comment entered against the photo when taken.
* EPD_AUDIT_LOG_REQUESTED_IND - int default 0
* EPL_PHOTO - the photo, in BASE64-encoded JPEG format.
* EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
* EPL_LAST_CHANGED_DATE - the date the photo was updated
* EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0
* EPL_LAST_CHANGED_TIME - the time the photo was updated
* EPD_LAST_AUDIT_LOG_RECEIVED_DATE - int default 0
* EPL_SITE_ID - the unique site ID.
* EPD_LAST_AUDIT_LOG_RECEIVED_TIME - int default 0
* EPL_IMAGE_TYPE - the type of image - see later
* EPD_LAST_AUDIT_LOG_RECEIVED - nvarchar(100) NULL
* EPL_KEYVAL_1 - key values based on the type.
* EPL_KEYVAL_2 - key values based on the type.
* EPL_KEYVAL_3 - key values based on the type.
* EPL_KEYVAL_4 - key values based on the type.
* EPL_KEYVAL_5 - key values based on the type.


The server PDA web service will be modified to recognise this flag on the following existing web service methods:
* LOGON_REQUEST
* AUTO_UPDATE_REQUEST


Image types and key values are as follows:
The device will be extracted and, if EPD_AUDIT_LOG_REQUESTED_IND is set to 1, the following additional information will be returned on the message:
* EPD_AUDIT_LOG_REQUESTED_IND - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0


{| border="1"
Structure to be defined, but it is assumed this will follow the structure of the existing EPOD_DEVICE table.
|- bgcolor="silver"
!EPL_IMAGE_TYPE !!Description !!EPL_KEYVAL_1 !!EPL_KEYVAL_2 !!EPL_KEYVAL_3 !!EPL_KEYVAL_4 !!EPL_KEYVAL_5
|-
|J ||Job Photo. ||EPL_JOB_ID ||&nbsp; ||&nbsp; ||&nbsp; ||&nbsp;
|-
|JU/JU1/JU2/JU3 ||Job UDF ||EPL_JOB_ID ||UDF Item ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|C ||Container ||EPL_JOB_ID ||EPL_CONTAINER_ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|CU ||Container UDF ||EPL_JOB_ID ||EPL_CONTAINER_ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|P ||Product ||EPL_JOB_ID ||EPL_CONTAINER_ID ||EPL_PRODUCT_CODE ||EPL_SEQUENCE ||&nbsp;
|-
|PU ||Product UDF ||EPL_JOB_ID ||EPL_CONTAINER_ID ||EPL_PRODUCT_CODE ||EPL_SEQUENCE ||UDF Item ID
|-
|S ||Service Item ||EPL_JOB_ID ||EPL_SERVICE_ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|SIU ||Service Item Info UDF ||EPL_JOB_ID ||EPL_SERVICE_ID ||UDF Item ID ||&nbsp; ||&nbsp;
|-
|SPR ||Service Item Prework UDF ||EPL_JOB_ID ||EPL_SERVICE_ID ||UDF Item ID ||&nbsp; ||&nbsp;
|-
|SPO ||Service Item Postwork UDF ||EPL_JOB_ID ||EPL_SERVICE_ID ||UDF Item ID ||&nbsp; ||&nbsp;
|-
|SDU ||Service Item Diagnosis UDF ||EPL_JOB_ID ||EPL_SERVICE_ID ||UDF Item ID ||&nbsp; ||&nbsp;
|-
|LSU ||Load Start Metrics UDF ||EPL_LOAD_ID ||UDF Item ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|LEU ||Load End Metrics UDF ||EPL_LOAD_ID ||UDF Item ID ||&nbsp; ||&nbsp; ||&nbsp;
|-
|VC ||Vehicle Checks ||EPL_VEHICLE_ID ||EPL_VEHICLE_CHECK_DATE<br />EPL_VEHICLE_CHECK_TIME ||UDF Item ID ||&nbsp; ||&nbsp;
|}




The device will be modified to check the responses to these messages (including a grace logon) and check the value of the indicator. If the flag is set to 1, the process will check the last requested date and time is different to the last request received. If so, the device will call the same code as the Audit screen i.e. generate a new AUDIT_LOG web service call.


A new Site parameter will control how photos are exported:
* N - Not exported
* Y - Job exported when all photos received.
* P - Job exported when ready and when any photos are received
* K - Job exported with Photo Key values only.


The server PDA web service AUDIT_LOG method will be modified to extract the device from the message and update the following fields:
* EPD_AUDIT_LOG_REQUESTED_IND - set to 0
* EPD_LAST_AUDIT_LOG_RECEIVED_DATE - set to sysdate
* EPD_LAST_AUDIT_LOG_RECEIVED_TIME - set to systime
* EPD_LAST_AUDIT_LOG_RECEIVED - set to the name of the audit log file created.




The device application will be modified to send back the key values of the photos for the job within the Job Update Request, as well as sending the photos separately.
=== Device Audit Log Configuration ===
{{Note}} This supersedes the Audit Logging configuration on the device.


    <EPOD_PHOTOS>
The EPOD_DEVICE table will be modified to add the following fields:
        <EPOD_PHOTO>
* EPD_AUDIT_LOGGING_IND - int, default 0
            <EPL_DEVICE_PHOTO_ID></EPL_PHOTO_ID>
* EPD_AUDIT_LOG_TYPES - nvarchar(MAX) -
            <EPL_DESCRIPTION></EPL_DESCRIPTION>
* EPD_AUDIT_LOG_LIMIT - int, default 2000
            <EPL_SITE_ID></EPL_SITE_ID>
            <EPL_IMAGE_TYPE></EPL_IMAGE_TYPE>
            <EPL_KEYVAL_1></EPL_KEYVAL_1>
            <EPL_KEYVAL_2></EPL_KEYVAL_2>
            <EPL_KEYVAL_3></EPL_KEYVAL_3>
            <EPL_KEYVAL_4></EPL_KEYVAL_4>
            <EPL_KEYVAL_5></EPL_KEYVAL_5>
        </EPOD_PHOTO>
        <EPOD_PHOTO>
            ...
        </EPOD_PHOTO>
    </EPOD_PHOTOS>


An EPOD_PHOTO tag will be sent back per EPOD_PHOTO for the EPL_JOB_ID, regardless of type.
Defaults for the system will be set to be:
* EPD_AUDIT_LOGGING_IND - 0
* EPD_AUDIT_LOG_TYPES - "{}"
* EPD_AUDIT_LOG_LIMIT - 2000


The server PDA web service will be modified for the LOGON_REQUEST method to return the content of the EPD_DEVICE table for the device.


The server Job Update request processor will recognise this content and create EPOD_PHOTO records for each EPOD_PHOTO tag, recording the details and marking the photos as not yet received.


The server Photo Request processor will update these records when received from the device. When received and complete, the processor will mark the job as not exported (EPL_XFER_FLAG) if the new Site parameter is set to "P".
The device will be modified to check the LOGON_RESPONSE message and store the devices flags. The value of EPD_AUDIT_LOG_TYPES will be stored as a JSON object or as a delimited list of areas.  


The export process will check this flag when building XML for a job to export:
{{Note}} This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.
* N - Do not include the EPOD_PHOTOS tag at all.
* Y - Only process the job if all photos for the job have EPL_COMPLETE set to "Y".
* P - Export with all photos with EPL_COMPLETE set to "Y" only.
* K - Job exported with Photo Key values only.


{{Doc_Appendix
The device will store the log indicator and limit (EPD_AUDIT_LOGGING_IND and EPD_AUDIT_LOG_LIMIT) as new global variables or system properties.
|Appendix=B
 
|Estimate=N
The device audit logging process (XF_AUDIT) will be modified to use the limit (EPD_AUDIT_LOG_LIMIT) instead of the fixed limit (2000). If the limit has changed, all messages will be removed from the table.
|Glossary=EPOD2
 
|Ref1=[http://172.198.45.54/calidus-assist/EPOD/index.php/UG_291094_EPOD_Admin_User_Guide UG 291094 EPOD Admin User Guide]
The device logging process will be modified to check whether the area exists in EPD_AUDIT_LOG_TYPES. If so, and audit logging is enabled (EPD_AUDIT_LOGGING_IND = 1), the device will write the debug message to the audit log.
|RefV1=4.0
 
|RefDate1=21/07/2016
 
|Ref2=[http://172.198.45.54/calidus-assist/EPOD/index.php/UG_291097_EPOD_Client_User_Guide UG 291097 EPOD Client User Guide]
=== Devices Maintenance Screen ===
|RefV2=5.0
The EPOD_DEVICE table will be modified to add the following fields:
|RefDate2=23/12/2016
* EPD_NAME - nvarchar(50)
|Ref3=[[FS 291096 Interface with CALIDUS ePOD]]
 
|RefV3=1.1
EPOD_LISTS and EPOD_LIST_ITEMS records will be created with all logging areas.
|RefDate3=11/01/2017
 
|Ref4=Portal User Guide - TTM
{{Note}} This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.
|RefV4=6.9.20
 
|RefDate4=14/12/2016
 
|REQ=0
A new Devices screen will be created to maintain the device table, including the new logging functionality.
|EST=0
 
|FS=0
This screen is available to OBSL users only, to configure audit logs and request them to be sent. This screen will not be added to any menus.
|TS=0
 
|DEV=0
This will be created as a new MVC screen. This requires the existing EPOD_DEVICE and EPOD_DEVICE_TYPE DAL classes to be converted to the new models.
|ST=0
 
|IMP=0
The screen will allow work similarly to existing screens, for finding and editing data.  
|Client=
 
|Year=
New devices cannot be created from this screen.
|FSEST=Y
 
|Rev1=Louis Merrett
The screen will allow searching for devices using the following criteria:
|Rev1Title=Oak Furniture Land Representative
* ''Device ID'' - text box with fuzzy match.
|Rev2=Matt Turner
* ''Device Name'' - text box with fuzzy match.
|Rev2Title=OBS Logistics Representative
* ''Date Type'' selector, one of:
}}
** ''Last Used''.
** ''Audit Requested''.
** ''Audit Received''.
* ''Date Range'' - a date range from/to, defaulting to the last week.
* ''User'' - textbox.
* ''Site'' - textbox, defaulting to the logged-on site.
* ''Audit Logging'' - a checkbox, defaulting to unchecked.
 
The results will be displayed in a jQuery datatable-enabled gridview.
 
The columns will be:
* ''Device ID''.
* ''Device Name''.
* ''Last Used'' (Date/Time).
* ''User''.
* ''Site''.
 
Clicking on a row will display the actions:
* '''Show Audit Logs''' - optional, allowing showing all logs associated to that device ID. This requires opening a folder on the IIS web server for browsing, like the PDAUpdates folder on the server.
* '''Select'''.
 
Pressing '''Select''' shows the details of the device:
* ''Device ID'' - read only
* ''Device Name'' - textbox.
* ''Last Used Date/Time'' - read only
* ''User'' - read only
* ''Site'' - read only
* ''Audit Logging'' section:
** ''Last Requested Date/Time'' - read only
** ''Last Received Date/Time'' - read only
** ''Last Audit Log'' - read only
** ''Enable Audit Logging'' - checkbox.
** ''Audit Log Types'' - a multi-select list. This is disabled if audit logging is disabled. This list will be populated from EPOD_LIST_ITEMS for the requisite list.
** '''Request Audit Log''' button - clicking this button enables the EPD_AUDIT_LOG_REQUESTED_IND field. This button is disabled if the indicator is already 1. This button is disabled if audit logging is disabled on the device.
 
 
A '''Save''' and '''Cancel''' button will also be provided.

Latest revision as of 17:13, 25 April 2019

325145 Device Audit Log Improvements

Requirements

  • Send the device audit log through a new web service method, rather than through email.
  • Request that the device send through the audit log by making a setting on the server.
  • Allow configuration of the audit log:
    • Per device and default for the system.
    • What is to be audited (types of audit log messages).
    • Number of records to store on the audit log.
  • Admin screen available to OBSL users only, to configure audit logs and request them to be sent (Devices screen).


Overview of Solution

Device Audit Log Web Service Method

The PDA Audit Log screen will be modified to build a message onto the pending queue, containing all the logged data.

A new message request will be created for this (AUDIT_LOG).

Structure to be defined, but it is assumed this will follow the structure of the existing XF_AUDIT device table.

The server PDA web service will be modified to receive this message and save this to a file in a server-side folder. The folder will be defined as a system web configuration parameter. The name to be confirmed, but will likely comprise:

  • "AUDIT_LOG_"
  • device_id
  • date
  • time
  • ".XML"


Request Device Audit Log

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_AUDIT_LOG_REQUESTED_IND - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_TIME - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED - nvarchar(100) NULL

The server PDA web service will be modified to recognise this flag on the following existing web service methods:

  • LOGON_REQUEST
  • AUTO_UPDATE_REQUEST

The device will be extracted and, if EPD_AUDIT_LOG_REQUESTED_IND is set to 1, the following additional information will be returned on the message:

  • EPD_AUDIT_LOG_REQUESTED_IND - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0

Structure to be defined, but it is assumed this will follow the structure of the existing EPOD_DEVICE table.


The device will be modified to check the responses to these messages (including a grace logon) and check the value of the indicator. If the flag is set to 1, the process will check the last requested date and time is different to the last request received. If so, the device will call the same code as the Audit screen i.e. generate a new AUDIT_LOG web service call.


The server PDA web service AUDIT_LOG method will be modified to extract the device from the message and update the following fields:

  • EPD_AUDIT_LOG_REQUESTED_IND - set to 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_DATE - set to sysdate
  • EPD_LAST_AUDIT_LOG_RECEIVED_TIME - set to systime
  • EPD_LAST_AUDIT_LOG_RECEIVED - set to the name of the audit log file created.


Device Audit Log Configuration

Note Note: This supersedes the Audit Logging configuration on the device.

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_AUDIT_LOGGING_IND - int, default 0
  • EPD_AUDIT_LOG_TYPES - nvarchar(MAX) -
  • EPD_AUDIT_LOG_LIMIT - int, default 2000

Defaults for the system will be set to be:

  • EPD_AUDIT_LOGGING_IND - 0
  • EPD_AUDIT_LOG_TYPES - "{}"
  • EPD_AUDIT_LOG_LIMIT - 2000

The server PDA web service will be modified for the LOGON_REQUEST method to return the content of the EPD_DEVICE table for the device.


The device will be modified to check the LOGON_RESPONSE message and store the devices flags. The value of EPD_AUDIT_LOG_TYPES will be stored as a JSON object or as a delimited list of areas.

Note Note: This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.

The device will store the log indicator and limit (EPD_AUDIT_LOGGING_IND and EPD_AUDIT_LOG_LIMIT) as new global variables or system properties.

The device audit logging process (XF_AUDIT) will be modified to use the limit (EPD_AUDIT_LOG_LIMIT) instead of the fixed limit (2000). If the limit has changed, all messages will be removed from the table.

The device logging process will be modified to check whether the area exists in EPD_AUDIT_LOG_TYPES. If so, and audit logging is enabled (EPD_AUDIT_LOGGING_IND = 1), the device will write the debug message to the audit log.


Devices Maintenance Screen

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_NAME - nvarchar(50)

EPOD_LISTS and EPOD_LIST_ITEMS records will be created with all logging areas.

Note Note: This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.


A new Devices screen will be created to maintain the device table, including the new logging functionality.

This screen is available to OBSL users only, to configure audit logs and request them to be sent. This screen will not be added to any menus.

This will be created as a new MVC screen. This requires the existing EPOD_DEVICE and EPOD_DEVICE_TYPE DAL classes to be converted to the new models.

The screen will allow work similarly to existing screens, for finding and editing data.

New devices cannot be created from this screen.

The screen will allow searching for devices using the following criteria:

  • Device ID - text box with fuzzy match.
  • Device Name - text box with fuzzy match.
  • Date Type selector, one of:
    • Last Used.
    • Audit Requested.
    • Audit Received.
  • Date Range - a date range from/to, defaulting to the last week.
  • User - textbox.
  • Site - textbox, defaulting to the logged-on site.
  • Audit Logging - a checkbox, defaulting to unchecked.

The results will be displayed in a jQuery datatable-enabled gridview.

The columns will be:

  • Device ID.
  • Device Name.
  • Last Used (Date/Time).
  • User.
  • Site.

Clicking on a row will display the actions:

  • Show Audit Logs - optional, allowing showing all logs associated to that device ID. This requires opening a folder on the IIS web server for browsing, like the PDAUpdates folder on the server.
  • Select.

Pressing Select shows the details of the device:

  • Device ID - read only
  • Device Name - textbox.
  • Last Used Date/Time - read only
  • User - read only
  • Site - read only
  • Audit Logging section:
    • Last Requested Date/Time - read only
    • Last Received Date/Time - read only
    • Last Audit Log - read only
    • Enable Audit Logging - checkbox.
    • Audit Log Types - a multi-select list. This is disabled if audit logging is disabled. This list will be populated from EPOD_LIST_ITEMS for the requisite list.
    • Request Audit Log button - clicking this button enables the EPD_AUDIT_LOG_REQUESTED_IND field. This button is disabled if the indicator is already 1. This button is disabled if audit logging is disabled on the device.


A Save and Cancel button will also be provided.