Commit ab0a0fe6 authored by Matthias's avatar Matthias
Browse files

add current parameters

parent d969c92a
Pipeline #14203 passed with stages
in 6 minutes and 8 seconds
from flask_restful import Resource, reqparse, current_app
from flasgger import swag_from
import requests
import hashlib
class ImportProcessStart(Resource):
......@@ -18,33 +19,34 @@ class ImportProcessStart(Resource):
# add example parameters for missing ones (remove this block in production!)
if job_parameters is None:
job_parameters = {}
if 'appDirectory' not in job_parameters:
job_parameters['appDirectory'] = 'integration-test-record-set'
if 'drupalJobUuid' not in job_parameters:
job_parameters['drupalJobUuid'] = 'adf48fb4-16ba-40b2-a207-8ff9d5aac657'
if 'drupalJobLogResultUuid' not in job_parameters:
job_parameters['drupalJobLogResultUuid'] = 'eef31a5c-7f73-4cac-b811-8ba948aef453'
if 'xsltFileName' not in job_parameters:
job_parameters['xsltFileName'] = 'transform.xslt'
if 'recordTag' not in job_parameters:
job_parameters['recordTag'] = 'record'
if 'identifierFieldName' not in job_parameters:
job_parameters['identifierFieldName'] = 'identifierMain'
if 'configFileName' not in job_parameters:
job_parameters['configFileName'] = 'mapping.yml'
if 'hasLocalTransformConfig' not in job_parameters:
job_parameters['hasLocalTransformConfig'] = False
if 'recordSetId' not in job_parameters:
job_parameters['recordSetId'] = 'defaultvalue...'
if 'sessionId' not in job_parameters:
job_parameters['sessionId'] = 'drupal...'
if 'institutionId' not in job_parameters:
job_parameters['institutionId'] = 'defaultvalue...'
if 'xmlRecordTag' not in job_parameters:
job_parameters['xmlRecordTag'] = 'defaultvalue...'
if 'xmlIdentifierFieldName' not in job_parameters:
job_parameters['xmlIdentifierFieldName'] = 'defaultvalue...'
if 'isPublished' not in job_parameters:
job_parameters['isPublished'] = 'defaultvalue...'
# start text-file-validation
shortSessionId = hashlib.sha1(job_parameters['sessionId'].encode("UTF-8")).hexdigest()[:10]
body = {
'appDirectory': job_parameters['appDirectory'],
'drupalJobUuid': job_parameters['drupalJobUuid'],
'drupalJobLogResultUuid': job_parameters['drupalJobLogResultUuid'],
'xsltFileName': job_parameters['xsltFileName'],
'recordTag': job_parameters['recordTag'],
'identifierFieldName': job_parameters['identifierFieldName'],
'configFileName': job_parameters['configFileName'],
'hasLocalTransformConfig': job_parameters['hasLocalTransformConfig']
'recordSetId': job_parameters['recordSetId'],
'sessionId': job_parameters['sessionId'],
'shortSessionId': shortSessionId,
'institutionId': job_parameters['institutionId'],
'xmlIdentifierFieldName': job_parameters['xmlIdentifierFieldName'],
'isPublished': job_parameters['isPublished']
}
response = requests.post(current_app.config['import-api-url'] +
'/v1/job/' + institution_id + '/' +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment