Class CommonSkinDAO

java.lang.Object
org.ametys.plugins.skincommons.CommonSkinDAO
All Implemented Interfaces:
Component, Serviceable

public class CommonSkinDAO extends Object implements Serviceable, Component
DAO for skin edition.
  • Constructor Details

  • Method Details

    • service

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

      public String getPreviewURI(String siteName, String lang)
      Get the URI to preview a site
      Parameters:
      siteName - the site name
      lang - the site langage
      Returns:
      The uri
    • checkUnsaveModifications

      Check if there is unsaved or uncomitted changes
      Parameters:
      skinName - The skin name
      Returns:
      The result
      Throws:
      IOException - if an error occurs while manipulating files
    • saveChanges

      public Map<String,Object> saveChanges(String skinName, boolean quit) throws IOException
      Save the current skin into the skin work folder
      Parameters:
      skinName - The name of the skin
      quit - True if the temp directory can be removed
      Returns:
      The name of the skin
      Throws:
      IOException - if an error occurs while manipulating files
    • commitChanges

      public Map<String,Object> commitChanges(String skinName, boolean quit) throws Exception
      Commit the changes made to the skin
      Parameters:
      skinName - the name of the skin
      quit - True to remove the temporary directory
      Returns:
      A map with information
      Throws:
      Exception - if an error occurs when committing the skin changes
    • cancelChanges

      public Map<String,Object> cancelChanges(String skinName, boolean workVersion, String toolId) throws IOException
      Cancel the current modification to the skin
      Parameters:
      skinName - The name of the skin
      workVersion - True it is the work version, false for the temp version
      toolId - the id of the tool
      Returns:
      True if some changes were canceled
      Throws:
      IOException - if an error occurs while manipulating files
    • getSkinModel

      public String getSkinModel(String siteName, String skinName, String mode)
      Get the model for the skin
      Parameters:
      siteName - the site name. Can be null if skinName is not null.
      skinName - the skin name. Can be null if siteName is not null.
      mode - the edition mode. Can be null.
      Returns:
      the model's name or null if there is no model for this skin
    • getLock

      public Map<String,Object> getLock(String siteName, String skinName) throws IOException
      Get lock informations on a skin
      Parameters:
      siteName - the site name. Can be null if skinName is not null.
      skinName - the skin name. Can be null if siteName is not null.
      Returns:
      Informations about the lock
      Throws:
      IOException - if an error occurs
    • clearModifications

      public Map<String,Object> clearModifications(String skinName, boolean workVersion) throws IOException
      Revert changes and back to last work version or to current skin
      Parameters:
      skinName - The skin name
      workVersion - true to get back the work version
      Returns:
      The skin name in case of success or lock infos if the skin is locked.
      Throws:
      IOException - if an error occurs