Class StaticAssetImpl
java.lang.Object
org.broadleafcommerce.cms.file.domain.StaticAssetImpl
- All Implemented Interfaces:
Serializable,StaticAsset,StaticAssetAdminPresentation,AdminMainEntity,MultiTenantCloneable<StaticAsset>
- Direct Known Subclasses:
ImageStaticAssetImpl
@Entity
public class StaticAssetImpl
extends Object
implements StaticAsset, AdminMainEntity, StaticAssetAdminPresentation
Created by bpolster.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.broadleafcommerce.cms.file.domain.StaticAssetAdminPresentation
StaticAssetAdminPresentation.FieldOrder, StaticAssetAdminPresentation.GroupName, StaticAssetAdminPresentation.GroupOrder, StaticAssetAdminPresentation.TabName, StaticAssetAdminPresentation.TabOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Map<String,StaticAssetDescription> protected Stringprotected Longprotected Stringprotected Longprotected Stringprotected Stringprotected Stringprotected StringFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends StaticAsset>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.Returns the altText of this asset.Returns the file extension of the asset.Filesize of the asset.URL used to retrieve this asset.getId()Returns the id of the static asset.Returns the mimeType of the asset.getName()The name of the static asset.Returns how the underlying asset is stored.getTitle()Returns the title of this asset.voidsetAltText(String altText) Set the altText of the static asset.voidsetContentMessageValues(Map<String, StaticAssetDescription> contentMessageValues) voidsetFileExtension(String fileExtension) Sets the fileExtension of the asset.voidsetFileSize(Long fileSize) Sets the filesize of the assetvoidsetFullUrl(String fullUrl) Sets the URL for the assetvoidSets the id of the static asset.voidsetMimeType(String mimeType) Sets the mimeType of the asset.voidSets the name of the static asset.voidsetStorageType(StorageType storageType) Returns how the asset was stored in the backend (e.g.voidSet the title of the static asset.
-
Field Details
-
id
-
name
-
fullUrl
-
title
-
altText
-
mimeType
-
fileSize
-
fileExtension
-
contentMessageValues
-
storageType
-
-
Constructor Details
-
StaticAssetImpl
public StaticAssetImpl()
-
-
Method Details
-
getFullUrl
Description copied from interface:StaticAssetURL used to retrieve this asset.- Specified by:
getFullUrlin interfaceStaticAsset- Returns:
-
setFullUrl
Description copied from interface:StaticAssetSets the URL for the asset- Specified by:
setFullUrlin interfaceStaticAsset
-
getTitle
Description copied from interface:StaticAssetReturns the title of this asset.- Specified by:
getTitlein interfaceStaticAsset- Returns:
-
setTitle
Description copied from interface:StaticAssetSet the title of the static asset.- Specified by:
setTitlein interfaceStaticAsset
-
getAltText
Description copied from interface:StaticAssetReturns the altText of this asset.- Specified by:
getAltTextin interfaceStaticAsset- Returns:
-
setAltText
Description copied from interface:StaticAssetSet the altText of the static asset.- Specified by:
setAltTextin interfaceStaticAsset
-
getFileSize
Description copied from interface:StaticAssetFilesize of the asset.- Specified by:
getFileSizein interfaceStaticAsset- Returns:
-
setFileSize
Description copied from interface:StaticAssetSets the filesize of the asset- Specified by:
setFileSizein interfaceStaticAsset
-
getContentMessageValues
- Specified by:
getContentMessageValuesin interfaceStaticAsset- Returns:
-
setContentMessageValues
- Specified by:
setContentMessageValuesin interfaceStaticAsset
-
getMimeType
Description copied from interface:StaticAssetReturns the mimeType of the asset.- Specified by:
getMimeTypein interfaceStaticAsset- Returns:
-
setMimeType
Description copied from interface:StaticAssetSets the mimeType of the asset.- Specified by:
setMimeTypein interfaceStaticAsset
-
getFileExtension
Description copied from interface:StaticAssetReturns the file extension of the asset.- Specified by:
getFileExtensionin interfaceStaticAsset- Returns:
-
setFileExtension
Description copied from interface:StaticAssetSets the fileExtension of the asset.- Specified by:
setFileExtensionin interfaceStaticAsset
-
getId
Description copied from interface:StaticAssetReturns the id of the static asset.- Specified by:
getIdin interfaceStaticAsset- Returns:
-
setId
Description copied from interface:StaticAssetSets the id of the static asset.- Specified by:
setIdin interfaceStaticAsset
-
getName
Description copied from interface:StaticAssetThe name of the static asset.- Specified by:
getNamein interfaceStaticAsset- Returns:
-
setName
Description copied from interface:StaticAssetSets the name of the static asset. Used primarily for- Specified by:
setNamein interfaceStaticAsset
-
getStorageType
Description copied from interface:StaticAssetReturns how the underlying asset is stored. Typically on the FileSystem or the Database.If null, this method returns
StorageType.DATABASEfor backwards compatibility.- Specified by:
getStorageTypein interfaceStaticAsset- Returns:
-
setStorageType
Description copied from interface:StaticAssetReturns how the asset was stored in the backend (e.g. DATABASE or FILESYSTEM)- Specified by:
setStorageTypein interfaceStaticAsset
-
createOrRetrieveCopyInstance
public <G extends StaticAsset> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneableClone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<StaticAsset>- Parameters:
context- a context object providing persistence and library functionality for copying entities- Returns:
- the resulting copy container, possibly already persisted
- Throws:
CloneNotSupportedException- if there's a problem detected with the cloning configuration
-
getMainEntityName
- Specified by:
getMainEntityNamein interfaceAdminMainEntity- Returns:
- the display name of this entity for the admin screen
-