public class Sitemap
extends java.util.TimerTask
Constructor and Description |
---|
Sitemap(java.io.File directory,
java.lang.String locationBase,
java.lang.String entryBase,
java.lang.String portalBase,
java.util.List<java.lang.String> portalFormats)
Construct a new instance of the Sitemap class.
|
Modifier and Type | Method and Description |
---|---|
void |
generateSitemaps()
Generate all of the sitemap files needed to list the URLs from this
instance of Metacat, using the open sitemap format described here:
http://www.sitemaps.org/protocol.html
URLs are written to a one or more files and a sitemap index file is
always written.
|
java.lang.String |
getMetadataFormatsQueryString()
Generate a comma-separated list of metadata format IDs so
generateSitemaps can filter the available objects to just metadata
objects.
|
void |
run()
Execute the timed task when called, in this case by generating the
sitemap files needed for this Metacat instance.
|
public Sitemap(java.io.File directory, java.lang.String locationBase, java.lang.String entryBase, java.lang.String portalBase, java.util.List<java.lang.String> portalFormats)
directory
- The location to store sitemap fileslocationBase
- The base URL for constructing sitemap location URLsentryBase
- The base URL for constructing sitemap entry URLs any metadata recordsportalBase
- The base URL for constructing sitemap entry URLs for portalsportalFormats
- Set of format IDs to determine whether a record is a portal or notpublic void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
public void generateSitemaps()
The sitemap index can be registered with search index providers such as Google, but beware that it needs to be accessible in a location above the mount point for the service URLs. By default the files are placed in {context}/sitemaps, but you will need to expose them at a location matching what's set in the sitemap.location.base and sitemap.entry.base properties in order to be trusted by Google. See the Sitemaps.org documentation for details.
public java.lang.String getMetadataFormatsQueryString()
Copyright © 2023 Regents of the University of California. All Rights Reserved.