Classes | Typedefs | Functions
Provenance API

Provenance traces the origins and history of the content contained in an i-model. More...

Classes

class  ProvenanceManager
 The Provenance Manager allows to write provenance to an i-model and read it back. More...
 

Typedefs

typedef ProvenanceManager * ProvenanceManagerP
 Provenance Manager pointer. More...
 
typedef RefCountedPtr
< ProvenanceManager > 
ProvenanceManagerPtr
 

Functions

static DGNPLATFORM_EXPORT
ProvenanceManagerPtr 
Create (DgnFileR fileR, bool isReadOnly=true, bool readEmbeddedfiles=false)
 Create an instance of ProvenanceManager. More...
 
static DGNPLATFORM_EXPORT
ProvenanceManagerPtr 
Create (WString fileName, bool isReadOnly=true, bool readEmbeddedfiles=false)
 Create an instance of ProvenanceManager. More...
 
DGNPLATFORM_EXPORT StatusInt ExtractXML (WCharCP xmlFileName, bool extractEmbedded=false)
 Extract provenance xml from i-model. More...
 
DGNPLATFORM_EXPORT StatusInt ExtractBuffer (WChar **ppXmlBuffer)
 Extract provenance buffer from i-model. More...
 
DGNPLATFORM_EXPORT bvector
< SourcePtr > 
GetFileSources ()
 Get file sources from provenance. More...
 
DGNPLATFORM_EXPORT bvector
< SourcePtr > 
GetEmbeddedFileSources (int index)
 Get file sources from embedded provenance for a given index. More...
 
DGNPLATFORM_EXPORT StatusInt GetFileSourceURLList (bvector< WString > &srcFileUrlVec)
 Get all file source URL path from provenance. More...
 
DGNPLATFORM_EXPORT StatusInt GetRootFileSourceURLList (bvector< WString > &srcFileUrlVec)
 Get all root file source URL path from provenance. More...
 
DGNPLATFORM_EXPORT bool IsFilePresentAsFileSource (WStringCR sourcePath)
 Find the source path available in provenance. More...
 
DGNPLATFORM_EXPORT bool IsFilePresentAsFileSource (WStringCR sourcePath, SourcePtr &source)
 Find the source path available in provenance. More...
 
DGNPLATFORM_EXPORT
FileProvenanceCollection 
GetAllFileProvenance ()
 Get all file provenance. More...
 
DGNPLATFORM_EXPORT ProvenanceFileP GetRootFileProvenance ()
 Get root file provenance. More...
 
DGNPLATFORM_EXPORT ProvenanceFileP GetFileProvenanceFromMatchingTarget (WStringCR targetURL)
 Get file provenance that matches with the target URL. More...
 
DGNPLATFORM_EXPORT int GetFileProvenanceCount ()
 Get count of all file provenances. More...
 
DGNPLATFORM_EXPORT
FileProvenanceCollection 
GetEmbeddedFileProvenanceList (int index)
 Get file provenance from embedded provenance for a valid index value . More...
 
DGNPLATFORM_EXPORT int GetEmbeddedProvenanceCount ()
 Get embedded provenance count . More...
 
DGNPLATFORM_EXPORT bool IsEmbeddedProvenaceExist ()
 Find out if embedded provenance exists or not . More...
 
DGNPLATFORM_EXPORT StatusInt SetFileSource (WCharCP targetFileNameFuture, DgnFileR sourceFileObject, ProcessType type, WCharCP engine, WCharCP engineVersion, WCharCP configuration, ProvenanceAttributeVector &attribList)
 *------------------------------------------------------------------------------—**//** More...
 
DGNPLATFORM_EXPORT StatusInt SetFileSource (WCharCP targetFileNameFuture, WCharCP targetFileURL, DgnFileR sourceFileObject, WCharCP sourceFileURL, ProcessType type, WCharCP engine, WCharCP engineVersion, WCharCP configuration, ProvenanceAttributeVector &attribList)
 *------------------------------------------------------------------------------—**//** More...
 
