0024927: Getting rid of "Persistent" functionality -- Code
[occt.git] / src / CDF / CDF_Store.cdl
1 -- Created on: 1995-11-13
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class Store from CDF
18
19 uses Document from CDM,
20      TryStoreStatus from CDF,
21      StoreSetNameStatus from CDF,
22      SubComponentStatus from CDF,
23      ExtendedString from TCollection,
24      StoreList from CDF,
25      StoreStatus from PCDM,
26      ExtendedString from TCollection
27     
28 is
29   
30   
31     Create  is private;
32     
33     Create (aDocument: Document from CDM)
34     returns Store from CDF;
35     ---Purpose: creates a store list  from the document of the current selection.
36     --          
37     
38     ---Category: Checks methods
39     --           
40     Check(me: in out)
41     ---Purpose: Checks will make the following control. Check must be used before
42     --          using Create method. Check will not be done twice by Create.
43     --          
44     --          1) controls whether there is one document in the current selection.
45     --          2) controls whether there is a storage driver for the document.
46     --          3) controls whether the applicationdatatype associated with the driver
47     --             exists as metadata in the metadata manager (Design Manager for example).
48     --          4) controls whether there is a storage driver for each subcomponents 
49     --             of the document if there are.  If the control fails for a subcomponent, 
50     --             the control stops and name and type of this subcomponent can be get 
51     --             with LastName method
52     --          5) controls whether the applicationdatatype associated with the driver of
53     --             each subcomponent exists as metadata in the metadata manager 
54     --             (Design Manager for example). If the control fails for a subcomponent, 
55     --             the control stops and name and type of this subcomponent can be get 
56     --             with LastName method
57     --            
58     returns TryStoreStatus from CDF;
59     
60     LastName(me) returns ExtString from Standard;
61     ---Purpose: in the case of a subcomponent for which no storage driver exists,
62     --          returns the name of the subcomponent if there is one.
63
64     ---Category:  Inquire Methods
65     --            
66     --            The store list contains one or more documents. One of them is the current document.
67     --            
68     Folder(me) 
69     returns ExtString from Standard;
70     ---Purpose: returns the folder in which the current document will be stored.
71     
72     Name(me) returns ExtString from Standard;
73     ---Purpose: returns the name under which the current document will be stored
74     
75     IsStored(me) returns Boolean from Standard;
76     ---Purpose: returns true if the current document is already stored
77
78     IsModified(me) returns Boolean from Standard;
79
80     CurrentIsConsistent(me) returns Boolean from Standard;
81     
82     IsConsistent(me) returns Boolean from Standard;
83     
84     HasAPreviousVersion(me) returns Boolean from Standard;
85     
86     PreviousVersion(me) returns ExtString from Standard;
87     
88     IsMainDocument(me) returns Boolean from Standard;
89     ---Purpose: returns true if the currentdocument is the main one, ie the document
90     --          of the current selection.
91
92 ---Category: Set methods
93 --           
94     SetFolder(me: in out; aFolder: ExtendedString from TCollection)
95     ---Purpose: defines the   folder in which  the document  should be
96     --          stored.  returns  Standard_True if  the Folder exists,
97     --          Standard_False otherwise.
98     returns Boolean from Standard;
99     
100                            
101     SetName(me: in out; aName: ExtString from Standard)
102     ---Purpose: defines the name under which the document should be stored.
103     returns StoreSetNameStatus  from CDF;
104     
105     SetComment(me: in out; aComment: ExtString from Standard);
106     
107     Comment(me) returns ExtString from Standard;
108     
109     RecheckName(me: in out)
110     ---Purpose: defines the name under which the document should be stored.
111     --          uses for example after modification of the folder.
112     returns StoreSetNameStatus  from CDF;
113     
114     SetPreviousVersion(me: in out; aPreviousVersion: ExtString from Standard)
115     returns Boolean from Standard;
116     
117     Realize(me: in out);
118
119     Path(me) returns ExtString from Standard;
120     ---Purpose: returns the complete path of the created meta-data.
121
122     MetaDataPath(me) returns ExtString from Standard;
123     ---Purpose: returns the path of  the previous store is the object
124     --          is already stored, otherwise an empty string;
125     Description(me) returns ExtString from Standard;
126     ---Purpose: returns the description of the format of the main object.
127
128 ---Category: subcomponents management.
129
130     InitComponent (me: in out);
131     ---Purpose : Allows to Start a new Iteration from beginning
132     
133     MoreComponent (me) returns Boolean from Standard;
134     ---Purpose : Returns True if there are more entries to return
135     
136     NextComponent (me: in out);
137     ---Purpose : Go to the next entry
138     --           (if there is not, Value will raise an exception)
139     
140     
141     SetCurrent(me: in out);
142     
143     Component (me) returns ExtString from Standard;
144     ---Purpose : Returns item value of current entry
145     
146     HasSubComponents(me) returns Boolean from Standard;
147     
148     SubComponentStatus(me; aPresentation: ExtString from Standard)
149     returns SubComponentStatus from CDF;
150
151     SetCurrent(me: in out; aPresentation: ExtString from Standard);
152     
153     SetMain(me: in out);
154
155
156 ---Category:  Status method 
157 ---Purpose:  the two following methods can
158 --           be used just after Realize  or Import --  method to know if
159 --           thes methods worked correctly, and if not why.
160
161     StoreStatus(me) returns StoreStatus from PCDM;
162     AssociatedStatusText(me) returns ExtString from Standard;
163
164     ---Category: Private methods
165
166     FindDefault(me: in out) is private;
167
168     Init(me: in out) is private;
169
170     SetName(me: in out; aName: ExtendedString from TCollection)
171     ---Purpose: defines the name under which the document should be stored.
172     returns StoreSetNameStatus  from CDF;
173     
174     
175 ---Category: compatibility
176     SetFolder(me: in out; aFolder: ExtString from Standard)
177     ---Purpose: defines the   folder in which  the document  should be
178     --          stored.  returns  Standard_True if  the Folder exists,
179     --          Standard_False otherwise.
180     returns Boolean from Standard;
181     
182                            
183 fields
184     myList: StoreList from CDF ;
185     myMainDocument: Document from CDM ;
186     myCurrentDocument: Document from CDM ;
187     myHasSubComponents: Boolean from Standard ;
188     myIsMainDocument: Boolean from Standard ;
189     
190     myLastName: ExtendedString from TCollection;
191
192     myPath: ExtendedString from TCollection;
193     myText: ExtendedString from TCollection;
194     myStatus: StoreStatus from PCDM;
195     
196
197 end Store from CDF;