Package org.ametys.plugins.skincommons
Class CommonSkinDAO
java.lang.Object
org.ametys.plugins.skincommons.CommonSkinDAO
- All Implemented Interfaces:
Component
,Serviceable
DAO for skin edition.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncancelChanges
(String skinName, boolean workVersion, String toolId) Cancel the current modification to the skincheckUnsaveModifications
(String skinName) Check if there is unsaved or uncomitted changesclearModifications
(String skinName, boolean workVersion) Revert changes and back to last work version or to current skincommitChanges
(String skinName, boolean quit) Commit the changes made to the skinGet lock informations on a skingetPreviewURI
(String siteName, String lang) Get the URI to preview a sitegetSkinModel
(String siteName, String skinName, String mode) Get the model for the skinsaveChanges
(String skinName, boolean quit) Save the current skin into the skin work foldervoid
service
(ServiceManager smanager)
-
Constructor Details
-
CommonSkinDAO
public CommonSkinDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPreviewURI
Get the URI to preview a site- Parameters:
siteName
- the site namelang
- 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
Save the current skin into the skin work folder- Parameters:
skinName
- The name of the skinquit
- True if the temp directory can be removed- Returns:
- The name of the skin
- Throws:
IOException
- if an error occurs while manipulating files
-
commitChanges
Commit the changes made to the skin- Parameters:
skinName
- the name of the skinquit
- 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 skinworkVersion
- True it is the work version, false for the temp versiontoolId
- the id of the tool- Returns:
- True if some changes were canceled
- Throws:
IOException
- if an error occurs while manipulating files
-
getSkinModel
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
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 nameworkVersion
- 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
-