About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:howtos:connecting_a_new_external_data_source

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
development:howtos:connecting_a_new_external_data_source [2023/03/27 19:23] – [9. Set Up Templates] demiankatzdevelopment:howtos:connecting_a_new_external_data_source [2023/06/19 18:21] (current) – [6. Create Controllers] demiankatz
Line 59: Line 59:
 In order to provide web access to your new code, you will need to create two new controllers in the module/VuFind/src/VuFind/Controller folder (or in an equivalent place in your local module): In order to provide web access to your new code, you will need to create two new controllers in the module/VuFind/src/VuFind/Controller folder (or in an equivalent place in your local module):
     - **Search Controller** - This should have a name like \VuFind\Controller\SampleController and should extend \VuFind\Controller\AbstractSearch.  This controller will handle displaying and processing search forms.  At a bare minimum, it should contain a constructor which sets the $this->searchClassId property to the appropriate value (i.e. 'Sample') and calls the parent constructor.  You can look at the \VuFind\Controller\AbstractSearch class for other available options.  You can also define controller actions if you wish, but this is not necessary -- by default, you will have Home, Results and Advanced actions inherited from the base class.     - **Search Controller** - This should have a name like \VuFind\Controller\SampleController and should extend \VuFind\Controller\AbstractSearch.  This controller will handle displaying and processing search forms.  At a bare minimum, it should contain a constructor which sets the $this->searchClassId property to the appropriate value (i.e. 'Sample') and calls the parent constructor.  You can look at the \VuFind\Controller\AbstractSearch class for other available options.  You can also define controller actions if you wish, but this is not necessary -- by default, you will have Home, Results and Advanced actions inherited from the base class.
-    - **Record Controller** - This should have a name like \VuFind\Controller\SamplerecordController and should extend \VuFind\Controller\AbstractRecord.  This controller will handle displaying records and performing record-related tasks (export, save, etc.).  At a bare minimum, it should contain a constructor which sets the $this->searchClassId property to the appropriate value (i.e. 'Sample') and calls the parent constructor.+    - **Record Controller** - This should have a name like \VuFind\Controller\SamplerecordController and should extend \VuFind\Controller\AbstractRecord.  This controller will handle displaying records and performing record-related tasks (export, save, etc.).  At a bare minimum, it should contain a constructor which sets the $this->sourceId property to the appropriate value (i.e. 'Sample') and calls the parent constructor.
  
 ====7. Register Controllers==== ====7. Register Controllers====
development/howtos/connecting_a_new_external_data_source.1679945031.txt.gz · Last modified: 2023/03/27 19:23 by demiankatz