public abstract class SiteSection extends Object
Constructor and Description |
---|
SiteSection(String mainname,
String prefix,
int visiblePages,
String[][] pagesAndTitles,
String dirname,
String bundle)
Create a new SiteSection object.
|
Modifier and Type | Method and Description |
---|---|
static void |
cleanup()
Clean up sitesections.
|
abstract void |
close()
Called when webserver shuts down.
|
void |
generateNavigationTree(javax.servlet.jsp.JspWriter out,
String url,
Locale locale)
Generate this section's part of the navigation tree (sidebar).
|
String |
getDirname()
Return the directory name of this site section.
|
static List<SiteSection> |
getSections()
The list of sections of the website.
|
String |
getTitle(String url,
Locale locale)
Given a URL, returns the corresponding page title.
|
abstract void |
initialize()
Called when the site section is first deployed.
|
static boolean |
isDeployed(String dirName)
Check whether a section with a given dirName is deployed.
|
public SiteSection(String mainname, String prefix, int visiblePages, String[][] pagesAndTitles, String dirname, String bundle)
mainname
- The name of the entire section used in the sidebar.prefix
- The prefix that all the JSP pages will have.visiblePages
- How many of the pages will be visible in the menu (taken from the start of the list).pagesAndTitles
- The actual pages and title-labels, without the prefix and jsp extension, involved in the
section. They must be given as an array of 2-element arrays.dirname
- The top level directory this site section is deployed under.bundle
- The resource bundle with translations of this sitesection.ArgumentNotValid
- if any of the elements of pagesAndTitles are not a 2-element array.public String getTitle(String url, Locale locale)
url
- a given URL.locale
- the current locale.ArgumentNotValid
- on null locale.public void generateNavigationTree(javax.servlet.jsp.JspWriter out, String url, Locale locale) throws IOException
out
- A place to write our HTMLurl
- The url of the page we're currently viewing. The list of subpages will only be displayed if the page
we're viewing is one that belongs to this section.locale
- The locale to generate the navigation tree for.IOException
- If there is a problem writing to the page.public String getDirname()
public abstract void initialize()
public abstract void close()
public static List<SiteSection> getSections()
IOFailure
- if site sections cannot be read from settings.public static void cleanup()
public static boolean isDeployed(String dirName)
dirName
- The dirName to check forArgumentNotValid
- if dirName is null or empty.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.