$Web Restore List or $Web Rest List: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Restore_List or $Web_Rest_List}}
{{DISPLAYTITLE:$Web_Restore_List or $Web_Rest_List}}
<span class="pageSubtitle"><section begin="desc" />Restore saved $list<section end="desc" /></span>
<span class="pageSubtitle">Restore saved $list</span>


$Web_Restore_List restores a Sirius $list that had been saved in the same or an earlier session (with $Web_Save_List) to another $list. $WEB_REST_LIST is a synonym for $Web_Restore_List.
<var>$Web_Restore_List</var> restores a Sirius $list that had been saved in the same or an earlier session (with <var>$Web_Save_List</var>) to another $list. <var>$Web_Rest_List</var> is a synonym for <var>$Web_Restore_List</var>.
==Syntax==
 
<p class="syntax"><section begin="syntax" /> %RC = $Web_Restore_List( listid, id, opts )
<var>$Web_Restore_List</var> is a [[Calling_Sirius_Mods_$functions|callable]] $function.
<section end="syntax" /></p>


$Web_Restore_List is a callable $function (see [[Calling_Sirius_Mods_$functions|"Calling Sirius Mods $functions"]]).  
<var>$Web_Restore_List</var> accepts three arguments, the first two required, and it returns a numeric return code indicating the nature of any error.


$Web_Restore_List accepts three arguments, the first two required, and it returns a numeric return code indicating the nature of any error.
==Syntax==
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Restore_List</span>(<span class="term"> listid, id, opts</span> )
</p>


