diff --git a/LSL2/STPROC/REACTITEMS_API.txt b/LSL2/STPROC/REACTITEMS_API.txt index a17be97..54fdffc 100644 --- a/LSL2/STPROC/REACTITEMS_API.txt +++ b/LSL2/STPROC/REACTITEMS_API.txt @@ -72,16 +72,14 @@ API reactItems.GET end else CurrStatus = '' end - - StatusCode = 200 - If ( (RIType NE '') or (CurrStatus NE '') ) then - // Perform a lookup and return a collection of objects - GoSub CreateHALCollection + If Index(QueryFields, 'showAllDetails', 1 ) then + ShowAllDetails = Http_Services('GetQueryField', 'showAllDetails') end else - // Return a template for a new react item record - GoSub CreateHALTemplate - end + ShowAllDetails = False$ + end + StatusCode = 200 + GoSub CreateHALCollection end api @@ -256,12 +254,21 @@ CreateHALCollection: JSONCollection = '' Abort = False$ - ReactItems = React_Item_Services('GetReactItems', RIType, CurrStatus) + If RIType NE '' OR CurrStatus NE '' then + ReactItems = React_Item_Services('GetReactItems', RIType, CurrStatus) + end else + ReactItems = React_Item_Services('GetAllReactItemKeys') + end + If ReactItems NE '' then If SRP_JSON(hJSONCollection, 'New', 'Object') then If SRP_JSON(hReactItemsArray, 'New', 'Array') then For each ReactItemID in ReactItems using @VM setting vPos - ReactItemJSON = React_Item_Services('ConvertRecordToJSONQuick', ReactItemID, '', FullEndpointURLNoQuery:'/':ReactItemID) + If Not(ShowAllDetails) then + ReactItemJSON = React_Item_Services('ConvertRecordToJSONQuick', ReactItemID, '', FullEndpointURLNoQuery:'/':ReactItemID) + end else + ReactItemJSON = React_Item_Services('ConvertRecordToJSON', ReactItemID, '', FullEndpointURLNoQuery:'/':ReactItemID) + end If Error_Services('NoError') then If (SRP_JSON(hReactItem, 'Parse', ReactItemJSON) EQ '') then SRP_JSON(hReactItemsArray, 'Add', hReactItem) @@ -277,13 +284,6 @@ CreateHALCollection: end SRP_JSON(hReactItemsArray, 'Release') end -* ReactItemTemplateJSON = React_Item_Services('GetReactItemTemplateJSON') -* If Error_Services('NoError') then -* If (SRP_JSON(hReactItemTemplate, 'Parse', ReactItemTemplateJSON) EQ '') then -* SRP_JSON(hJSONCollection, 'Set', 'reactItemOptions', hReactItemTemplate) -* SRP_JSON(hReactItemTemplate, 'Release') -* end -* end JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled') SRP_JSON(hJSONCollection, 'Release') end diff --git a/LSL2/STPROC/REACT_ITEM_SERVICES.txt b/LSL2/STPROC/REACT_ITEM_SERVICES.txt index 32dc611..9befbf1 100644 --- a/LSL2/STPROC/REACT_ITEM_SERVICES.txt +++ b/LSL2/STPROC/REACT_ITEM_SERVICES.txt @@ -38,6 +38,18 @@ Return Response or "" // SERVICES //----------------------------------------------------------------------------- +Service GetAllReactItemKeys() + AllKeys = '' + RList('SELECT REACT_ITEM', TARGET_ACTIVELIST$, '', '', '') + Done = False$ + Reactors = '' + Loop + Readnext keyId else Done = True$ + Until Done + AllKeys<1,-1> = keyId + Repeat + Response = AllKeys +end service Service GetReactItems(RIType, CurrStatus) @@ -94,6 +106,7 @@ Service ConvertRecordToJSON(KeyID, Record, ItemURL) SRP_JSON(objReactItem, 'SetValue', 'mfrPartNoRev', {MFR_PART_NO_REV}) SRP_JSON(objReactItem, 'SetValue', 'serialNo', {SERIAL_NO}) SRP_JSON(objReactItem, 'SetValue', 'riType', {RI_TYPE}) + SRP_JSON(objReactItem, 'SetValue', 'CurrentStatus', {CURR_STATUS}) // Add available disposition codes DispCodes = Xlate('SYSREPOSPOPUPS', 'LSL2**REACT_ITEM_DISP', 'DISPLAY', 'X') If SRP_JSON(objReactItemDispArray, 'New', 'Array') then @@ -408,3 +421,4 @@ return +