Give us feedback
stream-utils
Service icon

Stream Utils

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded on 15 Jan by 
0.0
 (0 ratings)
stream-utils

Stream Utils

Details
This component provides some extension actions to treat stream object. These can prevent exhausting server's memory in several limited situations. Normally, OutSystems' app treats binary data only on memory and whole at once (at Platform Server 11.17.0). So, when treating large binary, it consumes large amount of server's memory. This components is the tool against this problem.
Read more

Note: This component has some side effects. See known issues below. Please use this at your own risk.


Known Issues


  • ServiceCenter's Error Log reports the following error when using some actions in the module.
    "Server cannot set status after HTTP headers have been sent."
  • ServiceCenter's General Log reports SLOWEXTENSION.


Unfortunately, these are unavoidable.


Contents


This component includes an extension module only.
The extension has following actions.

  • Current_GetRequestStream
    Extracts a stream object from current request. This action can be used in an exposed REST action. The exposed REST action's input parameter which Receive In property is Body is not needed because this extension action extracts the body data of current request.
    • (out) Stream | Object | Extracted stream object.
    • (out) ContentLength | Long Integer | Content-Length header value of current request.
    • (out) ContentType | Text | Content-Type header value of current request.

  • Current_CopyStreamToResponse
    Takes a stream object as an input parameter and copy it to response stream for current request. This action can be used in an exposed REST action. The exposed REST action's output parameter which Send In property is Body is not needed because this extension action send the body data to current response.
    • Stream | Object | Stream object to send.
    • ContentLength | Long Integer | Value for Content-Length response header.
    • ContentType | Text | Value for Content-Type response header.

  • File_GetStream
    Extracts a stream object from the file specified by input parameter.
    • FilePath | Text | Windows' absolute path of target file to read. e.g. "C:\WINDOWS\TEMP\MyApp\sample.txt"
    • (out) Stream | Object | Extracted stream object.
    • (out) Length | Long Integer | File length in bytes.

  • File_CopyStreamTo
    Takes a stream object as an input parameter and copy it to a file specified by the other parameter.
    • FilePath | Text | Windows' absolute path of target file to write to. e.g. "C:\WINDOWS\TEMP\MyApp\sample.txt"
    • Stream | Object | Stream object to write in.

  • RestConsume_GetResponseStream
    Extracts a stream object from consumed REST response. This action can be used in an OnBeforeRequestAdvanced action of REST Consume, not in a normal OnBeforeRequest. The consumed REST action's output parameter which Receive In property is Body is not needed because this extension action extracts the body data of the consumed REST response.
    • (out) Stream | Object | Extracted stream object.
    • (out) ContentLength | Long Integer | Content-Length header value of the consumed REST response.
    • (out)ContentType | Text | Content-Type header value of the consumed REST response.

  • RestConsume_CopyStreamToRequest
    Takes a stream object as an input parameter and copy it to the consumed REST request. This action can be used in an OnBeforeRequestAdvanced action of REST Consume, not in a normal OnBeforeRequest. The consumed REST action's input parameter which Send In property is Body is not needed because this extension action send the body data of the consumed REST request.
    • Stream | Object | Stream object to send.
    • ContentLength | Long Integer | Value for Content-Length request header.
    • ContentType | Text | Value for Content-Type request header.

  • RestConsume_GetActionName
    Returns consumed REST action name about to be called. This action can be used in an OnBeforeRequestAdvanced action of REST Consume, not in a normal OnBeforeRequest. You can use the result of this action to switch logic in your OnBeforeRequestAdvanced flow.
    • (out) ActionName | Text | Consumed REST action name about to be called.

  • RestConsume_GetRequestProps
    Returns some properties of the consumed REST action about to be called. This action can be used in an OnBeforeRequestAdvanced action of REST Consume, not in a normal OnBeforeRequest. This return value is equivalent to the input parameter of normal OnBeforeRequest action.
    • (out) RequestProperties | HTTPRequestProps Record | Some properties of the consumed REST action about to be called.

  • RestConsume_SetRequestProps
    Overwrites some properties of the consumed REST action about to be called. This action can be used in an OnBeforeRequestAdvanced action of REST Consume, not in a normal OnBeforeRequest. The input parameter of this action is equivalent to the output parameter of normal OnBeforeRequest action.
    • RequestProperties | HTTPRequestProps Record | Customized properties of the consumed REST action about to be called.

(HTTPRequestProps Record Structure is also defined in this extension. The structure has attributes of Base URL, URL Path, URL Query Parameters and HTTP Headers.)

Release notes (1.0.0)
License (1.0.0)
Reviews (0)