Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-106b:API builder/controller re-roll for 1.4.0 #394

Merged
merged 45 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
86901b1
First public pass on Open API builder
DiegoPino Jun 3, 2022
77787bf
This fixes Entity Autocomplete UUID to allow Entity/UUID(string) inpu…
DiegoPino Jun 3, 2022
5ff9bcf
Ups. Wrong ISSUE!
DiegoPino Jun 3, 2022
0c9e6ed
And again, these ones go into #203
DiegoPino Jun 3, 2022
623b818
Merge remote-tracking branch 'origin/1.0.0' into ISSUE-106
DiegoPino Jul 15, 2022
c36d942
Small cleanups on entity list and API controller
DiegoPino Jul 18, 2022
2ddcdd5
Fix requirement for API routing
DiegoPino Jul 21, 2022
9ec9e13
Fix comment
DiegoPino Jul 21, 2022
6a683ee
Allow the MetadataDisplaySelection autocomplete to use a filter
DiegoPino Jul 21, 2022
534cbf7
Display the whole openAPI structure instead of a silly url
DiegoPino Jul 21, 2022
68b2f90
Small cleanups on the form
DiegoPino Jul 21, 2022
3209838
WIP. Doing some fancy mime type/response checking
DiegoPino Jul 21, 2022
479f982
Fix Ajax and add multi view UI. Never set IDs manually for Submit but…
DiegoPino Sep 29, 2022
8c5b87f
First pass on a Metadata Display (so far exposed) Search Controller
DiegoPino Oct 23, 2022
bae7814
Fix for wrong default for the embargo key #226
DiegoPino Oct 23, 2022
a3df3f8
WIP API on API Controller/settings.
DiegoPino Nov 1, 2022
33e19e1
First pass on Usage tab for Metadata Display Tabs
DiegoPino Dec 7, 2023
ad05f1d
Merge branch '1.3.0' into ISSUE-106
DiegoPino Dec 10, 2023
59b3fc0
Merge remote-tracking branch 'origin/ISSUE-106' into ISSUE-385
DiegoPino Dec 10, 2023
cb67fe3
Add required OpenAPI dependencies
DiegoPino Dec 12, 2023
71811ae
Remove Usage for now
DiegoPino Dec 12, 2023
a5d472b
Update MetadataAPIConfigEntity to extend generic ConfigEntityInterface
DiegoPino Dec 12, 2023
b89ef4e
Better handling of options for displays/views
DiegoPino Dec 12, 2023
dcf9dd0
Full refactor of the Controller. More to come
DiegoPino Dec 12, 2023
91b69d8
Rolling back the access check for OAI-PMH
DiegoPino Dec 18, 2023
094be1b
API Controller improvements. Not yet there, but much better.
DiegoPino Dec 18, 2023
8c59e02
Merge branch '1.4.0' into ISSUE-106b
DiegoPino Mar 7, 2024
37f395c
Update composer.json
DiegoPino Mar 7, 2024
5a743cb
Bit of cleanup and error logging
DiegoPino Mar 7, 2024
e42571a
Expose the pager. Also comment that i need to pass more data to the t…
DiegoPino Mar 7, 2024
0428c8a
Give it a name bc too much machinable stuff
DiegoPino Mar 7, 2024
84968e2
Stupid views handler. Ok, now we can actually page entity_references
DiegoPino Mar 7, 2024
07498bd
Ok. working pager!
DiegoPino Mar 7, 2024
99ea357
Don't depend on the pager
DiegoPino Mar 8, 2024
028707d
Fix enum add commas again when loading for edit
DiegoPino Mar 8, 2024
5ff62ee
fix being silly
DiegoPino Mar 8, 2024
2faeed6
Fix form/listing exceptions when saving without any arguments (yet)
DiegoPino Mar 8, 2024
4bc74a6
More form improvements
DiegoPino Mar 8, 2024
f0da27b
make new parameters and saved one's structure consistent
DiegoPino Mar 8, 2024
3489ec4
Exposes cache option
DiegoPino Mar 11, 2024
fd75f11
remove header and cookie from data_api twig context
DiegoPino Mar 11, 2024
6d9698f
Caching works now. Tested with logged in an anonymous
DiegoPino Mar 11, 2024
b5687dc
You can rename arguments
DiegoPino Mar 11, 2024
ca44a6a
Allows renaming of api arguments/parameters
DiegoPino Mar 11, 2024
9c044f6
Scrolls up when needed
DiegoPino Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"drupal/webform": "^6.1.5",
"drupal/jquery_ui_slider":"^2.0",
"drupal/jquery_ui_effects":"^2.0",
"cebe/php-openapi":"^1",
"league/openapi-psr7-validator": "^0.2",
"ext-json": "*",
"seboettg/citeproc-php": "dev-master"
},
Expand Down
29 changes: 29 additions & 0 deletions format_strawberryfield.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ use Drupal\Core\Database\Database;
/**
* Install Entity and add 'mime type' field to 'metadata display' entities.
*/

