Chapter 9 Accessing objects using VBScript
Extracting repository documents
There are two ways to extract a repository document using VBScript:
- A generic way that is applicable to any repository document
- A specific way that is only applicable to RepositoryModel and RepositoryReport documents
Generic way
To extract a repository document you must:
- Browse for a repository document using the ChildObjects collection
- Extract the document using the method ExtractToFile (ByVal FileName As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = -1, ByRef Actions As String = NULL, ByRef Conflicts As String = NULL) As BaseObject
Example
set C = RepositoryConnection
C.Open
Dim D, P
set P = Nothing
for each D in C.ChildObjects
if D.IsKindOf (cls_RepositoryModel) then
D.ExtractToFile ("C:\temp\OO.OOM")
end if
next
Specific way
To extract a RepositoryModel document or a RepositoryReport document you must:
- Retrieve the document from the local model or multi-model report, (provided it has already been consolidated) using the method UpdateFromRepository (ByVal MergeMode As Integer = 2, ByRef actions As String = NULL, ByRef conflicts As String = NULL) As Boolean
Example
set MyModel = OpenModel ("C:\temp\OO3.OOM")
MyModel.UpdateFromRepository
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|