Exemplo n.º 1
0
  def get_task_model(self, environment_name,task_name,misusecase_name, pathValues = []):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
    if task_name == 'all':  
      task_name = ''
    if misusecase_name == 'all': 
       misusecase_name = ''

    try:
      mcFilter = False
      filter_name = task_name
      if misusecase_name != '': 
        mcFilter = True
        filter_name = misusecase_name
      associationDirectory = self.db_proxy.taskModel(environment_name,filter_name,mcFilter)
      associations = KaosModel(list(associationDirectory.values()), environment_name, kaosModelType = 'task',goalName = filter_name,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
      dot_code = associations.graph()
      if not dot_code:
        raise ObjectNotFoundHTTPError('The task model')
      return dot_code
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)
Exemplo n.º 2
0
    def get_persona_characteristics(self,
                                    persona_name,
                                    variable_name,
                                    characteristic_name,
                                    pathValue=[]):
        fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
        if (variable_name == 'All' or variable_name == 'all'):
            variable_name = ''
        if (characteristic_name == 'All' or characteristic_name == 'all'):
            characteristic_name = ''

        try:
            modelAssocs = self.db_proxy.assumptionPersonaModel(
                persona_name, variable_name, characteristic_name)
            associations = AssumptionPersonaModel(modelAssocs,
                                                  font_name=fontName,
                                                  font_size=fontSize)
            associations.graph()
            pChars = associations.characteristics()
            return pChars
        except DatabaseProxyException as ex:
            self.close()
            raise ARMHTTPError(ex)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
Exemplo n.º 3
0
 def get_goal_model(self, environment_name, goal_name, usecase_name,
                    is_top_level):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         associationDictionary = {}
         goalFilter = 0
         ucFilter = 0
         if goal_name != '': goalFilter = 1
         if usecase_name != '':
             ucFilter = 1
             goal_name = usecase_name
         associationDictionary = self.db_proxy.goalModel(
             environment_name, goal_name, is_top_level, ucFilter)
         associations = KaosModel(list(associationDictionary.values()),
                                  environment_name,
                                  'goal',
                                  goal_name,
                                  db_proxy=self.db_proxy,
                                  font_name=fontName,
                                  font_size=fontSize)
         dot_code = associations.graph()
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
Exemplo n.º 4
0
 def get_risk_analysis_model(self, environment_name, dim_name, obj_name,
                             model_layout):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         riskAnalysisModel = self.db_proxy.riskAnalysisModel(
             environment_name, dim_name, obj_name)
         tLinks = EnvironmentModel(riskAnalysisModel,
                                   environment_name,
                                   self.db_proxy,
                                   model_layout,
                                   fontName=fontName,
                                   fontSize=fontSize)
         dot_code = tLinks.graph()
         if not dot_code:
             raise ObjectNotFoundHTTPError('The risk analysis model')
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except Exception as ex:
         self.close()
         print(ex)
Exemplo n.º 5
0
 def get_dataflow_diagram(self,
                          environment_name,
                          filter_type,
                          filter_element,
                          pathValues=[]):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     if filter_element == 'all':
         filter_element = ''
     try:
         dfdRows = self.db_proxy.dataFlowDiagram(environment_name,
                                                 filter_type,
                                                 filter_element)
         associations = DataFlowDiagram(dfdRows,
                                        environment_name,
                                        self.db_proxy,
                                        font_name=fontName,
                                        font_size=fontSize)
         dot_code = associations.graph()
         if not dot_code:
             raise ObjectNotFoundHTTPError('The data flow diagram')
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
Exemplo n.º 6
0
def get_hta_model(self, environment_name, usecaseName, sub_usecaseName,
                  pathValues):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
    is_top_level = pathValues[0]
    if usecaseName == 'all':
        usecaseName = ''
    if sub_usecaseName == 'all':
        sub_usecaseName = ''
    try:
        associationDictionary = {}
        ucFilter = 0
        sub_ucFilter = 0
        if usecaseName != '':
            ucFilter = 1
        if sub_usecaseName != '':
            sub_ucFilter = 1
            usecaseName = sub_usecaseName
        associationDictionary = self.db_proxy.UseCaseModel(
            environment_name, usecase_name, is_top_level, ucFilter)
        associations = UseCaseModel(list(associationDictionary.values()),
                                    environment_name,
                                    'usecase',
                                    usecase_name,
                                    db_proxy=self.db_proxy,
                                    font_name=fontName,
                                    font_size=fontSize)
        dot_code = associations.graph()
        return dot_code
    except DatabaseProxyException as ex:
        self.close()
        raise ARMHTTPError(ex)