DGNPLATFORM_EXPORT StatusInt SetFileSource (WCharCP targetFileNameFuture, WCharCP targetFileURL, DgnFileR sourceFileObject, WCharCP sourceFileURL, ProcessType type, WCharCP engine, WCharCP engineVersion, WCharCP configuration, const SourceVector &sources, ProvenanceAttributeVector &attribList)
 *------------------------------------------------------------------------------—**//** More...
 
DGNPLATFORM_EXPORT bool MatchFileSourceURL (WCharCP srcFileURL)
 *------------------------------------------------------------------------------—**//** More...
 

Detailed Description

Provenance traces the origins and history of the content contained in an i-model.

It specifies the original sources, date, state and scope of information and includes transformations applied to the original content. Provenance can be recorded at different levels of granularity, depending on the intended use, i.e., repository/file, model, component and property. NOTE: At this time, repository/file provenance is only recorded and accessible via the API. The API will be updated as the other forms of provenance are supported.

The Provenance library provides APIs to read provenance from any i-model.

Overview of common uses for Provenance library with the following capabilities:

Typedef Documentation

typedef ProvenanceManager* ProvenanceManagerP

Provenance Manager pointer.

typedef RefCountedPtr<ProvenanceManager> ProvenanceManagerPtr

Function Documentation

static DGNPLATFORM_EXPORT ProvenanceManagerPtr Create ( DgnFileR  fileR,
bool  isReadOnly = true,
bool  readEmbeddedfiles = false 
)
static

Create an instance of ProvenanceManager.

Parameters
fileRMSDgnFile reference from which provenance will be read or write.
isReadOnlyopen the file in readonly mode or read/write mode. Default is read only mode.
readEmbeddedfilesRead the provenance from embedded file. Default is not to read embedded file provenances.
Returns
pointer of ProvenanceManager if successful, else return NULL.
static DGNPLATFORM_EXPORT ProvenanceManagerPtr Create ( WString  fileName,
bool  isReadOnly = true,
bool  readEmbeddedfiles = false 
)
static

Create an instance of ProvenanceManager.

ProvenanceManagerPtr provManagerP = ProvenanceManager::Create ( dgnFilePath );
Parameters
fileNamefile path of a design file from which provenance will be read or write.
isReadOnlyopen the file in readonly mode or read/write mode
readEmbeddedfilesRead the provenance from embedded file. Default is not to read embedded file provenances.
Returns
pointer of ProvenanceManager if successful, else return NULL.
DGNPLATFORM_EXPORT StatusInt ExtractBuffer ( WChar **  ppXmlBuffer)

Extract provenance buffer from i-model.

Parameters
ppXmlBufferSet the xml buffer and filled the buffer with provenance data in xml format. Only primary provenance is read back in the buffer
Returns
status of the operation. ERROR if no provenance record found
DGNPLATFORM_EXPORT StatusInt ExtractXML ( WCharCP  xmlFileName,
bool  extractEmbedded = false 
)

Extract provenance xml from i-model.

Parameters
xmlFileNameName of the output xml file.
extractEmbeddedSet true to extract embedded file provenance from a package file. False to skip all embedded file provenance While exporting the embedded file provenance as xml files, same path will be used as provided through xmlFileName. Xml file name will be generated by appending .xml to the name of the embedded files for easy identification.
Returns
status of the operation. ERROR if no provenance record found
DGNPLATFORM_EXPORT FileProvenanceCollection GetAllFileProvenance ( )

Get all file provenance.

Returns
Collection of file provenances in the primary provenance
DGNPLATFORM_EXPORT FileProvenanceCollection GetEmbeddedFileProvenanceList ( int  index)

Get file provenance from embedded provenance for a valid index value .

Parameters
indexIndex of the embedded provenance.
Returns
Collection of file provenances for a given index. For invalid index the list will be empty
DGNPLATFORM_EXPORT bvector<SourcePtr> GetEmbeddedFileSources ( int  index)

Get file sources from embedded provenance for a given index.

This could be used to find timestamp and other information hold by Source struct. Currently this only fetches source from file provenances

Returns
List of Sources found in the provenance at given index. For invalid index, the source list will be empty.
DGNPLATFORM_EXPORT int GetEmbeddedProvenanceCount ( )

Get embedded provenance count .

