org.broadleafcommerce.cms.file.service
Interface StaticAssetService

All Superinterfaces:
SandBoxItemListener
All Known Implementing Classes:
StaticAssetServiceImpl

public interface StaticAssetService
extends SandBoxItemListener

Created by bpolster.


Method Summary
 StaticAsset addStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
          This method is intended to be called from within the CMS admin only.
 String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
          Deprecated. since 3.1.0.
 Long countAssets(SandBox sandbox, org.hibernate.Criteria criteria)
           
 StaticAsset createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file, Map<String,String> properties)
          Used when uploading a file to Broadleaf.
 void deleteStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
          If deleting and item where page.originalPageId != null then the item is deleted from the database.
 List<StaticAsset> findAssets(SandBox sandbox, org.hibernate.Criteria criteria)
           
 StaticAsset findStaticAssetByFullUrl(String fullUrl, SandBox targetSandBox)
           
 StaticAsset findStaticAssetById(Long id)
           
 boolean getAutomaticallyApproveAndPromoteStaticAssets()
          If set to true, then this service will not use the SandBox concept and will instead automatically promote images to production as they are entered into the system.
 String getStaticAssetEnvironmentSecureUrlPrefix()
          Deprecated. since 3.1.0.
 String getStaticAssetEnvironmentUrlPrefix()
          Deprecated. since 3.1.0.
 String getStaticAssetUrlPrefix()
          Deprecated. since 3.1.0.
 List<StaticAsset> readAllStaticAssets()
           
 void setAutomaticallyApproveAndPromoteStaticAssets(boolean setting)
          If set to true, then this service will not use the SandBox concept and will instead automatically promote images to production as they are entered into the system.
 StaticAsset updateStaticAsset(StaticAsset staticAsset, SandBox sandbox)
          This method is intended to be called from within the CMS admin only.
 
Methods inherited from interface org.broadleafcommerce.openadmin.server.domain.SandBoxItemListener
itemPromoted, itemRejected, itemReverted
 

Method Detail

findStaticAssetById

StaticAsset findStaticAssetById(Long id)

readAllStaticAssets

List<StaticAsset> readAllStaticAssets()

findStaticAssetByFullUrl

StaticAsset findStaticAssetByFullUrl(String fullUrl,
                                     SandBox targetSandBox)

createStaticAssetFromFile

StaticAsset createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file,
                                      Map<String,String> properties)
Used when uploading a file to Broadleaf. This method will create the corresponding asset. Depending on the the implementation, the actual asset may be saved to the DB or to the file system. The default implementation StaticAssetServiceImpl has a environment properties that determine this behavior asset.use.filesystem.storage, and asset.server.file.system.path. The properties allows for implementors to update other Asset properties at the same time they are uploading a file. The default implementation uses this for an optional URL to be specified.

Parameters:
file - - the file being uploaded
properties - - additional meta-data properties
Returns:
Throws:
IOException
See Also:
StaticAssetServiceImpl

addStaticAsset

StaticAsset addStaticAsset(StaticAsset staticAsset,
                           SandBox destinationSandbox)
This method is intended to be called from within the CMS admin only. Adds the passed in page to the DB. Creates a sandbox/site if one doesn't already exist.


updateStaticAsset

StaticAsset updateStaticAsset(StaticAsset staticAsset,
                              SandBox sandbox)
This method is intended to be called from within the CMS admin only. Updates the page according to the following rules: 1. If sandbox has changed from null to a value This means that the user is editing an item in production and the edit is taking place in a sandbox. Clone the page and add it to the new sandbox and set the cloned page's originalPageId to the id of the page being updated. 2. If the sandbox has changed from one value to another This means that the user is moving the item from one sandbox to another. Update the siteId for the page to the one associated with the new sandbox 3. If the sandbox has changed from a value to null This means that the item is moving from the sandbox to production. If the page has an originalPageId, then update that page by setting it's archived flag to true. Then, update the siteId of the page being updated to be the siteId of the original page. 4. If the sandbox is the same then just update the page.


deleteStaticAsset

void deleteStaticAsset(StaticAsset staticAsset,
                       SandBox destinationSandbox)
If deleting and item where page.originalPageId != null then the item is deleted from the database. If the originalPageId is null, then this method marks the items as deleted within the passed in sandbox.

Parameters:
staticAsset -
destinationSandbox -

countAssets

Long countAssets(SandBox sandbox,
                 org.hibernate.Criteria criteria)

findAssets

List<StaticAsset> findAssets(SandBox sandbox,
                             org.hibernate.Criteria criteria)

getStaticAssetUrlPrefix

String getStaticAssetUrlPrefix()
Deprecated. since 3.1.0.

See Also:
StaticAssetPathService.getStaticAssetUrlPrefix()

getStaticAssetEnvironmentUrlPrefix

String getStaticAssetEnvironmentUrlPrefix()
Deprecated. since 3.1.0.

See Also:
StaticAssetPathService.getStaticAssetEnvironmentUrlPrefix()

getStaticAssetEnvironmentSecureUrlPrefix

String getStaticAssetEnvironmentSecureUrlPrefix()
Deprecated. since 3.1.0.

See Also:
StaticAssetPathService.getStaticAssetEnvironmentSecureUrlPrefix()

getAutomaticallyApproveAndPromoteStaticAssets

boolean getAutomaticallyApproveAndPromoteStaticAssets()
If set to true, then this service will not use the SandBox concept and will instead automatically promote images to production as they are entered into the system. This is recommended for the best workflow within the BLC-CMS and has been set as the default behavior.


setAutomaticallyApproveAndPromoteStaticAssets

void setAutomaticallyApproveAndPromoteStaticAssets(boolean setting)
If set to true, then this service will not use the SandBox concept and will instead automatically promote images to production as they are entered into the system. This is recommended for the best workflow within the BLC-CMS and has been set as the default behavior.


convertAssetPath

String convertAssetPath(String assetPath,
                        String contextPath,
                        boolean secureRequest)
Deprecated. since 3.1.0.

See Also:
StaticAssetPathService.convertAssetPath(String, String, boolean)


Copyright © 2013. All Rights Reserved.