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 String
protected Map<String,
StaticAssetDescription> protected String
protected Long
protected String
protected Long
protected String
protected String
protected String
protected String
Fields 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.void
setAltText
(String altText) Set the altText of the static asset.void
setContentMessageValues
(Map<String, StaticAssetDescription> contentMessageValues) void
setFileExtension
(String fileExtension) Sets the fileExtension of the asset.void
setFileSize
(Long fileSize) Sets the filesize of the assetvoid
setFullUrl
(String fullUrl) Sets the URL for the assetvoid
Sets the id of the static asset.void
setMimeType
(String mimeType) Sets the mimeType of the asset.void
Sets the name of the static asset.void
setStorageType
(StorageType storageType) Returns how the asset was stored in the backend (e.g.void
Set 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:StaticAsset
URL used to retrieve this asset.- Specified by:
getFullUrl
in interfaceStaticAsset
- Returns:
-
setFullUrl
Description copied from interface:StaticAsset
Sets the URL for the asset- Specified by:
setFullUrl
in interfaceStaticAsset
-
getTitle
Description copied from interface:StaticAsset
Returns the title of this asset.- Specified by:
getTitle
in interfaceStaticAsset
- Returns:
-
setTitle
Description copied from interface:StaticAsset
Set the title of the static asset.- Specified by:
setTitle
in interfaceStaticAsset
-
getAltText
Description copied from interface:StaticAsset
Returns the altText of this asset.- Specified by:
getAltText
in interfaceStaticAsset
- Returns:
-
setAltText
Description copied from interface:StaticAsset
Set the altText of the static asset.- Specified by:
setAltText
in interfaceStaticAsset
-
getFileSize
Description copied from interface:StaticAsset
Filesize of the asset.- Specified by:
getFileSize
in interfaceStaticAsset
- Returns:
-
setFileSize
Description copied from interface:StaticAsset
Sets the filesize of the asset- Specified by:
setFileSize
in interfaceStaticAsset
-
getContentMessageValues
- Specified by:
getContentMessageValues
in interfaceStaticAsset
- Returns:
-
setContentMessageValues
- Specified by:
setContentMessageValues
in interfaceStaticAsset
-
getMimeType
Description copied from interface:StaticAsset
Returns the mimeType of the asset.- Specified by:
getMimeType
in interfaceStaticAsset
- Returns:
-
setMimeType
Description copied from interface:StaticAsset
Sets the mimeType of the asset.- Specified by:
setMimeType
in interfaceStaticAsset
-
getFileExtension
Description copied from interface:StaticAsset
Returns the file extension of the asset.- Specified by:
getFileExtension
in interfaceStaticAsset
- Returns:
-
setFileExtension
Description copied from interface:StaticAsset
Sets the fileExtension of the asset.- Specified by:
setFileExtension
in interfaceStaticAsset
-
getId
Description copied from interface:StaticAsset
Returns the id of the static asset.- Specified by:
getId
in interfaceStaticAsset
- Returns:
-
setId
Description copied from interface:StaticAsset
Sets the id of the static asset.- Specified by:
setId
in interfaceStaticAsset
-
getName
Description copied from interface:StaticAsset
The name of the static asset.- Specified by:
getName
in interfaceStaticAsset
- Returns:
-
setName
Description copied from interface:StaticAsset
Sets the name of the static asset. Used primarily for- Specified by:
setName
in interfaceStaticAsset
-
getStorageType
Description copied from interface:StaticAsset
Returns how the underlying asset is stored. Typically on the FileSystem or the Database.If null, this method returns
StorageType.DATABASE
for backwards compatibility.- Specified by:
getStorageType
in interfaceStaticAsset
- Returns:
-
setStorageType
Description copied from interface:StaticAsset
Returns how the asset was stored in the backend (e.g. DATABASE or FILESYSTEM)- Specified by:
setStorageType
in interfaceStaticAsset
-
createOrRetrieveCopyInstance
public <G extends StaticAsset> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneable
Clone 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 { CreateResponse
createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstance
in 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:
getMainEntityName
in interfaceAdminMainEntity
- Returns:
- the display name of this entity for the admin screen
-