/**
* Implements hook_install().
*/

function format_strawberryfield_install() {
}


function format_strawberryfield_update_8001() {

$schema = Database::getConnection()->schema();
Expand Down Expand Up @@ -214,6 +223,7 @@ function format_strawberryfield_update_8702() {
$message = "All Metadata Display Entities in Configurations updated to use UUIDs";
return $message;
}

/**
* Implements hook_update_N().
*
Expand Down Expand Up @@ -333,3 +343,22 @@ function format_strawberryfield_update_8704() {
return $message;
}

/**
* Implements hook_update_N().
*
* Installs metadataapi_entity config entity for dynamic APIs.
*
*/
function format_strawberryfield_update_9001() {
$schema = Database::getConnection()->schema();
if (!$schema->tableExists('metadataapi_entity')) {
\Drupal::entityTypeManager()->clearCachedDefinitions();
\Drupal::entityDefinitionUpdateManager()
->installEntityType(
\Drupal::entityTypeManager()->getDefinition('metadataapi_entity')
);
}
else {
return 'Metadata API Configuration Entity already exists';
}
}
7 changes: 6 additions & 1 deletion format_strawberryfield.links.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ entity.metadataexpose_entity.add_form:
route_name: 'entity.metadataexpose_entity.add_form'
title: 'Add Exposed Metadata Endpoint'
appears_on:
- entity.metadataexpose_entity.collection
- entity.metadataexpose_entity.collection
entity.metadataapi_entity.add_form:
route_name: 'entity.metadataapi_entity.add_form'
title: 'Add Metadata API'
appears_on:
- entity.metadataapi_entity.collection
8 changes: 8 additions & 0 deletions format_strawberryfield.links.menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ entity.metadataexpose_entity.collection:
description: 'Configure what Metadata will be exposed as direct access URIs on each Digital Object via Metadata Display Entities (Twig).'
parent: strawberryfield.group.admin
weight: 100

#Adds to Archipelago API Metadata Config
entity.metadataapi_entity.collection:
title: 'Configure Metadata APIs'
route_name: entity.metadataapi_entity.collection
description: 'Configure Metadata APIs based on Drupal Views, Metadata Display Entities (Twig) and custom options.'
parent: strawberryfield.group.admin
weight: 100
6 changes: 5 additions & 1 deletion format_strawberryfield.permissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ see strawberryfield embargoed ados:
title: 'See Embargoed object metadata and assets'
description: 'If an Object is embargoed this permission will allow any role with this assigned to bypass it.'
warning: 'This is not ACL. Enforced Embargo configured JSON keys will not act on Formatters if a user has this enabled.'
restrict access: TRUE
restrict access: TRUE
view strawberryfield api:
title: 'View/access Metadata APIs'
description: 'If Metadata APIs are accessible.'
restrict access: TRUE
16 changes: 14 additions & 2 deletions format_strawberryfield.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ entity.metadatadisplay_entity.usage_form:
type: 'entity:metadatadisplay_entity'
_admin_route: TRUE


# Metadatadisplay settings route

format_strawberryfield.metadatadisplay_settings:
Expand Down Expand Up @@ -126,7 +125,6 @@ format_strawberryfield.metadatadisplay_caster:
requirements:
format: .+
_entity_access: 'node.view'
# _entity_access: 'metadataexpose_entity.view'

format_strawberryfield.iiif_admin_settings_form:
path: '/admin/config/archipelago/iiif'
Expand Down Expand Up @@ -365,3 +363,17 @@ format_strawberryfield.iiif_content_search_exposed:
requirements:
page: \d+
_entity_access: 'node.view'

# Direct access to Metadata display / Views processed API using Metadata API Config Entity.
format_strawberryfield.metadataapi_caster_base:
path: '/ap/api/{metadataapiconfig_entity}/{patharg}'
methods: [GET, POST, HEAD]
defaults:
_controller: '\Drupal\format_strawberryfield\Controller\MetadataAPIController::castViaView'
patharg: 'v1'
options:
parameters:
metadataapiconfig_entity:
type: 'entity:metadataapi_entity'
requirements:
_permission: 'view strawberryfield api'
Loading