| Modifier and Type | Class and Description |
|---|---|
static class |
AssetService.OrderType |
| Modifier and Type | Field and Description |
|---|---|
static String |
ASSET_ID_IS_REQUIRED |
static String |
ASSET_TYPE_IS_REQUIRED |
static String |
ASSET_URL_IS_REQUIRED |
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
AssetService(Repository<T> repository,
AssetRepository<T> assetRepository,
AssetImporter<T> assetImporter,
JacksonObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
Asset |
changeAssetOrderInComponent(T component,
String assetId,
AssetService.OrderType ordering)
Uses to change assset order in the component
|
void |
changeAssetStateInPreviewable(T component,
String assetId,
boolean active)
Changes asset state (active/inactive) in prewiable
|
void |
delete(T component,
String assetId)
Delete an external asset
|
void |
duplicateAsset(Path artifactSourcePath,
Path artifactTargetPath,
String sourceArtifactId,
String targetArtifactId)
Duplicate assets when an artifact is duplicated
|
Path |
findAssetPath(String id,
String filename,
String type) |
String |
getAssetContent(T component,
Asset asset) |
void |
loadDefaultAssets(T content) |
Asset |
save(T component,
Asset asset)
Save an external asset
|
Asset |
save(T component,
Asset asset,
byte[] content)
Save an internal asset
|
Asset |
upload(org.springframework.web.multipart.MultipartFile file,
T component,
String type)
Upload a local asset
|
protected static final org.slf4j.Logger logger
public static final String ASSET_TYPE_IS_REQUIRED
public static final String ASSET_URL_IS_REQUIRED
public static final String ASSET_ID_IS_REQUIRED
public AssetService(Repository<T> repository, AssetRepository<T> assetRepository, AssetImporter<T> assetImporter, JacksonObjectMapper mapper)
public Asset upload(org.springframework.web.multipart.MultipartFile file, T component, String type)
public Path findAssetPath(String id, String filename, String type) throws IOException
IOExceptionpublic String getAssetContent(T component, Asset asset) throws IOException
IOExceptionpublic void duplicateAsset(Path artifactSourcePath, Path artifactTargetPath, String sourceArtifactId, String targetArtifactId)
public Asset changeAssetOrderInComponent(T component, String assetId, AssetService.OrderType ordering)
public void changeAssetStateInPreviewable(T component, String assetId, boolean active)
public void loadDefaultAssets(T content)
Copyright © 2021. All rights reserved.