def getDocTramite(request, data, LimitInfI): if (data == '0-00-0000/0-00-0000'): data_1 = datetime.datetime.now() end_date = data_1 + datetime.timedelta(days=7) data = str(data_1.strftime('%d-%m-%Y')) + '/' + str( end_date.strftime('%d-%m-%Y')) x = SILPCache('cache') endereco = server.ServerEndereco(request) IdLegislatura = views.getIdlegislatura(request) XMLdata = x.getContent( endereco + 'groupsittings/' + LimitInfI + '/4/' + str(IdLegislatura) + '/' + data, 0) #TotalDoc = tramites.getTotalDocumentTramite(data) TotalDoc = getTotalDocumentTramite(request, data) dados = xml.etree.ElementTree.fromstring(XMLdata) total = xml.etree.ElementTree.SubElement(dados, 'TotalDoc') total.text = str(TotalDoc) xml.etree.ElementTree.dump(dados) return HttpResponse(xml.etree.ElementTree.tostring(dados), content_type='text/xml')
def getDocLeiModal(request, IdDocLei): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'documenthistory/1/100/' + IdDocLei, 0) JsonWokflows = views.dicionaryWorkflow(request) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLmenusMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) response_feed = views.getFeed( request) #obtém dados de feed proveniente de http://asemana.sapo.cv context = { 'documenthistory': XMLdata, 'workflow': JsonWokflows, 'DocId': IdDocLei, 'committes': XMLdataY, 'ministeries': XMLmenusMinisterio, 'grupoPolitico': XMLGroupPolitico, 'feed': str(response_feed.content, encoding='utf-8') } #return render_to_response('docLeiModal.html', context, context_instance=RequestContext(request)) return render(request, 'app/docLeiModal.html', context)
def DeputadoList(request, LimitInf, LimitSup): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco+'getmembers/'+LimitInf+'/'+LimitSup+'',4) x.getImage(XMLdata) return HttpResponse(XMLdata)
def getIniciativa(request, IDMember): x = SILPCache('cache') endereco = server.ServerEndereco(request) IDLegislatura = views.getCourentLegislature(request) XMLdata = x.getContent( endereco + 'getdocsfromuser/1/10/' + str(IDLegislatura) + '/' + IDMember, 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLmenusMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) #TotalIniciativa = tramites.getTotalIniciativa(request, IDLegislatura, IDMember) TotalIniciativa = getTotalIniciativa(request, IDLegislatura, IDMember) context = { 'IDMember': IDMember, 'IDLegislatura': IDLegislatura, 'TotalIniciativa': TotalIniciativa, 'XMLdata': XMLdata, 'feed': '', 'committes': XMLdataY, 'ministeries': XMLmenusMinisterio, 'grupoPolitico': XMLGroupPolitico } #return render_to_response('Iniciativas.html',context, context_instance=RequestContext(request)) return render(request, 'app/Iniciativas.html', context)
def getMember(request, IDMember): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getmembergov/' + IDMember, 4) x.getImage(XMLdata) context = XMLdata return HttpResponse(context)
def getResultadoPesquisaAvancada( request, endpoint, parametros ): #parametros contém valores referente a documento, todo documento e interveniente x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + endpoint + '/1/100/' + parametros, 0) return HttpResponse(XMLdata)
def getTramiteList(request, LimitInf, LimitSup, IdTramite): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent( endereco + 'getdocsbytype/' + LimitInf + '/' + LimitSup + '/' + IdTramite, 0) return HttpResponse(XMLdata)
def getMemberSearch(request, LimitInf, LimitSup, Name, partido): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco+'getmembersearch/'+LimitInf+'/4/'+Name+'/'+partido,4) x.getImage(XMLdata) context = XMLdata return HttpResponse(context)
def getAllTramiteList(request, LimitInf, NumberElements, IDLegislatura, IDMember): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent( endereco + 'getdocsfromuser/' + LimitInf + '/' + NumberElements + '/' + IDLegislatura + '/' + IDMember, 0) return HttpResponse(XMLdata)
def MemberGroupList(request, LimitInfI, NumberElements, IdGroup): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent( endereco + 'getpoliticalgroupmembers/' + LimitInfI + '/' + NumberElements + '/' + IdGroup, 0) x.getImage(XMLdata) return HttpResponse(XMLdata)
def CommittesMemberList(request, LimitInfI, LimitSup, IdCommittes): x = SILPCache('cache') endereco = server.ServerEndereco('') XMLdata = x.getContent( endereco + 'getcommitteemembers/' + LimitInfI + '/' + LimitSup + '/' + IdCommittes, 0) x.getImage(XMLdata) return HttpResponse(XMLdata)
def getDocAssociados(request, IDDocumento, status): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getdocsannex/1/100/' + IDDocumento, 0) status = int(status) if status == 0: return HttpResponse(XMLdata) else: context = {'XMLdata': XMLdata} #return render_to_response('DocAssociado.html',context, context_instance=RequestContext(request)) return render(request, 'app/DocAssociado.html', context)
def getDocInterpelacoes(request, IdDocInterpelacoes): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent( endereco + 'documenthistory/1/100/' + IdDocInterpelacoes, 4) jsonWorkflow = views.dicionaryWorkflow(request) context = { 'documenthistory': XMLdata, 'workflow': jsonWorkflow, 'DocId': IdDocInterpelacoes } #return render_to_response('docInterpelacoes.html', context, context_instance=RequestContext(request)) return render(request, 'app/docInterpelacoes.html', context)
def getLeis(request, IdLei): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getdocsbytype/1/4/' + str(IdLei), 0) #TotalLeis = tramites.getTotalTramites(request, IdLei) TotalLeis = getTotalTramites(request, IdLei) jsonWorkflow = views.dicionaryWorkflow(request) context = { 'feed': XMLdata, 'TotalLeis': TotalLeis, 'workflow': jsonWorkflow } #return render_to_response('leis.html',context, context_instance=RequestContext(request)) return render(request, 'app/leis.html', context)
def getMembers(request): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco+'getmembers/1/9',4) x.getImage(XMLdata) response_feed = views.getFeed(request) XMLdataY = menus.getCommittesMenu(request) XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) totalMember = getTotalNumberMember(request, 0) Partidos = views.getAllParty(request) context = {'partido': Partidos, 'lista': XMLdata, 'feed': str(response_feed.content, encoding='utf-8'),'committes': XMLdataY, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico, 'TotalMember': totalMember} #return render_to_response('members.html', context, context_instance=RequestContext(self)) return render(request,'app/members.html', context)
def getInquerito(request): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getdocsbytype/1/4/' + str(5), 0) #Totalpeticoes = tramites.getTotalTramites(request, str(5)) Totalpeticoes = getTotalTramites(request, str(5)) jsonWorkflow = views.dicionaryWorkflow(request) context = { 'feed': XMLdata, 'Totalpeticoes': Totalpeticoes, 'workflow': jsonWorkflow } #return render_to_response('inquerito_parlamentar.html',context, context_instance=RequestContext(request)) return render(request, 'app/inquerito_parlamentar.html', context)
def getCalendar(request): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getscheduleditems/1/100', 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) context = { 'agendamentos': XMLdata, 'committes': XMLdataY, 'committes': XMLdataY, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico } #return render_to_response('calendar.html', context, context_instance=RequestContext(self)) return render(request, 'app/calendar.html', context)
def getMinisteries(request, IdMinisterio): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getministers/1/4/' + IdMinisterio, 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) context = { 'MinistersMembers': XMLdata, 'feed': '', 'committes': XMLdataY, 'idMinisterio': IdMinisterio, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico } #return render_to_response('Ministeries.html', context, context_instance=RequestContext(self)) return render(request, 'app/Ministeries.html', context)
def getListGP(request): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getpoliticalgroups/1/100', 4) XMLdataY = menus.getCommittesMenu( request) #obtem dados do servi�o getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) response_feed = views.getFeed( request) #obt�m dados de feed proveniente de http://asemana.sapo.cv context = { 'lista': XMLdata, 'feed': str(response_feed.content, encoding='utf-8'), 'committes': XMLdataY, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico } #return render_to_response('grupos_politicos.html', context, context_instance=RequestContext(self)) return render(request, 'app/grupos_politicos.html', context)
def getTramitesDocumento(request, datas, LimitInfI): if datas == '0-00-0000/0-00-0000': data_1 = datetime.datetime.now() end_date = data_1 + datetime.timedelta(days=7) datas = str(data_1.strftime('%d-%m-%Y')) + '/' + str( end_date.strftime('%d-%m-%Y')) x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent( endereco + 'getscheduleditems/' + LimitInfI + '/4/' + datas, 0) #TotalDoc = tramites.getTotalDocumentTramite(datas) TotalDoc = getTotalDocumentTramite(request, datas) dados = xml.etree.ElementTree.fromstring(XMLdata) total = xml.etree.ElementTree.SubElement(dados, 'TotalDoc') total.text = str(TotalDoc) return HttpResponse(xml.etree.ElementTree.tostring(dados), content_type='text/xml')
def getTramites(request): data_1 = datetime.datetime.now() end_date = data_1 + datetime.timedelta(days=7) datas = str(data_1.strftime('%d-%m-%Y')) + '/' + str( end_date.strftime('%d-%m-%Y')) x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getscheduleditems/1/4/' + datas, 0) response_feed = views.getFeed(request) #TotalDoc = tramites.getTotalDocumentTramite('') TotalDoc = getTotalDocumentTramite(request, '') JsonWokflows = views.dicionaryWorkflowDocument(request) context = { 'DocProgramado': XMLdata, 'feed': str(response_feed.content, encoding='utf-8'), 'TotalDoc': TotalDoc, 'workflow': JsonWokflows } #return render_to_response('tramite.html',context, context_instance=RequestContext(request)) return render(request, 'app/tramite.html', context)
def getHome(request): x = SILPCache('C:/tmp/cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getactivelegislature/1/1', 4) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) response_feed = views.getFeed( request) #obtém dados de feed proveniente de http://asemana.sapo.cv JsonWokflows = views.dicionaryWorkflowDocument(request) context = { 'legislatura': XMLdata, 'feed': str(response_feed.content, encoding='utf-8'), 'committes': XMLdataY, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico, 'workflow': JsonWokflows } #return render_to_response('home.html', context, context_instance=RequestContext(self)) return render(request, 'app/home.html', context)
def getGrupoPolitico(request, IdGpolitico): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLGroup = x.getContent(endereco + 'getgroup/' + IdGpolitico, 0) XMLdata = x.getContent( endereco + 'getpoliticalgroupmembers/1/9/' + IdGpolitico, 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do servi�o getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) TotalMember = getTotalNumberMember(request, IdGpolitico) context = { 'Group': XMLGroup, 'GrupoPoliticoMember': XMLdata, 'feed': '', 'committes': XMLdataY, 'idGrup': IdGpolitico, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico, 'TotalMembers': TotalMember } #return render_to_response('GrupoPolitico.html', context, context_instance=RequestContext(self)) return render(request, 'app/GrupoPolitico.html', context)
def getCommittesMembers(request, IdCommittes): x = SILPCache('cache') endereco = server.ServerEndereco('') XMLCommitte = x.getContent(endereco + 'getgroup/' + IdCommittes, 0) XMLdata = x.getContent(endereco + 'getcommitteemembers/1/9/' + IdCommittes, 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do servi�o getcommittes XMLMenuMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) TotalCountMember = getTotalNumberMemberCommittes(request, IdCommittes) context = { 'Committee': XMLCommitte, 'CommittesMembers': XMLdata, 'feed': '', 'committes': XMLdataY, 'idComicao': IdCommittes, 'ministeries': XMLMenuMinisterio, 'grupoPolitico': XMLGroupPolitico, 'TotalCountMember': TotalCountMember } #return render_to_response('CommittesMembers.html', context, context_instance=RequestContext(self)) return render(request, 'app/CommittesMembers.html', context)
def getDocIniciativas(request, IdDocPeticao): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'documenthistory/1/100/' + IdDocPeticao, 0) XMLdataY = menus.getCommittesMenu( request) #obtem dados do serviço getcommittes XMLmenusMinisterio = menus.getMinisteriesMenu(request) XMLGroupPolitico = menus.getGruposMenu(request) jsonWorkflow = views.dicionaryWorkflow(request) context = { 'documenthistory': XMLdata, 'workflow': jsonWorkflow, 'committes': XMLdataY, 'ministeries': XMLmenusMinisterio, 'grupoPolitico': XMLGroupPolitico, 'DocId': IdDocPeticao } #return render_to_response('docIniciativa.html', context, context_instance=RequestContext(request)) return render(request, 'app/docIniciativa.html', context)
def getCommittesMenu(request): y = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdataY = y.getContent(endereco + 'getcommittes/1/100', 0) return XMLdataY
def getGruposMenu(request): y = SILPCache('cache') endereco = server.ServerEndereco(request) XMLGroup = y.getContent(endereco + 'getpoliticalgroups/1/100', 4) return XMLGroup
def getCourentLegislature(request): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = requests.get(endereco + 'getactivelegislature/1/1') result = XMLdata.json() return result[0]['group_id']
def getListLeis(request, IdLei): x = SILPCache('cache') endereco = server.ServerEndereco(request) XMLdata = x.getContent(endereco + 'getdocsbytype/1/4/' + str(IdLei), 0) return HttpResponse(XMLdata)