You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intro:
I'm in the middle of implementing our institutional repository on top of invenio 3. For now I have two record types: Thesis (metadata about student thesis) and Attachment (for example fulltext, defence transcript, ... Each attachment has associated ACLs and potentially multiple files, such as original pdf and converted pdf/a). Thesis and n attachments are referenced via thesis id and for a couple of reasons I need to keep the two data types and not denormalize/merge them into one.
So far I've created two helper modules: acls providing generic mechanism for evaluating ACLs directly within elasticsearch queries and links defining LinkedObjectSerializerMixin(PreprocessorMixin) that in generic manner adds to thesis representation its associated attachments' metadata.
Problem:
What I'm facing is that I need to reference settings of REST endpoints - for example, when Attachments are searched for inside the mixin I would like to use the appropriate RecordsSearch - the same that is used for accessing Attachment through REST. So far I've ended up with code bloated with obj_or_import_string:
What about adding a dictionary current_records_rest.endpoints that would contain the configuration of endpoints that would be already resolved via the obj_or_import_string code that is now present at the beginning of create_url_rules ?
current_records_rest.endpoints[self.other_side_rest_endpoint].search_class
or
current_records_rest.endpoints[self.other_side_rest_endpoint]['search_class']
and would get the actual implementation of RecordsSearch.
If it makes sense I'm willing to create a pull request. Your opinions?
Thanks for all the work, so far I'm really happy with the ease of implementation and repository speed,
Mirek
The text was updated successfully, but these errors were encountered:
Hello folks,
Intro:
I'm in the middle of implementing our institutional repository on top of invenio 3. For now I have two record types: Thesis (metadata about student thesis) and Attachment (for example fulltext, defence transcript, ... Each attachment has associated ACLs and potentially multiple files, such as original pdf and converted pdf/a). Thesis and n attachments are referenced via thesis id and for a couple of reasons I need to keep the two data types and not denormalize/merge them into one.
So far I've created two helper modules: acls providing generic mechanism for evaluating ACLs directly within elasticsearch queries and links defining LinkedObjectSerializerMixin(PreprocessorMixin) that in generic manner adds to thesis representation its associated attachments' metadata.
Problem:
What I'm facing is that I need to reference settings of REST endpoints - for example, when Attachments are searched for inside the mixin I would like to use the appropriate RecordsSearch - the same that is used for accessing Attachment through REST. So far I've ended up with code bloated with obj_or_import_string:
Suggestion:
What about adding a dictionary
current_records_rest.endpoints
that would contain the configuration of endpoints that would be already resolved via the obj_or_import_string code that is now present at the beginning of create_url_rules ?invenio-records-rest/invenio_records_rest/views.py
Lines 237 to 298 in e3a33fc
Then my module would just call
and would get the actual implementation of RecordsSearch.
If it makes sense I'm willing to create a pull request. Your opinions?
Thanks for all the work, so far I'm really happy with the ease of implementation and repository speed,
Mirek
The text was updated successfully, but these errors were encountered: