Module #03.03 : Archiving and retrieving structures

All PVT documentation can be found under PHIGS Validation Tests - Overview. You may also return to the hierarchical table of topics covered by the PVT. For an explanation of the format of the individual module documentation, please see section 2.5 of the User's Guide.



DESCRIPTION: This module tests the various ways in which
structures may be archived to and retrieved from external files.
In particular, the programs test the effect of various ways of
specifying the set of affected structures and the effect of the
conflict resolution flags.


SEMANTIC REQUIREMENTS:


SR1. For <archive structures>, the set of structures to be archived in the specified archive file contains exactly those whose identifiers are in the specified list.
#F 137
#D
#S 4.4.7/32/3
#T P01/1 P02/1 P03/3 P03/4 P03/8 P07/1 P08/1 #C Note that archiving a structure, but not its descendants, can
create a "partial" network in the archive file, i.e. one in which
there are references to structures which do not exist in the
archive file.

SR2. For <archive structure networks>, the set of structures to be archived in the specified archive file contains those whose identifiers are in the specified list, and all their descendants in the CSS.
#F 138
#D 7.1 7.3.4
#S 4.4.7/32/3
#T P02/2 P03/2 P03/5 P03/6 P03/7 P03/9 P03/10 P03/13 P03/14

SR3. For <archive all structures>, the set of structures to be archived in the specified archive file contains all those currently in the CSS.
#F 139
#D 7.1
#S 4.4.7/32/3
#T P02/3 P03/1 P03/11 P03/12
***  Logic of archival conflict resolution,
***  for each specified structure S:
***
***     if (S in CSS) then
***        if (S already in archive) then
***           if     (archival-flag = UPDATE)   then
***              overwrite S from CSS to archive       [SR6]
***           elseif (archival-flag = MAINTAIN) then
***              no action                             [SR7]
***           elseif (archival-flag = ABANDON)  then
***              abort, signal error 405               [SR8]
***           endif
***        else (S not in archive)
***           copy S from CSS to archive               [SR4]
***        endif
***     else (S not in CSS)
***        no action - signal warning 200              [SR5]
***     endif


SR4. If a structure S is in the specified set of an archive operation and S exists in the CSS but not in the archive file, then S is copied from the CSS to the archive file.
#F 137 138 139
#D 7.1 9.1.1
#S 4.4.7/32/4
#T P01/1 P02/1 P02/2 P02/3 P03/1 P03/2 P03/3 P03/5 P03/6 P03/8 P03/9
#T P07/1 P08/1

SR5. If a structure S is in the specified set of an archive operation and S does not exist in the CSS, then S error 200 is signalled and no other action is taken for that structure.
#F 137 138 139
#D 7.1 9.1.1
#S
#T P03/3 P03/4 P03/6 P03/7 P03/9 P03/10 P03/14

SR6. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is UPDATE, then S is copied from the CSS to the archive file, replacing the old structure with the same identifier.
#F 137 138 139
#D 4.7 7.1 9.1.1
#S 4.4.7/32/7 4.4.7/33/1
#T P03/5 P03/6

SR7. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is MAINTAIN, then no action is taken for S.
#F 137 138 139
#D 4.7 7.1 9.1.1
#S 4.4.7/32/7 4.4.7/33/1
#T P03/1 P03/2 P03/3

SR8. If a structure S is in the specified set of an archive operation and S exists in both the CSS and the archive file, and the archival conflict resolution flag is ABANDON, then the archive file is left in the same state as it was before the operation and error 405 is signalled.
#F 137 138 139
#D 4.7 7.1 9.1.1
#S 4.4.7/32/7 4.4.7/33/1
#T P03/11 P03/12 P03/13 P03/14

*** *** *** *** ***   Retrieving structures   *** *** *** *** ***


SR9. For <retrieve structures>, the set of structures to be retrieved from the specified archive file contains exactly those whose identifiers are in the specified list.
#F 142
#D
#S 4.4.7/32/3
#T P01/1 P04/1 P05/3 P05/4 P05/8 P06/2 P07/2 P07/3

SR10. For <retrieve structure networks>, the set of structures to be retrieved from the specified archive file contains those whose identifiers are in the specified list, and all their descendants in the archive file.
#F 143
#D 9.1.1 9.1.2.4
#S 4.4.7/32/3
#T P04/2 P05/1 P05/5 P05/6 P05/7 P05/9 P05/10 P05/13 P05/14 P05/15
#T P05/16 P06/3

SR11. For <retrieve all structures>, the set of structures to be retrieved from the specified archive file contains all those currently in that file.
#F 144
#D 9.1.1
#S 4.4.7/32/3
#T P04/3 P05/2 P05/11 P05/12 P06/1 P08/2
***  Logic of retrieval conflict resolution,
***  for each specified structure S:
***
***     if (S in CSS) then
***        if     (retrieval-flag = MAINTAIN) then
***           no action                                   [SR14]
***        elseif (retrieval-flag = ABANDON)  then
***           abort, signal error 405                     [SR15]
***        elseif (retrieval-flag = UPDATE)   then
***           if (S in archive)
***              overwrite into CSS                       [SR16]
***           else (S not in archive)
***              overwrite empty S into CSS, warning 408  [SR17]
***           endif
***        endif
***     else (S not in CSS)
***        if (S in archive) then
***           copy S from archive to CSS                  [SR12]
***        else (S not in archive, nor in CSS)
***           create empty S in CSS, warning 408          [SR13]
***        endif
***     endif


