@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 StaticAssetService
public StaticAsset findStaticAssetByFullUrl(String fullUrl, SandBox targetSandBox)
findStaticAssetByFullUrl
in interface StaticAssetService
public StaticAsset addStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
StaticAssetService
addStaticAsset
in interface StaticAssetService
public StaticAsset updateStaticAsset(StaticAsset staticAsset, SandBox destSandbox)
StaticAssetService
updateStaticAsset
in interface StaticAssetService
public void deleteStaticAsset(StaticAsset staticAsset, SandBox destinationSandbox)
StaticAssetService
deleteStaticAsset
in interface StaticAssetService
public List<StaticAsset> findAssets(SandBox sandbox, org.hibernate.Criteria c)
findAssets
in interface StaticAssetService
public Long countAssets(SandBox sandbox, org.hibernate.Criteria c)
countAssets
in interface StaticAssetService
public void itemPromoted(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemPromoted
in interface SandBoxItemListener
public void itemRejected(SandBoxItem sandBoxItem, SandBox destinationSandBox)
itemRejected
in interface SandBoxItemListener
public void itemReverted(SandBoxItem sandBoxItem)
itemReverted
in interface SandBoxItemListener
public String getStaticAssetUrlPrefix()
StaticAssetService
getStaticAssetUrlPrefix
in interface StaticAssetService
public void setStaticAssetUrlPrefix(String staticAssetUrlPrefix)
setStaticAssetUrlPrefix
in interface StaticAssetService
public String getStaticAssetEnvironmentUrlPrefix()
StaticAssetService
getStaticAssetEnvironmentUrlPrefix
in interface StaticAssetService
public void setStaticAssetEnvironmentUrlPrefix(String staticAssetEnvironmentUrlPrefix)
StaticAssetService
setStaticAssetEnvironmentUrlPrefix
in interface StaticAssetService
public String getStaticAssetEnvironmentSecureUrlPrefix()
StaticAssetService
getStaticAssetEnvironmentSecureUrlPrefix
in interface StaticAssetService
public void setStaticAssetEnvironmentSecureUrlPrefix(String staticAssetEnvironmentSecureUrlPrefix)
public boolean getAutomaticallyApproveAndPromoteStaticAssets()
StaticAssetService
getAutomaticallyApproveAndPromoteStaticAssets
in interface StaticAssetService
public void setAutomaticallyApproveAndPromoteStaticAssets(boolean automaticallyApproveAndPromoteStaticAssets)
StaticAssetService
setAutomaticallyApproveAndPromoteStaticAssets
in interface StaticAssetService
public String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
convertAssetPath
in interface StaticAssetService
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 httpsStaticAssetService.getStaticAssetUrlPrefix()
,
StaticAssetService.getStaticAssetEnvironmentUrlPrefix()
Copyright © 2013. All rights reserved.