$Web Output Content: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Output_Content}}
{{DISPLAYTITLE:$Web_Output_Content}}
<span class="pageSubtitle"><section begin="desc" />Retrieve current output stream<section end="desc" /></span>
<span class="pageSubtitle">Retrieve current output stream</span>


<var>$Web_Output_Content</var> retrieves the current contents of the <var class="product">[[Janus Web Server]]</var> output stream as a longstring.


<var>$Web_Output_Content</var> takes a single optional argument and returns a longstring.


$Web_Output_Content retrieves the current contents of the ''[[Janus Web Server]]'' output stream as a longstring.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %LSTR = $Web_Output_Content( type )
<p class="syntax"><span class="term">%lstr</span> = <span class="literal">$Web_Output_Content</span>( [<span class="term">type</span>] )
<section end="syntax" /></p>
</p>


 
===Syntax terms===
$Web_Output_Content takes a single optional argument and returns a longstring.
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>type</th>
<tr><th>type</th>
Line 20: Line 20:
<td>The data is to be left unchanged.</td></tr>
<td>The data is to be left unchanged.</td></tr>
<tr><th>TextUtf8</th>
<tr><th>TextUtf8</th>
<td>The data is UTF-8 and is to be converted to EBCDIC: each two-byte UTF-8 sequence is converted to the corresponding ASCII character, which is then translated to EBCDIC using the translation table in effect for the ''[[Janus Web Server]]'' connection. This option was first provided as maintenance to ''[[Sirius Mods]]'' version 7.3.
<td>The data is UTF-8 and is to be converted to EBCDIC: each two-byte UTF-8 sequence is converted to the corresponding ASCII character, which is then translated to EBCDIC using the translation table in effect for the <var class="product">[[Janus Web Server]]</var> connection. This option was first provided as maintenance to ''[[Sirius Mods]]'' version 7.3.
</td></tr></table>
</td></tr></table>
''type'' is an optional argument, and it defaults to <tt>Binary</tt>.
''type'' is an optional argument, and it defaults to <tt>Binary</tt>.
Line 26: Line 26:
</table>
</table>


$Web_Output_Content can be used to examine data in the ''[[Janus Web Server]]'' output stream that results from Print or Html/Text statements when web capture is on ($Web_On), or to examine data that results from $WEB_PROC_SEND.  
==Usage notes==
 
<ul>
$Web_Output_Content cannot examine output data in these cases:
<li><var>$Web_Output_Content</var> can be used to examine data in the <var class="product">[[Janus Web Server]]</var> output stream that results from <var>Print</var> or <var>[[Text and Html statements|Html/Text]]</var> statements when web capture is on (<var>[[$Web_On]]</var>), or to examine data that results from <var>[[$Web_Proc_Send]]</var>.  


<var>$Web_Output_Content</var> cannot examine output data in these cases:
<ul>
<ul>
<li>After a <var>$Web_Done</var>  
<li>After a <var>$Web_Done</var>  
<li>After a $WEB_PROC_SEND without the MORE parameter  
<li>After a <var>$Web_Proc_Send</var> without the MORE parameter  
<li>After a $Web_Flush
<li>After a <var>$Web_Flush</var>
</ul>
</ul>


Text data is typically translated from EBCDIC to ASCII when sent to the ''[[Janus Web Server]]'' output stream. When the <tt>Text</tt> option is used with $WEB_OUTPUT_CONTENT, the data is translated back. If the EBCDIC-to-ASCII and ASCII-to-EBCDIC translate tables are not completely symmetrical, it is possible that the results of $Web_Output_Content will not be exactly what was sent.  
<li>Text data is typically translated from EBCDIC to ASCII when sent to the <var class="product">[[Janus Web Server]]</var> output stream. When the <tt>Text</tt> option is used with <var>$Web_Output_Content</var>, the data is translated back. If the EBCDIC-to-ASCII and ASCII-to-EBCDIC translate tables are not completely symmetrical, it is possible that the results of <var>$Web_Output_Content</var> will not be exactly what was sent.  
<p>
A particular translation problem is the pair of square bracket characters ([ ]), which has three different EBCDIC representations but only one ASCII representation. If the preferred EBCDIC square bracket values at a site are not the ones to which the default ASCII-to-EBCDIC translate table translates, the [[Translate tables]] can be modified.  </p>


