Package io.goobi.viewer.model.toc
Class TocMaker
java.lang.Object
io.goobi.viewer.model.toc.TocMaker
TocMaker class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic de.intranda.metadata.multilanguage.IMetadataValuebuildTocElementLabel(org.apache.solr.common.SolrDocument doc) static de.intranda.metadata.multilanguage.IMetadataValuecreateMultiLanguageValue(org.apache.solr.common.SolrDocument doc, String field, String altField) createMultiLanguageValue.static Map<String, List<TOCElement>> generateToc(TOC toc, StructElement structElement, boolean addAllSiblings, String mimeType, int tocCurrentPage, int hitsPerPage) Generate the TOC.static StringgetFirstFieldValue(org.apache.solr.common.SolrDocument doc, String footerIdField) getFirstFieldValue.getSolrFieldsToFetch(String template) Returns a list of fields to be used as the field filter for Solr queries.
-
Method Details
-
getSolrFieldsToFetch
Returns a list of fields to be used as the field filter for Solr queries. The list consists of statically defined fields in REQUIRED_FIELDS and any additional fields configured for the TOC label. -
generateToc
public static Map<String,List<TOCElement>> generateToc(TOC toc, StructElement structElement, boolean addAllSiblings, String mimeType, int tocCurrentPage, int hitsPerPage) throws PresentationException, IndexUnreachableException, DAOException Generate the TOC.- Parameters:
toc- The TOC object (only required to set the number of volumes for anchor TOCs.structElement- aStructElementobject.addAllSiblings- If true andstructElementhas a parent, other siblings will be listed as well and can be navigated.mimeType- Mime type determines the target URL of the TOC element.tocCurrentPage- Current page of a paginated TOC.hitsPerPage- Hits per page of a paginated TOC.- Returns:
- a
LinkedHashMapobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.
-
getFirstFieldValue
public static String getFirstFieldValue(org.apache.solr.common.SolrDocument doc, String footerIdField) getFirstFieldValue.
-
buildTocElementLabel
public static de.intranda.metadata.multilanguage.IMetadataValue buildTocElementLabel(org.apache.solr.common.SolrDocument doc) -
createMultiLanguageValue
public static de.intranda.metadata.multilanguage.IMetadataValue createMultiLanguageValue(org.apache.solr.common.SolrDocument doc, String field, String altField) createMultiLanguageValue.
- Parameters:
doc- aSolrDocumentobject.field- Index fieldaltField- Fallback index field- Returns:
- a
IMetadataValueobject.
-