@Service(value="blStaticAssetService") public class StaticAssetServiceImpl extends AbstractContentService implements StaticAssetService
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
automaticallyApproveAndPromoteStaticAssets |
protected SandBoxItemDao |
sandBoxItemDao |
protected StaticAssetDao |
staticAssetDao |
protected String |
staticAssetEnvironmentSecureUrlPrefix |
protected String |
staticAssetEnvironmentUrlPrefix |
protected StaticAssetStorageService |
staticAssetStorageService |
protected String |
staticAssetUrlPrefix |
| Constructor and Description |
|---|
StaticAssetServiceImpl() |
| 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 prepend the
staticAssetUrlPrefix if one exists.
|
Long |
countAssets(SandBox sandbox,
org.hibernate.Criteria c) |
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 c) |
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.
|
void |
itemPromoted(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemRejected(SandBoxItem sandBoxItem,
SandBox destinationSandBox) |
void |
itemReverted(SandBoxItem sandBoxItem) |
void |
setAutomaticallyApproveAndPromoteStaticAssets(boolean automaticallyApproveAndPromoteStaticAssets)
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 |
setStaticAssetEnvironmentSecureUrlPrefix(String staticAssetEnvironmentSecureUrlPrefix) |
void |
setStaticAssetEnvironmentUrlPrefix(String staticAssetEnvironmentUrlPrefix)
Sets the environment url prefix.
|
void |
setStaticAssetUrlPrefix(String staticAssetUrlPrefix) |
StaticAsset |
updateStaticAsset(StaticAsset staticAsset,
SandBox destSandbox)
This method is intended to be called from within the CMS
admin only.
|
countItems, findItems@Value(value="${asset.server.url.prefix.internal}")
protected String staticAssetUrlPrefix
@Value(value="${asset.server.url.prefix}")
protected String staticAssetEnvironmentUrlPrefix
@Value(value="${asset.server.url.prefix.secure}")
protected String staticAssetEnvironmentSecureUrlPrefix
@Value(value="${automatically.approve.static.assets}")
protected boolean automaticallyApproveAndPromoteStaticAssets
protected StaticAssetDao staticAssetDao
protected SandBoxItemDao sandBoxItemDao
protected StaticAssetStorageService staticAssetStorageService
public StaticAsset findStaticAssetById(Long id)
findStaticAssetById in interface StaticAssetServicepublic StaticAsset findStaticAssetByFullUrl(String fullUrl, SandBox targetSandBox)
findStaticAssetByFullUrl in interface StaticAssetServicepublic StaticAsset addStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
StaticAssetServiceaddStaticAsset in interface StaticAssetServicepublic StaticAsset updateStaticAsset(StaticAsset staticAsset, SandBox destSandbox)
StaticAssetServiceupdateStaticAsset in interface StaticAssetServicepublic void deleteStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
StaticAssetServicedeleteStaticAsset in interface StaticAssetServicepublic List<StaticAsset> findAssets(SandBox sandbox, org.hibernate.Criteria c)
findAssets in interface StaticAssetServicepublic Long countAssets(SandBox sandbox, org.hibernate.Criteria c)
countAssets in interface StaticAssetServicepublic void itemPromoted(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemPromoted in interface SandBoxItemListenerpublic void itemRejected(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemRejected in interface SandBoxItemListenerpublic void itemReverted(SandBoxItem sandBoxItem)
itemReverted in interface SandBoxItemListenerpublic String getStaticAssetUrlPrefix()
StaticAssetServicegetStaticAssetUrlPrefix in interface StaticAssetServicepublic void setStaticAssetUrlPrefix(String staticAssetUrlPrefix)
setStaticAssetUrlPrefix in interface StaticAssetServicepublic String getStaticAssetEnvironmentUrlPrefix()
StaticAssetServicegetStaticAssetEnvironmentUrlPrefix in interface StaticAssetServicepublic void setStaticAssetEnvironmentUrlPrefix(String staticAssetEnvironmentUrlPrefix)
StaticAssetServicesetStaticAssetEnvironmentUrlPrefix in interface StaticAssetServicepublic String getStaticAssetEnvironmentSecureUrlPrefix()
StaticAssetServicegetStaticAssetEnvironmentSecureUrlPrefix in interface StaticAssetServicepublic void setStaticAssetEnvironmentSecureUrlPrefix(String staticAssetEnvironmentSecureUrlPrefix)
public boolean getAutomaticallyApproveAndPromoteStaticAssets()
StaticAssetServicegetAutomaticallyApproveAndPromoteStaticAssets in interface StaticAssetServicepublic void setAutomaticallyApproveAndPromoteStaticAssets(boolean automaticallyApproveAndPromoteStaticAssets)
StaticAssetServicesetAutomaticallyApproveAndPromoteStaticAssets in interface StaticAssetServicepublic String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
convertAssetPath in interface StaticAssetServiceassetPath - - 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 httpsStaticAssetService.getStaticAssetUrlPrefix(),
StaticAssetService.getStaticAssetEnvironmentUrlPrefix()Copyright © 2013. All rights reserved.