public class SkinEditionHelper extends AbstractLogEnabled implements Component, ThreadSafe, Serviceable, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected Context |
_cocoonContext
The cocoon context
|
private static DateFormat |
_DATE_FORMAT |
private XMLResourceBundleFactory |
_i18nFactory |
private PageElementCache |
_inputDataCache |
private SiteManager |
_siteManager |
private PageElementCache |
_zoneItemCache |
static String |
ROLE
The Avalon role name
|
Constructor and Description |
---|
SkinEditionHelper() |
Modifier and Type | Method and Description |
---|---|
private String |
_getModel(File skinDir) |
private String |
_getSkinId(Site site) |
void |
contextualize(Context context) |
File |
createBackupFile(String skinName)
Create a backup file of the current skin
|
void |
deleteOldBackup(String skinName,
int keepMax)
Remove the old backup
|
boolean |
deleteQuicklyDirectory(File file)
Asynchronous file deletion
|
File |
getBackupDirectory(String skinName,
Date date)
Get the backup directory of skin
|
String |
getBackupDirectoryURI(String skinName,
Date date)
Get the backup directory of skin
|
File |
getRootBackupDirectory(String skinName)
Get the root backup directory of skin
|
String |
getRootBackupDirectoryURI(String skinName)
Get the root backup directory of skin
|
File |
getSkinDirectory(String skinName)
Get the skin directory of skin
|
String |
getSkinModel(String skinName)
Get the model of the skin
|
File |
getTempDirectory(String skinName)
Get the temp directory of skin
|
String |
getTempDirectoryURI(String skinName)
Get the temp directory of skin
|
String |
getTempModel(String skinName)
Get the model of temporary version of skin
|
File |
getWorkDirectory(String skinName)
Get the work directory of skin
|
String |
getWorkDirectoryURI(String skinName)
Get the work directory of skin
|
String |
getWorkModel(String skinName)
Get the model of working version of skin
|
void |
invalidateCaches(String skinName)
Invalidate all caches relative to the modified skin.
|
void |
invalidateSkinCatalogue(String skinName,
String lang)
Invalidate catalogue of the skin
|
void |
invalidateSkinCatalogues(String skinName)
Invalidate all catalogues of the skin
|
void |
invalidateTempSkinCatalogue(String skinName,
String lang)
Invalidate catalogue of the temporary skin
|
void |
invalidateTempSkinCatalogues(String skinName)
Invalidate all catalogues of the temporary skin
|
void |
service(ServiceManager smanager) |
getLogger, setLogger
private static final DateFormat _DATE_FORMAT
protected Context _cocoonContext
private SiteManager _siteManager
private PageElementCache _zoneItemCache
private PageElementCache _inputDataCache
private XMLResourceBundleFactory _i18nFactory
public SkinEditionHelper()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public File createBackupFile(String skinName) throws IOException
skinName
- The skin nameIOException
- If an error occurredpublic boolean deleteQuicklyDirectory(File file) throws IOException
file
- The file to deletetrue
if the deletion succeededIOException
- if an error occurs while manipulating filespublic void deleteOldBackup(String skinName, int keepMax) throws IOException
skinName
- The skin namekeepMax
- The max number of backup to keepIOException
- if an error occurs while manipulating filespublic void invalidateCaches(String skinName) throws Exception
skinName
- the modified skin name.Exception
- if an error occurs.private String _getSkinId(Site site)
public void invalidateSkinCatalogues(String skinName)
skinName
- The skin namepublic void invalidateSkinCatalogue(String skinName, String lang)
skinName
- The site namelang
- The language of cataloguepublic void invalidateTempSkinCatalogues(String skinName)
skinName
- The site namepublic void invalidateTempSkinCatalogue(String skinName, String lang)
skinName
- The site namelang
- The language of cataloguepublic File getTempDirectory(String skinName)
skinName
- The skin namepublic File getWorkDirectory(String skinName)
skinName
- The skin namepublic File getBackupDirectory(String skinName, Date date)
skinName
- The skin namedate
- The datepublic File getRootBackupDirectory(String skinName)
skinName
- The skin namepublic String getTempDirectoryURI(String skinName)
skinName
- The skin namepublic String getWorkDirectoryURI(String skinName)
skinName
- The skin namepublic String getBackupDirectoryURI(String skinName, Date date)
skinName
- The skin namedate
- The datepublic String getRootBackupDirectoryURI(String skinName)
skinName
- The skin namepublic File getSkinDirectory(String skinName)
skinName
- The skin namepublic String getTempModel(String skinName)
skinName
- The skin namepublic String getWorkModel(String skinName)
skinName
- The skin namepublic String getSkinModel(String skinName)
skinName
- skinName The skin namenull