|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.sitemap.AbstractGenerator
org.dspace.app.sitemap.HTMLSitemapGenerator
public class HTMLSitemapGenerator
Class for generating HTML "sitemaps" which contain links to various pages in a DSpace site. This should improve search engine coverage of the DSpace site and limit the server load caused by crawlers.
| Field Summary |
|---|
| Fields inherited from class org.dspace.app.sitemap.AbstractGenerator |
|---|
bytesWritten, currentOutput, fileCount, outputDir, urlsWritten |
| Constructor Summary | |
|---|---|
HTMLSitemapGenerator(File outputDirIn,
String urlStem,
String urlTail)
Construct an HTML sitemap generator, writing files to the given directory, and with the sitemaps eventually exposed at starting with the given URL stem and tail. |
|
| Method Summary | |
|---|---|
String |
getFilename(int number)
Return the filename a sitemap at the given index should be stored at. |
String |
getIndexFilename()
Get the filename the index should be written to. |
String |
getLeadingBoilerPlate()
Return the boilerplate at the top of a sitemap file. |
int |
getMaxSize()
Return the maximum size in bytes that an individual sitemap file should be. |
int |
getMaxURLs()
Return the maximum number of URLs that an individual sitemap file should contain. |
String |
getTrailingBoilerPlate()
Return the boilerplate at the end of a sitemap file. |
String |
getURLText(String url,
Date lastMod)
Return marked-up text to be included in a sitemap about a given URL. |
boolean |
useCompression()
Return whether the written sitemap files and index should be GZIP-compressed. |
void |
writeIndex(PrintStream output,
int sitemapCount)
Write the index file. |
| Methods inherited from class org.dspace.app.sitemap.AbstractGenerator |
|---|
addURL, closeCurrentFile, finish, startNewFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HTMLSitemapGenerator(File outputDirIn,
String urlStem,
String urlTail)
outputDirIn - Directory to write sitemap files tourlStem - start of URL that sitemap files will appear at, e.g.
http://dspace.myu.edu/sitemap?sitemap=urlTail - end of URL that sitemap files will appear at, e.g.
.html or null| Method Detail |
|---|
public String getFilename(int number)
AbstractGenerator
getFilename in class AbstractGeneratornumber - index of the sitemap file (zero is first).
public String getLeadingBoilerPlate()
AbstractGenerator
getLeadingBoilerPlate in class AbstractGeneratorpublic int getMaxSize()
AbstractGenerator
getMaxSize in class AbstractGeneratorpublic int getMaxURLs()
AbstractGenerator
getMaxURLs in class AbstractGeneratorpublic String getTrailingBoilerPlate()
AbstractGenerator
getTrailingBoilerPlate in class AbstractGenerator
public String getURLText(String url,
Date lastMod)
AbstractGenerator
getURLText in class AbstractGeneratorurl - URL to add information aboutlastMod - date URL was last modified, or null if unknown or not
applicable
public boolean useCompression()
AbstractGenerator
useCompression in class AbstractGeneratortrue if GZIP compression should be used, false
otherwise.public String getIndexFilename()
AbstractGenerator
getIndexFilename in class AbstractGenerator
public void writeIndex(PrintStream output,
int sitemapCount)
throws IOException
AbstractGenerator
writeIndex in class AbstractGeneratoroutput - stream to write the index tositemapCount - number of sitemaps that were generated
IOException - if an IO error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||