Exemplo n.º 7
0
 def get_task_model(self, environment_name, task_name, misusecase_name):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         mcFilter = False
         filter_name = task_name
         if misusecase_name != "":
             mcFilter = True
             filter_name = misusecase_name
         associationDirectory = self.db_proxy.taskModel(environment_name, filter_name, mcFilter)
         associations = KaosModel(
             associationDirectory.values(),
             environment_name,
             kaosModelType="task",
             goalName=filter_name,
             db_proxy=self.db_proxy,
             font_name=fontName,
             font_size=fontSize,
         )
         dot_code = associations.graph()
         if not dot_code:
             raise ObjectNotFoundHTTPError("The task model")
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
Exemplo n.º 8
0
 def get_asset_model(self,
                     environment_name,
                     asset_name,
                     hide_concerns=True):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         associationDictionary = self.db_proxy.classModel(
             environment_name, asset_name, hideConcerns=hide_concerns)
         associations = GraphicalAssetModel(list(
             associationDictionary.values()),
                                            environment_name,
                                            asset_name,
                                            hideConcerns=hide_concerns,
                                            db_proxy=self.db_proxy,
                                            fontName=fontName,
                                            fontSize=fontSize)
         dot_code = associations.graph()
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except Exception as ex:
         print(ex)
Exemplo n.º 9
0
 def get_control_structure(self,
                           environment_name,
                           filter_element,
                           pathValues=[]):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     if filter_element == 'all':
         filter_element = ''
     try:
         csRows = self.db_proxy.controlStructure(environment_name,
                                                 filter_element)
         associations = ControlStructure(csRows,
                                         environment_name,
                                         self.db_proxy,
                                         font_name=fontName,
                                         font_size=fontSize)
         dot_code = associations.graph()
         if not dot_code:
             raise ObjectNotFoundHTTPError('The control structure')
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
Exemplo n.º 10
0
 def get_user_goal_model(self,
                         environment_name,
                         filter_element,
                         pathValues=[]):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     if filter_element == 'all':
         filter_element = ''
     try:
         gcs = self.db_proxy.getGoalContributions(environment_name,
                                                  filter_element)
         ugm = UserGoalModel(gcs,
                             environment_name,
                             self.db_proxy,
                             font_name=fontName,
                             font_size=fontSize)
         dot_code = ugm.graph()
         if not dot_code:
             raise ObjectNotFoundHTTPError('The user goal model')
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
Exemplo n.º 11
0
 def get_concept_map_model(self, environment_name, requirement_name,
                           isAsset):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         associationDictionary = self.db_proxy.conceptMapModel(
             environment_name, requirement_name)
         associations = GraphicalConceptMapModel(list(
             associationDictionary.values()),
                                                 environment_name,
                                                 requirement_name,
                                                 isAsset,
                                                 True,
                                                 db_proxy=self.db_proxy,
                                                 font_name=fontName,
                                                 font_size=fontSize)
         dot_code = associations.graph()
         return dot_code
     except ObjectNotFound as ex:
         self.close()
         raise ObjectNotFoundHTTPError('The provided environment name')
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except Exception as ex:
         print(ex)
Exemplo n.º 12
0
    def get_persona_model(self,
                          persona_name,
                          variable_name,
                          characteristic_name,
                          pathValues=[]):
        fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
        if (variable_name == 'All' or variable_name == 'all'):
            variable_name = ''
        if (characteristic_name == 'All' or characteristic_name == 'all'):
            characteristic_name = ''

        try:
            modelAssocs = self.db_proxy.assumptionPersonaModel(
                persona_name, variable_name, characteristic_name)
            associations = AssumptionPersonaModel(modelAssocs,
                                                  font_name=fontName,
                                                  font_size=fontSize)
            dot_code = associations.graph()
            if not dot_code:
                raise ObjectNotFoundHTTPError('The persona model')
            return dot_code
        except DatabaseProxyException as ex:
            self.close()
            raise ARMHTTPError(ex)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
