SDMSHelper.DocumentHistory
| Syntax | Parameters | Return Value |
|---|---|---|
ReadOnly Property SDMSHelper.DocumentHistory( _
Hwnd As Integer, _
DocumentID As String) As DocumentHistory
|
The handle of the Statistica application. Type: Integer The ID of the item to retrieve. Type: String |
DocumentHistory |
SVB Example
Creating a documents version report for a folder:
Sub Main
Dim oOM As ObjectManager
'Reconnect into Enterprise
Set oOM = New ObjectManager
oOM.Reconnect Application
'The folder whose content will be reviewed
Dim MyFolder As SPCFolder
Set MyFolder = oOM.FindFolder("/Blake's Materials")
'Retrieve the folder's content.
'Specifically, we are gathering the items that support SDMS versioning.
'Note that the items we are retrieve here are from the root of the specified
'folder; it will not recursively retrieve files from subfolders. This could be
'achieved by running this process on each subfolder; however, for the sake of
'brevity, we will just concentrate on the contents of one folder in this example.
Dim MyContent
Set MyContent = MyFolder.List(swcBinaryDocument Or swcMonitor Or swcProfile Or swcStandardProfileSequence)
Dim docHist As DocumentHistory
Dim deSetupInfo As String, deSetupSeqInfo As String, externalDataConfigInfo As String, _
svbDataConfigInfo As String, analysisConfigInfo As String, outputReportInfo As String, docInfo As String
Dim sdmsDocId As String
'Iterate through the different file types from the folder.
Dim i As Long, j As Long
For i = LBound(MyContent) To UBound(MyContent)
'"StandardProfile" is a data entry setup.
If TypeName(MyContent(i)) = "StandardProfile" Then
'Note that we access the document from SDMS by passing in the SDMS document ID. For a data entry setup,
'we get this ID from the "Profile" documents.
'After we acquire the SDMS document ID, we pass that into "DocumentHistory" to retrieve the item's document history.
sdmsDocId = oOM.SDMSHelper.ProfileDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
deSetupInfo = deSetupInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
deSetupInfo = deSetupInfo & docHist(j).Version & vbTab & docHist(j).Description & vbTab & docHist(j).User & vbTab & docHist(j).Date & vbCrLf
Next
End If
'"StandardProfileSequence" is a data entry sequence.
ElseIf TypeName(MyContent(i)) = "StandardProfileSequence" Then
sdmsDocId = oOM.SDMSHelper.StandardProfileSequenceDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
deSetupSeqInfo = deSetupSeqInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
deSetupSeqInfo = deSetupSeqInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
'"ExternalProfile" is an external data configuration.
ElseIf TypeName(MyContent(i)) = "ExternalProfile" Then
sdmsDocId = oOM.SDMSHelper.ProfileDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
externalDataConfigInfo = externalDataConfigInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
externalDataConfigInfo = externalDataConfigInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
'"SVBProfile" is an SVB analysis configuration.
ElseIf TypeName(MyContent(i)) = "SVBProfile" Then
sdmsDocId = oOM.SDMSHelper.ProfileDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
svbDataConfigInfo = svbDataConfigInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
svbDataConfigInfo = svbDataConfigInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
'"Monitor" is an analysis configuration.
ElseIf TypeName(MyContent(i)) = "Monitor" Then
sdmsDocId = oOM.SDMSHelper.MonitorDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
analysisConfigInfo = analysisConfigInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
analysisConfigInfo = analysisConfigInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
'"OutputMonitor" is a report.
ElseIf TypeName(MyContent(i)) = "OutputMonitor" Then
sdmsDocId = oOM.SDMSHelper.MonitorDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
outputReportInfo = outputReportInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
outputReportInfo = outputReportInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
'"BinaryDocument" is a document (e.g., SVB macro, Word file, etc.).
ElseIf TypeName(MyContent(i)) = "BinaryDocument" Then
sdmsDocId = oOM.SDMSHelper.BinaryDocumentSDMSDocumentID(Application.Handle, MyContent(i).ID)
If Len(sdmsDocId) Then
Set docHist = oOM.SDMSHelper.DocumentHistory(Application.Handle, sdmsDocId)
docInfo = docInfo & vbCrLf & MyContent(i).FullPath & vbCrLf & "-------------------" & vbCrLf
For j = 1 To docHist.Count
docInfo = docInfo & docHist(j).Version & vbTab & docHist(j).Description & vbCrLf
Next
End If
End If
Next
'Create a report
Dim docVersionsRpt As New Report
docVersionsRpt.SelectionText = "DATA ENTRY SETUPS" & vbCrLf & "***************************************" & vbCrLf & deSetupInfo & vbCrLf & _
"DATA ENTRY SEQUENCES" & vbCrLf & "***************************************" & vbCrLf & deSetupSeqInfo & vbCrLf & _
"EXTERNAL DATA CONFIGURATIONS" & vbCrLf & "***************************************" & vbCrLf & externalDataConfigInfo & vbCrLf & _
"SVB DATA CONFIGURATIONS" & vbCrLf & "***************************************" & vbCrLf & svbDataConfigInfo & vbCrLf & _
"ANALYSIS CONFIGURATIONS" & vbCrLf & "***************************************" & vbCrLf & analysisConfigInfo & vbCrLf & _
"OUTPUT REPORTS" & vbCrLf & "***************************************" & vbCrLf & outputReportInfo & vbCrLf & _
"DOCUMENTS" & vbCrLf & "***************************************" & vbCrLf & docInfo
docVersionsRpt.Visible = True
oOM.Disconnect
End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.
