Package org.ametys.skinfactory.model
Class ModelDesignsManager
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.skinfactory.model.ModelDesignsManager
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,ThreadSafe
public class ModelDesignsManager extends AbstractLogEnabled implements ThreadSafe, Serviceable, Component
Manages the design conceptions of a model
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ModelDesignsManager.Design
Bean representing a model design
-
Field Summary
Fields Modifier and Type Field Description private Map<String,Map<String,ModelDesignsManager.Design>>
_designsCache
private SkinModelsManager
_modelsManager
private SkinFactoryComponent
_skinFactoryManager
static String
ROLE
The avalon role name
-
Constructor Summary
Constructors Constructor Description ModelDesignsManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ModelDesignsManager.Design
_configureDesign(String modelName, Path configurationFile)
private void
_configureDesigns(String modelName)
private I18nizableText
_configureI18nizableText(Configuration configuration, I18nizableText defaultValue, String modelName)
private String
_getColorTheme(Path file)
private Map<String,Object>
_getParameterValues(String modelName, Path file)
void
applyDesign(String modelName, String id, Path skinDir)
Apply a designModelDesignsManager.Design
getDesign(String modelName, String id)
Get design instance of given id and model nameMap<String,ModelDesignsManager.Design>
getDesigns(String modelName)
Get all design instances for given modelvoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_modelsManager
private SkinModelsManager _modelsManager
-
_skinFactoryManager
private SkinFactoryComponent _skinFactoryManager
-
_designsCache
private Map<String,Map<String,ModelDesignsManager.Design>> _designsCache
-
-
Constructor Detail
-
ModelDesignsManager
public ModelDesignsManager()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getDesigns
public Map<String,ModelDesignsManager.Design> getDesigns(String modelName)
Get all design instances for given model- Parameters:
modelName
- The model name- Returns:
- all design instances for given model
-
getDesign
public ModelDesignsManager.Design getDesign(String modelName, String id)
Get design instance of given id and model name- Parameters:
modelName
- The model nameid
- The id- Returns:
- design instance
-
applyDesign
public void applyDesign(String modelName, String id, Path skinDir)
Apply a design- Parameters:
modelName
- The model nameid
- Id of designskinDir
- The skin directory (could be temp, work or skins)
-
_configureDesigns
private void _configureDesigns(String modelName)
-
_configureDesign
private ModelDesignsManager.Design _configureDesign(String modelName, Path configurationFile)
-
_getColorTheme
private String _getColorTheme(Path file)
-
_configureI18nizableText
private I18nizableText _configureI18nizableText(Configuration configuration, I18nizableText defaultValue, String modelName) throws ConfigurationException
- Throws:
ConfigurationException
-
-