Example #1
0
def record_bp(app):
    """Callable record blueprint (we need an application context)."""
    with app.app_context():
        return BibliographicRecordResource(
            config=BibliographicRecordResourceConfig(),
            service=BibliographicRecordService(
                config=BibliographicRecordServiceConfig()
            )
        ).as_blueprint("bibliographic_record_resource")
Example #2
0
def app(app):
    """app fixture."""
    RecordIdProviderV2.default_status_with_obj = PIDStatus.RESERVED

    record_draft_service = BibliographicRecordService()
    record_bp = BibliographicRecordResource(
        service=record_draft_service
    ).as_blueprint("bibliographic_record_resource")
    draft_bp = BibliographicDraftResource(
        service=record_draft_service
    ).as_blueprint("bibliographic_draft_resource")
    draft_action_bp = BibliographicDraftActionResource(
        service=record_draft_service
    ).as_blueprint("bibliographic_draft_action_resource")

    app.register_blueprint(record_bp)
    app.register_blueprint(draft_bp)
    app.register_blueprint(draft_action_bp)
    return app
Example #3
0
        }
    }
    searchbar_config = dict(searchUrl='/search')

    initial_record = dump_empty(MetadataSchemaV1)
    initial_record.update(record)
    return render_template(current_app.config['DEPOSITS_FORMS_BASE_TEMPLATE'],
                           forms_config=forms_config,
                           record=initial_record,
                           searchbar_config=searchbar_config)


@blueprint.route('/deposits')
def deposits_user():
    """List of user deposits page."""
    return render_template(current_app.config['DEPOSITS_UPLOADS_TEMPLATE'],
                           searchbar_config=dict(searchUrl='/search'))


# New implementation
RecordIdProviderV2.default_status_with_obj = PIDStatus.NEW

record_draft_service = BibliographicRecordDraftService()
record_bp = BibliographicRecordResource(
    service=record_draft_service).as_blueprint("bibliographic_record_resource")
draft_bp = BibliographicDraftResource(
    service=record_draft_service).as_blueprint("bibliographic_draft_resource")
draft_action_bp = BibliographicDraftActionResource(
    service=record_draft_service).as_blueprint(
        "bibliographic_draft_action_resource")