A particular translation problem is the pair of square bracket characters ([ ]), which has three different EBCDIC representations but only one ASCII representation. If the preferred EBCDIC square bracket values at a site are not the ones to which the default ASCII-to-EBCDIC translate table translates, the translate tables can be modified. For more information about this, see the "Translate Tables" chapter in the ''Janus TCP/IP Base Reference Manual''.<blockquote> ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the CR, LF, or CRLF setting of JANUS DEFINE, JANUS WEB ON, or $Web_ProcSend). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by $Web_Output_Content.</blockquote>  
<p>'''Note:''' ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the <var>CR</var>, <var>LF</var>, or <var>CRLF</var> setting of <var>[[JANUS DEFINE]]</var>, <var>[[JANUS WEB ON]]</var>, or <var>$Web_Proc_Send</var>). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by <var>$Web_Output_Content</var>.</p>  


Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this longstring using either longstring parsing functions (see the ''Sirius Functions Reference Manual'') or Stringlist parsing methods (see the ''Janus SOAP Reference Manual'' -- the Stringlist class ParseLines method is likely to be particularly helpful).  
<li>Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this [[Longstrings|longstring]] using either [[List of $functions|$Lstr_xxx]] longstring parsing functions or <var>Stringlist</var> class parsing methods &mdash; the  <var>[[ParseLines (Stringlist subroutine)|ParseLines]]</var> method is likely to be particularly helpful.
 
</ul>
$Web_Output_Content is available only in Versions 6.7 and later of the ''[[Sirius Mods]]''.
 
See also:


==See also==
<ul>
<ul>
<li>[[$Web_Output_Type]]  
<li><var>[[$Web_Output_Type]]</var>
<li>[[$Web_Input_Content]]  
<li><var>[[$Web_Input_Content]]</var>
<li>[[$Web_File_Content]]
<li><var>[[$Web_File_Content]]</var>
</ul>
</ul>


[[Category:Janus Web Server $functions|$Web_Output_Content]]
[[Category:Janus Web Server $functions|$Web_Output_Content]]

Latest revision as of 16:52, 10 October 2014

Retrieve current output stream

$Web_Output_Content retrieves the current contents of the Janus Web Server output stream as a longstring.

$Web_Output_Content takes a single optional argument and returns a longstring.

Syntax

%lstr = $Web_Output_Content( [type] )

Syntax terms

type A case-independent string set to one of the following:
Text The data is text and is to be translated from ASCII to EBCDIC.
Binary The data is to be left unchanged.
TextUtf8 The data is UTF-8 and is to be converted to EBCDIC: each two-byte UTF-8 sequence is converted to the corresponding ASCII character, which is then translated to EBCDIC using the translation table in effect for the Janus Web Server connection. This option was first provided as maintenance to Sirius Mods version 7.3.

type is an optional argument, and it defaults to Binary.

Usage notes

  • $Web_Output_Content can be used to examine data in the Janus Web Server output stream that results from Print or Html/Text statements when web capture is on ($Web_On), or to examine data that results from $Web_Proc_Send. $Web_Output_Content cannot examine output data in these cases:
    • After a $Web_Done
    • After a $Web_Proc_Send without the MORE parameter
    • After a $Web_Flush
  • Text data is typically translated from EBCDIC to ASCII when sent to the Janus Web Server output stream. When the Text option is used with $Web_Output_Content, the data is translated back. If the EBCDIC-to-ASCII and ASCII-to-EBCDIC translate tables are not completely symmetrical, it is possible that the results of $Web_Output_Content will not be exactly what was sent.

    A particular translation problem is the pair of square bracket characters ([ ]), which has three different EBCDIC representations but only one ASCII representation. If the preferred EBCDIC square bracket values at a site are not the ones to which the default ASCII-to-EBCDIC translate table translates, the Translate tables can be modified.

    Note: ASCII carriage returns (X'0D'), linefeeds (X'0A'), or both are added to the output stream for each text data output line (according to the CR, LF, or CRLF setting of JANUS DEFINE, JANUS WEB ON, or $Web_Proc_Send). These characters get translated back to EBCDIC carriage returns (X'0D') and linefeeds (X'25') by $Web_Output_Content.

  • Having the output content as a single longstring might be inconvenient for many applications, especially if the data is line-oriented. It is the application's responsibility to parse this longstring using either $Lstr_xxx longstring parsing functions or Stringlist class parsing methods — the ParseLines method is likely to be particularly helpful.

See also