@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 StaticAssetService
public List<StaticAsset> readAllStaticAssets()
readAllStaticAssets
in interface StaticAssetService
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)
StaticAssetService
StaticAssetServiceImpl
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 StaticAssetService
file
- - the file being uploadedproperties
- - additional meta-data propertiesStaticAssetServiceImpl
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)
findStaticAssetByFullUrl
in interface StaticAssetService
@Transactional(value="blTransactionManager") public StaticAsset addStaticAsset(StaticAsset staticAsset)
StaticAssetService
addStaticAsset
in interface StaticAssetService
@Transactional(value="blTransactionManager") public StaticAsset updateStaticAsset(StaticAsset staticAsset)
StaticAssetService
updateStaticAsset
in interface StaticAssetService
@Transactional(value="blTransactionManager") public void deleteStaticAsset(StaticAsset staticAsset)
StaticAssetService
deleteStaticAsset
in interface StaticAssetService
public String getStaticAssetUrlPrefix()
getStaticAssetUrlPrefix
in interface StaticAssetService
StaticAssetPathService.getStaticAssetUrlPrefix()
public String getStaticAssetEnvironmentUrlPrefix()
getStaticAssetEnvironmentUrlPrefix
in interface StaticAssetService
StaticAssetPathService.getStaticAssetEnvironmentUrlPrefix()
public String getStaticAssetEnvironmentSecureUrlPrefix()
getStaticAssetEnvironmentSecureUrlPrefix
in interface StaticAssetService
StaticAssetPathService.getStaticAssetEnvironmentSecureUrlPrefix()
public String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
convertAssetPath
in interface StaticAssetService
StaticAssetPathService.convertAssetPath(String, String, boolean)
Copyright © 2014. All rights reserved.