Browse Source

Conserta bugs em verb Identify

pull/2582/head
Edward Ribeiro 6 years ago
parent
commit
05785958fe
  1. 4
      sapl/lexml/OAIServer.py
  2. 3
      sapl/lexml/views.py

4
sapl/lexml/OAIServer.py

@ -54,7 +54,7 @@ class OAIServer:
granularity='YYYY-MM-DDThh:mm:ssZ', granularity='YYYY-MM-DDThh:mm:ssZ',
compression=['identity'], compression=['identity'],
toolkit_description=False) toolkit_description=False)
if not self.config['descricao']: if self.config['descricao']:
result.add_description(self.config['descricao']) result.add_description(self.config['descricao'])
return result return result
@ -263,7 +263,7 @@ def get_config(url, batch_size):
'base_asset_path': None, 'base_asset_path': None,
'metadata_prefixes': ['oai_lexml']} 'metadata_prefixes': ['oai_lexml']}
config.update({'titulo': casa_legislativa().nome, # Inicializa variável global casa config.update({'titulo': casa_legislativa().nome, # Inicializa variável global casa
'email': casa.email, 'email': [casa.email], # lista de e-mails
'base_url': url[:url.find('/', 8)], 'base_url': url[:url.find('/', 8)],
'descricao': casa.informacao_geral, 'descricao': casa.informacao_geral,
'batch_size': batch_size}) 'batch_size': batch_size})

3
sapl/lexml/views.py

@ -12,7 +12,6 @@ LexmlPublicadorCrud = CrudAux.build(LexmlPublicador, 'lexml_publicador')
def lexml_request(request): def lexml_request(request):
config = get_config(request.get_raw_uri(), int(request.GET.get('batch_size', 10))) config = get_config(request.get_raw_uri(), int(request.GET.get('batch_size', 10)))
oai_server = OAIServerFactory(config) oai_server = OAIServerFactory(config)
r = oai_server.handleRequest({'verb': request.GET.get('verb', 'ListRecords'), r = oai_server.handleRequest(request.GET)
'metadataPrefix': request.GET.get('metadataPrefix', 'oai_lexml')})
response = r.decode('UTF-8') response = r.decode('UTF-8')
return HttpResponse(response, content_type='text/xml') return HttpResponse(response, content_type='text/xml')

Loading…
Cancel
Save