diff --git a/config/install/islandora.settings.yml b/config/install/islandora.settings.yml new file mode 100644 index 00000000..bafdcd17 --- /dev/null +++ b/config/install/islandora.settings.yml @@ -0,0 +1,2 @@ +broker_url: 'http://localhost:61613' +triplestore_index_queue: '/islandora/triplestore/index' diff --git a/islandora.links.menu.yml b/islandora.links.menu.yml index 4c4ed548..68f3f79b 100644 --- a/islandora.links.menu.yml +++ b/islandora.links.menu.yml @@ -1,11 +1,3 @@ -# Fedora resource menu items definition -entity.fedora_resource.collection: - title: 'Fedora resource list' - route_name: entity.fedora_resource.collection - description: 'List Fedora resource entities' - parent: system.admin_structure - weight: 100 - # Fedora resource type menu items definition entity.fedora_resource_type.collection: title: 'Fedora resource type list' @@ -14,3 +6,16 @@ entity.fedora_resource_type.collection: parent: system.admin_structure weight: 99 +# Menu list of Islandora configuration forms +system.admin_config_islandora: + title: Islandora + parent: system.admin_config + route_name: system.admin_config_islandora + weight: 100 + +# Core Islandora configuration form +system.islandora_settings: + title: 'Core Settings' + parent: system.admin_config_islandora + route_name: system.islandora_settings + description: 'Confgure core Islandora settings' diff --git a/islandora.links.task.yml b/islandora.links.task.yml index 547e0758..e3096748 100644 --- a/islandora.links.task.yml +++ b/islandora.links.task.yml @@ -14,3 +14,8 @@ entity.fedora_resource.delete_form: base_route: entity.fedora_resource.canonical title: Delete weight: 10 + +entity.fedora_resource.collection: + route_name: entity.fedora_resource.collection + base_route: system.admin_content + title: 'Fedora Resources' diff --git a/islandora.routing.yml b/islandora.routing.yml index a228fc34..a5e27da7 100644 --- a/islandora.routing.yml +++ b/islandora.routing.yml @@ -9,4 +9,22 @@ entity.fedora_resource_type.rdftest: options: parameters: node_preview: - type: 'node_preview' \ No newline at end of file + type: 'node_preview' + +# Menu list of Islandora configuration forms +system.admin_config_islandora: + path: '/admin/config/islandora' + defaults: + _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + _title: 'Islandora' + requirements: + _permission: 'access administration pages' + +# Core Islandora configuration form +system.islandora_settings: + path: '/admin/config/islandora/core' + defaults: + _form: '\Drupal\islandora\Form\IslandoraSettingsForm' + _title: 'Islandora Settings' + requirements: + _permission: 'administer site configuration' diff --git a/src/Entity/FedoraResource.php b/src/Entity/FedoraResource.php index 62b3ece7..0b2d93f8 100644 --- a/src/Entity/FedoraResource.php +++ b/src/Entity/FedoraResource.php @@ -59,7 +59,7 @@ use Drupal\user\UserInterface; * "add-form" = "/fedora_resource/add/{fedora_resource_type}", * "edit-form" = "/fedora_resource/{fedora_resource}/edit", * "delete-form" = "/fedora_resource/{fedora_resource}/delete", - * "collection" = "/admin/structure/fedora_resource", + * "collection" = "/admin/content/fedora_resource", * }, * bundle_entity_type = "fedora_resource_type", * field_ui_base_route = "entity.fedora_resource_type.edit_form" diff --git a/src/Form/IslandoraSettingsForm.php b/src/Form/IslandoraSettingsForm.php new file mode 100644 index 00000000..33f4e23f --- /dev/null +++ b/src/Form/IslandoraSettingsForm.php @@ -0,0 +1,72 @@ +config(self::CONFIG_NAME); + + $form[self::BROKER_URL] = array( + '#type' => 'textfield', + '#title' => $this->t('Broker URL'), + '#default_value' => $config->get(self::BROKER_URL), + ); + + $form[self::TRIPLESTORE_INDEX_QUEUE] = array( + '#type' => 'textfield', + '#title' => $this->t('Triplestore Index Queue'), + '#default_value' => $config->get(self::TRIPLESTORE_INDEX_QUEUE), + ); + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $config = \Drupal::service('config.factory')->getEditable(self::CONFIG_NAME); + + $config + ->set(self::BROKER_URL, $form_state->getValue(self::BROKER_URL)) + ->set(self::TRIPLESTORE_INDEX_QUEUE, $form_state->getValue(self::TRIPLESTORE_INDEX_QUEUE)) + ->save(); + + parent::submitForm($form, $form_state); + } +} +