def add(self, newLabel, idx=-1, newName="", newDescription="", newPriority="1", newRationale="None", newFitCriterion="None", newOriginator="", newType="Functional", newParent=-1): reqId = self.dbProxy.newId() modName = self.modCombo.GetStringSelection() if (modName == ''): modName = self.modCombo.GetString(0) r = RequirementFactory.build(reqId, newLabel, newName, newDescription, newPriority, newRationale, newFitCriterion, newOriginator, newType, modName) self.dbProxy.addRequirement(r, modName, self.isAsset) if (idx != -1): self.reqs.insert(idx, r) self.relabel() else: self.reqs.append(r) self.commitChanges() return r
def endElement(self,name): if name == 'domainproperty': p = DomainPropertyParameters(self.theName,self.theDescription,self.theType,self.theOriginator,self.theTags) self.theDomainProperties.append(p) self.resetDomainPropertyAttributes() elif name == 'goal_environment': p = GoalEnvironmentProperties(self.theEnvironmentName,'',self.theDescription,self.theCategory,self.thePriority,self.theFitCriterion,self.theIssue,[],[],self.theConcerns,self.theConcernAssociations) self.theEnvironmentProperties.append(p) self.resetGoalEnvironmentAttributes() elif name == 'obstacle_environment': p = ObstacleEnvironmentProperties(self.theEnvironmentName,'',self.theDescription,self.theCategory,[],[],self.theConcerns) self.theEnvironmentProperties.append(p) self.resetObstacleEnvironmentAttributes() elif name == 'goal': p = GoalParameters(self.theName,self.theOriginator,self.theTags,self.theEnvironmentProperties) self.theGoals.append(p) self.resetGoalAttributes() elif name == 'obstacle': p = ObstacleParameters(self.theName,self.theOriginator,self.theTags,self.theEnvironmentProperties) self.theObstacles.append(p) self.resetObstacleAttributes() elif name == 'requirement': reqId = self.dbProxy.newId() r = RequirementFactory.build(reqId,self.theLabel,self.theName,self.theDescription,self.thePriority,self.theRationale,self.theFitCriterion,self.theOriginator,self.theType,self.theReference) self.theRequirements.append((r,self.theReference,self.theReferenceType)) self.resetRequirementAttributes() elif name == 'countermeasure': p = CountermeasureParameters(self.theName,self.theDescription,self.theType,self.theTags,self.theEnvironmentProperties) self.theCountermeasures.append(p) self.resetCountermeasureAttributes() elif name == 'mitigating_property': self.theSpDict[self.thePropertyName] = (self.thePropertyValue,self.theDescription) self.resetMitigatingPropertyAttributes() elif name == 'countermeasure_environment': cProperty,cRationale = self.theSpDict['confidentiality'] iProperty,iRationale = self.theSpDict['integrity'] avProperty,avRationale = self.theSpDict['availability'] acProperty,acRationale = self.theSpDict['accountability'] anProperty,anRationale = self.theSpDict['anonymity'] panProperty,panRationale = self.theSpDict['pseudonymity'] unlProperty,unlRationale = self.theSpDict['unlinkability'] unoProperty,unoRationale = self.theSpDict['unobservability'] p = CountermeasureEnvironmentProperties(self.theEnvironmentName,self.theCmRequirements,self.theTargets,[cProperty,iProperty,avProperty,acProperty,anProperty,panProperty,unlProperty,unoProperty],[cRationale,iRationale,avRationale,acRationale,anRationale,panRationale,unlRationale,unoRationale],self.theCost,self.theCmRoles,self.theTaskPersonas) self.theEnvironmentProperties.append(p) self.resetCountermeasureEnvironmentAttributes() elif (name == 'target'): self.theTargets.append(Target(self.theTargetName,self.theTargetEffectiveness,self.theRationale)) self.theTargetResponses = [] elif (name == 'description'): self.inDescription = 0 elif (name =='definition'): self.inDescription = 0 elif name == 'fit_criterion': self.inFitCriterion = 0 elif name == 'issue': self.inIssue = 0 elif name == 'rationale': self.inRationale = 0 elif name == 'originator': self.inOriginator = 0
def onRequirement(self, evt): try: ucId = self.dbProxy.getDimensionId(self.theUseCaseName, 'usecase') dlg = SingleRequirementDialog(self) if (dlg.ShowModal() == armid.SINGLEREQUIREMENT_BUTTONCOMMIT_ID): refName = dlg.referrer() completeReqLabel = self.dbProxy.lastRequirementLabel(refName) referrer, reqLabel = completeReqLabel.split('-') reqId = self.dbProxy.newId() reqLabel = int(reqLabel) reqLabel += 1 r = RequirementFactory.build(reqId, reqLabel, dlg.description(), dlg.priority(), dlg.rationale(), dlg.fitCriterion(), dlg.originator(), dlg.type(), refName) isAsset = True if (dlg.referrerType() == 'environment'): isAsset = False self.dbProxy.addRequirement(r, refName, isAsset) self.dbProxy.addTrace('requirement_usecase', reqId, ucId, dlg.theContributionType) completeReqLabel = self.dbProxy.lastRequirementLabel(refName) ackDlg = wx.MessageDialog( self, 'Added requirement ' + completeReqLabel, 'Refining requirement', wx.OK) ackDlg.ShowModal() except ARMException, errorText: dlg = wx.MessageDialog(self, str(errorText), 'Refining requirement', wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy()
def onRequirement(self, evt): try: ucId = self.dbProxy.getDimensionId(self.theUseCaseName, "usecase") dlg = SingleRequirementDialog(self) if dlg.ShowModal() == armid.SINGLEREQUIREMENT_BUTTONCOMMIT_ID: refName = dlg.referrer() completeReqLabel = self.dbProxy.lastRequirementLabel(refName) referrer, reqLabel = completeReqLabel.split("-") reqId = self.dbProxy.newId() reqLabel = int(reqLabel) reqLabel += 1 r = RequirementFactory.build( reqId, reqLabel, dlg.description(), dlg.priority(), dlg.rationale(), dlg.fitCriterion(), dlg.originator(), dlg.type(), refName, ) isAsset = True if dlg.referrerType() == "environment": isAsset = False self.dbProxy.addRequirement(r, refName, isAsset) self.dbProxy.addTrace("requirement_usecase", reqId, ucId, dlg.theContributionType) completeReqLabel = self.dbProxy.lastRequirementLabel(refName) ackDlg = wx.MessageDialog(self, "Added requirement " + completeReqLabel, "Refining requirement", wx.OK) ackDlg.ShowModal() except ARMException, errorText: dlg = wx.MessageDialog(self, str(errorText), "Refining requirement", wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy()
def requirementParameters(self): reqType = self.decorator.getComboValue("newRequirementTypeCtrl") reqPri = self.decorator.getComboValue("newRequirementPriorityCtrl") reqDesc = self.decorator.getMLText("newRequirementDescriptionCtrl") reqRat = self.decorator.getMLText("newRequirementRationaleCtrl") reqFC = self.decorator.getMLText("newRequirementFitCriterionCtrl") reqOrig = self.decorator.getMLText("newRequirementOriginatorCtrl") self.theAssetName = self.decorator.getComboValue("requirementAssetCtrl") completeReqLabel = self.dbProxy.lastRequirementLabel(self.theAssetName) reqAsset,reqLabel = completeReqLabel.split('-') reqId = self.dbProxy.newId() reqLabel = int(reqLabel) reqLabel += 1 r = RequirementFactory.build(reqId,reqLabel,reqDesc,reqPri,reqRat,reqFC,reqOrig,reqType,self.theAssetName) return r
def add(self,newLabel,idx=-1,newName="",newDescription="", newPriority="1", newRationale="None", newFitCriterion="None", newOriginator="",newType="Functional",newParent=-1): reqId = self.dbProxy.newId() modName = self.modCombo.GetStringSelection() if (modName == ''): modName = self.modCombo.GetString(0) r = RequirementFactory.build(reqId,newLabel,newName,newDescription,newPriority,newRationale,newFitCriterion,newOriginator,newType,modName) self.dbProxy.addRequirement(r,modName,self.isAsset) if (idx != -1): self.reqs.insert(idx,r) self.relabel() else: self.reqs.append(r) self.commitChanges() return r
def requirementParameters(self): reqType = self.decorator.getComboValue("newRequirementTypeCtrl") reqPri = self.decorator.getComboValue("newRequirementPriorityCtrl") reqDesc = self.decorator.getMLText("newRequirementDescriptionCtrl") reqRat = self.decorator.getMLText("newRequirementRationaleCtrl") reqFC = self.decorator.getMLText("newRequirementFitCriterionCtrl") reqOrig = self.decorator.getMLText("newRequirementOriginatorCtrl") self.theAssetName = self.decorator.getComboValue( "requirementAssetCtrl") completeReqLabel = self.dbProxy.lastRequirementLabel(self.theAssetName) reqAsset, reqLabel = completeReqLabel.split('-') reqId = self.dbProxy.newId() reqLabel = int(reqLabel) reqLabel += 1 r = RequirementFactory.build(reqId, reqLabel, reqDesc, reqPri, reqRat, reqFC, reqOrig, reqType, self.theAssetName) return r
def onRequirement(self,evt): try: taskId = self.dbProxy.getDimensionId(self.theTaskName,'task') dlg = SingleRequirementDialog(self) if (dlg.ShowModal() == armid.SINGLEREQUIREMENT_BUTTONCOMMIT_ID): refName = dlg.referrer() completeReqLabel = self.dbProxy.lastRequirementLabel(refName) referrer,reqLabel = completeReqLabel.split('-') reqId = self.dbProxy.newId() reqLabel = int(reqLabel) reqLabel += 1 r = RequirementFactory.build(reqId,reqLabel,dlg.description(),dlg.priority(),dlg.rationale(),dlg.fitCriterion(),dlg.originator(),dlg.type(),refName) isAsset = True if (dlg.referrerType() == 'environment'): isAsset = False self.dbProxy.addRequirement(r,refName,isAsset) self.dbProxy.addTrace('requirement_task',reqId,taskId) completeReqLabel = self.dbProxy.lastRequirementLabel(refName) ackDlg = wx.MessageDialog(self,'Added requirement ' + completeReqLabel,'Refining requirement',wx.OK) ackDlg.ShowModal() except ARMException,errorText: dlg = wx.MessageDialog(self,str(errorText),'Refining requirement',wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy()
def endElement(self, name): if name == 'domainproperty': p = DomainPropertyParameters(self.theName, self.theDescription, self.theType, self.theOriginator, self.theTags) self.theDomainProperties.append(p) self.resetDomainPropertyAttributes() elif name == 'goal_environment': p = GoalEnvironmentProperties(self.theEnvironmentName, '', self.theDescription, self.theCategory, self.thePriority, self.theFitCriterion, self.theIssue, [], [], self.theConcerns, self.theConcernAssociations) self.theEnvironmentProperties.append(p) self.resetGoalEnvironmentAttributes() elif name == 'obstacle_environment': p = ObstacleEnvironmentProperties(self.theEnvironmentName, '', self.theDescription, self.theCategory, [], [], self.theConcerns) self.theEnvironmentProperties.append(p) self.resetObstacleEnvironmentAttributes() elif name == 'goal': p = GoalParameters(self.theName, self.theOriginator, self.theTags, self.theEnvironmentProperties) self.theGoals.append(p) self.resetGoalAttributes() elif name == 'obstacle': p = ObstacleParameters(self.theName, self.theOriginator, self.theTags, self.theEnvironmentProperties) self.theObstacles.append(p) self.resetObstacleAttributes() elif name == 'requirement': reqId = self.dbProxy.newId() r = RequirementFactory.build(reqId, self.theLabel, self.theName, self.theDescription, self.thePriority, self.theRationale, self.theFitCriterion, self.theOriginator, self.theType, self.theReference) self.theRequirements.append( (r, self.theReference, self.theReferenceType)) self.resetRequirementAttributes() elif name == 'countermeasure': p = CountermeasureParameters(self.theName, self.theDescription, self.theType, self.theTags, self.theEnvironmentProperties) self.theCountermeasures.append(p) self.resetCountermeasureAttributes() elif name == 'mitigating_property': self.theSpDict[self.thePropertyName] = (self.thePropertyValue, self.theDescription) self.resetMitigatingPropertyAttributes() elif name == 'countermeasure_environment': cProperty, cRationale = self.theSpDict['confidentiality'] iProperty, iRationale = self.theSpDict['integrity'] avProperty, avRationale = self.theSpDict['availability'] acProperty, acRationale = self.theSpDict['accountability'] anProperty, anRationale = self.theSpDict['anonymity'] panProperty, panRationale = self.theSpDict['pseudonymity'] unlProperty, unlRationale = self.theSpDict['unlinkability'] unoProperty, unoRationale = self.theSpDict['unobservability'] p = CountermeasureEnvironmentProperties( self.theEnvironmentName, self.theCmRequirements, self.theTargets, [ cProperty, iProperty, avProperty, acProperty, anProperty, panProperty, unlProperty, unoProperty ], [ cRationale, iRationale, avRationale, acRationale, anRationale, panRationale, unlRationale, unoRationale ], self.theCost, self.theCmRoles, self.theTaskPersonas) self.theEnvironmentProperties.append(p) self.resetCountermeasureEnvironmentAttributes() elif (name == 'target'): self.theTargets.append( Target(self.theTargetName, self.theTargetEffectiveness, self.theRationale)) self.theTargetResponses = [] elif (name == 'description'): self.inDescription = 0 elif (name == 'definition'): self.inDescription = 0 elif name == 'fit_criterion': self.inFitCriterion = 0 elif name == 'issue': self.inIssue = 0 elif name == 'rationale': self.inRationale = 0 elif name == 'originator': self.inOriginator = 0