public class SkinModelsManager extends AbstractLogEnabled implements ThreadSafe, Serviceable, Component, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected Context |
_cocoonContext
Cocoon context
|
protected Context |
_context
Avalon context
|
protected ServiceManager |
_manager
The avalon service manager
|
protected Map<String,SkinModel> |
_models
The set of templates classified by skins
|
protected SkinsManager |
_skinsManager
The sites manager
|
protected SourceResolver |
_sourceResolver
The excalibur source resolver
|
static String |
ROLE
The avalon role name
|
Constructor and Description |
---|
SkinModelsManager() |
Modifier and Type | Method and Description |
---|---|
private String |
_getModelLocation(String id)
Get the model location
|
private boolean |
_modelExists(File modelDir) |
void |
contextualize(Context context) |
void |
generateModelFile(File skinDir,
String modelId)
Generates the model.xml file for the skin
|
void |
generateModelFile(File skinDir,
String modelId,
String colorTheme)
Generates the model.xml file for the skin
|
SkinModel |
getModel(String id)
Get a model
|
String |
getModelHash(String id)
Get hash from model
|
String |
getModelOfSkin(Skin skin)
Get the id of model associated to a skin
|
Set<String> |
getModels()
Get the list of existing models
|
String |
getModelsLocation()
Get the skins location
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ServiceManager _manager
protected SourceResolver _sourceResolver
protected SkinsManager _skinsManager
protected Context _cocoonContext
public SkinModelsManager()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public Set<String> getModels() throws ProcessingException
ProcessingException
- if an error occurspublic SkinModel getModel(String id)
id
- The id of the modelpublic String getModelOfSkin(Skin skin)
skin
- The skinnull
if there is no model for this skinpublic String getModelHash(String id)
id
- The id of the modelpublic void generateModelFile(File skinDir, String modelId, String colorTheme) throws IOException, SAXException, TransformerConfigurationException
skinDir
- The skin directorymodelId
- The model idcolorTheme
- The id of color theme. Can be null.IOException
- if an I/O exception occurs during generationSAXException
- if an error occurs during generationTransformerConfigurationException
- if an error occurs during generationpublic void generateModelFile(File skinDir, String modelId) throws IOException, SAXException, TransformerConfigurationException
skinDir
- The skin directorymodelId
- The model idIOException
- if an I/O exception occurs during generationSAXException
- if an error occurs during generationTransformerConfigurationException
- if an error occurs during generationpublic String getModelsLocation()
private String _getModelLocation(String id)
id
- The id of the modelprivate boolean _modelExists(File modelDir)