Class SkinEditionHelper

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.skincommons.SkinEditionHelper
All Implemented Interfaces:
LogEnabled, Component, Contextualizable, Serviceable, ThreadSafe

Helper for skin edition
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • createBackupFile

      public Path createBackupFile(String skinName) throws IOException
      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

      public boolean deleteQuicklyDirectory(Path file) throws IOException
      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

      public void deleteOldBackup(String skinName, int keepMax) throws IOException
      Remove the old backup
      Parameters:
      skinName - The skin name
      keepMax - The max number of backup to keep
      Throws:
      IOException - if an error occurs while manipulating files
    • invalidateCaches

      public void invalidateCaches(String skinName) throws Exception
      Invalidate all caches relative to the modified skin.
      Parameters:
      skinName - the modified skin name.
      Throws:
      Exception - if an error occurs.
    • invalidateTempSkinCatalogues

      public void invalidateTempSkinCatalogues(String skinName)
      Invalidate all catalogs of the temporary skin
      Parameters:
      skinName - The site name
    • invalidateTempSkinCatalogue

      public void invalidateTempSkinCatalogue(String skinName, String lang)
      Invalidate a catalog of the temporary skin for a given language
      Parameters:
      skinName - The site name
      lang - The language
    • invalidateSkinCatalogues

      public void invalidateSkinCatalogues(String skinName)
      Invalidate all catalogs of the skin
      Parameters:
      skinName - The skin name
    • invalidateSkinCatalogue

      public void invalidateSkinCatalogue(String skinName, String lang)
      Invalidate a catalog of the skin for a given language
      Parameters:
      skinName - The site name
      lang - The language
    • getTempDirectory

      public Path getTempDirectory(String skinName)
      Get the temp directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The temp directory
    • getWorkDirectory

      public Path getWorkDirectory(String skinName)
      Get the work directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The work directory
    • getBackupDirectory

      public Path getBackupDirectory(String skinName, Date date)
      Get the backup directory of skin
      Parameters:
      skinName - The skin name
      date - The date
      Returns:
      The backup directory
    • getRootBackupDirectory

      public File getRootBackupDirectory(String skinName)
      Get the root backup directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The root backup directory
    • getTempDirectoryURI

      public String getTempDirectoryURI(String skinName)
      Get the temp directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The temp directory URI
    • getWorkDirectoryURI

      public String getWorkDirectoryURI(String skinName)
      Get the work directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The work directory URI
    • getBackupDirectoryURI

      public String getBackupDirectoryURI(String skinName, Date date)
      Get the backup directory of skin
      Parameters:
      skinName - The skin name
      date - 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

      public Path getSkinDirectory(String skinName)
      Get the skin directory of skin
      Parameters:
      skinName - The skin name
      Returns:
      The skin directory
    • getTempModel

      public String getTempModel(String skinName)
      Get the model of temporary version of skin
      Parameters:
      skinName - The skin name
      Returns:
      the model name
    • getWorkModel

      public String getWorkModel(String skinName)
      Get the model of working version of skin
      Parameters:
      skinName - The skin name
      Returns:
      the model name
    • getSkinModel

      public String getSkinModel(String skinName)
      Get the model of the skin
      Parameters:
      skinName - skinName The skin name
      Returns:
      The model name or null