public class SkinDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
private static String |
__LICENCE |
private I18nUtils |
_i18nUtils |
private SkinModelsManager |
_modelsManager |
private SiteManager |
_siteManager |
private SkinsManager |
_skinsManager |
static String |
ROLE
The avalon role
|
Constructor and Description |
---|
SkinDAO() |
Modifier and Type | Method and Description |
---|---|
private void |
_createConfigFile(File skinDir,
Map<String,Object> values) |
private Map<String,Object> |
_skin2JsonObject(String id,
List<Site> skinSites) |
private List<Object> |
_skins2JsonObject() |
Map<String,Object> |
configureSkin(String skinName,
Map<String,Object> values)
Configure a skin
|
String |
copySkin(String skinId,
String originalSkinId)
Duplicate an existing skin
|
String |
deleteSkin(String skinId)
Delete a skin
|
Map<String,Object> |
getSkin(String skinId)
Retrieve informations on a skin
|
Map<String,Object> |
getSkins()
Retrieve the list of available skins
|
Map<String,Object> |
importSkin(String skinName,
String tmpDirPath,
Map<String,Object> values)
This action receive a form with the "importfile" zip file as an exported skin.
|
boolean |
isInUse(String skinId)
Determines if a skin is currently used by one or more sites
|
void |
service(ServiceManager manager) |
boolean |
skinExists(String skinId)
Determines if a skin exists
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String __LICENCE
private SkinsManager _skinsManager
private SkinModelsManager _modelsManager
private SiteManager _siteManager
private I18nUtils _i18nUtils
public SkinDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getSkin(String skinId)
skinId
- The skin idpublic boolean skinExists(String skinId) throws ProcessingException
skinId
- The skin idProcessingException
- if an error occurspublic boolean isInUse(String skinId)
skinId
- The skin idpublic Map<String,Object> getSkins() throws ProcessingException
ProcessingException
- if an error occursprivate List<Object> _skins2JsonObject()
public Map<String,Object> importSkin(String skinName, String tmpDirPath, Map<String,Object> values) throws TransformerConfigurationException, IOException, SAXException
skinName
- The skin nametmpDirPath
- The directory where the zip was uploadedvalues
- the configuration's values. Can be empty.SAXException
- if an error occurs during configuration file creationIOException
- if an error occurs while manipulating filesTransformerConfigurationException
- if an error occurs during configuration file creationpublic Map<String,Object> configureSkin(String skinName, Map<String,Object> values) throws TransformerConfigurationException, IOException, SAXException
skinName
- the skin namevalues
- the configuration's valuesSAXException
- if an error occurs during configuration file creationIOException
- if an error occurs during configuration file creationTransformerConfigurationException
- if an error occurs during configuration file creationprivate void _createConfigFile(File skinDir, Map<String,Object> values) throws IOException, SAXException, TransformerConfigurationException
public String copySkin(String skinId, String originalSkinId) throws IOException
skinId
- The new skin idoriginalSkinId
- The original skin idIOException
- if an I/O exception occurs during copypublic String deleteSkin(String skinId) throws IOException
skinId
- The skin idIOException
- if an I/O exception occurs during deletion