Exemplo n.º 13
0
 def get_responsibility_model(self, environment_name, role_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.responsibilityModel(environment_name, role_name)
     associations = KaosModel(associationDictionary.values(), environment_name, 'responsibility',goalName=role_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 14
0
 def get_responsibility_model(self, environment_name, role_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.responsibilityModel(environment_name, role_name)
     associations = KaosModel(associationDictionary.values(), environment_name, 'responsibility',goalName=role_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 15
0
  def get_obstacle_model(self, environment_name, obstacle_name):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)

    try:
      obstacle_filter = 0
      associationDictionary = self.db_proxy.obstacleModel(environment_name, obstacle_name, obstacle_filter)
      associations = KaosModel(list(associationDictionary.values()), environment_name, 'obstacle',obstacle_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize)
      dot_code = associations.graph()
      return dot_code
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
Exemplo n.º 16
0
  def get_obstacle_model(self, environment_name, obstacle_name):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)

    try:
      obstacle_filter = 0
      if obstacle_name != '': obstacle_filter = 1

      associationDictionary = self.db_proxy.obstacleModel(environment_name, obstacle_name, obstacle_filter)
      associations = KaosModel(associationDictionary.values(), environment_name, 'obstacle',obstacle_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize)
      dot_code = associations.graph()
      return dot_code
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
Exemplo n.º 17
0
 def get_persona_characteristics(self, persona_name,variable_name,characteristic_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     modelAssocs = self.db_proxy.assumptionPersonaModel(persona_name,variable_name,characteristic_name)
     associations = AssumptionPersonaModel(modelAssocs,font_name=fontName,font_size=fontSize)
     associations.graph()
     pChars = associations.characteristics()
     return pChars
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 18
0
 def get_component_goal_model(self,cName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.componentGoalModel(cName)
     associations = KaosModel(associationDictionary.values(), '',kaosModelType='template_goal',db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 19
0
 def get_component_model(self,cvName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     interfaces,connectors = self.db_proxy.componentView(cvName)
     associations = GraphicalComponentModel(interfaces,connectors,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 20
0
 def get_locations_model(self, locations_name, environment_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     riskOverlay = self.db_proxy.locationsRiskModel(locations_name,environment_name) 
     lModel = GraphicalLocationModel(locations_name,environment_name, riskOverlay,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = lModel.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 21
0
 def get_component_asset_model(self,cName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.componentAssetModel(cName)
     associations = GraphicalAssetModel(associationDictionary.values(), db_proxy=self.db_proxy, fontName=fontName, fontSize=fontSize,isComponentAssetModel=True)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 22
0
 def get_component_goal_model(self,cName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.componentGoalModel(cName)
     associations = KaosModel(associationDictionary.values(), '',kaosModelType='template_goal',db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 23
0
 def get_persona_model(self, persona_name,variable_name,characteristic_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     modelAssocs = self.db_proxy.assumptionPersonaModel(persona_name,variable_name,characteristic_name)
     associations = AssumptionPersonaModel(modelAssocs,font_name=fontName,font_size=fontSize)
     dot_code = associations.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The persona model')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 24
0
 def get_asset_model(self, environment_name, with_concerns=True):
     fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
     try:
         associationDictionary = self.db_proxy.classModel(environment_name, hideConcerns=(with_concerns is False))
         associations = GraphicalAssetModel(associationDictionary.values(), environment_name, db_proxy=self.db_proxy, fontName=fontName, fontSize=fontSize)
         dot_code = associations.graph()
         return dot_code
     except DatabaseProxyException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except ARMException as ex:
         self.close()
         raise ARMHTTPError(ex)
     except Exception as ex:
         print(ex)
Exemplo n.º 25
0
 def get_locations_model(self, locations_name, environment_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     riskOverlay = self.db_proxy.locationsRiskModel(locations_name,environment_name) 
     lModel = GraphicalLocationModel(locations_name,environment_name, riskOverlay,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = lModel.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 26
0
 def get_goal_model(self, environment_name,goal_name,usecase_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = {}
     goalFilter = 0
     ucFilter = 0
     if goal_name != '': goalFilter = 1
     if usecase_name != '': ucFilter = 1
     associationDictionary = self.db_proxy.goalModel(environment_name,goal_name,goalFilter,ucFilter)
     associations = KaosModel(associationDictionary.values(), environment_name, 'goal',goal_name,db_proxy=self.db_proxy, font_name=fontName,font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 27
0
 def get_misusability_model(self, mc_name,tc_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associations = self.db_proxy.assumptionTaskModel(mc_name,tc_name)
     model = GraphicalAssumptionTaskModel(associations,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = model.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The misusability model')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 28
0
 def get_component_model(self,cvName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     interfaces,connectors = self.db_proxy.componentView(cvName)
     associations = GraphicalComponentModel(interfaces,connectors,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 29
0
 def get_component_asset_model(self,cName):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDictionary = self.db_proxy.componentAssetModel(cName)
     associations = GraphicalAssetModel(associationDictionary.values(), db_proxy=self.db_proxy, fontName=fontName, fontSize=fontSize)
     dot_code = associations.graph()
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 30
0
 def get_misusability_model(self, mc_name,tc_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associations = self.db_proxy.assumptionTaskModel(mc_name,tc_name)
     model = GraphicalAssumptionTaskModel(associations,db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = model.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The misusability model')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 31
0
 def get_dataflow_diagram(self, environment_name, filter_element):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     dfdRows = self.db_proxy.dataFlowDiagram(environment_name,filter_element)
     associations = DataFlowDiagram(dfdRows,environment_name,self.db_proxy,font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The data flow diagram')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 32
0
 def get_task_model(self, environment_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     associationDirectory = self.db_proxy.taskModel(environment_name)
     associations = KaosModel(associationDirectory.values(), environment_name, kaosModelType = 'task',db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The task model')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
Exemplo n.º 33
0
  def get_risk_analysis_model(self, environment_name, pathValues = []):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
    dim_name = pathValues[0]
    obj_name = pathValues[1]
    isTagged = pathValues[2]
    rankDir = pathValues[3]
    model_layout = pathValues[4]

    if (isTagged == '1'):
      isTagged = True
    else:
      isTagged = False

    if dim_name == 'all':
      dim_name = ''
    if obj_name == 'all':
      obj_name = ''

    if model_layout == 'Hierarchical':
      model_layout = 'dot'
    elif model_layout == 'Spring':
      model_layout = 'fdp'
    elif model_layout == 'Radial':
      model_layout = 'twopi'
    else:
      model_layout = 'circo'

    if rankDir == 'Horizontal':
      rankDir = 'LR'
    else:
      rankDir = 'TB'
   
    try:
      riskAnalysisModel = self.db_proxy.riskAnalysisModel(environment_name, dim_name, obj_name)
      tLinks = EnvironmentModel(riskAnalysisModel, environment_name, self.db_proxy, model_layout, fontName=fontName, fontSize=fontSize, isTagged=isTagged, rankDir=rankDir)
      dot_code = tLinks.graph()
      if not dot_code:
        raise ObjectNotFoundHTTPError('The risk analysis model')
      return dot_code
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except Exception as ex:
      self.close()
      print(ex)
Exemplo n.º 34
0
 def get_risk_analysis_model(self, environment_name, dim_name, obj_name,model_layout):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     riskAnalysisModel = self.db_proxy.riskAnalysisModel(environment_name, dim_name, obj_name)
     tLinks = EnvironmentModel(riskAnalysisModel, environment_name, self.db_proxy, model_layout, fontName=fontName, fontSize=fontSize)
     dot_code = tLinks.graph()
     if not dot_code:
       raise ObjectNotFoundHTTPError('The risk analysis model')
     return dot_code
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     self.close()
     print(ex)
Exemplo n.º 35
0
 def get_concept_map_model(self, environment_name, requirement_name):
   fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
   try:
     self.db_proxy.getDimensionId(environment_name,'environment')
     associationDictionary = self.db_proxy.conceptMapModel(environment_name, requirement_name)
     associations = GraphicalConceptMapModel(list(associationDictionary.values()), environment_name, requirement_name, True, db_proxy=self.db_proxy, font_name=fontName, font_size=fontSize)
     dot_code = associations.graph()
     return dot_code
   except ObjectNotFound as ex:
     self.close()
     raise ObjectNotFoundHTTPError('The provided environment name')
   except DatabaseProxyException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except ARMException as ex:
     self.close()
     raise ARMHTTPError(ex)
   except Exception as ex:
     print(ex)
Exemplo n.º 36
0
    def get_asset_model(self, environment_name, asset_name, pathValues):
        fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)

        hide_concerns = pathValues[0]
        if hide_concerns == '0' or hide_concerns == 0:
            hide_concerns = False
        else:
            hide_concerns = True

        if asset_name == 'all':
            asset_name = ''

        try:
            self.db_proxy.getDimensionId(environment_name, 'environment')
            if (asset_name != ''):
                self.db_proxy.getDimensionId(asset_name, 'asset')

            associationDictionary = self.db_proxy.classModel(
                environment_name, asset_name, hideConcerns=hide_concerns)
            associations = GraphicalAssetModel(list(
                associationDictionary.values()),
                                               environment_name,
                                               asset_name,
                                               hideConcerns=hide_concerns,
                                               db_proxy=self.db_proxy,
                                               fontName=fontName,
                                               fontSize=fontSize)
            dot_code = associations.graph()
            return dot_code
        except ObjectNotFound as ex:
            self.close()
            raise ObjectNotFoundHTTPError(ex)
        except DatabaseProxyException as ex:
            self.close()
            raise ARMHTTPError(ex)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)
        except Exception as ex:
            print(ex)
Exemplo n.º 37
0
  def get_asset_model(self, environment_name, asset_name, hide_concerns=True):
    fontName, fontSize, apFontName = get_fonts(session_id=self.session_id)
    try:
      self.db_proxy.getDimensionId(environment_name,'environment')
      if (asset_name != ''):
        self.db_proxy.getDimensionId(asset_name,'asset')

      associationDictionary = self.db_proxy.classModel(environment_name, asset_name, hideConcerns=hide_concerns)
      associations = GraphicalAssetModel(list(associationDictionary.values()), environment_name, asset_name, hideConcerns=hide_concerns, db_proxy=self.db_proxy, fontName=fontName, fontSize=fontSize)
      dot_code = associations.graph()
      return dot_code
    except ObjectNotFound as ex:
      self.close()
      raise ObjectNotFoundHTTPError(ex)
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except Exception as ex:
      print(ex)