SR12. If a structure S is in the specified set of a retrieve operation and S exists in the archive file but not in the CSS, then S is copied from the archive file to the CSS.
#F 142 143 144
#D 7.1 9.1.1
#S 4.4.7/32/3
#T P01/1 P04/1 P04/2 P04/3 P05/1 P05/2 P05/3 P05/5 P05/6 P05/8 P05/9
#T P07/2 P07/3 P08/2

SR13. If a structure S is in the specified set of a retrieve operation and S exists in neither the archive file nor in the CSS, then an empty structure with identifier S is created in the CSS and warning 408 is signalled.
#F 142 143 144
#D 7.1 9.1.1
#S
#T P05/3 P05/4 P05/9 P05/10 P05/14 P05/16

SR14. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and the retrieval conflict resolution flag is MAINTAIN, then no action is taken for S.
#F 142 143 144
#D 4.8 7.1 9.1.1
#S 4.4.7/33/1
#T P05/1 P05/2 P05/3 #C This rule applies regardless of whether S exists in archive.

SR15. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and the retrieval conflict resolution flag is ABANDON, then the CSS is left in the same state as it was before the operation and error 405 is signalled.
#F 142 143 144
#D 4.8 7.1 9.1.1
#S 4.4.7/33/1
#T P05/11 P05/12 P05/13 P05/14 P05/15 P05/16 #C This rule applies regardless of whether S exists in archive.

SR16. If a structure S is in the specified set of a retrieve operation and S exists in both the CSS and the archive file, and the retrieval conflict resolution flag is UPDATE, then S is copied from the archive file to the CSS, replacing the old structure with the same identifier.
#F 142 143 144
#D 4.8 7.1 9.1.1
#S 4.4.7/33/1
#T P05/5 P05/6 P06/1 P06/3

SR17. If a structure S is in the specified set of a retrieve operation and S exists in the CSS and but not in the archive file, and the retrieval conflict resolution flag is UPDATE, then an empty structure with identifier S is created in the CSS replacing the old structure with the same identifier and warning 408 is signalled.
#F 142 143 144
#D 4.8 7.1 9.1.1
#S 4.4.7/33/1
#T P05/6 P05/7 P06/2

SR18. Whenever an open CSS structure is to be overwritten by a retrieve operation, it is first closed, overwritten, and then re-opened, implying that the element pointer indicates the last element of the structure.
#F 142 143 144
#D 4.3 7.1
#S
#T P06/1 P06/2 P06/3

SR19. Whenever a completed retrieve operation has introduced into the CSS a reference to a non-existent structure, then an empty structure is created with the corresponding identifier.
#F 142 143 144
#D 7.1 7.3.4
#S 4.4.2/25/2
#T P07/2 P07/3


LOCAL DICTIONARY:

  Functions ---
  137: parst   <archive structures>
  138: parsn   <archive structure networks>
  139: parast  <archive all structures>
  142: prest   <retrieve structures>
  143: presn   <retrieve structure networks>
  144: prast   <retrieve all structures>
 
  Data Structures ---
  4  ...  phigs_state_list
  4.3  ...  element_pointer
  4.7  ...  archival_conflict_resolution_flag
  4.8  ...  retrieval_conflict_resolution_flag
  7  ...  structure_state_list
  7.1  ...  structure_identifier
  7.3  ...  list_of_structure_elements
  7.3.4  ...  execute_structure
  9  ...  archive
  9.1  ...  archive_file
  9.1.1  ...  structure_identifier
  9.1.2  ...  list_of_structure_elements
  9.1.2.4  ...  execute_structure
 
LOCAL SUBROUTINES:

AVARNM returns an available name for a new archive file.

CSSIDS checks the actual set of structure identifiers in the CSS
against an expected list, encoded as a string.  If equal, it
returns true, else false.

RETOPN checks that the state of the open structure is as expected
and issues pass or fail as a result.  If there is an open
structure, it is closed by RETOPN



PROGRAM 1: Preservation of structure contents

You may inspect either the design or code for this program.


PROGRAM 2: Selection of structures for archiving

You may inspect either the design or code for this program.


PROGRAM 3: Archival conflict resolution

You may inspect either the design or code for this program.


PROGRAM 4: Selection of structures for retrieving

You may inspect either the design or code for this program.


PROGRAM 5: Retrieval conflict resolution

You may inspect either the design or code for this program.


PROGRAM 6: Retrieving open structure

You may inspect either the design or code for this program.


PROGRAM 7: Partial networks in archive

You may inspect either the design or code for this program.


PROGRAM 8: Archiving and retrieving with multiple files

You may inspect either the design or code for this program.

End of documentation for 03.03