Forum OpenACS Q&A: Tagging

Collapse
Posted by Claudio Pasolini on
Tagging is very useful (and fashionable).

I wrote a small package to allow tagging any acs object and to display the popular tags as a tag cloud.

xowiki provides an implementation that is limited to xowiki pages, while the tags package is more general allowing tagging against acs_objects and to this end it uses the xowiki_tags table, replacing the foreign key constraint on cr_items with acs_objects.

tags acts much like general-comments, attachments and ratings, providing to the programmer a way to include tagging in any application.

To generate a link in your pages you can invoke tags::create_link. This brings you to the edit page, where you can view, add or change your own object's tags. The edit page shows also the other object's tags and the popular tags, that you can click to add to the form before submitting.

The 'Popular tags' portlet shows the tags as a tagcloud. You can include it in your pages:

  1. via <include src="/packages/tags/lib/tagcloud"> in your adp
  2. or via {{adp portlets/tagcloud}} after copying the portlet from the resources folder to the portlets folder of xowiki

Clicking a tag finally brings you to the tagged-items page, where you can view, order and filter the tagged items.

Actually the package is marked as a singleton and is localized only in English and Italian.

Collapse
2: Re: Tagging (response to 1)
Posted by Claudio Pasolini on
I forgot to mention that the package is available at https://openacs.org/storage/
Collapse
3: Re: Tagging (response to 1)
Posted by Dave Bauer on
Why are you reusing the xowiki tags table? Does that mean you need to have xowiki installed? Does it have any other dependencies on xowiki?

I usually install xowiki on all my sites, but everyone might not want to do that, and this generalized service seems useful with out without xowiki.

Collapse
4: Re: Tagging (response to 3)
Posted by Claudio Pasolini on
You are right, but personally I can't think of a site without xowiki and being in a hurry I choose to use the xowiki_tags table.

Actually this is the only dependency on xowiki and it would be very easy to switch to an independent table.

Collapse
5: Re: Tagging (response to 4)
Posted by Torben Brosten on
Claudio,

tags may be useful for ecommerce without xowiki. I'm not certain that xowiki with ecommerce is a secure combination, if customers have permission to edit xowiki pages.

Collapse
6: Re: Tagging (response to 1)
Posted by Claudio Pasolini on
I just loaded a new version of the package independent from xowiki.
Collapse
7: Re: Tagging (response to 1)
Posted by Brian Fenton on
This looks great Claudio! Well done!

Brian

Collapse
8: Re: Tagging (response to 6)
Posted by Emmanuelle Raffenne on
Hi Claudio,

Thank you for this contribution. I'm very interested in the xowiki independant version (my instances don't include xowiki). Just downloaded it...

Thanks

Collapse
9: Re: Tagging (response to 1)
Posted by Claudio Pasolini on
I loaded a new version of the package adding pagination to the tagged items list and correcting a couple of errors.
Collapse
10: Re: Tagging (response to 9)
Posted by Claudio Pasolini on
I loaded a new version of the package with:
  • a parameter to control the maximum number of tags to display in the tagcloud includelet
  • corrected tagged-items left joining cr_items to better distinguish items with object_type = 'content_item'
  • added the 'Popular tags' filter to tagged-items
Collapse
11: Re: Tagging (response to 1)
Posted by Michael Steigman on
Hi Claudio,

Thanks for sharing. I've got a very similar package I've been developing for use here and was planning to share. We should at some point soon compare/combine whathaveyou and get the result into the toolkit.

Collapse
12: Re: Tagging (response to 11)
Posted by Claudio Pasolini on
Hi Michael,

I'm more than happy to collaborate.

Collapse
13: Re: Tagging (response to 1)
Posted by Michael Steigman on
Claudio/All,

Posted my tags package here: https://openacs.org/storage/view/packages/tags.tar.gz. Very similar but a slightly different approach. There's a txt file included with snippets of how we're integrating it here. It's primarily an API-driven approach with display integrated into listbuilder. It's still a work in progress, of course...

Collapse
14: Re: Tagging (response to 13)
Posted by Claudio Pasolini on
Michael,

I'm busy now and will look at your package only next week.

Collapse
15: Re: Tagging (response to 13)
Posted by Claudio Pasolini on
Hi Michael,

I'm still busy and so looked quickly at your package without installing it.

It seems to me that with a little effort we could create a package that offers both a ready to use UI and an API driven UI.