public interface StaticAssetService extends SandBoxItemListener
Modifier and Type | Method and Description |
---|---|
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)
This method will take in an assetPath (think image url) and convert it if
the value contains the asseturlprefix.
|
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()
Returns the secure value of the environment url prefix (e.g.
|
String |
getStaticAssetEnvironmentUrlPrefix()
Returns the value configured for the current environment
for the static asset url prefix.
|
String |
getStaticAssetUrlPrefix()
Returns the value configured to mark an item as a static URL.
|
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.
|
void |
setStaticAssetEnvironmentUrlPrefix(String prefix)
Sets the environment url prefix.
|
void |
setStaticAssetUrlPrefix(String prefix) |
StaticAsset |
updateStaticAsset(StaticAsset staticAsset,
SandBox sandbox)
This method is intended to be called from within the CMS
admin only.
|
itemPromoted, itemRejected, itemReverted
StaticAsset findStaticAssetById(Long id)
List<StaticAsset> readAllStaticAssets()
StaticAsset findStaticAssetByFullUrl(String fullUrl, SandBox targetSandBox)
StaticAsset createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file, Map<String,String> properties)
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.file
- - the file being uploadedproperties
- - additional meta-data propertiesIOException
StaticAssetServiceImpl
StaticAsset addStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
StaticAsset updateStaticAsset(StaticAsset staticAsset, SandBox sandbox)
void deleteStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
staticAsset
- destinationSandbox
- List<StaticAsset> findAssets(SandBox sandbox, org.hibernate.Criteria criteria)
String getStaticAssetUrlPrefix()
void setStaticAssetUrlPrefix(String prefix)
String getStaticAssetEnvironmentUrlPrefix()
String getStaticAssetEnvironmentSecureUrlPrefix()
void setStaticAssetEnvironmentUrlPrefix(String prefix)
prefix
- boolean getAutomaticallyApproveAndPromoteStaticAssets()
void setAutomaticallyApproveAndPromoteStaticAssets(boolean setting)
String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
assetPath
- - The path to rewrite if it is a cms managed assetcontextPath
- - The context path of the web application (if applicable)secureRequest
- - True if the request is being served over httpsgetStaticAssetUrlPrefix()
,
getStaticAssetEnvironmentUrlPrefix()
Copyright © 2014. All rights reserved.