Using Cameron API to update ListIndentLevel

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Using Cameron API to update ListIndentLevel

Post by vaetgt1 »

When using the Boylan API we use the following piece of VB.net code to update Exceptions and Requirements, and it works fine

DIM spsCommitment As ICommitment ' this has been set up elsewhere in the code
Dim spsReqEx As IRequirementException
Dim xmlNodeList As XmlNodeList
Dim xmlNode As XmlNode
Dim strDesc As String = ""
Dim strTemp As String = ""

strDesc = GetNode(xmlNode, "Text", "")
If strType = mconSPSException Then
spsReqEx = spsCommitment.Exceptions.CreateNew()
Else
spsReqEx = spsCommitment.Requirements.CreateNew()
End If
With spsReqEx
.Description = strDesc
.Code = GetNode(xmlNode, "Code", "")
.ListIndentLevel = CByte(GetNode(xmlNode, "ParagraphLevel", "1"))
.ShowOnDocument = CBool(IIf(UCase(GetNode(xmlNode, "Document", "")) = "ALL", True, False))

When attempting to use the Cameron API, using the following piece of VB.net code

Dim spsOrder As Object 'this has been set up elsewhere in the code
Dim xmlNode As XmlNode
Dim strDesc As String = ""
Dim strTemp As String = ""

strDesc = GetNode(xmlNode, "Text", "")
Dim ospsReqEx As Object
ospsReqEx = DirectCast(spsOrder, IOrder).CreateNew(strType)
ospsReqEx.Text = strDesc
ospsReqEx.Code = GetNode(xmlNode, "Code", "")
ospsReqEx.ListIndentLevel = CByte(GetNode(xmlNode, "ParagraphLevel", "1"))
ospsReqEx.ShowOnDocument = CBool(IIf(UCase(GetNode(xmlNode, "Document", "")) = "ALL", True, False))

The line
ospsReqEx.ListIndentLevel = CByte(GetNode(xmlNode, "ParagraphLevel", "1"))
Fails with the error "Cannot Access Member". Can you tell me what needs to be done to update the property "ListIndexLevel"
Joni Hoffman
Posts: 18
Joined: Fri Oct 03, 2008 1:12 pm

Re: Using Cameron API to update ListIndentLevel

Post by Joni Hoffman »

In the Boylan API, the Requirements/Exceptions were a flat list so we used the ListIndentLevel property to determine how the tree should be structured. In the Cameron API, the ListIndentLevel property became ReadOnly as the Requirements/Exceptions are no longer a flat list but are instead a hierarchical structure. Each instance of a Requirement/Exception has a property called Phrases which is its collection of child items. In order to have the ListIndentLevel set properly, you need to add each Requirement/Exception to the Phrases collection on the correct parent.
Joni Hoffman
Software Developer
SoftPro
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Re: Using Cameron API to update ListIndentLevel

Post by vaetgt1 »

Do you have any documentation I can read or samples that I can look at which go into detail about having the various indent levels set corretly using the Phrases collection?
Post Reply