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:
  • Field Details

    • id

      protected Long id
    • name

      protected String name
    • fullUrl

      protected String fullUrl
    • title

      protected String title
    • altText

      protected String altText
    • mimeType

      protected String mimeType
    • fileSize

      protected Long fileSize
    • fileExtension

      protected String fileExtension
    • contentMessageValues

      protected Map<String,StaticAssetDescription> contentMessageValues
    • storageType

      protected String storageType
  • Constructor Details

    • StaticAssetImpl

      public StaticAssetImpl()
  • Method Details

    • getFullUrl

      public String getFullUrl()
      Description copied from interface: StaticAsset
      URL used to retrieve this asset.
      Specified by:
      getFullUrl in interface StaticAsset
      Returns:
    • setFullUrl

      public void setFullUrl(String fullUrl)
      Description copied from interface: StaticAsset
      Sets the URL for the asset
      Specified by:
      setFullUrl in interface StaticAsset
    • getTitle

      public String getTitle()
      Description copied from interface: StaticAsset
      Returns the title of this asset.
      Specified by:
      getTitle in interface StaticAsset
      Returns:
    • setTitle

      public void setTitle(String title)
      Description copied from interface: StaticAsset
      Set the title of the static asset.
      Specified by:
      setTitle in interface StaticAsset
    • getAltText

      public String getAltText()
      Description copied from interface: StaticAsset
      Returns the altText of this asset.
      Specified by:
      getAltText in interface StaticAsset
      Returns:
    • setAltText

      public void setAltText(String altText)
      Description copied from interface: StaticAsset
      Set the altText of the static asset.
      Specified by:
      setAltText in interface StaticAsset
    • getFileSize

      public Long getFileSize()
      Description copied from interface: StaticAsset
      Filesize of the asset.
      Specified by:
      getFileSize in interface StaticAsset
      Returns:
    • setFileSize

      public void setFileSize(Long fileSize)
      Description copied from interface: StaticAsset
      Sets the filesize of the asset
      Specified by:
      setFileSize in interface StaticAsset
    • getContentMessageValues

      public Map<String,StaticAssetDescription> getContentMessageValues()
      Specified by:
      getContentMessageValues in interface StaticAsset
      Returns:
    • setContentMessageValues

      public void setContentMessageValues(Map<String,StaticAssetDescription> contentMessageValues)
      Specified by:
      setContentMessageValues in interface StaticAsset
    • getMimeType

      public String getMimeType()
      Description copied from interface: StaticAsset
      Returns the mimeType of the asset.
      Specified by:
      getMimeType in interface StaticAsset
      Returns:
    • setMimeType

      public void setMimeType(String mimeType)
      Description copied from interface: StaticAsset
      Sets the mimeType of the asset.
      Specified by:
      setMimeType in interface StaticAsset
    • getFileExtension

      public String getFileExtension()
      Description copied from interface: StaticAsset
      Returns the file extension of the asset.
      Specified by:
      getFileExtension in interface StaticAsset
      Returns:
    • setFileExtension

      public void setFileExtension(String fileExtension)
      Description copied from interface: StaticAsset
      Sets the fileExtension of the asset.
      Specified by:
      setFileExtension in interface StaticAsset
    • getId

      public Long getId()
      Description copied from interface: StaticAsset
      Returns the id of the static asset.
      Specified by:
      getId in interface StaticAsset
      Returns:
    • setId

      public void setId(Long id)
      Description copied from interface: StaticAsset
      Sets the id of the static asset.
      Specified by:
      setId in interface StaticAsset
    • getName

      public String getName()
      Description copied from interface: StaticAsset
      The name of the static asset.
      Specified by:
      getName in interface StaticAsset
      Returns:
    • setName

      public void setName(String name)
      Description copied from interface: StaticAsset
      Sets the name of the static asset. Used primarily for
      Specified by:
      setName in interface StaticAsset
    • getStorageType

      public StorageType 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 interface StaticAsset
      Returns:
    • setStorageType

      public void setStorageType(StorageType storageType)
      Description copied from interface: StaticAsset
      Returns how the asset was stored in the backend (e.g. DATABASE or FILESYSTEM)
      Specified by:
      setStorageType in interface StaticAsset
    • 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();

      //copy extended field values on myClone here

      return createResponse; }

      Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:

      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 interface MultiTenantCloneable<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

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface AdminMainEntity
      Returns:
      the display name of this entity for the admin screen