Exemple #1
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
#
# inspirehep is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

from invenio_records_rest.serializers.response import search_responsify

from inspirehep.records.marshmallow.base import wrap_schema_class_with_metadata
from inspirehep.records.marshmallow.jobs import JobsPublicSchema
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import JSONSerializer

jobs_json = JSONSerializer(wrap_schema_class_with_metadata(JobsPublicSchema),
                           index_name="records-jobs")

jobs_json_response = record_responsify(jobs_json, "application/json")

jobs_json_response_search = search_responsify(jobs_json, "application/json")
Exemple #2
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
#
# inspirehep is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

from invenio_records_rest.serializers.response import search_responsify

from inspirehep.records.marshmallow.base import wrap_schema_class_with_metadata
from inspirehep.records.marshmallow.experiments import ExperimentsPublicSchema
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import JSONSerializer

experiments_json = JSONSerializer(
    wrap_schema_class_with_metadata(ExperimentsPublicSchema),
    index_name="records-experiments",
)

experiments_json_response = record_responsify(experiments_json,
                                              "application/json")

experiments_json_response_search = search_responsify(experiments_json,
                                                     "application/json")
Exemple #3
0
    [
        (
            lambda _: is_superuser_or_cataloger_logged_in(),
            wrap_schema_class_with_metadata(LiteratureAdminSchema),
        ),
        (None, wrap_schema_class_with_metadata(LiteraturePublicSchema)),
    ]
)

literature_json_response = record_responsify(literature_json, "application/json")
literature_json_response_search = search_responsify(
    literature_json_search, "application/json"
)

literature_detail = JSONSerializer(
    wrap_schema_class_with_metadata(LiteratureDetailSchema)
)
literature_list = JSONSerializerLiteratureSearch(
    LiteratureListWrappedSchema, index_name="records-hep"
)

literature_json_detail_response = record_responsify(
    literature_detail, "application/vnd+inspire.record.ui+json"
)
literature_json_list_response = search_responsify(
    literature_list, "application/vnd+inspire.record.ui+json"
)

# Literature Authors
literature_authors_json = JSONSerializer(
    wrap_schema_class_with_metadata(LiteratureAuthorsSchema)
Exemple #4
0
    InstitutionsListSchema,
)
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import ConditionalMultiSchemaJSONSerializer, JSONSerializer

institutions_json = ConditionalMultiSchemaJSONSerializer([
    (
        lambda _: is_superuser_or_cataloger_logged_in(),
        wrap_schema_class_with_metadata(InstitutionsAdminSchema),
    ),
    (None, wrap_schema_class_with_metadata(InstitutionsPublicSchema)),
])

institutions_json_response = record_responsify(institutions_json,
                                               "application/json")

institutions_json_response_search = search_responsify(institutions_json,
                                                      "application/json")

institutions_json_detail = JSONSerializer(
    wrap_schema_class_with_metadata(InstitutionsDetailSchema))
institutions_json_detail_response = record_responsify(
    institutions_json_detail, "application/vnd+inspire.record.ui+json")

institutions_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(InstitutionsListSchema),
    index_name="records-institutions",
)
institutions_json_list_response = search_responsify(
    institutions_json_list, "application/vnd+inspire.record.ui+json")
Exemple #5
0
# Literature
literature_json = ConditionalMultiSchemaJSONSerializer(
    [
        (
            lambda _: is_superuser_or_cataloger_logged_in(),
            wrap_schema_class_with_metadata(LiteratureAdminSchema),
        ),
        (None, wrap_schema_class_with_metadata(LiteraturePublicSchema)),
    ]
)

literature_json_response = record_responsify(literature_json, "application/json")
literature_json_response_search = search_responsify(literature_json, "application/json")

literature_detail = JSONSerializer(
    wrap_schema_class_with_metadata(LiteratureDetailSchema)
)
literature_list = JSONSerializer(LiteratureListWrappedSchema, index_name="records-hep")

literature_json_detail_response = record_responsify(
    literature_detail, "application/vnd+inspire.record.ui+json"
)
literature_json_list_response = search_responsify(
    literature_list, "application/vnd+inspire.record.ui+json"
)

# Literature Authors
literature_authors_json = JSONSerializer(
    wrap_schema_class_with_metadata(LiteratureAuthorsSchema)
)
from inspirehep.records.marshmallow.base import wrap_schema_class_with_metadata
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import ConditionalMultiSchemaJSONSerializer, JSONSerializer

authors_json = ConditionalMultiSchemaJSONSerializer([
    (
        lambda _: is_superuser_or_cataloger_logged_in(),
        wrap_schema_class_with_metadata(AuthorsAdminSchema),
    ),
    (None, wrap_schema_class_with_metadata(AuthorsPublicSchema)),
])
authors_json_response = record_responsify(authors_json, "application/json")
authors_json_response_search = search_responsify(authors_json,
                                                 "application/json")

authors_json_detail = JSONSerializer(
    wrap_schema_class_with_metadata(AuthorsDetailSchema))
authors_json_detail_response = record_responsify(
    authors_json_detail, "application/vnd+inspire.record.ui+json")

authors_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(AuthorsListSchema))
authors_json_list_response = search_responsify(
    authors_json_list, "application/vnd+inspire.record.ui+json")

authors_control_number_only_json = JSONSerializer(
    wrap_schema_class_with_metadata(AuthorsOnlyControlNumberSchema))
