示例#1
0
    def add(self,
            idx=-1,
            goalName="",
            envName="",
            newDefinition="",
            newCategory="Maintain",
            newPriority="Low",
            newFitCriterion="None",
            newIssue="None",
            newOriginator=""):
        envName = self.envCombo.GetValue()
        parentGoalName = self.goalCombo.GetValue()

        ep = GoalEnvironmentProperties(
            envName, '', newDefinition, newCategory, newPriority,
            newFitCriterion, newIssue,
            [(parentGoalName, 'goal', 'and', 'No', 'None')])
        g = Goal(-1, goalName, newOriginator, [], [ep])
        gp = GoalParameters(goalName, newOriginator, [], [ep])
        g.setId(self.dbProxy.addGoal(gp))
        if (idx != -1):
            self.goals.insert(idx, g)
        else:
            self.goals.append(g)
        return g
示例#2
0
  def prepare_new_goal(self):
    new_goal_refinements = [
      RefinementModel("PreventUnauthorised Certificate Access",
      "goal",
      "or",
      "No",
      "None")
    ]
    new_subgoal_refinements = [
      RefinementModel("PreventUnauthorised Certificate Access",
      "goal",
      "or",
      "No",
      "None")
    ]
    new_goal_props = [
      GoalEnvironmentProperties(
        environmentName=self.existing_environment_name_1,
        lbl='',
        definition='This is a first test property',
        category=self.existing_category,
        priority='Medium',
        fitCriterion='None',
        issue='None',
        goalRefinements=new_goal_refinements,
        subGoalRefinements=new_subgoal_refinements,
        concs=[],cas=[]
      ),
      GoalEnvironmentProperties(
        environmentName=self.existing_environment_name_2,
        lbl='',
        definition='This is a second test property',
        category=self.existing_category,
        priority='Low',
        fitCriterion='None',
        issue='Test issue',
        goalRefinements=new_goal_refinements,
        subGoalRefinements=new_subgoal_refinements,
        concs=[],cas=[]
      )
    ]

    new_goal = Goal(
      goalId=-1,
      goalName='Test goal',
      goalOrig='',
      tags=['test', 'test123'],
      environmentProperties=[]
    )
    new_goal.theEnvironmentProperties = new_goal_props

    new_goal.theEnvironmentDictionary = {}
    new_goal.theGoalPropertyDictionary = {}

    delattr(new_goal, 'theEnvironmentDictionary')
    delattr(new_goal, 'theGoalPropertyDictionary')

    return new_goal
示例#3
0
  def add(self,idx=-1,goalName="",envName="",newDefinition="",newCategory="Maintain", newPriority="Low", newFitCriterion="None", newIssue="None", newOriginator=""):
    envName = self.envCombo.GetValue()
    parentGoalName = self.goalCombo.GetValue()

    ep = GoalEnvironmentProperties(envName,'',newDefinition,newCategory,newPriority,newFitCriterion,newIssue,[(parentGoalName,'goal','and','No','None')])
    g = Goal(-1,goalName,newOriginator,[],[ep])
    gp = GoalParameters(goalName,newOriginator,[],[ep])
    g.setId(self.dbProxy.addGoal(gp))
    if (idx != -1):
      self.goals.insert(idx,g)
    else:
      self.goals.append(g)
    return g
示例#4
0
    def prepare_new_goal(self):
        new_goal_refinements = [
            RefinementModel("PreventUnauthorised Certificate Access", "goal",
                            "or", "No", "None")
        ]
        new_subgoal_refinements = [
            RefinementModel("PreventUnauthorised Certificate Access", "goal",
                            "or", "No", "None")
        ]
        new_goal_props = [
            GoalEnvironmentProperties(
                environmentName=self.existing_environment_name_1,
                lbl='',
                definition='This is a first test property',
                category=self.existing_category,
                priority='Medium',
                fitCriterion='None',
                issue='None',
                goalRefinements=new_goal_refinements,
                subGoalRefinements=new_subgoal_refinements,
                concs=[],
                cas=[]),
            GoalEnvironmentProperties(
                environmentName=self.existing_environment_name_2,
                lbl='',
                definition='This is a second test property',
                category=self.existing_category,
                priority='Low',
                fitCriterion='None',
                issue='Test issue',
                goalRefinements=[],
                subGoalRefinements=[],
                concs=[],
                cas=[])
        ]

        new_goal = Goal(goalId=-1,
                        goalName='Test goal',
                        goalOrig='',
                        tags=['test', 'test123'],
                        environmentProperties=[])
        new_goal.theEnvironmentProperties = new_goal_props

        new_goal.theEnvironmentDictionary = {}
        new_goal.theGoalPropertyDictionary = {}

        delattr(new_goal, 'theEnvironmentDictionary')
        delattr(new_goal, 'theGoalPropertyDictionary')

        return new_goal
示例#5
0
def deserialize_goal(dict):
    goal = Goal(dict['theId'], dict['theName'], dict['theOriginator'],
                dict['theTags'], dict['theEnvironmentProperties'])
    return goal