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), ); $form[self::FEDORA_REST_ENDPOINT] = array( '#type' => 'textfield', '#title' => $this->t('Fedora REST Endpoint'), '#description' => $this->t('The URL for your Fedora instance.'), '#default_value' => $config->get(self::FEDORA_REST_ENDPOINT), ); $form[self::FEDORA_INDEXING_QUEUE] = array( '#type' => 'textfield', '#title' => $this->t('Fedora Indexing Queue Name'), '#description' => $this->t('Name of the queue where Drupal will publish updates to have "indexed" to Fedora'), '#default_value' => $config->get(self::FEDORA_INDEXING_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)) ->set(self::FEDORA_REST_ENDPOINT, $form_state->getValue(self::FEDORA_REST_ENDPOINT)) ->set(self::FEDORA_INDEXING_QUEUE, $form_state->getValue(self::FEDORA_INDEXING_QUEUE)) ->save(); parent::submitForm($form, $form_state); } }