public class SkinModelDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
private static DateFormat |
_DATE_FORMAT |
private I18nUtils |
_i18nUtils |
private SkinModelsManager |
_modelsManager |
private SkinDAO |
_skinDAO |
private SkinFactoryComponent |
_skinFactoryManager |
private SkinEditionHelper |
_skinHelper |
private SkinsManager |
_skinsManager |
Constructor and Description |
---|
SkinModelDAO() |
Modifier and Type | Method and Description |
---|---|
private List<Object> |
_models2JsonObject() |
protected void |
applyModel(Skin skin,
String modelId)
Apply model to the skin
|
void |
applyModel(String skinId,
String modelId)
Apply model to the skin
|
Set<String> |
applyModelToAll(String modelId)
Apply the model to all its skins
|
void |
delete(String modelId)
Delete a model
|
String |
generateSkin(String skinId,
String modelId)
Generate a new skin from a model
|
Map<String,Object> |
getModel(String modelId)
Retrieve informations on a skin
|
Map<String,Object> |
getSkinsAndModels()
Retrieve the list of models and skins available
|
String |
importModel(String modelName,
String tmpDirPath)
Import a model from a zip file
|
boolean |
modelExists(String modelId)
Determines if a model exists
|
void |
service(ServiceManager manager) |
private void |
unlinkModel(Skin skin) |
String |
unlinkModel(String skinId,
String modelId)
Unlink the skin from its model
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final DateFormat _DATE_FORMAT
private SkinsManager _skinsManager
private SkinModelsManager _modelsManager
private SkinFactoryComponent _skinFactoryManager
private SkinEditionHelper _skinHelper
private I18nUtils _i18nUtils
public SkinModelDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getModel(String modelId)
modelId
- The skin idpublic Map<String,Object> getSkinsAndModels() throws ProcessingException
ProcessingException
- if something goes wrong when retrieving the skinsprivate List<Object> _models2JsonObject() throws ProcessingException
ProcessingException
public boolean modelExists(String modelId) throws ProcessingException
modelId
- The model idProcessingException
- if something goes wrong when retrieving the list of modelspublic String importModel(String modelName, String tmpDirPath) throws IOException
modelName
- The name of the new modeltmpDirPath
- the tmp dir path where the zip has been uploadedIOException
- if something goes wrong when manipulating filespublic String generateSkin(String skinId, String modelId) throws IOException, ProcessingException
skinId
- The new skin idmodelId
- The modelIOException
- if an error occurs when manipulating filesProcessingException
- if an exception occurred during the generation processspublic Set<String> applyModelToAll(String modelId) throws IOException
modelId
- The model idIOException
- if an error occurs when manipulating filespublic void applyModel(String skinId, String modelId) throws IOException
skinId
- The skin idmodelId
- The id of modelIOException
- if an error occurs when manipulating filesprotected void applyModel(Skin skin, String modelId) throws IOException
skin
- The skinmodelId
- The id of modelIOException
- if an error occurs when manipulating filespublic void delete(String modelId) throws IOException
modelId
- The model idIOException
- if an error occurs when manipulating filespublic String unlinkModel(String skinId, String modelId)
skinId
- The id of the skinmodelId
- The id of the modelprivate void unlinkModel(Skin skin)