b311480e |
1 | -- Created on: 1997-08-07 |
2 | -- Created by: Jean-Louis Frenkel |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | deferred class Application from CDF inherits Application from CDM |
18 | |
19 | uses |
20 | ExtendedString from TCollection, |
21 | ExtendedString from TCollection, |
22 | Document from CDM, |
23 | Manager from Resource, |
24 | MetaData from CDM, |
15e8b082 |
25 | ReaderStatus from PCDM, |
7fd59977 |
26 | GUID from Standard, |
27 | Reader from PCDM, |
28 | Writer from PCDM, |
29 | TypeOfActivation from CDF, |
30 | SequenceOfExtendedString from TColStd, |
31 | CanCloseStatus from CDM, |
32 | AsciiString from TCollection |
33 | |
34 | raises NoSuchObject from Standard |
35 | is |
36 | |
37 | |
38 | Initialize; |
39 | |
40 | Load(myclass; aGUID:GUID from Standard) |
6e33d3ce |
41 | returns Application from CDF; |
7fd59977 |
42 | ---Purpose: plugs an application. |
43 | |
44 | |
45 | ---Category: Open closing of documents |
46 | ---Purpose: |
47 | -- Open is used |
48 | -- - for opening a Document that has been created in an application |
49 | -- - for opening a Document from the database |
50 | -- - for opening a Document from a file. |
51 | -- The Open methods always add the document in the session directory and |
52 | -- calls the virtual Activate method. The document is considered to be |
53 | -- opened until Close is used. To be storable, a document must be |
54 | -- opened by an application since the application resources are |
55 | -- needed to store it. |
56 | -- |
57 | -- |
58 | -- |
59 | -- |
60 | Open(me: mutable; aDocument: Document from CDM); |
61 | ---Purpose: puts the document in the current session directory |
62 | -- and calls the virtual method Activate on it. |
63 | |
64 | |
65 | CanClose(me: mutable; aDocument: Document from CDM) |
66 | returns CanCloseStatus from CDM; |
67 | |
68 | Close(me: mutable; aDocument: Document from CDM); |
69 | ---Purpose: removes the document of the current session directory |
70 | -- and closes the document; |
71 | |
72 | Retrieve (me: mutable; aFolder, aName: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True) |
73 | returns Document from CDM; |
74 | ---Purpose: This method retrieves a document from the database. |
75 | -- If the Document references other documents which have |
76 | -- been updated, the latest version of these documents will |
77 | -- be used if {UseStorageConfiguration} is Standard_True. |
78 | -- The content of {aFolder}, {aName} and {aVersion} depends on |
79 | -- the Database Manager system. If the DBMS is only based on |
80 | -- the OS, {aFolder} is a directory and {aName} is the name of a |
81 | -- file. In this case the use of the syntax with {aVersion} |
82 | -- has no sense. For example: |
83 | -- |
84 | -- Handle(CDM_Document) theDocument=myApplication->Retrieve("/home/cascade","box.dsg"); |
85 | -- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} |
86 | -- have the form they have in EUCLID/Design Manager. For example: |
87 | -- |
88 | -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box"); |
89 | -- |
90 | -- Since the version is not specified in this syntax, the latest wil be used. |
91 | -- A link is kept with the database through an instance of CDM_MetaData |
92 | |
93 | |
94 | Retrieve (me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True) |
95 | returns Document from CDM; |
96 | ---Purpose: This method retrieves a document from the database. |
97 | -- If the Document references other documents which have |
98 | -- been updated, the latest version of these documents |
99 | -- will be used if {UseStorageConfiguration} is |
100 | -- Standard_True. -- If the DBMS is only based on the |
101 | -- OS, this syntax should not be used. |
102 | -- |
103 | -- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} |
104 | -- and {aVersion} have the form they have in |
105 | -- EUCLID/Design Manager. For example: |
106 | -- |
107 | -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box","2"); |
108 | -- A link is kept with the database through an instance |
109 | -- of CDM_MetaData |
110 | |
111 | |
112 | CanRetrieve(me: mutable; aFolder, aName: ExtendedString from TCollection) |
113 | ---Purpose: |
15e8b082 |
114 | returns ReaderStatus from PCDM; |
7fd59977 |
115 | |
116 | CanRetrieve(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection) |
117 | ---Purpose: |
15e8b082 |
118 | returns ReaderStatus from PCDM; |
7fd59977 |
119 | |
120 | Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd) |
121 | is deferred; |
122 | ---Category: CurrentDocument methods. |
123 | -- |
124 | |
15e8b082 |
125 | GetRetrieveStatus(me) returns ReaderStatus from PCDM; |
7fd59977 |
126 | ---C++: inline |
127 | ---Purpose: Checks status after Retrieve |
128 | |
129 | ---Category: Store&Retrieve virtuals methods |
130 | |
131 | Activate(me: mutable; aDocument: Document from CDM; aTypeOfActivation: TypeOfActivation from CDF) |
132 | is virtual private; |
133 | ---Purpose: Informs the application that aDocument has been |
134 | -- activated. A document is activated when it is created or |
135 | -- retrieved. |
136 | -- aTypeOfActivation will be: |
137 | -- - CDF_TOA_New if the document is a new one |
138 | -- (even empty or retrieved from the database for |
139 | -- the first time). |
140 | -- - CDF_TOA_Unchanged if the document was already |
141 | -- retrieved but had no changes since the previous retrieval. |
142 | -- - CDF_TOA_Modified if the document was already |
143 | -- retrieved and modified since the previous retrieval. |
144 | -- You do not need to call <Activate>, but you should redefine |
145 | -- this method to implement application specific behavior. |
146 | |
147 | |
148 | ---Category: methods to get storage/retrieval driver. |
149 | -- |
150 | -- |
151 | FindReader(me: mutable; aFileName: ExtendedString from TCollection) |
152 | returns Boolean from Standard; |
153 | |
154 | |
155 | Reader(me: mutable; aFileName: ExtendedString from TCollection) |
156 | returns Reader from PCDM |
157 | raises NoSuchObject from Standard; |
158 | |
159 | FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection) |
160 | returns Boolean from Standard; |
161 | |
162 | ReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection) |
163 | returns Reader from PCDM |
164 | raises NoSuchObject from Standard; |
165 | |
166 | ---Purpose: |
167 | |
168 | Format (me : mutable; aFileName : ExtendedString from TCollection; |
169 | theFormat : out ExtendedString from TCollection) |
170 | ---Purpose: try to retrieve a Format directly in the file or in |
171 | -- application resource by using extension. returns |
172 | -- True if found; |
173 | returns Boolean from Standard; |
174 | |
175 | |
176 | |
177 | ---Category: Default Storage folder |
178 | -- |
179 | DefaultFolder(me: mutable) returns ExtString from Standard; |
180 | |
181 | SetDefaultFolder(me: mutable; aFolder: ExtString from Standard) |
182 | returns Boolean from Standard; |
183 | |
184 | DefaultExtension(me: mutable) returns ExtString from Standard; |
185 | |
186 | ---Category: private methods |
187 | Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard) |
6e33d3ce |
188 | returns Document from CDM |
7fd59977 |
189 | is private; |
190 | |
191 | Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard; IsComponent: Boolean from Standard) |
6e33d3ce |
192 | returns Document from CDM |
7fd59977 |
193 | is private; |
194 | |
195 | DocumentVersion(me: mutable; theMetaData: MetaData from CDM) |
196 | returns Integer from Standard |
197 | is private; |
198 | |
199 | FindReader(me: mutable; aFileName: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection) |
200 | returns Boolean from Standard |
201 | is private; |
202 | |
203 | |
204 | FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection) |
205 | returns Boolean from Standard |
206 | is private; |
207 | |
208 | TypeOfActivation(me: mutable; aMetaData: MetaData from CDM) |
209 | returns TypeOfActivation from CDF |
210 | is private; |
211 | |
212 | CanRetrieve(me: mutable; aMetaData: MetaData from CDM) |
15e8b082 |
213 | returns ReaderStatus from PCDM |
7fd59977 |
214 | is private; |
215 | fields |
216 | |
217 | myDefaultFolder: ExtendedString from TCollection; |
15e8b082 |
218 | myRetrievableStatus : ReaderStatus from PCDM is protected; |
7fd59977 |
219 | |
220 | friends |
221 | class Session from CDF--, |
222 | --class CheckDocumentToStore from CDF |
223 | |
224 | end Application from CDF; |