Sitemap and Category (Metadata) Browsing Plugins

76 views
Skip to first unread message

kevin.reiss

unread,
Apr 1, 2010, 9:10:16 PM4/1/10
to Omeka Dev, jku...@metro.org
As part of the digitalMETRO project [http://nycdigital.org/] we have
developed a couple of plugins that we wanted to share with the Omeka
Community and see if they might be useful to anyone else. We also
wanted to get some suggestions and input on how they can be improved.

The first of the two plugins generates a valid XML Sitemap file
[http://www.sitemaps.org/] for content in a given Omeka instance.
There are configuration options provided that allow a site
administrator decide what content should be included. The biggest
improvement this plugin needs is an efficient way to handle
incremental updates and make sure that the timestamps of changed pages
and newly added items are accurate. I first attempted to do this by
rebuilding the sitemap file using plugin hooks for content add,
update, and delete functions but this is unwiedly and too slow for
large sites. Is there a way through Zend to schedule that certain
processes are run daily or once a week through Chron?

The sitemap plugin has options to include and manipulate "categories".
These are generated and configured using our second plugin which we've
called the MetadataBrowser plugin. This plugin defines a "Category"
class that can be used to generate browsing views of the values
assigned to selected Omeka Elements. The plugin reads the Omeka
Elements Table to populate the list of category choices that a site
administrator sees. The ones set to "active" are visible on a new
public view at http://myomekasite.org/category. Helper functions are
also provided that can be used to generate links on the Omeka theme
item "show" and "browse" pages, see the howtolink.txt file included in
the plugin distribution on how to currently do this. A Zend route and
a URL-friendly "slug" are generated for each category that is selected
as an active browsing option. The URLs for these active categories
take the form: http://myomekasite.org/category/my-category-slug.

The MetadataBrowser plug-in manipulates the omeka advanced search
syntax to create links to values assigned to a given element. A later
iteration might generate slugs for each individual element value. This
is something that Wordpress does and makes for search engine friendly
URLs. I struggled to find a way to convert the Omeka advanced search
syntax into a viable route. The Category class is tied to the Element
Table using the ID value assigned to an Element. This is stored in the
Category table under the "element_id" value. The plug-in makes a lot
of use of this value to pull data back from the Element table where
needed. These plugins are released under the same GNU license that
covers the entire Omeka project.

To Download:

http://www.kevinreiss.com/code/XmlSitemap.zip
http://www.kevinreiss.com/code/MetadataBrowser.zip

To Install:
Standard Omeka plugin installation

Omeka Version: Test on stable Omeka 1.1

These are In public use at http://nycdigital.org/ if you'd like to
check them out in action.

Will Riley

unread,
Apr 1, 2010, 9:21:10 PM4/1/10
to omek...@googlegroups.com
Thank you Kevin for sharing these plugins with the Omeka community. I
can't wait to take a look at them.

-Will

> --
> You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
> To post to this group, send email to omek...@googlegroups.com.
> To unsubscribe from this group, send email to omeka-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/omeka-dev?hl=en.
>
>

Kris Kelly

unread,
Apr 1, 2010, 10:37:47 PM4/1/10
to omek...@googlegroups.com
Wow, I'm impressed.

As far as setting up cron jobs, you could easily just write a PHP script that partially loads the Omeka environment (for example, only the database) and then runs whatever plugin code you want it to run. Then run that script via cron as you would any other.

To get the Omeka environment loaded, all you need to do is require the 'paths.php' file in the root of Omeka (for path/miscellaneous constants), and then load the Omeka_Core class so that you can call Omeka_Core::phasedLoading(). For an example of how this might be done, check out the 'application/core/background.php' script.

Anyway, we look forward to testing out your plugins.

Cheers,
Kris

kevin.reiss

unread,
Apr 12, 2010, 9:58:27 AM4/12/10
to Omeka Dev
Hi,

I was tested these two plugins on Omeka 1.2 and noticed a bug related
to Exhibits in the sitemap that I'll update. It can't find the Exhibit
object any longer. So don't use that one on 1.2 until further notice.
I also noticed a bug with the "show" view of category values in the
admin theme for the category plugin. I'll post a corrected version of
that one tonight.

Thanks for the tip on the background script. I will take a look at
that see if I can get something set-up.

Kevin

> > public view athttp://myomekasite.org/category. Helper functions are


> > also provided that can be used to generate links on the Omeka theme
> > item "show" and "browse" pages, see the howtolink.txt file included in
> > the plugin distribution on how to currently do this.  A Zend route and
> > a URL-friendly "slug" are generated for each category that is selected
> > as an active browsing option. The URLs for these active categories
> > take the form:http://myomekasite.org/category/my-category-slug.
>
> > The MetadataBrowser plug-in manipulates the omeka advanced search
> > syntax to create links to values assigned to a given element. A later
> > iteration might generate slugs for each individual element value. This
> > is something that Wordpress does and makes for search engine friendly
> > URLs. I struggled to find a way to convert the Omeka advanced search
> > syntax into a viable route. The Category class is tied to the Element
> > Table using the ID value assigned to an Element. This is stored in the
> > Category table under the "element_id" value. The plug-in makes a lot
> > of use of this value to pull data back from the Element table where
> > needed. These plugins are released under the same GNU license that
> > covers the entire Omeka project.
>
> > To Download:
>
> >http://www.kevinreiss.com/code/XmlSitemap.zip
> >http://www.kevinreiss.com/code/MetadataBrowser.zip
>
> > To Install:
> > Standard Omeka plugin installation
>
> > Omeka Version: Test on stable Omeka 1.1
>

> > These are In public use athttp://nycdigital.org/if you'd like to

kevin.reiss

unread,
Apr 12, 2010, 10:07:16 PM4/12/10
to Omeka Dev
Hi,

I updated these two plugins to work on Omeka 1.2. The files are at:

http://kevinreiss.com/code/

The current version I'm calling these is .011. Haven't had a chance to
try he sugestion about the background process yet.

Kevin

> > > These are In public use athttp://nycdigital.org/ifyou'd like to

Jeremy Boggs

unread,
Apr 13, 2010, 8:08:25 AM4/13/10
to omek...@googlegroups.com
Thanks, Kevin, glad you got it working on 1.2! Is the only thing you
had to change in XmlSitemap the addition of the line to require the
Exhibit model? That's the only place where I notice a mention of Omeka
1.2.

Jeremy

kevin.reiss

unread,
Apr 13, 2010, 9:29:50 AM4/13/10
to Omeka Dev
Hi Jeremy,

That is all I had to do. I just had to add a require statement
included the Exhibit object in plugin.php for the sitemap tool. There
was a bug with my admin show view that displayed all values assigned
to given a category (omeka element) that I fixed in the other plugin.
In the original version I put up the view came up blank. One thing
which I'd like to improve is the date stamps assigned to URLs for the
ones that didn't have some sort of last modified date in the Omeka db
I just insert a current datestamp. I need to come up with a real
strategy for doing this. If anyone has any ideas that could improve
this it would be most appreciated.

Kevin

> >>>> These are In public use athttp://nycdigital.org/ifyou'dlike to

Reply all
Reply to author
Forward
0 new messages