From fd55fe06a9e086bf2505d729b7a93577c4df557a Mon Sep 17 00:00:00 2001 From: Chase Tucker Date: Mon, 30 Jun 2025 13:07:11 -0700 Subject: [PATCH] Removing JSON not used by scanner app --- LSL2/STPROC/SCAN_API.txt | 9 +-- LSL2/STPROC/SCAN_SERVICES.txt | 105 +--------------------------------- 2 files changed, 2 insertions(+), 112 deletions(-) diff --git a/LSL2/STPROC/SCAN_API.txt b/LSL2/STPROC/SCAN_API.txt index a60ac54..d1cce05 100644 --- a/LSL2/STPROC/SCAN_API.txt +++ b/LSL2/STPROC/SCAN_API.txt @@ -423,14 +423,6 @@ CreateHALItem: jsonScan = Scan_Services('ConvertMVScanToJSON', ScanID, '', FullEndpointURL) If Error_Services('NoError') then - If SRP_JSON(objResource, 'Parse', jsonScan) EQ '' then - lastModified = SRP_JSON(objResource, 'GetValue', 'lastModified') - end else - lastModified = '' - end - SRP_JSON(objResource, 'Release') - HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL) - HTTP_Services('SetResponseHeaderField', 'Last-Modified', lastModified) HTTP_Services('SetResponseBody', jsonScan, False$, 'application/hal+json') If Assigned(Message) then HTTP_Services('SetResponseStatus', StatusCode, Message) @@ -444,3 +436,4 @@ CreateHALItem: return + diff --git a/LSL2/STPROC/SCAN_SERVICES.txt b/LSL2/STPROC/SCAN_SERVICES.txt index d26ebb3..4d30ae9 100644 --- a/LSL2/STPROC/SCAN_SERVICES.txt +++ b/LSL2/STPROC/SCAN_SERVICES.txt @@ -1710,23 +1710,6 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL) SRP_JSON(objScan, 'SetValue', 'result', {RESULT}, 'String') SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer') SRP_JSON(objScan, 'SetValue', 'testRunTypeName', XLate('TEST_RUN_TYPE', {TEST_RUN_TYPE_ID}, TEST_RUN_TYPE_RUN_TYPE$, 'X'), 'String') - If SRP_JSON(arrayScanLog, 'New', 'Array') then - If {SCANNED_DATES} NE '' then - ScannedDates = {SCANNED_DATES} - For Each ScannedDate in scannedDates using @VM setting vPos - objScanSession = '' - If SRP_JSON(objScanSession, 'New', 'Object') then - SRP_JSON(objScanSession, 'SetValue', 'date', Oconv({SCANNED_DATES}<0, vPos>, 'D4/'), 'String') - SRP_JSON(objScanSession, 'SetValue', 'time', Oconv({SCANNED_TIMES}<0, vPos>, 'MTH'), 'String') - SRP_JSON(objScanSession, 'SetValue', 'data', {SCANNED_DATA}<0, vPos>, 'String') - SRP_JSON(arrayScanLog, 'Add', objScanSession) - SRP_JSON(objScanSession, 'Release') - end - Next ScannedDate - end - SRP_JSON(objScan, 'Set', 'scanLog', arrayScanLog) - SRP_JSON(arrayScanLog, 'Release') - end SRP_JSON(objJSONScan, 'Set', 'scan', objScan) SRP_JSON(objScan, 'Release') @@ -2087,93 +2070,6 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL) end end - If itemURL NE '' then - // The itemURL was passed in so add HAL+JSON properties. - objLinks = '' - // Create the _links property and then all link objects needed for this resource. - If SRP_JSON(objLinks, 'New', 'Object') then - // Create a self link. - objLink = '' - If SRP_JSON(objLink, 'New', 'Object') then - SRP_JSON(objLink, 'SetValue', 'href', ItemURL, 'String') - SRP_JSON(objLink, 'SetValue', 'title', 'Self', 'String') - SRP_JSON(objLinks, 'Set', 'self', objLink) - SRP_JSON(objLink, 'Release') - end - SRP_JSON(objJSONScan, 'Set', '_links', objLinks) - SRP_JSON(objLinks, 'Release') - end - objForm = '' - // Create the _form property to help UIs determine what to display. - If SRP_JSON(objForm, 'New', 'Object') then - arrayFields = '' - If SRP_JSON(arrayFields, 'New', 'Array') then - If {EMPLOYEE_ID} NE '' then - objField = '' - If SRP_JSON(objField, 'New', 'Object') then - SRP_JSON(objField, 'SetValue', 'label', 'Employee', 'String') - SRP_JSON(objField, 'SetValue', 'value', {EMPLOYEE_NAME}, 'String') - SRP_JSON(arrayFields, 'Add', objField) - SRP_JSON(objField, 'Release') - end - end - If {LOCATION_ID} NE '' then - If SRP_JSON(objField, 'New', 'Object') then - SRP_JSON(objField, 'SetValue', 'label', 'Location', 'String') - SRP_JSON(objField, 'SetValue', 'value', {LOCATION_NAME}, 'String') - SRP_JSON(arrayFields, 'Add', objField) - SRP_JSON(objField, 'Release') - end - end - If {TOOL_ID} NE '' then - If SRP_JSON(objField, 'New', 'Object') then - SRP_JSON(objField, 'SetValue', 'label', 'Tool', 'String') - ToolName = {TOOL_NAME} - If {LOAD_LOCK} NE '' then ToolName := ' ( ' : {LOAD_LOCK} : ' )' - SRP_JSON(objField, 'SetValue', 'value', ToolName, 'String') - SRP_JSON(arrayFields, 'Add', objField) - SRP_JSON(objField, 'Release') - end - * If {LOAD_LOCK} NE '' then - * If SRP_JSON(objField, 'New', 'Object') then - * SRP_JSON(objField, 'SetValue', 'label', 'Load Lock', 'String') - * SRP_JSON(objField, 'SetValue', 'value', {LOAD_LOCK}, 'String') - * SRP_JSON(arrayFields, 'Add', objField) - * SRP_JSON(objField, 'Release') - * end - * end - end - If {TRANSFER_TOOL_ID} NE '' then - If SRP_JSON(objField, 'New', 'Object') then - SRP_JSON(objField, 'SetValue', 'label', 'Transfer', 'String') - SRP_JSON(objField, 'SetValue', 'value', {TRANSFER_TOOL_NAME}, 'String') - SRP_JSON(arrayFields, 'Add', objField) - SRP_JSON(objField, 'Release') - end - end - If {CASSETTE_IDS} NE '' then - If SRP_JSON(objField, 'New', 'Object') then - SRP_JSON(objField, 'SetValue', 'label', 'Cassette ID', 'String') - If SRP_JSON(arrayCassetteIDs, 'New', 'Array') then - For Each CassetteID in CassetteIDs using @VM - SRP_JSON(arrayCassetteIDs, 'AddValue', CassetteID, 'String') - Next CassetteID - SRP_JSON(objField, 'Set', 'values', arrayCassetteIDs) - SRP_JSON(arrayCassetteIDs, 'Release') - end - SRP_JSON(arrayFields, 'Add', objField) - SRP_JSON(objField, 'Release') - end - end - SRP_JSON(objForm, 'Set', 'fields', arrayFields) - SRP_JSON(arrayFields, 'Release') - end - SRP_JSON(objJSONScan, 'Set', '_form', objForm) - SRP_JSON(objForm, 'Release') - end - // Create the _class property for this resource. - SRP_JSON(objJSONScan, 'SetValue', '_class', 'resource') - end jsonScan = SRP_JSON(objJSONScan, 'Stringify', 'Fast') SRP_JSON(objJSONScan, 'Release') end else @@ -2425,3 +2321,4 @@ ClearCursors: return +