' Working with projects and project policy
Dim CC As New ClearCase.Application
' Get the project VOB with tag \projects
Dim PVOB As CCProjectVOB
On Error Resume Next
Set PVOB = CC.ProjectVOB("\projects")
If Err.Number <> 0 Then
MsgBox "CC.ProjectVOB returned error: " & Err.Description
Else
' Get a particular project in the project VOB
Dim Project As CCProject
On Error Resume Next
Set Project = PVOB.Project("Web_interface")
If Err.Number <> 0 Then
MsgBox "Error getting project: " & Err.Description
Else
' Determine if the project is CRM-enabled
If Project.IsCRMEnabled Then
MsgBox " Project's associated ClearQuest database: " & _
Project.ClearQuestDatabaseName
End If
' Determine the project's minimum promotion level
MsgBox "The project's required promotion level is " & _
Project.RequiredPromotionLevel
' Determine the project VOB's default promotion level
MsgBox "The project VOB's default promotion level is " & _
PVOB.DefaultPromotionLevel
' Get and set various policy settings
Dim ProjPol As CCProjectPolicy
Set ProjPol = Project.Policy
If ProjPol.WinDevelopmentSnapshot Then
MsgBox "Project recommends snapshot views for " & _
"Windows development"
Else
ProjPol.WinDevelopmentSnapshot = True
End If
If Not ProjPol.DeliverRequireCheckin Then
MsgBox "Project allows deliver from a stream with " & _
"checked-out files"
Else
ProjPol.DeliverRequireCheckin = False
End If
If Not ProjPol.DeliverRequireRebase Then
MsgBox "Project does not require a development stream " & _
"to be based on the current recommended baseline " & _
"before a deliver to the integration stream"
Else
ProjPol.DeliverRequireRebase = False
End If
End If
End If