Class CmsBean
- java.lang.Object
-
- io.goobi.viewer.managedbeans.CmsBean
-
- All Implemented Interfaces:
Serializable
@Named @SessionScoped public class CmsBean extends Object implements Serializable
CMS functions.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CMSPAGES_FILTER
-
Constructor Summary
Constructors Constructor Description CmsBean()
CmsBean(CMSTemplateManager templateManager, NavigationHelper navigationHelper)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkRelatedWork()
checkRelatedWork.String
cmsContextAction()
Action method called when a CMS page is opened.String
cmsContextAction(boolean resetSearch)
Action method called when a CMS page is opened.void
fillSelectedMediaHolder(CategorizableTranslatedSelectable<CMSMediaItem> mediaItem)
Set the given (wrapped)CMSMediaItem
to Media holder set bysetSelectedMediaHolder(io.goobi.viewer.model.cms.media.CMSMediaHolder)
void
fillSelectedMediaHolder(CategorizableTranslatedSelectable<CMSMediaItem> mediaItem, boolean saveMedia)
Set the given (wrapped)CMSMediaItem
to Media holder set bysetSelectedMediaHolder(io.goobi.viewer.model.cms.media.CMSMediaHolder)
Additionally save the given media item if the parameter saveMedia is set to truevoid
forwardToCMSPage()
Deprecated.This method only remains to avoid pages failing to load which still call this methodList<CMSNavigationItem>
getActiveNavigationMenuItems()
List<CMSCategory>
getAllCategories()
getAllCategories.List<CMSPage>
getAllCMSPages()
getAllCMSPages.static List<Locale>
getAllLocales()
getAllLocales.List<CMSCategory>
getAllowedCategories(User user)
Returns a filtered category list for the given user, unless the user is a superuser.List<String>
getAllowedSubthemeDiscriminatorValues(User user)
Returns a filtered subtheme discriminator value list for the given user, unless the user is a superuser.List<CMSPageTemplate>
getAllowedTemplates(User user)
Returns a filtered page template list for the given user, unless the user is a superuser.List<CMSPage>
getAvailableCmsPages(CMSStaticPage page)
getAvailableCmsPages.List<CMSPage>
getAvailableParentPages(CMSPage page)
getAvailableParentPages.String
getCmsBodyClass()
For cms pages withCMSPage.getWrapperElementClass()
return 'body_' followed by the wrapperElementClass.CMSPage
getCMSPage(Long pageId)
getCMSPage.String
getCmsPagesFilter()
getter for jsfList<CMSPage>
getCMSPagesWithSearch()
getCMSPagesWithSearch.String
getCssClass()
getCssClass.Optional<CMSPage>
getCurrentCmsPageIfLoaded()
static Locale
getCurrentLocale()
getCurrentLocale.CMSPage
getCurrentPage()
Getter for the fieldcurrentPage
.String
getCurrentPageId()
getCurrentPageId.String
getCurrentPageUrl()
String
getCurrentWorkPi()
Getter for the fieldcurrentWorkPi
.Locale
getDefaultLocale()
getDefaultLocale.List<CMSPage>
getDisplayedPages()
getDisplayedPages.protected javax.faces.context.FacesContext
getFacesContext()
getFacesContext.List<String>
getFieldNames(org.apache.solr.common.SolrDocument solrDoc)
getFieldNames.List<Glossary>
getGlossaries()
getGlossaries.List<Map.Entry<String,List<SearchHit>>>
getGroupedQueryResults(List<SearchHit> hits, String groupingField)
Long
getLastEditedTimestamp(long pageId)
getLastEditedTimestamp.TableDataProvider<CMSPage>
getLazyModelPages()
Getter for the fieldlazyModelPages
.List<String>
getLuceneFields()
getLuceneFields.List<String>
getLuceneFields(boolean includeUntokenized)
getLuceneFields.List<String>
getLuceneFields(boolean includeUntokenized, boolean excludeTokenizedMetadataFields)
getLuceneFields.List<CMSPage>
getMostRecentlyEditedPages(int number)
Returns the most recently edited CMS pages from the lazy model, which should include all restrictions placed upon the current user.List<CMSNavigationItem>
getNavigationMenuItems()
getNavigationMenuItems.CMSPage
getPage(CMSPage page)
getPage.CMSPage
getPage(Long pageId)
getPage.String
getPageUrl(Long pageId)
Returns the URL to the CMS template of the given page.String
getPageUrl(Long pageId, boolean pretty)
getPageUrl.List<String>
getPossibleGroupFields()
getPossibleGroupFields.List<String>
getPossibleSortFields()
getPossibleSortFields.long
getQueryResultCount()
Calculates the number of pages needed for the paginator.List<SearchHit>
getQueryResults()
getQueryResults.List<CMSPage>
getRelatedPages(String pi)
getRelatedPages.List<CMSPage>
getRelatedPages(String pi, CMSCategory category)
getRelatedPages.String
getRepresentativeImageForQuery(CMSPage page)
getRepresentativeImageForQuery.String
getRepresentativeImageForQuery(CMSPage page, int width, int height)
getRepresentativeImageForQuery.String
getRepresentativeImageForQuery(CMSRecordListContent item)
getRepresentativeImageForQuery.String
getRepresentativeImageForQuery(CMSRecordListContent item, int width, int height)
getRepresentativeImageForQuery.CMSMediaHolder
getSelectedMediaHolder()
CMSMediaItem
getSelectedMediaItem()
Getter for the fieldselectedMediaItem
.Locale
getSelectedMediaLocale()
Getter for the fieldselectedMediaLocale
.Collection<Sorting>
getSortingModes()
CMSStaticPage
getStaticPage(String pageName)
getStaticPage.List<CMSStaticPage>
getStaticPages()
Getter for the fieldstaticPages
.List<String>
getSubthemeDiscriminatorValues()
getSubthemeDiscriminatorValues.CMSTemplateManager
getTemplateManager()
List<CMSPageTemplate>
getTemplates()
getTemplates.List<CMSPageTemplate>
getTemplates(boolean enabled)
String
getUrl(CMSPage page)
getUrl.String
getUrl(CMSPage page, boolean pretty)
getUrl.List<CMSPage>
getValidCMSPages()
getValidCMSPages.boolean
hasSearchResults()
hasSearchResults.boolean
hasSelectedMediaHolder()
hasSelectedMediaHolder.void
init()
init.boolean
isHasRelatedPages(String pi)
isHasRelatedPages.boolean
isLinkedFromNavBar(CMSPage page)
isLinkedFromNavBar.boolean
isLinkedToStaticPage(CMSPage page)
boolean
isMappedToStaticPage(CMSPage page)
boolean
isRelatedWorkLoaded()
isRelatedWorkLoaded.boolean
isSubthemeRequired(User user)
isSubthemeRequired.void
loadTemplates()
loadTemplates.boolean
mayEdit(CMSPage page)
mayEdit.void
resetCurrentWorkPi()
resetCurrentWorkPi.void
saveStaticPages()
Save static page status for all cms pagesString
saveTemplatesAction()
Persists the enabled/disabled status of all CMS tempaltes in the DB.void
setCurrentPage(CMSPage currentPage)
Setter for the fieldcurrentPage
.void
setCurrentPageId(String id)
Page ID setter for PrettyFaces.void
setCurrentWorkPi(String currentWorkPi)
Setter for the fieldcurrentWorkPi
.void
setNavigationHelper(NavigationHelper navigationHelper)
Required setter for ManagedProperty injectionvoid
setSearchBean(SearchBean searchBean)
Required setter for ManagedProperty injectionvoid
setSearchType()
Sets the searchType in SearchBean to the type assciated with the current static view (e.g.void
setSelectedMediaHolder(CMSMediaHolder item)
Set aCMSMediaHolder
in theCmsMediaBean
which may receive aCMSMediaItem
selected in the selectMedia dialogvoid
setSelectedMediaItem(CMSMediaItem selectedMediaItem)
Setter for the fieldselectedMediaItem
.void
setSelectedMediaLocale(Locale selectedMediaLocale)
Setter for the fieldselectedMediaLocale
.
-
-
-
Field Detail
-
CMSPAGES_FILTER
public static final String CMSPAGES_FILTER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsBean
public CmsBean()
-
CmsBean
public CmsBean(CMSTemplateManager templateManager, NavigationHelper navigationHelper)
-
-
Method Detail
-
init
@PostConstruct public void init()
init.
-
getMostRecentlyEditedPages
public List<CMSPage> getMostRecentlyEditedPages(int number)
Returns the most recently edited CMS pages from the lazy model, which should include all restrictions placed upon the current user.- Parameters:
number
- Number of requested rows- Returns:
-
setNavigationHelper
public void setNavigationHelper(NavigationHelper navigationHelper)
Required setter for ManagedProperty injection- Parameters:
navigationHelper
- navigationHelper searchBean to set
-
setSearchBean
public void setSearchBean(SearchBean searchBean)
Required setter for ManagedProperty injection- Parameters:
searchBean
- the searchBean to set
-
forwardToCMSPage
@Deprecated public void forwardToCMSPage()
Deprecated.This method only remains to avoid pages failing to load which still call this methodforwardToCMSPage.
-
getCurrentLocale
public static Locale getCurrentLocale()
getCurrentLocale.
- Returns:
- a
Locale
object.
-
loadTemplates
public void loadTemplates()
loadTemplates.
-
getTemplates
public List<CMSPageTemplate> getTemplates() throws DAOException
getTemplates.
- Returns:
- all existing templates
- Throws:
DAOException
-
getTemplates
public List<CMSPageTemplate> getTemplates(boolean enabled) throws DAOException
- Parameters:
enabled
-- Returns:
- Throws:
DAOException
-
getAllowedTemplates
public List<CMSPageTemplate> getAllowedTemplates(User user) throws DAOException
Returns a filtered page template list for the given user, unless the user is a superuser. Other CMS admins get a list matching the template ID list attached to their CMS license.- Parameters:
user
- aUser
object.- Returns:
- List of CMS templates whose IDs are among allowed template IDs
- Throws:
DAOException
-
saveTemplatesAction
public String saveTemplatesAction() throws DAOException
Persists the enabled/disabled status of all CMS tempaltes in the DB.- Returns:
- Throws:
DAOException
-
getDisplayedPages
public List<CMSPage> getDisplayedPages()
getDisplayedPages.
- Returns:
- a
List
object.
-
getLazyModelPages
public TableDataProvider<CMSPage> getLazyModelPages()
Getter for the field
lazyModelPages
.- Returns:
- a
TableDataProvider
object.
-
getPageUrl
public String getPageUrl(Long pageId)
Returns the URL to the CMS template of the given page. This URL will only resolve if the page has been published or the current user is CMS admin.
-
getAllCMSPages
public List<CMSPage> getAllCMSPages() throws DAOException
getAllCMSPages.
- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getCMSPage
public CMSPage getCMSPage(Long pageId) throws DAOException
getCMSPage.
- Parameters:
pageId
- aLong
object.- Returns:
- a
CMSPage
object. - Throws:
DAOException
- if any.
-
isRelatedWorkLoaded
public boolean isRelatedWorkLoaded() throws IndexUnreachableException
isRelatedWorkLoaded.
- Returns:
- true if an
ActiveDocumentBean
is registered and the theCMSPage.getRelatedPI()
ofgetCurrentPage()
is loaded - Throws:
IndexUnreachableException
- if any.
-
isLinkedFromNavBar
public boolean isLinkedFromNavBar(CMSPage page) throws DAOException
isLinkedFromNavBar.
- Parameters:
page
- aCMSPage
object.- Returns:
- a boolean.
- Throws:
DAOException
- if any.
-
getCurrentCmsPageIfLoaded
public Optional<CMSPage> getCurrentCmsPageIfLoaded()
- Returns:
- the
getCurrentPage()
if one is set, or an empty Optional if the current page is not a cmsPage (i.e. ifNavigationHelper.isCmsPage()
== false)
-
getPage
public CMSPage getPage(Long pageId) throws DAOException
getPage.
- Parameters:
pageId
- aLong
object.- Returns:
- a
CMSPage
object. - Throws:
DAOException
- if any.
-
getCurrentPage
public CMSPage getCurrentPage()
Getter for the field
currentPage
.- Returns:
- a
CMSPage
object.
-
setCurrentPage
public void setCurrentPage(CMSPage currentPage)
Setter for the field
currentPage
.- Parameters:
currentPage
- aCMSPage
object.
-
setCurrentPageId
public void setCurrentPageId(String id) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
Page ID setter for PrettyFaces.- Parameters:
id
- aString
object.- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
checkRelatedWork
public void checkRelatedWork() throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
checkRelatedWork.
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
getAllCategories
public List<CMSCategory> getAllCategories() throws DAOException
getAllCategories.
- Returns:
- the return value of
IDAO.getAllCategories()
- Throws:
DAOException
- if any.
-
getSelectedMediaItem
public CMSMediaItem getSelectedMediaItem()
Getter for the field
selectedMediaItem
.- Returns:
- a
CMSMediaItem
object.
-
setSelectedMediaItem
public void setSelectedMediaItem(CMSMediaItem selectedMediaItem)
Setter for the field
selectedMediaItem
.- Parameters:
selectedMediaItem
- aCMSMediaItem
object.
-
getSelectedMediaLocale
public Locale getSelectedMediaLocale()
Getter for the field
selectedMediaLocale
.- Returns:
- a
Locale
object.
-
setSelectedMediaLocale
public void setSelectedMediaLocale(Locale selectedMediaLocale)
Setter for the field
selectedMediaLocale
.- Parameters:
selectedMediaLocale
- aLocale
object.
-
cmsContextAction
public String cmsContextAction() throws IndexUnreachableException, DAOException, ViewerConfigurationException, RecordNotFoundException, RecordDeletedException
Action method called when a CMS page is opened. The exact action depends on the page and content item type.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.IndexUnreachableException
DAOException
ViewerConfigurationException
RecordDeletedException
RecordNotFoundException
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
cmsContextAction
public String cmsContextAction(boolean resetSearch) throws IndexUnreachableException, DAOException, ViewerConfigurationException, RecordNotFoundException, RecordDeletedException
Action method called when a CMS page is opened. The exact action depends on the page and content item type.- Parameters:
resetSearch
- If true, the search parameters in SearchBean will be reset- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.IndexUnreachableException
DAOException
ViewerConfigurationException
RecordDeletedException
RecordNotFoundException
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getQueryResults
public List<SearchHit> getQueryResults() throws IndexUnreachableException, PresentationException, DAOException
getQueryResults.
- Returns:
- a
List
object. - Throws:
IndexUnreachableException
- if any.PresentationException
- if any.DAOException
- if any.
-
getGroupedQueryResults
public List<Map.Entry<String,List<SearchHit>>> getGroupedQueryResults(List<SearchHit> hits, String groupingField)
- Parameters:
hits
-groupingField
-- Returns:
-
hasSearchResults
public boolean hasSearchResults()
hasSearchResults.
- Returns:
- a boolean.
-
getQueryResultCount
public long getQueryResultCount() throws PresentationException, IndexUnreachableException
Calculates the number of pages needed for the paginator. The value is taken directly fromSearch.getLastPage(int)
- Returns:
- The number of pages to display in the paginator
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getFieldNames
public List<String> getFieldNames(org.apache.solr.common.SolrDocument solrDoc)
getFieldNames.
- Parameters:
solrDoc
- aSolrDocument
object.- Returns:
- a
List
object.
-
getLuceneFields
public List<String> getLuceneFields(boolean includeUntokenized)
getLuceneFields.
- Parameters:
includeUntokenized
- a boolean.- Returns:
- a
List
object.
-
getLuceneFields
public List<String> getLuceneFields(boolean includeUntokenized, boolean excludeTokenizedMetadataFields)
getLuceneFields.
- Parameters:
includeUntokenized
- a boolean.excludeTokenizedMetadataFields
- a boolean.- Returns:
- a
List
object.
-
getStaticPages
public List<CMSStaticPage> getStaticPages() throws DAOException
Getter for the field
staticPages
.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getStaticPage
public CMSStaticPage getStaticPage(String pageName) throws DAOException
getStaticPage.
- Parameters:
pageName
- aString
object.- Returns:
- a
CMSStaticPage
object. - Throws:
DAOException
- if any.
-
isMappedToStaticPage
public boolean isMappedToStaticPage(CMSPage page) throws DAOException
- Parameters:
page
-- Returns:
- true if the given CMS page is mapped to any static page; otherwise
- Throws:
DAOException
-
getAvailableParentPages
public List<CMSPage> getAvailableParentPages(CMSPage page) throws DAOException
getAvailableParentPages.
- Parameters:
page
- aCMSPage
object.- Returns:
- A list of all cmsPages except the given one
- Throws:
DAOException
- if any.
-
getAvailableCmsPages
public List<CMSPage> getAvailableCmsPages(CMSStaticPage page) throws DAOException
getAvailableCmsPages.
- Parameters:
page
- aCMSStaticPage
object.- Returns:
- A list of all cmsPages not yet registered to a static page
- Throws:
DAOException
- if any.
-
getCMSPagesWithSearch
public List<CMSPage> getCMSPagesWithSearch() throws DAOException
getCMSPagesWithSearch.
- Returns:
- a list of all valid cms pages which contain a "search" item
- Throws:
DAOException
- if any.
-
saveStaticPages
public void saveStaticPages() throws DAOException
Save static page status for all cms pages- Throws:
DAOException
- if any.
-
isLinkedToStaticPage
public boolean isLinkedToStaticPage(CMSPage page) throws DAOException
- Throws:
DAOException
-
getValidCMSPages
public List<CMSPage> getValidCMSPages() throws DAOException
getValidCMSPages.
- Returns:
- all cmsPages which are valid and have a menu title
- Throws:
DAOException
- if any.
-
getFacesContext
protected javax.faces.context.FacesContext getFacesContext()
getFacesContext.
- Returns:
- a
FacesContext
object.
-
getSubthemeDiscriminatorValues
public List<String> getSubthemeDiscriminatorValues() throws PresentationException, IndexUnreachableException
getSubthemeDiscriminatorValues.
- Returns:
- a
List
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getAllowedSubthemeDiscriminatorValues
public List<String> getAllowedSubthemeDiscriminatorValues(User user) throws PresentationException, IndexUnreachableException
Returns a filtered subtheme discriminator value list for the given user, unless the user is a superuser. Other CMS admins get a list matching values list attached to their CMS license.- Parameters:
user
- aUser
object.- Returns:
- List of CMS templates whose IDs are among allowed template IDs
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
isSubthemeRequired
public boolean isSubthemeRequired(User user) throws PresentationException, IndexUnreachableException
isSubthemeRequired.
- Parameters:
user
- aUser
object.- Returns:
- true if user is limited to a subset of all available subtheme discriminator values; false otherwise
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getAllowedCategories
public List<CMSCategory> getAllowedCategories(User user) throws DAOException
Returns a filtered category list for the given user, unless the user is a superuser. Other CMS admins get a list matching values list attached to their CMS license.- Parameters:
user
- aUser
object.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
setSearchType
public void setSearchType()
Sets the searchType in SearchBean to the type assciated with the current static view (e.g. if the current cms page replaces the static page 'advancedSearch' the search type is set to 'advanced') For the normal search pages this is done in the pretty mapping which isn't used if redirecting to cms page
-
isHasRelatedPages
public boolean isHasRelatedPages(String pi) throws DAOException
isHasRelatedPages.
- Parameters:
pi
- aString
object.- Returns:
- a boolean.
- Throws:
DAOException
- if any.
-
getRelatedPages
public List<CMSPage> getRelatedPages(String pi) throws DAOException
getRelatedPages.
- Parameters:
pi
- aString
object.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getRelatedPages
public List<CMSPage> getRelatedPages(String pi, CMSCategory category) throws DAOException
getRelatedPages.
- Parameters:
pi
- aString
object.category
- aCMSCategory
object.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getRepresentativeImageForQuery
public String getRepresentativeImageForQuery(CMSPage page) throws PresentationException, IndexUnreachableException, ViewerConfigurationException
getRepresentativeImageForQuery.
- Parameters:
page
- aCMSPage
object.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.ViewerConfigurationException
- if any.
-
getRepresentativeImageForQuery
public String getRepresentativeImageForQuery(CMSRecordListContent item) throws PresentationException, IndexUnreachableException, ViewerConfigurationException
getRepresentativeImageForQuery.
- Parameters:
item
- aio.goobi.viewer.model.cms.CMSContentItem
object.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.ViewerConfigurationException
- if any.
-
getRepresentativeImageForQuery
public String getRepresentativeImageForQuery(CMSPage page, int width, int height) throws PresentationException, IndexUnreachableException, ViewerConfigurationException
getRepresentativeImageForQuery.
- Parameters:
page
- aCMSPage
object.width
- a int.height
- a int.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.ViewerConfigurationException
- if any.
-
getRepresentativeImageForQuery
public String getRepresentativeImageForQuery(CMSRecordListContent item, int width, int height) throws PresentationException, IndexUnreachableException, ViewerConfigurationException
getRepresentativeImageForQuery.
- Parameters:
item
- aio.goobi.viewer.model.cms.CMSContentItem
object.width
- a int.height
- a int.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.ViewerConfigurationException
- if any.
-
getPossibleSortFields
public List<String> getPossibleSortFields() throws org.apache.solr.client.solrj.SolrServerException, IOException
getPossibleSortFields.
- Returns:
- a
List
object. - Throws:
org.apache.solr.client.solrj.SolrServerException
- if any.IOException
- if any.
-
getPossibleGroupFields
public List<String> getPossibleGroupFields() throws IndexUnreachableException
getPossibleGroupFields.
- Returns:
- a
List
object. - Throws:
org.apache.solr.client.solrj.SolrServerException
- if any.IOException
- if any.DAOException
IndexUnreachableException
-
getCssClass
public String getCssClass()
getCssClass.
- Returns:
- The
CMSPage.getWrapperElementClass()
of the current CMSPage. If no current page is set orNavigationHelper.isCmsPage()
returns false, an empty String is returned
-
getLastEditedTimestamp
public Long getLastEditedTimestamp(long pageId) throws DAOException
getLastEditedTimestamp.
- Parameters:
pageId
- a long.- Returns:
- a
Long
object. - Throws:
DAOException
- if any.
-
getCurrentWorkPi
public String getCurrentWorkPi()
Getter for the field
currentWorkPi
.- Returns:
- the currentWorkPi
-
setCurrentWorkPi
public void setCurrentWorkPi(String currentWorkPi)
Setter for the field
currentWorkPi
.- Parameters:
currentWorkPi
- the currentWorkPi to set
-
resetCurrentWorkPi
public void resetCurrentWorkPi()
resetCurrentWorkPi.
-
setSelectedMediaHolder
public void setSelectedMediaHolder(CMSMediaHolder item)
Set aCMSMediaHolder
in theCmsMediaBean
which may receive aCMSMediaItem
selected in the selectMedia dialog- Parameters:
item
- aCMSMediaHolder
object.
-
getSelectedMediaHolder
public CMSMediaHolder getSelectedMediaHolder()
-
fillSelectedMediaHolder
public void fillSelectedMediaHolder(CategorizableTranslatedSelectable<CMSMediaItem> mediaItem)
Set the given (wrapped)CMSMediaItem
to Media holder set bysetSelectedMediaHolder(io.goobi.viewer.model.cms.media.CMSMediaHolder)
- Parameters:
mediaItem
- aCategorizableTranslatedSelectable
object.
-
fillSelectedMediaHolder
public void fillSelectedMediaHolder(CategorizableTranslatedSelectable<CMSMediaItem> mediaItem, boolean saveMedia)
Set the given (wrapped)CMSMediaItem
to Media holder set bysetSelectedMediaHolder(io.goobi.viewer.model.cms.media.CMSMediaHolder)
Additionally save the given media item if the parameter saveMedia is set to true- Parameters:
mediaItem
- aCategorizableTranslatedSelectable
object.saveMedia
- a boolean.
-
hasSelectedMediaHolder
public boolean hasSelectedMediaHolder()
hasSelectedMediaHolder.
- Returns:
- true if a mediaHolder is present
-
mayEdit
public boolean mayEdit(CMSPage page) throws DAOException, PresentationException, IndexUnreachableException
mayEdit.
- Parameters:
page
- aCMSPage
object.- Returns:
- a boolean.
- Throws:
DAOException
- if any.PresentationException
- if any.IndexUnreachableException
- if any.
-
getCmsBodyClass
public String getCmsBodyClass()
For cms pages withCMSPage.getWrapperElementClass()
return 'body_' followed by the wrapperElementClass. Otherwise return an empty String- Returns:
-
getCmsPagesFilter
public String getCmsPagesFilter()
getter for jsf- Returns:
-
getNavigationMenuItems
public List<CMSNavigationItem> getNavigationMenuItems()
getNavigationMenuItems.
- Returns:
- a
List
object.
-
getActiveNavigationMenuItems
public List<CMSNavigationItem> getActiveNavigationMenuItems()
-
getSortingModes
public Collection<Sorting> getSortingModes()
-
getCurrentPageUrl
public String getCurrentPageUrl()
-
getTemplateManager
public CMSTemplateManager getTemplateManager()
-
-