mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-20 02:26:12 +00:00
Implement importer engine
This commit is contained in:
parent
e6c6da20f6
commit
6ee4bc0b3a
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user