The InboundSeparatedValue handler is used to receive posted separated values and to send separated values as a reply.
Syntax:
|
When the RECEIVE command of this content handler is executed the following steps occur:
1. If there is no content or list argument, then an OK status is returned.
2. The handler checks that the content type belongs to the separated values group of content types, if it does not support the content type, then an error is returned to the program. Use the CONTENT keyword to override this check and to allow the handler to receive the data, it is assumed the data is CSV.
3. The handler determines the encoding to apply to the receive byte stream to convert it to Unicode.
4. The handler determines if this Unicode data needs to be archived.
5. The handler reads the separated values into the working list.
Example
RECEIVE HANDLER(InboundSeparatedValue) SVHEAD(ORDER) #WRKLST
When the SEND command of this content handler is executed the following steps occur:
1. The handler uses the value of the CONTENT keyword to determine the type of separated values to create:
2. If no content value is available, the handler defaults to application/comma-separated-values
3. If the content value is *CSV, then content type will be application/comma-separated-values
4. If the content value is *TEXTCSV, then content type will be text/comma-separated-values
5. If the content value is *TSV, then content type will be application/tab-separated-values
6. If the content value is *TEXTTSV, then content type will be text/tab-separated-values
7. If the content value is not a valid separated value content type then CSV data is created, but the specified content type is sent.
8. The optional SVHEAD keyword allows a header record to be inserted at the beginning of the data.
9. The handler creates Unicode data using all entries in the list, if there is no list argument then zero length content is created.
10. The handler determines if this Unicode data needs to be archived.
11. The handler creates a HTTP response to return to the remote client.
The optional UAFILE and UAPATH keywords are available to inform the remote client program of a recommended path and filename for the content. LANSA Integrator UserAgent will add these file and path names to the save popup menu on the response panel.
Syntax:
|
Example
SEND HANDLER(InboundSeparatedValue) CONTENT(*CSV) UAFILE(order.csv) #WRKLST