Package org.ametys.skinfactory.model
Class SkinModelDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.skinfactory.model.SkinModelDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Component for interact with a skin model
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyModel
(String skinId, String modelId) Apply model to the skinprotected boolean
applyModel
(Skin skin, String modelId) Apply model to the skinapplyModelToAll
(String modelId) Apply the model to all its skinsvoid
Delete a modelgenerateSkin
(String skinId, String modelId) Generate a new skin from a modelRetrieve informations on a skingetSkinsAndModels
(boolean includeAbstract) Retrieve the list of models and skins availableimportModel
(String modelName, String tmpDirPath) Import a model from a zip fileboolean
modelExists
(String modelId) Determines if a model existsvoid
service
(ServiceManager manager) unlinkModel
(String skinId, String modelId) Unlink the skin from its modelMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
SkinModelDAO
public SkinModelDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getModel
Retrieve informations on a skin- Parameters:
modelId
- The skin id- Returns:
- the informations of a skin
-
getSkinsAndModels
Retrieve the list of models and skins available- Parameters:
includeAbstract
- Should include abstract skins- Returns:
- a map of skins and models
-
modelExists
Determines if a model exists- Parameters:
modelId
- The model id- Returns:
- true if model exists.
- Throws:
ProcessingException
- if something goes wrong when retrieving the list of models
-
importModel
Import a model from a zip file- Parameters:
modelName
- The name of the new modeltmpDirPath
- the tmp dir path where the zip has been uploaded- Returns:
- The model name
- Throws:
IOException
- if something goes wrong when manipulating files
-
generateSkin
Generate a new skin from a model- Parameters:
skinId
- The new skin idmodelId
- The model- Returns:
- An error message, or null on success
- Throws:
IOException
- if an error occurs when manipulating filesProcessingException
- if an exception occurred during the generation processs
-
applyModelToAll
Apply the model to all its skins- Parameters:
modelId
- The model id- Returns:
- The set of modified skins id
- Throws:
IOException
- if an error occurs when manipulating files
-
applyModel
Apply model to the skin- Parameters:
skinId
- The skin idmodelId
- The id of model- Returns:
- true if the model was applyed successfully
- Throws:
IOException
- if an error occurs when manipulating files
-
applyModel
Apply model to the skin- Parameters:
skin
- The skinmodelId
- The id of model- Returns:
- true if the model was applyed successfully
- Throws:
IOException
- if an error occurs when manipulating files
-
delete
Delete a model- Parameters:
modelId
- The model id- Throws:
IOException
- if an error occurs when manipulating files
-
unlinkModel
Unlink the skin from its model- Parameters:
skinId
- The id of the skinmodelId
- The id of the model- Returns:
- An error code, or null on success
- Throws:
IOException
- If an error occurred while removing the link
-