def get(self,architectural_pattern_name,environment_name):
   session_id = get_session_id(session, request)
   dao = ArchitecturalPatternDAO(session_id)
   cwm = dao.get_weakness_analysis(architectural_pattern_name,environment_name)
   dao.close()
   resp = make_response(json_serialize(cwm, session_id=session_id), OK)
   resp.contenttype = 'application/json'
   return resp
 def get(self,name):
   session_id = get_session_id(session, request)
   dao = ArchitecturalPatternDAO(session_id)
   ap = dao.get_architectural_pattern(name)
   dao.close()
   resp = make_response(json_serialize(ap, session_id=session_id), OK)
   resp.contenttype = 'application/json'
   return resp
 def get(self, name):
     session_id = get_session_id(session, request)
     dao = ArchitecturalPatternDAO(session_id)
     ap = dao.get_architectural_pattern(name)
     dao.close()
     resp = make_response(json_serialize(ap, session_id=session_id), OK)
     resp.contenttype = 'application/json'
     return resp
 def post(self,architectural_pattern_name,environment_name):
   session_id = get_session_id(session, request)
   dao = ArchitecturalPatternDAO(session_id)
   cwm = dao.situate_component_view(architectural_pattern_name,environment_name)
   dao.close()
   resp_dict = {'message': 'Architectural Pattern successfully situated'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
 def get(self, architectural_pattern_name, environment_name):
     session_id = get_session_id(session, request)
     dao = ArchitecturalPatternDAO(session_id)
     cwm = dao.get_weakness_analysis(architectural_pattern_name,
                                     environment_name)
     dao.close()
     resp = make_response(json_serialize(cwm, session_id=session_id), OK)
     resp.contenttype = 'application/json'
     return resp
  def delete(self,name):
    session_id = get_session_id(session, request)
    dao = ArchitecturalPatternDAO(session_id)
    dao.delete_architectural_pattern(name)
    dao.close()

    resp_dict = {'message': 'Architectural Pattern successfully deleted'}
    resp = make_response(json_serialize(resp_dict), OK)
    resp.headers['Content-type'] = 'application/json'
    return resp
Beispiel #7
0
 def post(self, architectural_pattern_name, environment_name):
     session_id = get_session_id(session, request)
     dao = ArchitecturalPatternDAO(session_id)
     cwm = dao.situate_component_view(architectural_pattern_name,
                                      environment_name)
     dao.close()
     resp_dict = {'message': 'Architectural Pattern successfully situated'}
     resp = make_response(json_serialize(resp_dict), httplib.OK)
     resp.contenttype = 'application/json'
     return resp
  def get(self, component):
    session_id = get_session_id(session, request)
    model_generator = get_model_generator()

    dao = ArchitecturalPatternDAO(session_id)
    dot_code = dao.get_component_asset_model(component)
    dao.close()

    if not isinstance(dot_code, str):
      raise ObjectNotFoundHTTPError('The model')

    resp = make_response(model_generator.generate(dot_code,renderer='dot'), OK)
    accept_header = request.headers.get('Accept', 'image/svg+xml')
    if accept_header.find('text/plain') > -1:
      resp.headers['Content-type'] = 'text/plain'
    else:
      resp.headers['Content-type'] = 'image/svg+xml'

    return resp
Beispiel #9
0
    def get(self, ap_name):
        session_id = get_session_id(session, request)
        model_generator = get_model_generator()

        dao = ArchitecturalPatternDAO(session_id)
        dot_code = dao.get_component_model(ap_name)
        dao.close()

        if not isinstance(dot_code, str):
            raise ObjectNotFoundHTTPError('The model')

        resp = make_response(
            model_generator.generate(dot_code, renderer='dot'), httplib.OK)
        accept_header = request.headers.get('Accept', 'image/svg+xml')
        if accept_header.find('text/plain') > -1:
            resp.headers['Content-type'] = 'text/plain'
        else:
            resp.headers['Content-type'] = 'image/svg+xml'

        return resp
Beispiel #10
0
 def put(self, name):
     session_id = get_session_id(session, request)
     dao = ArchitecturalPatternDAO(session_id)
     upd_ap = dao.from_json(request)
     dao.update_architectural_pattern(upd_ap, name)
     dao.close()
     resp_dict = {'message': 'Architectural Pattern successfully updated'}
     resp = make_response(json_serialize(resp_dict), httplib.OK)
     resp.contenttype = 'application/json'
     return resp
Beispiel #11
0
 def post(self):
     session_id = get_session_id(session, request)
     dao = ArchitecturalPatternDAO(session_id)
     new_ap = dao.from_json(request)
     dao.add_architectural_pattern(new_ap)
     dao.close()
     resp_dict = {'message': 'Architectural Pattern successfully added'}
     resp = make_response(json_serialize(resp_dict), httplib.OK)
     resp.contenttype = 'application/json'
     return resp
 def put(self,name):
   session_id = get_session_id(session, request)
   dao = ArchitecturalPatternDAO(session_id)
   upd_ap = dao.from_json(request)
   dao.update_architectural_pattern(upd_ap,name)
   dao.close()
   resp_dict = {'message': 'Architectural Pattern successfully updated'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
 def post(self):
   session_id = get_session_id(session, request)
   dao = ArchitecturalPatternDAO(session_id)
   new_ap = dao.from_json(request)
   dao.add_architectural_pattern(new_ap)
   dao.close()
   resp_dict = {'message': 'Architectural Pattern successfully added'}
   resp = make_response(json_serialize(resp_dict), OK)
   resp.contenttype = 'application/json'
   return resp
Beispiel #14
0
    def delete(self, name):
        session_id = get_session_id(session, request)
        dao = ArchitecturalPatternDAO(session_id)
        dao.delete_architectural_pattern(name)
        dao.close()

        resp_dict = {'message': 'Architectural Pattern successfully deleted'}
        resp = make_response(json_serialize(resp_dict), httplib.OK)
        resp.headers['Content-type'] = 'application/json'
        return resp