Class CmsMediaBean
- All Implemented Interfaces:
Serializable
CmsMediaBean class.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateMediaItem.void
deleteMedia
(CMSMediaItem item) deleteMedia.void
Deletes all mediaItems fromgetMediaItems()
which are are marked as selected.getAllMedia.getAllMediaCategories.static String
static String
static String
Getter for the fielddataProvider
.static String
static String
static String
getFileName
(javax.servlet.http.Part filePart) getFileName.Getter for the fieldfilenameFilter
.Getter for the fieldfilter
.static String
getImageFilter.static String
static String
getMediaFileAsString.static String
getMediaItems.static String
getMediaPreviewUrl.static String
getMediaUrl
(CMSMediaItem item) getMediaUrl.static String
getMediaUrl
(CMSMediaItem item, String width, String height) getMediaUrl.Getter for the fieldselectedMediaItem
.Getter for the fieldselectedTag
.static String
static String
boolean
isAllSelected.boolean
isAudio
(CMSMediaItem item) isAudio.boolean
isImage
(CMSMediaItem item) isImage.boolean
isText
(CMSMediaItem item) isText.boolean
isVideo
(CMSMediaItem item) isVideo.boolean
needsPaginator.void
reloadMediaList.void
reloadMediaList
(boolean resetCurrentPage) reloadMediaList.void
Reload all media items, along with the available categoriesvoid
saveMedia
(CMSMediaItem media) saveMedia.void
saveMedia
(CMSMediaItem media, List<Selectable<CMSCategory>> categories) Save media item, adding or removing the given categories, depending wether they are selected or not. ifUser.hasPrivilegeForAllSubthemeDiscriminatorValues()
is false for the current user and none of the given categories is selected, then don't change the media categories since doing so would break category restrictionsvoid
Saves all mediaItems fromgetMediaItems()
which are are marked as selected.void
saveSelectedMediaItem.void
setAllSelected
(boolean allSelected) Setter for the fieldallSelected
.void
setFilenameFilter
(String filter) Setter for the fieldfilenameFilter
.void
Setter for the fieldfilter
.void
setSelectedMediaItem
(CategorizableTranslatedSelectable<CMSMediaItem> selectedMediaItem) Setter for the fieldselectedMediaItem
.void
setSelectedTag
(String selectedTag) Setter for the fieldselectedTag
.void
toggleSelectedMediaItem
(CategorizableTranslatedSelectable<CMSMediaItem> selectedMediaItem) toggleSelectedMediaItem.
-
Field Details
-
userBean
-
-
Constructor Details
-
CmsMediaBean
public CmsMediaBean()Constructor for CmsMediaBean.
-
-
Method Details
-
resetData
public void resetData()Reload all media items, along with the available categories -
createMediaItem
createMediaItem.
- Returns:
- a
CMSMediaItem
object.
-
deleteMedia
deleteMedia.
- Parameters:
item
- aCMSMediaItem
object.- Throws:
DAOException
- if any.
-
getAllMedia
getAllMedia.
- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getDataProvider
Getter for the field
dataProvider
.- Returns:
- a
TableDataProvider
object.
-
getMediaItems
getMediaItems.
- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
reloadMediaList
public void reloadMediaList()reloadMediaList.
-
reloadMediaList
public void reloadMediaList(boolean resetCurrentPage) reloadMediaList.
- Parameters:
resetCurrentPage
- a boolean.
-
deleteSelectedItems
Deletes all mediaItems fromgetMediaItems()
which are are marked as selected. Reloads the media list- Throws:
DAOException
- if any.
-
saveSelectedItems
Saves all mediaItems fromgetMediaItems()
which are are marked as selected. Reloads the media list- Throws:
DAOException
- if any.
-
getMediaUrl
getMediaUrl.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a
String
object. - Throws:
NumberFormatException
- if any.ViewerConfigurationException
- if any.
-
getMediaUrl
getMediaUrl.
- Parameters:
item
- aCMSMediaItem
object.width
- aString
object.height
- aString
object.- Returns:
- a
String
object. - Throws:
ViewerConfigurationException
- if any.
-
getMediaFileAsString
getMediaFileAsString.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a
String
object. - Throws:
ViewerConfigurationException
- if any.
-
getMediaPreviewUrl
getMediaPreviewUrl.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a
String
object. - Throws:
NumberFormatException
- if any.ViewerConfigurationException
- if any.
-
isImage
isImage.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a boolean.
-
isVideo
isVideo.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a boolean.
-
isAudio
isAudio.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a boolean.
-
isText
isText.
- Parameters:
item
- aCMSMediaItem
object.- Returns:
- a boolean.
-
saveSelectedMediaItem
saveSelectedMediaItem.
- Throws:
DAOException
- if any.
-
saveMedia
public void saveMedia(CMSMediaItem media, List<Selectable<CMSCategory>> categories) throws DAOException Save media item, adding or removing the given categories, depending wether they are selected or not. ifUser.hasPrivilegeForAllSubthemeDiscriminatorValues()
is false for the current user and none of the given categories is selected, then don't change the media categories since doing so would break category restrictions- Parameters:
media
- aCMSMediaItem
object.categories
- aList
object.- Throws:
DAOException
- if any.
-
saveMedia
saveMedia.
- Parameters:
media
- aCMSMediaItem
object.- Throws:
DAOException
- if any.
-
getFileName
getFileName.
- Parameters:
filePart
- aPart
object.- Returns:
- a
String
object.
-
setSelectedTag
Setter for the field
selectedTag
.- Parameters:
selectedTag
- the selectedTag to set
-
getSelectedTag
Getter for the field
selectedTag
.- Returns:
- the selectedTag
-
getAllMediaCategories
getAllMediaCategories.
- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
getImageFilter
getImageFilter.
- Returns:
- a regex matching only filenames ending with one of the supported image format suffixes
-
getVideoFilter
-
getAudioFilter
-
getDocumentFilter
-
getMediaFilter
-
getImageTypes
-
getVideoTypes
-
getAudioTypes
-
getDocumentTypes
-
getAllTypes
-
getFilter
Getter for the field
filter
.- Returns:
- the filter
-
setFilter
Setter for the field
filter
.- Parameters:
filter
- the filter to set
-
getFilenameFilter
Getter for the field
filenameFilter
.- Returns:
- the filter
-
setFilenameFilter
Setter for the field
filenameFilter
.- Parameters:
filter
- the filter to set
-
setSelectedMediaItem
Setter for the field
selectedMediaItem
.- Parameters:
selectedMediaItem
- the selectedMediaItem to set
-
toggleSelectedMediaItem
public void toggleSelectedMediaItem(CategorizableTranslatedSelectable<CMSMediaItem> selectedMediaItem) toggleSelectedMediaItem.
- Parameters:
selectedMediaItem
- aCategorizableTranslatedSelectable
object.
-
getSelectedMediaItem
Getter for the field
selectedMediaItem
.- Returns:
- the selectedMediaItem
-
setAllSelected
public void setAllSelected(boolean allSelected) Setter for the field
allSelected
.- Parameters:
allSelected
- the allSelected to set
-
isAllSelected
public boolean isAllSelected()isAllSelected.
- Returns:
- the allSelected
-
needsPaginator
public boolean needsPaginator()needsPaginator.
- Returns:
- true if there is more than one page in the data-provider. False otherwise
-