[katello-devel] Custom Values as more of a plugin model

jesus m. rodriguez jesusr at redhat.com
Wed Aug 8 14:26:12 UTC 2012


On 08/08/2012 05:45 AM, Ohad Levy wrote:
> On 08/07/2012 06:43 PM, Adam Price wrote:
>> ----- Original Message -----
>>> From: "Bryan Kearney" <bkearney at redhat.com>
>>> To: katello-devel at redhat.com, "Adam Price" <adprice at redhat.com>
>>> Sent: Tuesday, August 7, 2012 10:58:33 AM
>>> Subject: Custom Values as more of a plugin model
>>>
>>> Adam:
>>>
>>> Ohad was commenting that he is interested in a re-usable bit of ruby
>>> functionality (gem, engine, dunno) which would allow folks to to
>>> extend
>>> a rails app on site. It sounded like custom values may be in line
>>> with
>>> that idea. Perhaps you could hook up and see if it makes sense to
>>> combine the ideas?
>>
>> Ohad, what functionality are wanting to be re-usable? it sounds like you're wanting to make something that is modular enough to be detachable from any part of katello and then attached onto something else. That does sound in-line with custom value attaching to subscriptions, systems, or what ever else. I'm trying to think of how this would be done.
>>
>> With the custom values for a system, we were first thinking of having candlepin store the values, but if we'd like to do something more modular, then perhaps katello should retain the custom information and then inject it whenever an object with custom information is requested. Something along the lines of a decorator when we're grabbing data.
>>
>> thoughts? katello-devel, what say you?
>
> Ideally, it should be a collection of the following elements:
>
> 1. be able to add new MCV's
> 2. be able to extend attributes of existing MVC
> 3. be able to add more routes, db migrations, etc.
>
> all of the above is supported afaik using rails engine (might be better
> supported under rails 3.1, but thats another discussion), excluding
> option #2 for view.
>
> In order to allow users to extend the existing view, we would need to
> come up with UI hooks, where people could inject stuff (e.g. like
> additional tab, additional dropdown etc).
>
> I think that redmine has such a system and its worth exploring how they
> implemented that.
>
> Ohad
>

[snip]


In my past life (previous job) our web application had modules that we sold 
separately. When they were installed they would supply their own tabs to 
the main UI. While it wasn't a rails application, maybe the concepts can be 
reused. Effectively, we had the notion of a ScenarioContainer (each module 
was called a scenario), this container had an api that could be called by 
the different modules to 'register' themselves. The Container knew what 
tabs to turn on when the app started.

The modules themselves had their own ui (same look and feel, just different 
pages), own schema bits, and model objects. They used events to communicate 
from one to another where integration was needed or used formvars to pass 
information from one page to another. Most of the applications had clearly 
defined points where you could extend the code. The UI was a bit murkier 
since it came with the source so consultants did the customization.

In Spacewalk, I think we tried to let users customize the css and replace 
portions of the UI i.e. footer, header, leftnav, legends, and advertisements.

http://git.fedorahosted.org/cgit/spacewalk.git/tree/java/code/webapp/WEB-INF/includes

Also the layouts of the pages:

http://git.fedorahosted.org/cgit/spacewalk.git/tree/java/code/webapp/WEB-INF/decorators

I agree with Ohad that we "need to  come up with UI hooks, where people 
could inject stuff (e.g. like additional tab, additional dropdown etc)."
I think the key to creating a customizable application is to include hooks 
in key locations that folks could fill in. Very similar to how servlet 
filters allow you to modify the requests and response in a Java 
application, or interceptors in guice and resteasy work. Again these are 
Java things but I'm sure ruby can do similar things.

Sincerely,
jesus

-- 
jesus m. rodriguez          | jesusr at redhat.com
principal software engineer | irc: zeus
red hat systems management  | 919.754.4413 (w)
rhce # 805008586930012      | 919.623.0080 (c)
+---------------------------------------------+
|   "Those who cannot remember the past       |
|    are condemned to repeat it."             |
|                        -- George Santayana  |
+---------------------------------------------+




More information about the katello-devel mailing list