Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine plugin architecture #47

Closed
ginatrapani opened this issue Feb 22, 2010 · 11 comments
Closed

Refine plugin architecture #47

ginatrapani opened this issue Feb 22, 2010 · 11 comments
Labels

Comments

@ginatrapani
Copy link
Member

IMMEDIATE TODO'S:

  • Detect which plugins are available
  • Add an enable/disable front-end for available plugins
  • Build plugin options interface so that configuration comes out of config.inc.php

BACKGROUND:
To make TT truly multi-service and enable users to build their own features into it, it's got to be pluggable. There should be allowances for both webapp plugins (data visualizations and custom listings, etc) as well as crawler plugins (new data sources like Facebook and Buzz).

As we build TT plugins, we will continue to refine the plugin architecture.

Here's an update on the current state of the pluggable architecture:

Files

  • All plugin files are now located in a single place, common/plugins/.
  • Each individual plugin has its own subfolder there, so the Twitter plugin is in common/plugins/twitter/.
  • Templates for rendering plugin-specific things on the frontend are in a templates subdirectory, ie, common/plugins/twitter/templates/.
  • Classes the plugin requires should be in a lib subdirectory, ie, common/plugins/twitter/lib/.
  • Right now the only webapp plugin that's working is the configuration screen.

Database

  • There are now tt_plugins and tt_plugin_options tables
  • By default, the Twitter plugin is inserted and set to active in the tt_plugins table.

Future plans:

My vision is that ThinkTank plugins will work like WordPress: you drop a folder into the common/plugins/ directory, and it gets listed in the webapp as "Inactive." Click a link to activate the plugin (insert its row into the db, set is_active to 1, run any relevant installation routines) and the crawler and webapp will execute the methods it registers from there on in.

A hooks wishlist is underway here:
http://wiki.github.com/ginatrapani/thinktank/thinktank-plugin-hooks-wish-list

@CVi
Copy link
Contributor

CVi commented Feb 22, 2010

And custom Table fields

@ginatrapani
Copy link
Member Author

I think I know what you mean, but just in case: can you explain?

@CVi
Copy link
Contributor

CVi commented Feb 22, 2010

The plugins also needs to be able to add custom fields to tables...
Or at least fields that can be joined in... (from a custom table)
for instance I'm trying myself and my phobia for API fiddling on TweetBlocker (adding Tweetblocker ratings to users) this needs eighter a field in users table OR custom table joined...
Did I make any sense?

@ginatrapani
Copy link
Member Author

Yep, that makes sense... I think requiring plugins to create their own tables that join to existing ones would be safer.

@CVi
Copy link
Contributor

CVi commented Feb 28, 2010

I'm taking a crack at this one as I speak... I'm trying to to everything from scratch and then we can make the old code plug into the new one instead of making new code to fit the old one.

We should also make sure that any API we provide to te plugins does not get to spesiffic, we do want reusability right?

@ginatrapani
Copy link
Member Author

Excellent... and yes.

@CVi
Copy link
Contributor

CVi commented Mar 2, 2010

@ginatrapani
Copy link
Member Author

Interesting, thanks cvi. I'll get this set up on my dev box and give it a test run today, and have more feedback later on tonight.

@CVi
Copy link
Contributor

CVi commented Mar 2, 2010

it is a quick'n dirty smack together so it barely works :p said that already, but the point here is to show an idea of how we could put it together (if there is a better saying for that, tell me :p)
Unfortunately it does not! solve the frontend plugin problem....

also the files in config_c is supposed to be compiled by install script (faster that way, database may be slowing it down)

It is just one simple plugin there... I'm not sure if i want to touch the crawlers directly (ill be happy to make APIs for them to use tho)

@ginatrapani
Copy link
Member Author

Gina's take on this:
http://github.com/ginatrapani/thinktank/tree/pluggable

I'm going to work in this tree till I get the db changes done and do more testing, then I'll merge it into master.

@ginatrapani
Copy link
Member Author

This is more of an ongoing project than a next action, so I'm putting the project on the TT roadmap wiki page, and I'll add discrete to-do's to the Issues list as they come up.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants