Class JpaAsset
- All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware,com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>,com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable,com.broadleafcommerce.data.tracking.core.Trackable,com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>,Serializable
Asset for use with a JPA-supported datastore.- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanorg.modelmapper.ModelMapperfromMe()Text that corresponds to the HTMLaltattribute that should be used when this asset is rendered in a browser.User who created this asset.Class<?>If and only if thetypeisDefaultAssetType.EMBED, this field holds the HTML to embed.For assets with an externalstorageType, this field is required and names where the external asset is sourced from.Date the file was last updated.Designate this asset to be used in a specificLocaleMIME storageType of the file represented by this asset: image/png, image/jpeg, application/pdf, &c.longgetSize()Size in bytes of the file represented by this asset.Defines where the digital content represented by this asset is stored.getTags()Descriptive or identifying labels.getTitle()Text that corresponds to the HTMLtitleattribute that should be used when this asset is rendered in a browser.com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTrackinggetType()Describes the general type of the asset.Date the file was uploaded to create this asset.getUrl()Location used to resolve this asset by callers using the service such as "/icon.png" for aninternal assetor "https://www.youtube.com/watch?v=a1S2d3F4" forexternal asset.inthashCode()voidsetAltText(String altText) Text that corresponds to the HTMLaltattribute that should be used when this asset is rendered in a browser.voidsetAttributes(Map<String, String> attributes) voidUser who created this asset.voidsetContextId(String contextId) voidsetEmbedCode(String embedCode) If and only if thetypeisDefaultAssetType.EMBED, this field holds the HTML to embed.voidsetExternalProvider(String externalProvider) For assets with an externalstorageType, this field is required and names where the external asset is sourced from.voidsetFolderContextId(String folderContextId) voidsetLastUpdatedDate(Instant lastUpdatedDate) Date the file was last updated.voidDesignate this asset to be used in a specificLocalevoidsetMimeType(String mimeType) MIME storageType of the file represented by this asset: image/png, image/jpeg, application/pdf, &c.voidsetSize(long size) Size in bytes of the file represented by this asset.voidsetStorageType(String storageType) Defines where the digital content represented by this asset is stored.voidsetTags(List<JpaAssetTag> tags) Descriptive or identifying labels.voidText that corresponds to the HTMLtitleattribute that should be used when this asset is rendered in a browser.voidsetTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) voidDescribes the general type of the asset.voidsetUploadDate(Instant uploadDate) Date the file was uploaded to create this asset.voidLocation used to resolve this asset by callers using the service such as "/icon.png" for aninternal assetor "https://www.youtube.com/watch?v=a1S2d3F4" forexternal asset.protected org.modelmapper.Converter<Set<String>,List<JpaAssetTag>> org.modelmapper.ModelMappertoMe()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMeMethods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationStateMethods inherited from interface com.broadleafcommerce.data.tracking.core.Trackable
getNotificationStates, getNotificationStates, setNotificationStatesMethods inherited from interface com.broadleafcommerce.data.tracking.core.TypedTrackable
setTracking
-
Constructor Details
-
JpaAsset
public JpaAsset()
-
-
Method Details
-
fromMe
@NonNull public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
@NonNull public org.modelmapper.ModelMapper toMe()- Specified by:
toMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
tagValuesToTagEntities
-
getBusinessDomainType
- Specified by:
getBusinessDomainTypein interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getDisplay
- Specified by:
getDisplayin interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
getContextId
- Specified by:
getContextIdin interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
getUrl
Location used to resolve this asset by callers using the service such as "/icon.png" for aninternal assetor "https://www.youtube.com/watch?v=a1S2d3F4" forexternal asset.- Returns:
- the url for this asset
-
getEmbedCode
If and only if thetypeisDefaultAssetType.EMBED, this field holds the HTML to embed.Note that
urland this field can never both be present.- Returns:
- the HTML to embed
-
getAltText
Text that corresponds to the HTMLaltattribute that should be used when this asset is rendered in a browser. This is used as an alternative for screen-readers and as an SEO enhancement describing the asset.- Returns:
- the altText for this asset
-
getTitle
Text that corresponds to the HTMLtitleattribute that should be used when this asset is rendered in a browser. This is used a tooltip or caption.- Returns:
- the title for this asset
-
getTags
Descriptive or identifying labels.
Tags can be used to:
- provide a means of designating special purposes for the asset
- group otherwise related assets such as "banners"
- provide a label for some other, arbitrary purpose
- Returns:
- the tags for this asset
-
getLocale
Designate this asset to be used in a specificLocale- Returns:
- the locale for this asset
-
getType
Describes the general type of the asset. This is used to determine how to render the asset on the frontend. For example, if the type isDefaultAssetType.IMAGE, then the frontend will know to render it in an<img/>tag.For assets with an external
storageType, this field is required input. For internal assets, this is inferred from themimeTypeduring upload.- Returns:
- the general type of the asset
- See Also:
-
DefaultAssetTypeAsset.type
-
getExternalProvider
For assets with an externalstorageType, this field is required and names where the external asset is sourced from. This field should be null for assets with an internalstorageType.- Returns:
- the provider (for example, the name of the CDN) that is hosting the external asset
- See Also:
-
Asset.externalProvider
-
getMimeType
MIME storageType of the file represented by this asset: image/png, image/jpeg, application/pdf, &c.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types for more info on MIME types
- Returns:
- the mimeType for this asset
-
getSize
public long getSize()Size in bytes of the file represented by this asset.- Returns:
- the size in bytes for this asset
-
getUploadDate
Date the file was uploaded to create this asset.- Returns:
- the uploadDate for this asset
-
getLastUpdatedDate
Date the file was last updated.- Returns:
- the lastUpdatedDate for this asset
-
getAuthor
User who created this asset.- Returns:
- the author for this asset
-
getStorageType
Defines where the digital content represented by this asset is stored. The default types areDefaultAssetStorageType.INTERNALandDefaultAssetStorageType.EXTERNAL.- Returns:
- the storageType for this asset
- See Also:
-
getFolderContextId
- Returns:
- the persistent counter-part to
Asset.getFolderId()
-
getAttributes
- Returns:
- the persisted counter-part of
Asset.getAttributes()
-
getTracking
public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()- Specified by:
getTrackingin interfacecom.broadleafcommerce.data.tracking.core.Trackable- Returns:
- the
ApplicationJpaTrackinginformation for this - See Also:
-
ApplicationJpaTracking
-
setContextId
- Specified by:
setContextIdin interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
setUrl
Location used to resolve this asset by callers using the service such as "/icon.png" for aninternal assetor "https://www.youtube.com/watch?v=a1S2d3F4" forexternal asset.- Parameters:
url- the value to set as the url for this asset
-
setEmbedCode
If and only if thetypeisDefaultAssetType.EMBED, this field holds the HTML to embed.Note that
urland this field can never both be present.- Parameters:
embedCode- the HTML to embed
-
setAltText
Text that corresponds to the HTMLaltattribute that should be used when this asset is rendered in a browser. This is used as an alternative for screen-readers and as an SEO enhancement describing the asset.- Parameters:
altText- the value to set as the altText for this asset
-
setTitle
Text that corresponds to the HTMLtitleattribute that should be used when this asset is rendered in a browser. This is used a tooltip or caption.- Parameters:
title- the value to set as the title for this asset
-
setTags
Descriptive or identifying labels.
Tags can be used to:
- provide a means of designating special purposes for the asset
- group otherwise related assets such as "banners"
- provide a label for some other, arbitrary purpose
- Parameters:
tags- the value to set as the tags for this asset
-
setLocale
Designate this asset to be used in a specificLocale- Parameters:
locale- the value to set as the locale for this asset
-
setType
Describes the general type of the asset. This is used to determine how to render the asset on the frontend. For example, if the type isDefaultAssetType.IMAGE, then the frontend will know to render it in an<img/>tag.For assets with an external
storageType, this field is required input. For internal assets, this is inferred from themimeTypeduring upload.- Parameters:
type- the general type of the asset- See Also:
-
DefaultAssetTypeAsset.type
-
setExternalProvider
For assets with an externalstorageType, this field is required and names where the external asset is sourced from. This field should be null for assets with an internalstorageType.- Parameters:
externalProvider- the provider (for example, the name of the CDN) that is hosting the external asset- See Also:
-
Asset.externalProvider
-
setMimeType
MIME storageType of the file represented by this asset: image/png, image/jpeg, application/pdf, &c.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types for more info on MIME types
- Parameters:
mimeType- the value to set as the mimeType for this asset
-
setSize
public void setSize(long size) Size in bytes of the file represented by this asset.- Parameters:
size- the value to set as the size in bytes for this asset
-
setUploadDate
Date the file was uploaded to create this asset.- Parameters:
uploadDate- the value to set as the uploadDate for this asset
-
setLastUpdatedDate
Date the file was last updated.- Parameters:
lastUpdatedDate- the value to set as the lastUpdatedDate for this asset
-
setAuthor
User who created this asset.- Parameters:
author- the value to set as the author for this asset
-
setStorageType
Defines where the digital content represented by this asset is stored. The default types areDefaultAssetStorageType.INTERNALandDefaultAssetStorageType.EXTERNAL.- Parameters:
storageType- the value to set as the storageType for this asset- See Also:
-
setFolderContextId
- Parameters:
folderContextId- the persistent counter-part toAsset.getFolderId()
-
setAttributes
- Parameters:
attributes- the persisted counter-part ofAsset.getAttributes()
-
setTracking
public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) - Specified by:
setTrackingin interfacecom.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>- Parameters:
tracking- theApplicationJpaTrackinginformation for this- See Also:
-
ApplicationJpaTracking
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-