Implement importer engine

This commit is contained in:
Alejandro Avilés 2014-10-29 17:20:41 +01:00
parent e6c6da20f6
commit 6ee4bc0b3a

View File

@ -12,13 +12,23 @@
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico;if not, see <http://www.gnu.org/licenses/>.
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
from flask_pluginengine import current_plugin
from indico_importer import ImporterEngineBase
from .connector import InvenioConnector
from .converters import InvenioRecordConverter
class InvenioImporter(ImporterEngineBase):
"""Fetches and converts data from CDS Invenio"""
_id = 'invenio'
name = 'CDS Invenio'
def import_data(self, query, size):
url = current_plugin.settings.get('server_url')
registers = InvenioConnector(url).search(p=query, rg=size)
return InvenioRecordConverter.convert(registers)