Package io.goobi.viewer.model.cms
Class PageList
java.lang.Object
io.goobi.viewer.model.cms.PageList
A list of strings with some convenience methods. Each string is either the id of a cmsPage or a pageType name The list may be stored as a single
string containing all strings in the list separated by ;
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetPage()Get the if/pageName of the first page, or an empty string if no pages exist.getPage(int index) getPage.getPage.getPages()Getter for the fieldpages.Get the matchingSearchInterfacefor the first listed page.getSearch(int pageIndex) getSearch.getUrl(int pageIndex) getUrl.inthashCode()booleanisEmpty()isEmpty.iterator()voidSets the pages list to a list containing only the given string.voidSetter for the fieldpages.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PageList
public PageList()Creates a new PageList instance. -
PageList
-
PageList
Creates a new PageList instance.- Parameters:
stringRep- semicolon-separated string of CMS page IDs or page type names.
-
-
Method Details
-
toString
-
hashCode
public int hashCode() -
equals
-
getPages
Getter for the fieldpages.- Returns:
- the list of CMS page IDs or page type names managed by this page list
-
setPages
Setter for the fieldpages.- Parameters:
pages- the list of page names or identifiers managed by this page list
-
getPage
Get the if/pageName of the first page, or an empty string if no pages exist.- Returns:
- the if/pageName of the first page, or an empty string if no pages exist
-
getPage
getPage.- Parameters:
index- zero-based position in the page list.- Returns:
- the page URL at the given index, or an empty string if the index is out of range
-
getSearch
Get the matchingSearchInterfacefor the first listed page. This is theSearchFunctionalityof that page if any exists, or otherwise theSearchBean- Returns:
- the matching
SearchInterfacefor the first listed page. This is theSearchFunctionalityof that page if any exists, or otherwise theSearchBean - Throws:
NumberFormatException- if any.DAOException- if any.
-
getSearch
getSearch.- Parameters:
pageIndex- zero-based position of the desired page in the list.- Returns:
- the SearchInterface for the given page, or null if not available
- Throws:
NumberFormatException- if any.DAOException- if any.
-
getUrl
getUrl.- Parameters:
pageIndex- the index of the desired page in the page list- Returns:
- the url of the page at pageIndex, relative to the host url
- Throws:
NumberFormatException- if any.DAOException- if any.
-
setPage
Sets the pages list to a list containing only the given string.- Parameters:
page- CMS page ID or page type name to set as sole entry.
-
iterator
-
getPage
getPage.- Parameters:
idString- numeric CMS page ID as string.- Returns:
- the CMS page with the given ID
- Throws:
DAOException- if any.
-
isEmpty
public boolean isEmpty()isEmpty.- Returns:
- true if this page list contains no pages, false otherwise
-