@Service(value="blStaticAssetService") public class StaticAssetServiceImpl extends Object implements StaticAssetService
| Modifier and Type | Field and Description |
|---|---|
protected ImageArtifactProcessor |
imageArtifactProcessor |
protected StaticAssetDao |
staticAssetDao |
protected StaticAssetPathService |
staticAssetPathService |
protected StaticAssetStorageService |
staticAssetStorageService |
protected boolean |
storeAssetsOnFileSystem |
| Constructor and Description |
|---|
StaticAssetServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
StaticAsset |
addStaticAsset(StaticAsset staticAsset)
Add an asset outside of Broadleaf Admin.
|
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) |
StaticAsset |
createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file,
Map<String,String> properties)
Used when uploading a file to Broadleaf.
|
void |
deleteStaticAsset(StaticAsset staticAsset)
Delete an asset outside of Broadleaf Admin.
|
StaticAsset |
findStaticAssetByFullUrl(String fullUrl) |
StaticAsset |
findStaticAssetById(Long id) |
protected String |
generateFileName(int size)
Generates a filename as a set of Hex digits.
|
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() |
List<StaticAsset> |
readAllStaticAssets() |
StaticAsset |
updateStaticAsset(StaticAsset staticAsset)
Update an asset outside of Broadleaf Admin.
|
protected ImageArtifactProcessor imageArtifactProcessor
@Value(value="${asset.use.filesystem.storage}")
protected boolean storeAssetsOnFileSystem
protected StaticAssetDao staticAssetDao
protected StaticAssetStorageService staticAssetStorageService
protected StaticAssetPathService staticAssetPathService
public StaticAsset findStaticAssetById(Long id)
findStaticAssetById in interface StaticAssetServicepublic List<StaticAsset> readAllStaticAssets()
readAllStaticAssets in interface StaticAssetServiceprotected 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
The properties Map 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 propertiesStaticAssetServiceImplprotected String getCountUrl(String fullUrl, int count, boolean legacyFormat)
protected void getMimeType(org.springframework.web.multipart.MultipartFile file,
StaticAsset newAsset)
public StaticAsset findStaticAssetByFullUrl(String fullUrl)
findStaticAssetByFullUrl in interface StaticAssetService@Transactional(value="blTransactionManager") public StaticAsset addStaticAsset(StaticAsset staticAsset)
StaticAssetServiceaddStaticAsset in interface StaticAssetService@Transactional(value="blTransactionManager") public StaticAsset updateStaticAsset(StaticAsset staticAsset)
StaticAssetServiceupdateStaticAsset in interface StaticAssetService@Transactional(value="blTransactionManager") public void deleteStaticAsset(StaticAsset staticAsset)
StaticAssetServicedeleteStaticAsset in interface StaticAssetServicepublic String getStaticAssetUrlPrefix()
getStaticAssetUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetUrlPrefix()public String getStaticAssetEnvironmentUrlPrefix()
getStaticAssetEnvironmentUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetEnvironmentUrlPrefix()public String getStaticAssetEnvironmentSecureUrlPrefix()
getStaticAssetEnvironmentSecureUrlPrefix in interface StaticAssetServiceStaticAssetPathService.getStaticAssetEnvironmentSecureUrlPrefix()public String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
convertAssetPath in interface StaticAssetServiceStaticAssetPathService.convertAssetPath(String, String, boolean)Copyright © 2014. All rights reserved.