-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc3efa3
commit d63a7e6
Showing
13 changed files
with
339 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Tour of the application code | ||
|
||
In general, the MED is a "normal" Blacklight (v5) application, with a lot | ||
of added stuff. | ||
|
||
Like most Blacklight apps, the heart of the configuration is | ||
in the [Catalog Controller](../app/controllers/catalog_controller.rb), | ||
specifying the search and facet fields. This is repeated for the | ||
other controllers, and they're fairly straightforward so long as | ||
you're willing to take on faith that Rails will find things at the | ||
right time. | ||
|
||
|
||
## Models | ||
The files in [models](../app/models) are unusual for a Rails app in that we're not using | ||
a backing database, and thus not deriving them from ActiveRecord. | ||
The directly is empty of anything interesting. | ||
|
||
The _actual_ objects to represent each of the many, many layers of a dictionary | ||
entry are actually defined in the [middle_english_dictionary](https://github.com/mlibrary/middle_english_dictionary) | ||
repository. The nomenclature can be confusing, since it's derived from | ||
the jargon of the field, but none of the objects are particularly complex. | ||
|
||
## Presenters | ||
|
||
The meat of the interface is actually built into the presenters. | ||
[quotes presenter](../app/presenters/quotes/index_presenter.rb) | ||
is indicative of the setup, pulling in lots of XSLT and getting values | ||
out of the document with XSLT transforms or by querying the | ||
`Nokogiri::XML` document directly. | ||
|
||
## lib/med_installer | ||
|
||
...is all indexing code, and isn't used in the rest of the application. See | ||
[indexing.md](indexing.md) for a brief overview. | ||
|
||
## /solr | ||
|
||
...has all the solr configuration in it, as well as the | ||
[Dockerfile](../solr/Dockerfile) and the [container initialization](../solr/container/solr_init.sh) | ||
code. See [solr.md](solr.md) for more. | ||
|
||
## Everything else | ||
|
||
...is basically just normal views and utility objects | ||
(most importantly the [services.rb](../lib/dromedary/services.rb) file). | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Configuration | ||
|
||
Configuration of this application has...grown organically. Thus, lots | ||
of things are spread out over a few locations. | ||
|
||
## ./config | ||
|
||
**The normal rails `config` directory** has all the "normal" stuff | ||
in it, including the [`routes.rb`](../config/routes.rb) file which can be inspected to | ||
understand what things are exposed. | ||
|
||
Additions to the normal rails/blacklight stuff include: | ||
* [autocomplete.yml](../config/autocomplete.yml) configures the exposed | ||
names and the solr targets for each autocomplete field's `suggester` handler. | ||
* [autocomplete_overrid_code.rb](../config/initializers/autocomplete_override_code.rb), | ||
which provides extra code (via `module prepend`) to deal with the fact | ||
that we're running multiple suggesters. | ||
* [load_local_config.rb](../config/load_local_config.rb) had so much | ||
stripped away that it's now mostly utility code to reload the | ||
`hyp_to_bibid` data from the current solr and extract data from | ||
the name of the underlying collection. | ||
|
||
## Controllers | ||
|
||
The [CatalogController](../app/controllers/catalog_controller.rb) is the heart | ||
of any Blacklight application, specifying how to talk to solr, what fields to | ||
expose as searchable, etc. We have controllers for all the different aspects | ||
of the site (e.g., bibliography, quotes), so make sure you're looking at | ||
the right one. | ||
|
||
## Mystery Solr Configuration in the controllers | ||
|
||
The solr configuration in the controllers includes variables that look like | ||
`$everything_qf` where normally you'd have a list of fields. The decision was | ||
made to actually store this configuration in _solr_, so sending that | ||
magic reference will cause solr (on its end) to use the values defined in | ||
the XML up there. See ([headword_and_forms_search.xml](../solr/dromedary/conf/solrconfig_med/entry_searches/headword_and_forms_search.xml)) | ||
for a representative sample. | ||
|
||
|
||
## The Dromedary::Services object | ||
|
||
The [services object](../lib/dromedary/services.rb) is really the heart of | ||
all the configuration. Every effort has been made to push everything | ||
though it, as opposed to directly using ENV variables and such. | ||
|
||
Instead of just being a passthrough for the environment, though, the | ||
Services object also includes useful things derived from those | ||
variables, including things like a connection object for the | ||
configured solr. | ||
|
||
Essentially everything you need to understand how the application is | ||
influence "from the outside" (e.g., the argocd config) is in this file. | ||
|
||
## AnnoyingUtilities | ||
|
||
The [annoying_utilities.rb](../lib/annoying_utilities.rb) file once did | ||
all the little, annoying substitutions that were necessary to run the application | ||
on two relatively-different staging and production platforms. Now that | ||
it's all container-based, all of that code has been ripped out and | ||
replaced with thin wrappers around `Dromedary::Services`. Mentioned | ||
here because it's still in the code in some places and might be | ||
confusing. | ||
|
Oops, something went wrong.