Returns
number of embedded provenance present
DGNPLATFORM_EXPORT int GetFileProvenanceCount ( )

Get count of all file provenances.

Returns
Count of file provenances
DGNPLATFORM_EXPORT ProvenanceFileP GetFileProvenanceFromMatchingTarget ( WStringCR  targetURL)

Get file provenance that matches with the target URL.

Parameters
targetURLtarget URL that will be matched with the Provenance's target URL.
Returns
file provenance that matches with the target URL. return NULL if no match found
DGNPLATFORM_EXPORT bvector<SourcePtr> GetFileSources ( )

Get file sources from provenance.

This could be used to find timestamp and other information hold by Source struct. Currently this only fetches source from file provenances

Returns
List of Sources found in the provenance
DGNPLATFORM_EXPORT StatusInt GetFileSourceURLList ( bvector< WString > &  srcFileUrlVec)

Get all file source URL path from provenance.

Parameters
srcFileUrlVecvector of URL string of all sources
Returns
status of the operation
DGNPLATFORM_EXPORT ProvenanceFileP GetRootFileProvenance ( )

Get root file provenance.

This is the main provenance of an i-model.

Returns
root file provenance. return NULL if no provenance found
DGNPLATFORM_EXPORT StatusInt GetRootFileSourceURLList ( bvector< WString > &  srcFileUrlVec)

Get all root file source URL path from provenance.

Parameters
srcFileUrlVecvector of URL string of all root sources
Returns
status of the operation
DGNPLATFORM_EXPORT bool IsEmbeddedProvenaceExist ( )

Find out if embedded provenance exists or not .

Returns
true if embedded provenance exist else return false
DGNPLATFORM_EXPORT bool IsFilePresentAsFileSource ( WStringCR  sourcePath)

Find the source path available in provenance.

Parameters
sourcePathpath of the file to be searched. Disk file source should be of the form L"file://C:\\DesignHistory.dgn" Projectwise file source should be of the form L"pw://PW8119SS3REF2K8.bentley.com:SS3109PWSH/Documents/D{f9d0209b-d19e-40d0-b759-8d671d60a99c}"
Returns
true if found in provenance or else false
DGNPLATFORM_EXPORT bool IsFilePresentAsFileSource ( WStringCR  sourcePath,
SourcePtr source 
)

Find the source path available in provenance.

Parameters
sourcePathpath of the file to be searched. File source should be of the form L"file://C:\\DesignHistory.dgn" Projectwise file should be of the form L"pw://PW8119SS3REF2K8.bentley.com:SS3109PWSH/Documents/D{f9d0209b-d19e-40d0-b759-8d671d60a99c}"
sourceget the pointer of Source struct if source path is found
Returns
true if source path is found in provenance or else false
DGNPLATFORM_EXPORT bool MatchFileSourceURL ( WCharCP  srcFileURL)

*------------------------------------------------------------------------------—**//**

DGNPLATFORM_EXPORT StatusInt SetFileSource ( WCharCP  targetFileNameFuture,
DgnFileR  sourceFileObject,
ProcessType  type,
WCharCP  engine,
WCharCP  engineVersion,
WCharCP  configuration,
ProvenanceAttributeVector attribList 
)

*------------------------------------------------------------------------------—**//**

DGNPLATFORM_EXPORT StatusInt SetFileSource ( WCharCP  targetFileNameFuture,
WCharCP  targetFileURL,
DgnFileR  sourceFileObject,
WCharCP  sourceFileURL,
ProcessType  type,
WCharCP  engine,
WCharCP  engineVersion,
WCharCP  configuration,
ProvenanceAttributeVector attribList 
)

*------------------------------------------------------------------------------—**//**

DGNPLATFORM_EXPORT StatusInt SetFileSource ( WCharCP  targetFileNameFuture,
WCharCP  targetFileURL,
DgnFileR  sourceFileObject,
WCharCP  sourceFileURL,
ProcessType  type,
WCharCP  engine,
WCharCP  engineVersion,
WCharCP  configuration,
const SourceVector sources,
ProvenanceAttributeVector attribList 
)

*------------------------------------------------------------------------------—**//**


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.