1 -- Created on: 1997-08-07
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 deferred class Application from CDF inherits Application from CDM
25 ExtendedString from TCollection,
26 ExtendedString from TCollection,
28 Manager from Resource,
30 ReaderStatus from PCDM,
34 TypeOfActivation from CDF,
35 SequenceOfExtendedString from TColStd,
36 CanCloseStatus from CDM,
37 AsciiString from TCollection
39 raises NoSuchObject from Standard
45 Load(myclass; aGUID:GUID from Standard)
46 returns mutable Application from CDF;
47 ---Purpose: plugs an application.
50 ---Category: Open closing of documents
53 -- - for opening a Document that has been created in an application
54 -- - for opening a Document from the database
55 -- - for opening a Document from a file.
56 -- The Open methods always add the document in the session directory and
57 -- calls the virtual Activate method. The document is considered to be
58 -- opened until Close is used. To be storable, a document must be
59 -- opened by an application since the application resources are
60 -- needed to store it.
65 Open(me: mutable; aDocument: Document from CDM);
66 ---Purpose: puts the document in the current session directory
67 -- and calls the virtual method Activate on it.
70 CanClose(me: mutable; aDocument: Document from CDM)
71 returns CanCloseStatus from CDM;
73 Close(me: mutable; aDocument: Document from CDM);
74 ---Purpose: removes the document of the current session directory
75 -- and closes the document;
77 Retrieve (me: mutable; aFolder, aName: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
78 returns Document from CDM;
79 ---Purpose: This method retrieves a document from the database.
80 -- If the Document references other documents which have
81 -- been updated, the latest version of these documents will
82 -- be used if {UseStorageConfiguration} is Standard_True.
83 -- The content of {aFolder}, {aName} and {aVersion} depends on
84 -- the Database Manager system. If the DBMS is only based on
85 -- the OS, {aFolder} is a directory and {aName} is the name of a
86 -- file. In this case the use of the syntax with {aVersion}
87 -- has no sense. For example:
89 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("/home/cascade","box.dsg");
90 -- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
91 -- have the form they have in EUCLID/Design Manager. For example:
93 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box");
95 -- Since the version is not specified in this syntax, the latest wil be used.
96 -- A link is kept with the database through an instance of CDM_MetaData
99 Retrieve (me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection; UseStorageConfiguration: Boolean from Standard = Standard_True)
100 returns Document from CDM;
101 ---Purpose: This method retrieves a document from the database.
102 -- If the Document references other documents which have
103 -- been updated, the latest version of these documents
104 -- will be used if {UseStorageConfiguration} is
105 -- Standard_True. -- If the DBMS is only based on the
106 -- OS, this syntax should not be used.
108 -- If the DBMS is EUCLID/Design Manager, {aFolder}, {aName}
109 -- and {aVersion} have the form they have in
110 -- EUCLID/Design Manager. For example:
112 -- Handle(CDM_Document) theDocument=myApplication->Retrieve("|user|cascade","box","2");
113 -- A link is kept with the database through an instance
117 CanRetrieve(me: mutable; aFolder, aName: ExtendedString from TCollection)
119 returns ReaderStatus from PCDM;
121 CanRetrieve(me: mutable; aFolder, aName, aVersion: ExtendedString from TCollection)
123 returns ReaderStatus from PCDM;
125 Formats(me: mutable; Formats: out SequenceOfExtendedString from TColStd)
127 ---Category: CurrentDocument methods.
130 GetRetrieveStatus(me) returns ReaderStatus from PCDM;
132 ---Purpose: Checks status after Retrieve
134 ---Category: Store&Retrieve virtuals methods
136 Activate(me: mutable; aDocument: Document from CDM; aTypeOfActivation: TypeOfActivation from CDF)
138 ---Purpose: Informs the application that aDocument has been
139 -- activated. A document is activated when it is created or
141 -- aTypeOfActivation will be:
142 -- - CDF_TOA_New if the document is a new one
143 -- (even empty or retrieved from the database for
145 -- - CDF_TOA_Unchanged if the document was already
146 -- retrieved but had no changes since the previous retrieval.
147 -- - CDF_TOA_Modified if the document was already
148 -- retrieved and modified since the previous retrieval.
149 -- You do not need to call <Activate>, but you should redefine
150 -- this method to implement application specific behavior.
153 ---Category: methods to get storage/retrieval driver.
156 FindReader(me: mutable; aFileName: ExtendedString from TCollection)
157 returns Boolean from Standard;
160 Reader(me: mutable; aFileName: ExtendedString from TCollection)
161 returns Reader from PCDM
162 raises NoSuchObject from Standard;
164 FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection)
165 returns Boolean from Standard;
167 ReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection)
168 returns Reader from PCDM
169 raises NoSuchObject from Standard;
173 Format (me : mutable; aFileName : ExtendedString from TCollection;
174 theFormat : out ExtendedString from TCollection)
175 ---Purpose: try to retrieve a Format directly in the file or in
176 -- application resource by using extension. returns
178 returns Boolean from Standard;
182 ---Category: Default Storage folder
184 DefaultFolder(me: mutable) returns ExtString from Standard;
186 SetDefaultFolder(me: mutable; aFolder: ExtString from Standard)
187 returns Boolean from Standard;
189 DefaultExtension(me: mutable) returns ExtString from Standard;
191 ---Category: private methods
192 Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard)
193 returns mutable Document from CDM
196 Retrieve(me: mutable; aMetaData: MetaData from CDM; UseStorageConfiguration: Boolean from Standard; IsComponent: Boolean from Standard)
197 returns mutable Document from CDM
200 DocumentVersion(me: mutable; theMetaData: MetaData from CDM)
201 returns Integer from Standard
204 FindReader(me: mutable; aFileName: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
205 returns Boolean from Standard
209 FindReaderFromFormat(me: mutable; aFormat: ExtendedString from TCollection; PluginIn: out GUID from Standard; ResourceName: out ExtendedString from TCollection)
210 returns Boolean from Standard
213 TypeOfActivation(me: mutable; aMetaData: MetaData from CDM)
214 returns TypeOfActivation from CDF
217 CanRetrieve(me: mutable; aMetaData: MetaData from CDM)
218 returns ReaderStatus from PCDM
222 myDefaultFolder: ExtendedString from TCollection;
223 myRetrievableStatus : ReaderStatus from PCDM is protected;
226 class Session from CDF--,
227 --class CheckDocumentToStore from CDF
229 end Application from CDF;