Habari Photo Gallery Plugin Design

23 views
Skip to first unread message

Bill

unread,
Sep 23, 2008, 1:34:19 PM9/23/08
to habari-dev
Hi everyone,

This message is going to be a bit verbose so please bear with me. The
subject is about a photo plugin that I originally wrote for Wordpress
a long time ago and want to port a newer derivative/design to Habari.
My thought process is to cover the design, see what people think, and
ask a few Habari API/functionality questions. If this is of no
interest, abort now. :) If this is an abuse of this discussion list,
please let me know, 'cause I certainly don't want to do that.

Feature Overview:

Without getting into a big discussion of "Why create something that
already exists in Gallery 2 or other tools and plugins?" Let's just
say that I have my own reasons for features that I'm thinking about
and because I just want to see if I can do it. :)

In a nutshell, I want to write a plugin that gives me the ability to
add photos and group them into sets (like Flickr). I want to be able
to nest sets and have the ability to browse the entire gallery from a
page (or something like that). In addition I want an easy mechanism to
add individual photos as well as sets to posts and pages.

Javascript for simple cropping/selecting portions for thumbnails.
Possibly pluggable for different javascript or flash editors like
picnik.

Some "nifty" functionality I would like to have is the ability to tag
parts of a photo similar to Flickr and Facebook and have those tags
added to the tag list for the photo. I want to be able to display the
photo metadata (exif, etc.)

An even loftier goal would be to make the backend be pluggable (using
silos?) so that different photo sources could be used but have one
common interface.

I've either written much of this in my Wordpress plugin or played with
various pieces in test code so I'm not looking for someone to write
it. Where I am lacking is the various pieces needed to adapt it to the
Habari infrastructure.

Questions:

So I can take advantage of the Habari comment and tag functionality, I
was thinking of creating new content types: ex. gallery and photo so
comments could be created for them individually. In playing, when I've
created these new types, I end up with four additional menu options:
create gallery and photo, and manage gallery and photo. While I can
certainly create views for all these, it seems a bit much to add that
many menu items when really all I would really need is one: manage
gallery. Is there a way to "hide" the others so I don't clutter the
menu?

OwenW already pointed me to a podcast for modifying the formUI so that
I can update the post and page views. One question I was curious about
here was what happens if multiple plugins modify the same view? Is
there a priority or order to which plugins are processed?

With the Post::add_new_type method, I noticed it takes an "activated"
parameter, as well as having methods for activating and deactivating
types, what does it mean when a type is deactivated?

Finally, do the various pieces (at least that bind to Habari) seem
doable. I'm still slowly spinning up on the Habari code. The pieces
that I seem to need cat a better handle on are silos, plugin
infrastructure, new content types.

Any comments, advice, etc?

Thanks for being patient with this.

Bill

Ali B.

unread,
Sep 23, 2008, 4:47:55 PM9/23/08
to habar...@googlegroups.com
On Tue, Sep 23, 2008 at 8:34 PM, Bill <bi...@copperleaf.org> wrote:


    Hi everyone,


First and foremost, welcome to Habari.


    [snip]... If this is an abuse of this discussion list,

    please let me know, 'cause I certainly don't want to do that.


It's not an abuse at all! This is, amongst other things, the purpose of -dev IMHO. If you stick around, you will see that the habari community loves ideas and loves to help you implement them :)


    [snip Feature Overview]


    Questions:

I can answer to about one question, sorry about that. But other should be able to easily answer the rest.


    [snip Q1]


    OwenW already pointed me to a podcast for modifying the formUI so that
    I can update the post and page views. One question I was curious about
    here was what happens if multiple plugins modify the same view? Is
    there a priority or order to which plugins are processed?


The formUI itself appends fields rather than replacing them. So if more than one plugin add different fields to the same view (eg. Publish post), all of the fields from all the plugins are appended.



    With the Post::add_new_type method, I noticed it takes an "activated"
    parameter, as well as having methods for activating and deactivating
    types, what does it mean when a type is deactivated?

If I remember correctly, the deactive content types will not have it's "publish" and "mange" menue links added in menu.

My answers are far from sufficient, but I hope that they at least can get the discussion to roll.


Cheers
--
Ali B / dmondark
http://www.awhitebox.com

Arthus Erea

unread,
Sep 23, 2008, 5:05:23 PM9/23/08
to habar...@googlegroups.com

On Sep 23, 2008, at 1:34 PM, Bill wrote:

>
> Hi everyone,
>
> This message is going to be a bit verbose so please bear with me. The
> subject is about a photo plugin that I originally wrote for Wordpress
> a long time ago and want to port a newer derivative/design to Habari.
> My thought process is to cover the design, see what people think, and
> ask a few Habari API/functionality questions. If this is of no
> interest, abort now. :) If this is an abuse of this discussion list,
> please let me know, 'cause I certainly don't want to do that.

Thanks for sharing! This is definitely the right place for these kind
of questions, though once you have a fleshed out plugin the wiki would
be a nice place to document it as well.

>
>
> Feature Overview:
>
> Without getting into a big discussion of "Why create something that
> already exists in Gallery 2 or other tools and plugins?" Let's just
> say that I have my own reasons for features that I'm thinking about
> and because I just want to see if I can do it. :)

I completely see your point – thanks for volunteering to build this! :)

