|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.cms.common.AbstractContentService
org.broadleafcommerce.cms.file.service.StaticAssetServiceImpl
@Service(value="blStaticAssetService") public class StaticAssetServiceImpl
Created by bpolster.
| Field Summary | |
|---|---|
protected boolean |
automaticallyApproveAndPromoteStaticAssets
|
protected ImageArtifactProcessor |
imageArtifactProcessor
|
protected SandBoxItemDao |
sandBoxItemDao
|
protected StaticAssetDao |
staticAssetDao
|
protected StaticAssetPathService |
staticAssetPathService
|
protected StaticAssetStorageService |
staticAssetStorageService
|
protected boolean |
storeAssetsOnFileSystem
|
| Constructor Summary | |
|---|---|
StaticAssetServiceImpl()
|
|
| Method Summary | |
|---|---|
StaticAsset |
addStaticAsset(StaticAsset staticAsset,
SandBox destinationSandbox)
This method is intended to be called from within the CMS admin only. |
protected String |
buildAssetURL(Map<String,String> assetProperties,
String originalFilename)
Will assemble the url from the passed in properties as /{entityType}/{fileName} /product/7001-ab12 If the properties above are not set, it will generate the fileName randomly. |
String |
convertAssetPath(String assetPath,
String contextPath,
boolean secureRequest)
|
Long |
countAssets(SandBox sandbox,
org.hibernate.Criteria c)
|
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 c)
|
StaticAsset |
findStaticAssetByFullUrl(String fullUrl,
SandBox targetSandBox)
|
StaticAsset |
findStaticAssetById(Long id)
|
protected String |
generateFileName(int size)
Generates a filename as a set of Hex digits. |
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. |
protected String |
getCountUrl(String fullUrl,
int count,
boolean legacyFormat)
Gets the count URL based on the original fullUrl. |
protected String |
getFileExtension(String fileName)
|
protected void |
getMimeType(org.springframework.web.multipart.MultipartFile file,
StaticAsset newAsset)
|
String |
getStaticAssetEnvironmentSecureUrlPrefix()
|
String |
getStaticAssetEnvironmentUrlPrefix()
|
String |
getStaticAssetUrlPrefix()
|
void |
itemPromoted(SandBoxItem sandBoxItem,
SandBox destinationSandBox)
|
void |
itemRejected(SandBoxItem sandBoxItem,
SandBox destinationSandBox)
|
void |
itemReverted(SandBoxItem sandBoxItem)
|
List<StaticAsset> |
readAllStaticAssets()
|
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. |
StaticAsset |
updateStaticAsset(StaticAsset staticAsset,
SandBox destSandbox)
This method is intended to be called from within the CMS admin only. |
| Methods inherited from class org.broadleafcommerce.cms.common.AbstractContentService |
|---|
countItems, findItems |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ImageArtifactProcessor imageArtifactProcessor
@Value(value="${asset.use.filesystem.storage}")
protected boolean storeAssetsOnFileSystem
@Value(value="${automatically.approve.static.assets}")
protected boolean automaticallyApproveAndPromoteStaticAssets
protected StaticAssetDao staticAssetDao
protected SandBoxItemDao sandBoxItemDao
protected StaticAssetStorageService staticAssetStorageService
protected StaticAssetPathService staticAssetPathService
| Constructor Detail |
|---|
public StaticAssetServiceImpl()
| Method Detail |
|---|
public StaticAsset findStaticAssetById(Long id)
findStaticAssetById in interface StaticAssetServicepublic List<StaticAsset> readAllStaticAssets()
readAllStaticAssets in interface StaticAssetServiceprotected String getFileExtension(String fileName)
protected String generateFileName(int size)
size -
protected String buildAssetURL(Map<String,String> assetProperties,
String originalFilename)
url - asset - assetProperties -
@Transactional(value="blTransactionManager")
public StaticAsset createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file,
Map<String,String> properties)
StaticAssetServiceStaticAssetServiceImpl 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.
createStaticAssetFromFile in interface StaticAssetServicefile - - the file being uploadedproperties - - additional meta-data properties
StaticAssetServiceImpl
protected String getCountUrl(String fullUrl,
int count,
boolean legacyFormat)
protected void getMimeType(org.springframework.web.multipart.MultipartFile file,
StaticAsset newAsset)
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 SandBoxItemListenerpublic void itemReverted(SandBoxItem sandBoxItem)
itemReverted in interface SandBoxItemListenerpublic String getStaticAssetUrlPrefix()
getStaticAssetUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetUrlPrefix()public String getStaticAssetEnvironmentUrlPrefix()
getStaticAssetEnvironmentUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetEnvironmentUrlPrefix()public String getStaticAssetEnvironmentSecureUrlPrefix()
getStaticAssetEnvironmentSecureUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetEnvironmentSecureUrlPrefix()public boolean getAutomaticallyApproveAndPromoteStaticAssets()
StaticAssetService
getAutomaticallyApproveAndPromoteStaticAssets in interface StaticAssetServicepublic void setAutomaticallyApproveAndPromoteStaticAssets(boolean automaticallyApproveAndPromoteStaticAssets)
StaticAssetService
setAutomaticallyApproveAndPromoteStaticAssets in interface StaticAssetService
public String convertAssetPath(String assetPath,
String contextPath,
boolean secureRequest)
convertAssetPath in interface StaticAssetServiceStaticAssetPathService.convertAssetPath(String, String, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||