Author image Derek J. Curtis
and 1 contributors


Catalyst::Plugin::BigSitemap::SitemapBuilder - Helper object for the BigSitemap plugin




This object's role is to accept a collection of WWW::Sitemap::XML::URL objects via the add method.


There are two required parameters that must be passed to the constructor, sitemap_base_uri and sitemap_name_format.


urls - ArrayRef of WWW::Sitemap::XML::URL

A collection of every URL in your application that will be included in the sitemap.

sitemap_base_uri - URI::http

The base URI that should be used when resolving the action urls in your application. You should really specify this manually, in the event that one day you want to start run this module from a cron job.

sitemap_name_format - Str

A sprintf style format for the names of your sitemap files. Note: The names of the sitemap files will start by inserting the number 1 and incrementing for each sitemap file written. It's important to note that in code, calls to the sitemap method use a 0-based-index but your sitemap filenames are 1-based. This is just that way so the names of the individual sitemaps match to the examples given on the website.

failed_count - Int

A running count of all the URLs that failed validation in the WWW::Sitemap::XML::URL module and could not be added to the collection.. This should always report zero unless you've screwed something up in your sub my_action_sitemap controller methods.


add( $myUrlString ) =item add( $myUriObject ) =item add( loc => ? [, changefreq => ?] [, priority => ?] [, lastmod => ?] )

This method comes in three flavors. The first, take a single string parameter that should be the stringified version of the URL you want to add to the sitemap. The second, takes a URI::http object. The last flavor takes a hashref containing all your input parameters.

urls_count() = Int

.. how many urls total have been added to the builder.

sitemap_count() - Int

.. how many total sitemap files can be built with this data.

sitemap_index() - WWW::SitemapIndex::XML

Generates and returns a new sitemapindex object based on the urls currently in this object's urls collection, the sitemap_base_uri and the sitemap_name_format setting.

sitemap($index) - WWW::Sitemap::XML

Generates and returns a new sitemap object based at your requested index.

Note: $index is a 0-based index of the sitemap you want to retrieve.


Methods you're not meant to use directly, so don't! They're here for documentation purposes only.


Returns an array slice of URLs for the sitemap at the provided index. Sitemaps can consist of up to 50,000 URLS, when creating the slice, we use the assumption that we'll try to get up to 50,000 per each sitemap.



Derek J. Curtis djcurtis at summersetsoftware dot com


Derek J. Curtis 2013


This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 32:

Unknown directive: =shift

Around line 34:

'=item' outside of any '=over'