> [snip]


>
> An even loftier goal would be to make the backend be pluggable (using
> silos?) so that different photo sources could be used but have one
> common interface.

A silo would definitely be a good way to go about this – especially
since your core interface should be built around the "publish photo"
page.

>
> Questions:
>
> So I can take advantage of the Habari comment and tag functionality, I
> was thinking of creating new content types: ex. gallery and photo so
> comments could be created for them individually. In playing, when I've
> created these new types, I end up with four additional menu options:
> create gallery and photo, and manage gallery and photo. While I can
> certainly create views for all these, it seems a bit much to add that
> many menu items when really all I would really need is one: manage
> gallery. Is there a way to "hide" the others so I don't clutter the
> menu?

Yes, you can do this. Your plugin should implement the
'adminhandler_post_loadplugins_main_menu' filter and unset the menu
items which you want to hide.

Something like this: http://pastoid.com/8w.

> OwenW already pointed me to a podcast for modifying the formUI so that
> I can update the post and page views. One question I was curious about
> here was what happens if multiple plugins modify the same view? Is
> there a priority or order to which plugins are processed?

Yes, plugins have a priority. I do not know how that priority is
determined off the top of my head.

Please note that FormUI works progmatically: multiple plugins can
modify the same view, with each one adding and removing various
fields. That will all be handled transparently until the final product
(the form) is output.

> With the Post::add_new_type method, I noticed it takes an "activated"
> parameter, as well as having methods for activating and deactivating
> types, what does it mean when a type is deactivated?

It means you cannot create new posts with that type.

> Finally, do the various pieces (at least that bind to Habari) seem
> doable. I'm still slowly spinning up on the Habari code. The pieces
> that I seem to need cat a better handle on are silos, plugin
> infrastructure, new content types.

Yes, this is definitely doable (though no easy feat). The Habari
community is always very glad to help.

Thanks for working on this!

>
>
> Any comments, advice, etc?

I'd focus on getting the most basic functionality working to start
with (publishing a single photo), and then publishing it to the
developer list so we can comment on how you are doing things and
assist you in developing the more advanced hierarchy.

Bill

unread,
Sep 25, 2008, 11:03:55 AM9/25/08
to habari-dev
Thanks for all the advice. Things are going slow right now because of
a bunch of other work that I'm having to deal with, etc. but I am
slowly moving forward with this.

BTW, if anyone is interested in making this a multiple developer
effort, just let me know.

Bill

Arthus Erea

unread,
Sep 25, 2008, 1:12:34 PM9/25/08
to habar...@googlegroups.com
Are you willing to license the plugin with Apache Software License 2.0
- if so, it can be added to our SVN repository.

If you add it up there, multiple developers can help with bugfixes and
work. I'd even be willing to lend a hand as well (but I likewise don't
have much time).

Bill

unread,
Sep 25, 2008, 4:20:19 PM9/25/08
to habari-dev
I haven't looked into what license it would be yet, but most certainly
it would be whatever is the license that the core of Habari is using,
so I'm sure it will be the Apache license. Once I have a few basic
pieces, I'll look at how to get it added to the repository.

Bill

unread,
Oct 1, 2008, 11:25:12 AM10/1/08
to habari-dev
I've started to put together some basic code. Of course the plugin
isn't functional, but does do things like create the tables, load it's
options, etc. So I'd like to check it in so that people that are
interested can start commenting, etc.

Two questions:

1) I was unable to add it to the habari-extras vault. This didn't
surprise me as I'm sure I don't have permission. What is the process
for doing this?

2) Do we have a place in the wiki for documenting plugins?

TIA,
BIll

Arthus Erea

unread,
Oct 1, 2008, 3:51:41 PM10/1/08
to habar...@googlegroups.com
Great to hear!

~Morgante Pell (arthus)

On Oct 1, 2008, at 11:25 AM, Bill wrote:

>
> I've started to put together some basic code. Of course the plugin
> isn't functional, but does do things like create the tables, load it's
> options, etc. So I'd like to check it in so that people that are
> interested can start commenting, etc.
>
> Two questions:
>
> 1) I was unable to add it to the habari-extras vault. This didn't
> surprise me as I'm sure I don't have permission. What is the process
> for doing this?

If you sign onto IRC (freenode: #habari) someone can hook you up with
access.

>
>
> 2) Do we have a place in the wiki for documenting plugins?

For the time being, I believe it is mostly freely organized. Just
create a new page with your plugin name. However, someone should
correct me if this isn't the case.

>
>
> TIA,
> BIll
>

Michael Bishop

unread,
Oct 3, 2008, 4:29:59 PM10/3/08
to habari-dev


On Oct 1, 11:25 am, Bill <b...@copperleaf.org> wrote:
> Two questions:
>
> 1) I was unable to add it to the habari-extras vault. This didn't
> surprise me as I'm sure I don't have permission. What is the process
> for doing this?

For future reference, if someone asks via this mailing list and
outlines what they want to do in -extras, as well as signup/provide
their trac user name ( http://trac.habariproject.org/habari ), then
someone with access can do so and post back to the list.

Though we thoroughly enjoy new users/devs popping into the IRC
channel, it's not a prerequisite to getting access to extras.

~miklb
Reply all
Reply to author
Forward
0 new messages