b311480e |
1 | -- Created on: 1995-11-13 |
2 | -- Created by: Jean-Louis Frenkel |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class Store from CDF |
23 | |
24 | uses Document from CDM, |
25 | TryStoreStatus from CDF, |
26 | StoreSetNameStatus from CDF, |
27 | SubComponentStatus from CDF, |
28 | ExtendedString from TCollection, |
29 | StoreList from CDF, |
15e8b082 |
30 | StoreStatus from PCDM, |
7fd59977 |
31 | ExtendedString from TCollection |
32 | |
33 | is |
34 | |
35 | |
36 | Create is private; |
37 | |
38 | Create (aDocument: Document from CDM) |
39 | returns Store from CDF; |
40 | ---Purpose: creates a store list from the document of the current selection. |
41 | -- |
42 | |
43 | ---Category: Checks methods |
44 | -- |
45 | Check(me: in out) |
46 | ---Purpose: Checks will make the following control. Check must be used before |
47 | -- using Create method. Check will not be done twice by Create. |
48 | -- |
49 | -- 1) controls whether there is one document in the current selection. |
50 | -- 2) controls whether there is a storage driver for the document. |
51 | -- 3) controls whether the applicationdatatype associated with the driver |
52 | -- exists as metadata in the metadata manager (Design Manager for example). |
53 | -- 4) controls whether there is a storage driver for each subcomponents |
54 | -- of the document if there are. 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 | -- 5) controls whether the applicationdatatype associated with the driver of |
58 | -- each subcomponent exists as metadata in the metadata manager |
59 | -- (Design Manager for example). If the control fails for a subcomponent, |
60 | -- the control stops and name and type of this subcomponent can be get |
61 | -- with LastName method |
62 | -- |
63 | returns TryStoreStatus from CDF; |
64 | |
65 | LastName(me) returns ExtString from Standard; |
66 | ---Purpose: in the case of a subcomponent for which no storage driver exists, |
67 | -- returns the name of the subcomponent if there is one. |
68 | |
69 | ---Category: Inquire Methods |
70 | -- |
71 | -- The store list contains one or more documents. One of them is the current document. |
72 | -- |
73 | Folder(me) |
74 | returns ExtString from Standard; |
75 | ---Purpose: returns the folder in which the current document will be stored. |
76 | |
77 | Name(me) returns ExtString from Standard; |
78 | ---Purpose: returns the name under which the current document will be stored |
79 | |
80 | IsStored(me) returns Boolean from Standard; |
81 | ---Purpose: returns true if the current document is already stored |
82 | |
83 | IsModified(me) returns Boolean from Standard; |
84 | |
85 | CurrentIsConsistent(me) returns Boolean from Standard; |
86 | |
87 | IsConsistent(me) returns Boolean from Standard; |
88 | |
89 | HasAPreviousVersion(me) returns Boolean from Standard; |
90 | |
91 | PreviousVersion(me) returns ExtString from Standard; |
92 | |
93 | IsMainDocument(me) returns Boolean from Standard; |
94 | ---Purpose: returns true if the currentdocument is the main one, ie the document |
95 | -- of the current selection. |
96 | |
97 | ---Category: Set methods |
98 | -- |
99 | SetFolder(me: in out; aFolder: ExtendedString from TCollection) |
100 | ---Purpose: defines the folder in which the document should be |
101 | -- stored. returns Standard_True if the Folder exists, |
102 | -- Standard_False otherwise. |
103 | returns Boolean from Standard; |
104 | |
105 | |
106 | SetName(me: in out; aName: ExtString from Standard) |
107 | ---Purpose: defines the name under which the document should be stored. |
108 | returns StoreSetNameStatus from CDF; |
109 | |
110 | SetComment(me: in out; aComment: ExtString from Standard); |
111 | |
112 | Comment(me) returns ExtString from Standard; |
113 | |
114 | RecheckName(me: in out) |
115 | ---Purpose: defines the name under which the document should be stored. |
116 | -- uses for example after modification of the folder. |
117 | returns StoreSetNameStatus from CDF; |
118 | |
119 | SetPreviousVersion(me: in out; aPreviousVersion: ExtString from Standard) |
120 | returns Boolean from Standard; |
121 | |
122 | Realize(me: in out); |
123 | |
124 | Path(me) returns ExtString from Standard; |
125 | ---Purpose: returns the complete path of the created meta-data. |
126 | |
127 | MetaDataPath(me) returns ExtString from Standard; |
128 | ---Purpose: returns the path of the previous store is the object |
129 | -- is already stored, otherwise an empty string; |
130 | Description(me) returns ExtString from Standard; |
131 | ---Purpose: returns the description of the format of the main object. |
132 | |
133 | ---Category: subcomponents management. |
134 | |
135 | InitComponent (me: in out); |
136 | ---Purpose : Allows to Start a new Iteration from beginning |
137 | |
138 | MoreComponent (me) returns Boolean from Standard; |
139 | ---Purpose : Returns True if there are more entries to return |
140 | |
141 | NextComponent (me: in out); |
142 | ---Purpose : Go to the next entry |
143 | -- (if there is not, Value will raise an exception) |
144 | |
145 | |
146 | SetCurrent(me: in out); |
147 | |
148 | Component (me) returns ExtString from Standard; |
149 | ---Purpose : Returns item value of current entry |
150 | |
151 | HasSubComponents(me) returns Boolean from Standard; |
152 | |
153 | SubComponentStatus(me; aPresentation: ExtString from Standard) |
154 | returns SubComponentStatus from CDF; |
155 | |
156 | SetCurrent(me: in out; aPresentation: ExtString from Standard); |
157 | |
158 | SetMain(me: in out); |
159 | |
160 | |
161 | ---Category: Status method |
162 | ---Purpose: the two following methods can |
163 | -- be used just after Realize or Import -- method to know if |
164 | -- thes methods worked correctly, and if not why. |
165 | |
15e8b082 |
166 | StoreStatus(me) returns StoreStatus from PCDM; |
7fd59977 |
167 | AssociatedStatusText(me) returns ExtString from Standard; |
168 | |
169 | ---Category: Private methods |
170 | |
171 | FindDefault(me: in out) is private; |
172 | |
173 | Init(me: in out) is private; |
174 | |
175 | SetName(me: in out; aName: ExtendedString from TCollection) |
176 | ---Purpose: defines the name under which the document should be stored. |
177 | returns StoreSetNameStatus from CDF; |
178 | |
179 | |
180 | ---Category: compatibility |
181 | SetFolder(me: in out; aFolder: ExtString from Standard) |
182 | ---Purpose: defines the folder in which the document should be |
183 | -- stored. returns Standard_True if the Folder exists, |
184 | -- Standard_False otherwise. |
185 | returns Boolean from Standard; |
186 | |
187 | |
188 | fields |
189 | myList: StoreList from CDF ; |
190 | myMainDocument: Document from CDM ; |
191 | myCurrentDocument: Document from CDM ; |
192 | myHasSubComponents: Boolean from Standard ; |
193 | myIsMainDocument: Boolean from Standard ; |
194 | |
195 | myLastName: ExtendedString from TCollection; |
196 | |
197 | myPath: ExtendedString from TCollection; |
198 | myText: ExtendedString from TCollection; |
15e8b082 |
199 | myStatus: StoreStatus from PCDM; |
7fd59977 |
200 | |
201 | |
202 | end Store from CDF; |