authors_control_number_only_json_response = record_responsify(
    authors_control_number_only_json,
    "application/vnd+inspire.record.control_number+json",
)
Exemple #7
0
    SeminarsListSchema,
)
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import ConditionalMultiSchemaJSONSerializer, JSONSerializer

seminars_json = ConditionalMultiSchemaJSONSerializer(
    [
        (
            lambda _: is_superuser_or_cataloger_logged_in(),
            wrap_schema_class_with_metadata(SeminarsAdminSchema),
        ),
        (None, wrap_schema_class_with_metadata(SeminarsPublicSchema)),
    ]
)
seminars_json_response = record_responsify(seminars_json, "application/json")
seminars_json_response_search = search_responsify(seminars_json, "application/json")

seminars_json_detail = JSONSerializer(
    wrap_schema_class_with_metadata(SeminarsDetailSchema)
)
seminars_json_detail_response = record_responsify(
    seminars_json_detail, "application/vnd+inspire.record.ui+json"
)

seminars_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(SeminarsListSchema), index_name="records-seminars"
)
seminars_json_list_response = search_responsify(
    seminars_json_list, "application/vnd+inspire.record.ui+json"
)
Exemple #8
0
    ExperimentsDetailSchema,
    ExperimentsListSchema,
)
from inspirehep.serializers import ConditionalMultiSchemaJSONSerializer, JSONSerializer

experiments_json = ConditionalMultiSchemaJSONSerializer([
    (
        lambda _: is_superuser_or_cataloger_logged_in(),
        wrap_schema_class_with_metadata(ExperimentsAdminSchema),
    ),
    (None, wrap_schema_class_with_metadata(ExperimentsPublicSchema)),
])

experiments_json_response = record_responsify(experiments_json,
                                              "application/json")

experiments_json_response_search = search_responsify(experiments_json,
                                                     "application/json")

experiments_json_detail = JSONSerializer(
    wrap_schema_class_with_metadata(ExperimentsDetailSchema))
experiments_json_detail_response = record_responsify(
    experiments_json_detail, "application/vnd+inspire.record.ui+json")

experiments_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(ExperimentsListSchema),
    index_name="records-experiments",
)
experiments_json_list_response = search_responsify(
    experiments_json_list, "application/vnd+inspire.record.ui+json")
#
# Copyright (C) 2019 CERN.
#
# inspirehep is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

from invenio_records_rest.serializers.response import search_responsify

from inspirehep.records.marshmallow.base import wrap_schema_class_with_metadata
from inspirehep.records.marshmallow.jobs import JobsPublicSchema
from inspirehep.records.marshmallow.jobs.ui import JobsDetailSchema, JobsListSchema
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import JSONSerializer

jobs_json = JSONSerializer(
    wrap_schema_class_with_metadata(JobsPublicSchema), index_name="records-jobs"
)

jobs_json_response = record_responsify(jobs_json, "application/json")

jobs_json_response_search = search_responsify(jobs_json, "application/json")

jobs_json_detail = JSONSerializer(wrap_schema_class_with_metadata(JobsDetailSchema))
jobs_json_detail_response = record_responsify(
    jobs_json_detail, "application/vnd+inspire.record.ui+json"
)
jobs_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(JobsListSchema), index_name="records-jobs"
)
jobs_json_list_response = search_responsify(
    jobs_json_list, "application/vnd+inspire.record.ui+json"
Exemple #10
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
#
# inspirehep is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

from invenio_records_rest.serializers.response import search_responsify

from inspirehep.records.marshmallow.base import wrap_schema_class_with_metadata
from inspirehep.records.marshmallow.institutions import InstitutionsPublicSchema
from inspirehep.records.serializers.response import record_responsify
from inspirehep.serializers import JSONSerializer

institutions_json = JSONSerializer(
    wrap_schema_class_with_metadata(InstitutionsPublicSchema),
    index_name="records-institutions",
)

institutions_json_response = record_responsify(institutions_json,
                                               "application/json")

institutions_json_response_search = search_responsify(institutions_json,
                                                      "application/json")
Exemple #11
0
conferences_json = ConditionalMultiSchemaJSONSerializer([
    (
        lambda _: is_superuser_or_cataloger_logged_in(),
        wrap_schema_class_with_metadata(ConferencesAdminSchema),
    ),
    (None, wrap_schema_class_with_metadata(ConferencesPublicSchema)),
])
conferences_json_search = ConditionalMultiSchemaJSONSerializer([
    (
        lambda _: is_superuser_or_cataloger_logged_in(),
        wrap_schema_class_with_metadata(ConferencesAdminSchema),
    ),
    (None, wrap_schema_class_with_metadata(ConferencesPublicListSchema)),
])
conferences_json_response = record_responsify(conferences_json,
                                              "application/json")
conferences_json_response_search = search_responsify(conferences_json_search,
                                                     "application/json")

conferences_json_detail = JSONSerializer(
    wrap_schema_class_with_metadata(ConferencesDetailSchema))
conferences_json_detail_response = record_responsify(
    conferences_json_detail, "application/vnd+inspire.record.ui+json")

conferences_json_list = JSONSerializer(
    wrap_schema_class_with_metadata(ConferencesListSchema),
    index_name="records-conferences",
)
conferences_json_list_response = search_responsify(
    conferences_json_list, "application/vnd+inspire.record.ui+json")