===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%rc</th>
<td>A numeric [[#Status codes|status code]].
<tr><th>listid</th>
<tr><th>listid</th>
<td>The identifier of the $list to receive the saved $list. This identifier is probably the output from a $ListNew call. This argument is required. The current contents of the this $list are replaced by the contents of the saved $list.</td></tr>
<td>The identifier of the $list to receive the saved $list. This identifier is probably the output from a $ListNew call. This argument is required. The current contents of the this $list are replaced by the contents of the saved $list.</td></tr>
<tr><th>id</th>
<tr><th>id</th>
<td>The 16-byte identifier of the saved record set that was returned by a previous $Web_Save_List call. This argument is required.</td></tr>
<td>The 16-byte identifier of the saved record set that was returned by a previous <var>$Web_Save_List</var> call. This argument is required.</td></tr>
 
<tr><th>opts</th>
<tr><th>opts</th>
<td>A blank delimited set of options that affects the function's behavior. This argument is optional; it can contain the following options:
<td>A blank delimited set of options that affects the function's behavior. This argument is optional; it can contain the following options:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>MOVE</th>
 
<tr><th><var>MOVE</var></th>
<td>Does a ''move''-style restore, that is, the pointers to the source record set or $list are simply moved to the restored version, so the source saved record set or $list is no longer accessible after the call. This is more efficient than a COPY style save, but it does produce a potentially problematic side-effect.</td></tr>
<td>Does a ''move''-style restore, that is, the pointers to the source record set or $list are simply moved to the restored version, so the source saved record set or $list is no longer accessible after the call. This is more efficient than a COPY style save, but it does produce a potentially problematic side-effect.</td></tr>
<tr><th>COPY</th>
 
<tr><th><var>COPY</var></th>
<td>Does a ''copy''-style save, that is, the contents of the source record set or $list are copied to the restored version, so the source saved record set or $list is still accessible after the call. This is less efficient than a MOVE style save, but it does avoid a potentially problematic side-effect.
<td>Does a ''copy''-style save, that is, the contents of the source record set or $list are copied to the restored version, so the source saved record set or $list is still accessible after the call. This is less efficient than a MOVE style save, but it does avoid a potentially problematic side-effect.
</td></tr></table>
</td></tr>
The default behavior of $WEB_REST_LIST is as if MOVE were specified.  
</table>
 
The default behavior of <var>$Web_Rest_List</var> is as if MOVE were specified.  
This default behavior can be changed on a thread basis by setting the <var>[[SRSPARM parameter|SRSPARM]]</var> parameter.
This default behavior can be changed on a thread basis by setting the <var>[[SRSPARM parameter|SRSPARM]]</var> parameter.
</td></tr></table>
</td></tr></table>


===Status codes===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>Code</th>
<tr><th>Code</th>
<td>Meaning</td></tr>
<th>Meaning</th></tr>
<tr><th>0</th>
<tr><th>0</th>
<td>No error</td></tr>
<td>No error</td></tr>
Line 38: Line 50:
<td>Identifier not found</td></tr>
<td>Identifier not found</td></tr>
</table>
</table>
<p class="caption">$WEB_RESTORE_LIST return codes</p>


$Web_Restore_List can be used on non-<var class="product">[[Janus Web Server]]</var> threads by <var class="product">[[Janus Web Server]]</var> customers. In fact, a $list can be saved on one type of thread (say a <var class="product">[[Janus Web Server]]</var> thread) and restored on another (say a VTAM 3270 thread).  
==Usage notes==
<ul>
<li><var>$Web_Restore_List</var> can be used on non-<var class="product">Janus Web Server</var> threads by <var class="product">Janus Web Server</var> customers. In fact, a $list can be saved on one type of thread (say a <var class="product">Janus Web Server</var> thread) and restored on another (say a VTAM 3270 thread).  


A $Web_Restore_List must be issued under the same userid under which the $Web_Save_List was issued. This userid ''can'' be the WEBUSER userid.  
<li>A <var>$Web_Restore_List</var> must be issued under the same userid under which the <var>$Web_Save_List</var> was issued. This userid ''can'' be the WEBUSER userid.  


If $Web_Restore_List is successful, the original contents of the $list are lost.  
<li>If <var>$Web_Restore_List</var> is successful, the original contents of the $list are lost.  


The primary purpose of $Web_Restore_List is to avoid redoing the complex processing required to build a large $list. There are many cases, however, where the original saved $list might be gone, either because of a timeout or an Online being cycled. Web applications that use $Web_Restore_List should be prepared to rebuild the $list if the $Web_Restore_List fails.
<li>The primary purpose of <var>$Web_Restore_List</var> is to avoid redoing the complex processing required to build a large $list. There are many cases, however, where the original saved $list might be gone, either because of a timeout or an Online being cycled. Web applications that use <var>$Web_Restore_List</var> should be prepared to rebuild the $list if the <var>$Web_Restore_List</var> fails.


<p class="code"> * Get the ID and try to restore the $list
<li>For more information about saved record sets and $lists, see [[Janus Web Server Saved Record Set Support|"Janus Web Server Saved Record Set Support"]] and <var>[[$Web_Save_List]]</var>.
%ID = $Web_Form_Parm('FINDID')
</ul>
IF %ID NE '' THEN
 
    %RC = $Web_Restore_List(%LIST, %ID)
==Examples==
    IF NOT %RC THEN
In the following example, the ID for a previously saved $list is retrieved from an invisible form field. If the ID exists and the $list restored, the call to computationally expensive subroutine <code>COMPLEX</code> is skipped. Otherwise, the parameters for a very complex subroutine called <code>COMPLEX</code> are retrieved from form fields and the $list is rebuilt. Later in the code, the $list associated with $list identifier %LIST could be saved with <var>$Web_Save_List</var>, whether it had been restored with <var>$Web_Restore_List</var> or built by subroutine <code>COMPLEX</code>.
      JUMP TO GOTL1
<p class="code">* Get the ID and try to restore the $list
    END IF
%ID = $Web_Form_Parm('FINDID')
END IF
IF %ID NE <nowiki>''</nowiki> THEN
  %RC = $Web_Restore_List(%LIST, %ID)
  IF NOT %RC THEN
      JUMP TO GOTL1
  END IF
END IF
   
   
* Couldn't restore it, rebuild $list
&#42; Couldn't restore it, rebuild $list
   
   
%START = $Web_Form_Parm('FINDSTART')
%START = $Web_Form_Parm('FINDSTART')
%END = $Web_Form_Parm('FINDEND')
%END = $Web_Form_Parm('FINDEND')
   
   
CALL COMPLEX(%LIST, %START, %END)
CALL COMPLEX(%LIST, %START, %END)
   
   
GOTL1:
GOTL1:
</p>
</p>
In the above example, the ID for a previously saved $list is retrieved from an invisible form field. If the ID exists and the $list restored, the call to computationally expensive subroutine COMPLEX is skipped. Otherwise, the parameters for a very complex subroutine called COMPLEX are retrieved from form fields and the $list is rebuilt. Later in the code, the $list associated with $list identifier %LIST could be saved with [[$Web_Save_List]], whether it had been restored with $Web_Restore_List or built by subroutine COMPLEX.
For more information about saved record sets and $lists, see and [[$Web_Save_List]].


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

Latest revision as of 21:35, 5 June 2013

Restore saved $list

$Web_Restore_List restores a Sirius $list that had been saved in the same or an earlier session (with $Web_Save_List) to another $list. $Web_Rest_List is a synonym for $Web_Restore_List.

$Web_Restore_List is a callable $function.

$Web_Restore_List accepts three arguments, the first two required, and it returns a numeric return code indicating the nature of any error.

Syntax

%rc = $Web_Restore_List( listid, id, opts )

Syntax terms

%rc A numeric status code.
listid The identifier of the $list to receive the saved $list. This identifier is probably the output from a $ListNew call. This argument is required. The current contents of the this $list are replaced by the contents of the saved $list.
id The 16-byte identifier of the saved record set that was returned by a previous $Web_Save_List call. This argument is required.
opts A blank delimited set of options that affects the function's behavior. This argument is optional; it can contain the following options:
MOVE Does a move-style restore, that is, the pointers to the source record set or $list are simply moved to the restored version, so the source saved record set or $list is no longer accessible after the call. This is more efficient than a COPY style save, but it does produce a potentially problematic side-effect.
COPY Does a copy-style save, that is, the contents of the source record set or $list are copied to the restored version, so the source saved record set or $list is still accessible after the call. This is less efficient than a MOVE style save, but it does avoid a potentially problematic side-effect.

The default behavior of $Web_Rest_List is as if MOVE were specified. This default behavior can be changed on a thread basis by setting the SRSPARM parameter.

Status codes

Code Meaning
0 No error
1 Not a valid $list identifier
2 Identifier not found

Usage notes

  • $Web_Restore_List can be used on non-Janus Web Server threads by Janus Web Server customers. In fact, a $list can be saved on one type of thread (say a Janus Web Server thread) and restored on another (say a VTAM 3270 thread).
  • A $Web_Restore_List must be issued under the same userid under which the $Web_Save_List was issued. This userid can be the WEBUSER userid.
  • If $Web_Restore_List is successful, the original contents of the $list are lost.
  • The primary purpose of $Web_Restore_List is to avoid redoing the complex processing required to build a large $list. There are many cases, however, where the original saved $list might be gone, either because of a timeout or an Online being cycled. Web applications that use $Web_Restore_List should be prepared to rebuild the $list if the $Web_Restore_List fails.
  • For more information about saved record sets and $lists, see "Janus Web Server Saved Record Set Support" and $Web_Save_List.

Examples

In the following example, the ID for a previously saved $list is retrieved from an invisible form field. If the ID exists and the $list restored, the call to computationally expensive subroutine COMPLEX is skipped. Otherwise, the parameters for a very complex subroutine called COMPLEX are retrieved from form fields and the $list is rebuilt. Later in the code, the $list associated with $list identifier %LIST could be saved with $Web_Save_List, whether it had been restored with $Web_Restore_List or built by subroutine COMPLEX.

* Get the ID and try to restore the $list %ID = $Web_Form_Parm('FINDID') IF %ID NE '' THEN %RC = $Web_Restore_List(%LIST, %ID) IF NOT %RC THEN JUMP TO GOTL1 END IF END IF * Couldn't restore it, rebuild $list %START = $Web_Form_Parm('FINDSTART') %END = $Web_Form_Parm('FINDEND') CALL COMPLEX(%LIST, %START, %END) GOTL1: