Package org.ametys.plugins.skincommons
Class SkinEditionHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.skincommons.SkinEditionHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
,ThreadSafe
public class SkinEditionHelper
extends AbstractLogEnabled
implements Component, ThreadSafe, Serviceable, Contextualizable
Helper for skin edition
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) createBackupFile
(String skinName) Create a backup file of the current skinvoid
deleteOldBackup
(String skinName, int keepMax) Remove the old backupboolean
deleteQuicklyDirectory
(Path file) Asynchronous file deletiongetBackupDirectory
(String skinName, Date date) Get the backup directory of skingetBackupDirectoryURI
(String skinName, Date date) Get the backup directory of skingetRootBackupDirectory
(String skinName) Get the root backup directory of skingetRootBackupDirectoryURI
(String skinName) Get the root backup directory of skingetSkinDirectory
(String skinName) Get the skin directory of skingetSkinModel
(String skinName) Get the model of the skingetTempDirectory
(String skinName) Get the temp directory of skingetTempDirectoryURI
(String skinName) Get the temp directory of skingetTempModel
(String skinName) Get the model of temporary version of skingetWorkDirectory
(String skinName) Get the work directory of skingetWorkDirectoryURI
(String skinName) Get the work directory of skingetWorkModel
(String skinName) Get the model of working version of skinvoid
invalidateCaches
(String skinName) Invalidate all caches relative to the modified skin.void
invalidateSkinCatalogue
(String skinName, String lang) Invalidate a catalog of the skin for a given languagevoid
invalidateSkinCatalogues
(String skinName) Invalidate all catalogs of the skinvoid
invalidateTempSkinCatalogue
(String skinName, String lang) Invalidate a catalog of the temporary skin for a given languagevoid
invalidateTempSkinCatalogues
(String skinName) Invalidate all catalogs of the temporary skinvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role name -
_cocoonContext
The cocoon context
-
-
Constructor Details
-
SkinEditionHelper
public SkinEditionHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
createBackupFile
Create a backup file of the current skin- Parameters:
skinName
- The skin name- Returns:
- The created backup directory
- Throws:
IOException
- If an error occurred
-
deleteQuicklyDirectory
Asynchronous file deletion- Parameters:
file
- The file to delete- Returns:
true
if the deletion succeeded- Throws:
IOException
- if an error occurs while manipulating files
-
deleteOldBackup
Remove the old backup- Parameters:
skinName
- The skin namekeepMax
- The max number of backup to keep- Throws:
IOException
- if an error occurs while manipulating files
-
invalidateCaches
Invalidate all caches relative to the modified skin.- Parameters:
skinName
- the modified skin name.- Throws:
Exception
- if an error occurs.
-
invalidateTempSkinCatalogues
Invalidate all catalogs of the temporary skin- Parameters:
skinName
- The site name
-
invalidateTempSkinCatalogue
Invalidate a catalog of the temporary skin for a given language- Parameters:
skinName
- The site namelang
- The language
-
invalidateSkinCatalogues
Invalidate all catalogs of the skin- Parameters:
skinName
- The skin name
-
invalidateSkinCatalogue
Invalidate a catalog of the skin for a given language- Parameters:
skinName
- The site namelang
- The language
-
getTempDirectory
Get the temp directory of skin- Parameters:
skinName
- The skin name- Returns:
- The temp directory
-
getWorkDirectory
Get the work directory of skin- Parameters:
skinName
- The skin name- Returns:
- The work directory
-
getBackupDirectory
Get the backup directory of skin- Parameters:
skinName
- The skin namedate
- The date- Returns:
- The backup directory
-
getRootBackupDirectory
Get the root backup directory of skin- Parameters:
skinName
- The skin name- Returns:
- The root backup directory
-
getTempDirectoryURI
Get the temp directory of skin- Parameters:
skinName
- The skin name- Returns:
- The temp directory URI
-
getWorkDirectoryURI
Get the work directory of skin- Parameters:
skinName
- The skin name- Returns:
- The work directory URI
-
getBackupDirectoryURI
Get the backup directory of skin- Parameters:
skinName
- The skin namedate
- The date- Returns:
- The backup directory URI
-
getRootBackupDirectoryURI
Get the root backup directory of skin- Parameters:
skinName
- The skin name- Returns:
- The root backup directory URI
-
getSkinDirectory
Get the skin directory of skin- Parameters:
skinName
- The skin name- Returns:
- The skin directory
-
getTempModel
Get the model of temporary version of skin- Parameters:
skinName
- The skin name- Returns:
- the model name
-
getWorkModel
Get the model of working version of skin- Parameters:
skinName
- The skin name- Returns:
- the model name
-
getSkinModel
Get the model of the skin- Parameters:
skinName
- skinName The skin name- Returns:
- The model name or
null
-