Fix left-right truncation fix
[yaz-moved-to-github.git] / src / esupdate.asn
1 ESFormat-Update
2 {Z39-50-extendedService Update (5) revisions (1)  revision-1 (1)} DEFINITIONS ::=
3   -- oid is 1.2.840.10003.9.5.1.1
4 BEGIN
5 IMPORTS DiagRec, InternationalString
6 FROM Z39-50-APDU-1995;
7 Update ::= CHOICE{
8     esRequest      [1] IMPLICIT SEQUENCE{
9        toKeep         [1] OriginPartToKeep,
10        notToKeep      [2] OriginPartNotToKeep},
11     taskPackage    [2] IMPLICIT SEQUENCE{
12                        originPart     [1]
13                                    OriginPartToKeep,
14                        targetPart     [2] TargetPart}}
15
16 OriginPartToKeep ::= SEQUENCE{
17 action                  [1] IMPLICIT INTEGER{
18                                 recordInsert    (1),
19                                 recordReplace   (2),
20                                 recordDelete    (3),
21                                 elementUpdate   (4),
22                                 specialUpdate   (5)},
23  databaseName           [2] IMPLICIT InternationalString,
24  schema                 [3] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
25  elementSetName         [4] IMPLICIT InternationalString OPTIONAL,
26  actionQualifier        [5] IMPLICIT EXTERNAL OPTIONAL}
27
28 OriginPartNotToKeep ::= SuppliedRecords
29
30 TargetPart ::= SEQUENCE{
31   updateStatus        [1] IMPLICIT INTEGER{
32                           success (1),
33                           partial (2),
34                           failure (3)},
35   globalDiagnostics   [2] IMPLICIT SEQUENCE OF
36                               DiagRec OPTIONAL,
37                     -- These are non-surrogate
38                     -- diagnosticsrelating to the task,
39                     -- not to individual records.
40   taskPackageRecords  [3] IMPLICIT SEQUENCE OF
41 TaskPackageRecordStructure
42                     -- There should be a
43                     -- TaskPackageRecordStructure
44                     -- for every record supplied.
45                     -- The target should create
46                     -- such a structure for every
47                     -- record immediately upon
48                     -- creating the task package
49                     -- to include correlation
50                     -- information and status.
51                     -- The record itself would not
52                     -- be included until processing
53                     -- for that record is complete.
54                }
55
56 -- Auxiliary definitions for Update
57 SuppliedRecords ::= SEQUENCE OF SEQUENCE{
58   recordId     [1] CHOICE{
59                 number  [1] IMPLICIT INTEGER,
60                 string  [2] IMPLICIT  InternationalString,
61                 opaque  [3] IMPLICIT OCTET STRING} OPTIONAL,
62   supplementalId [2] CHOICE{
63                  timeStamp       [1] IMPLICIT  GeneralizedTime,
64                  versionNumber   [2] IMPLICIT InternationalString,
65                  previousVersion [3] IMPLICIT EXTERNAL} OPTIONAL,
66   correlationInfo   [3] IMPLICIT CorrelationInfo OPTIONAL,
67   record            [4] IMPLICIT EXTERNAL}
68
69 CorrelationInfo ::= SEQUENCE{
70             -- origin may supply one or both for any record:
71   note [1] IMPLICIT InternationalString OPTIONAL,
72   id   [2] IMPLICIT INTEGER OPTIONAL}
73
74 TaskPackageRecordStructure ::= SEQUENCE{
75      recordOrSurDiag  [1] CHOICE {
76                     record     [1] IMPLICIT EXTERNAL,
77                       -- Choose 'record' if
78                       -- recordStatus is 'success', and
79                       -- elementSetName was supplied.
80
81                   surrogateDiagnostics   [2] IMPLICIT
82                               SEQUENCE OF DiagRec
83                          -- Choose 'SurrogateDiagnostics', if
84                          -- RecordStatus is failure.
85                                 } OPTIONAL,
86                 -- The parameter recordOrSurDiag
87                     -- will thus be omitted only if
88                     -- 'elementSetName' was omitted and
89                     -- recordStatus is 'success'; or
90                     --if record status is 'queued'
91                     -- or in 'process'.
92      correlationInfo [2] IMPLICIT
93                          CorrelationInfo OPTIONAL,
94                     -- This should be included
95                     -- if it was supplied by the origin.
96      recordStatus    [3] IMPLICIT INTEGER{
97                                         success   (1),
98                                         queued    (2),
99                                         inProcess (3),
100                                         failure   (4)},
101       supplementalDiagnostics   [4] IMPLICIT
102                 SEQUENCE OF DiagRec OPTIONAL}
103 END