[Blacklight-development] Engines?

Matt Mitchell goodieboy at gmail.com
Mon Mar 24 15:34:55 EDT 2008


Hi Jamie!

I thought about using Engines. I want to look into that as soon as I get
some more time. But the current Blacklight works in an "Engines" kind of
way. Blacklight and Flare are implemented as plugins actually, you won't see
it in the plugins directory though, because it's brought in by
svn:externals.

The basic application hierarchy is:

uva-blacklight < blacklight < flare

- Flare provides the basic Rails UI and querying building for Solr
- Blacklight uses Flare and contains additional "library" code
- uva-blacklight uses all of the above, but customizes some of the
views/helpers to look fancy. uva-blacklight is also the real Rails
application.

The details...

Flare is a plugin, but it also has the basic app files; controllers, views,
helpers. Flare is "booted" in your application's environment.rb file, within
the config.initialize block. It's during this "boot" process that Flare is
able to add it's load and view paths to the current Rails configuration.
After that happens, the usual init.rb file is loaded by the Rails plugin
framework. So you can install Flare, and have an app up and running in no
time. As soon as you want to override something, you can simply re-create
the parallel file in your application's "app" directory.

The Blacklight plugin is similar. It's a plugin, but it also has app files
that can be "masked" by parallel files in your "app" directory; it's booted
like Flare. The Blacklight plugin uses Flare as a plugin. And because of
that, it's strikingly similar, but it contains additional "library" domain
code (MARC, Z3950 etc.). Flare is linked in to Blacklight via svn:externals.
The Blacklight plugin can mask the Flare files, and the app that uses the
Blacklight plugin (UVa's implementation for example) can mask Blacklights
files.

The Blacklight plugin is a work in progress... as soon as the UVa
implementation solves a particular problem, I try to abstract it into
something more generally useful and then put it into the Blacklight plugin's
lib directory. For example, last week I created a module that loads book
covers from multiple sources (Syndetics, Google and Amazon). I plan on
putting that into Blacklight sometime this week. There will also be more
Z3950 code coming.

The UVa Blacklight uses svn:externals on both Flare and Blacklight.

I'd love to look at Engines again sometime. The main reason I didn't go with
Engines is because I wanted to avoid anything with too much "magic". I think
Engines will automatically mixin code (controllers, models helpers) and some
of that freaks me a bit. But who knows, it could be a very useful thing for
us.

The source for the plugins is here:

http://blacklight.rubyforge.org/svn/rails-plugins/

For a basic usage of Flare and Blacklight, see:

http://blacklight.rubyforge.org/svn/demos/
- you won't see anything in the plugins directory until you do a checkout
- have a look at the config/environment.rb files to see how the booting
works

I'd love to hear your thoughts, concerns and/or ideas.

Matt

On Mon, Mar 24, 2008 at 2:05 PM, Jamie Orchard-Hays <jamie at dang.com> wrote:

> I'm curious if BL is going to use rails Engines plugin or if that idea
> was abandoned. I see there are no plugins in the source code right now.
>
> Jamie
> _______________________________________________
> Blacklight-development mailing list
> Blacklight-development at rubyforge.org
> http://rubyforge.org/mailman/listinfo/blacklight-development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/blacklight-development/attachments/20080324/88dc90d3/attachment.html 


More information about the Blacklight-development mailing list