public class SkinDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
private static String |
__PROD_MODE |
private static String |
__WORK_MODE |
private static DateFormat |
_DATE_FORMAT |
private ModelDesignsManager |
_designsManager |
private I18nUtils |
_i18nUtils |
private LanguagesManager |
_languageManager |
private SkinLockManager |
_lockManager |
private SkinModelsManager |
_modelsManager |
private SiteManager |
_siteManager |
private SkinFactoryComponent |
_skinFactoryManager |
private SkinEditionHelper |
_skinHelper |
private SkinsManager |
_skinsManager |
private UploadManager |
_uploadManager |
private UserManager |
_userManager |
private CurrentUserProvider |
_userProvider |
static String |
SKIN_FACTORY_TOOL_ID
Constant for skin editor tool id
|
Constructor and Description |
---|
SkinDAO() |
Modifier and Type | Method and Description |
---|---|
private void |
_copyFilesToPreserve(File skinDir) |
private String |
_getDefaultLanguage(File i18nFile) |
private String |
_getHash(File skinDir) |
private File |
_getUploadDir(File tempDir,
ImageParameter imgParam) |
private List<Object> |
_imageFiles2JsonObject(String imageDirPath,
String libraryDirPath,
File file,
String modelName,
boolean deep) |
private boolean |
_isImage(File file) |
private void |
_preserveFile(File skinDir,
File fileToPreserve) |
private void |
_reapplyModel(File skinDir,
File modelDir,
String hash) |
private Map<String,Object> |
_uploadImages2JsonObject(File uploadDir,
String skinName,
ImageParameter imageParam) |
Map<String,Object> |
affectDesign(String skinName,
String designId)
Affect a new design configuration
|
Map<String,Object> |
changeModel(String modelName,
String skinName,
boolean useDefaults)
Change the model of a skin
|
protected Map<String,Object> |
checkLock(File skinDir)
Determines the skin directory is locked.
|
String |
checkManualCloseCondition(String skinId)
Check the current save state of a skin
|
Map<String,String> |
checkOpenCondition(String siteName)
Check the conditions for opening the current skin of a site
|
Map<String,Object> |
getColors(String siteName)
Get the colors of a model and its theme for a site.
|
Map<String,Object> |
getCssStyleItems(String siteName)
Get the css style items used by a site
|
Map<String,Object> |
getGalleryImages(String skinName,
String paramId)
Retrieve the list of images for the skin and parameter
|
List<Object> |
getGalleryVariants(String skinName,
String paramId)
Retrieve the list of gallery variants available for the specified skin and parameter
|
Map<String,Object> |
getLanguages(String siteName)
Get the languages available on a site
|
Map<String,Object> |
getParametersValues(String siteName,
List<String> paramIds)
Get the parameters of the skin of a site
|
Map<String,Object> |
getSkinModelParameters(String modelName)
Get the skin model's parameters
|
List<Object> |
getThemeColors(String siteName)
Retrieve the list of themes' colors for a site
|
Map<String,String> |
openSkin(String siteName,
String mode)
Open the skin of a site for edition
|
Map<String,Object> |
restoreDefaults(String skinName)
Restore the default parameters for a skin
|
void |
service(ServiceManager manager) |
Map<String,Object> |
updateColorTheme(String skinName,
String themeId)
Set the theme used by a skin
|
Map<String,Object> |
updateParameter(String skinName,
String lang,
String parameterId,
String value,
boolean uploaded)
Update a parameter of the skin
|
Map<String,Object> |
uploadLocalImage(String uploadId,
String fileName,
String skinName,
String parameterId)
Upload a local image and set it as value for a image parameter
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public static final String SKIN_FACTORY_TOOL_ID
private static final DateFormat _DATE_FORMAT
private static final String __WORK_MODE
private static final String __PROD_MODE
private CurrentUserProvider _userProvider
private I18nUtils _i18nUtils
private LanguagesManager _languageManager
private ModelDesignsManager _designsManager
private SiteManager _siteManager
private SkinEditionHelper _skinHelper
private SkinFactoryComponent _skinFactoryManager
private SkinLockManager _lockManager
private SkinModelsManager _modelsManager
private SkinsManager _skinsManager
private UserManager _userManager
private UploadManager _uploadManager
public SkinDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public String checkManualCloseCondition(String skinId) throws IOException
skinId
- The skin idIOException
- if an error occurs when manipulating filespublic Map<String,String> checkOpenCondition(String siteName) throws IOException
siteName
- The name of the siteIOException
- if an error occurs when manipulating filesprotected Map<String,Object> checkLock(File skinDir) throws IOException
skinDir
- The skin directoryIOException
- if an error occurs when manipulating filespublic Map<String,Object> affectDesign(String skinName, String designId) throws IOException
skinName
- The skin namedesignId
- The design idIOException
- if an error occurs when manipulating filespublic Map<String,Object> changeModel(String modelName, String skinName, boolean useDefaults) throws IOException, TransformerConfigurationException, SAXException
modelName
- The model nameskinName
- The skin nameuseDefaults
- true
to use default model parametersIOException
- if an error occurs when manipulating filesTransformerConfigurationException
- if something goes wrong when generating the model fileSAXException
- if an error occurs while saxingpublic Map<String,Object> getLanguages(String siteName)
siteName
- The site nameprivate String _getDefaultLanguage(File i18nFile)
public Map<String,Object> getColors(String siteName)
siteName
- The site namepublic Map<String,Object> getCssStyleItems(String siteName)
siteName
- The site namepublic Map<String,Object> getParametersValues(String siteName, List<String> paramIds)
siteName
- The site nameparamIds
- If not null, specify the ids of the parameters to retrievepublic Map<String,String> openSkin(String siteName, String mode) throws IOException
siteName
- The site namemode
- The open modeIOException
- if an error occurs when manipulating filesprivate void _reapplyModel(File skinDir, File modelDir, String hash) throws IOException
IOException
private void _preserveFile(File skinDir, File fileToPreserve) throws IOException
IOException
private void _copyFilesToPreserve(File skinDir) throws IOException
IOException
public Map<String,Object> restoreDefaults(String skinName) throws IOException, TransformerConfigurationException, SAXException
skinName
- The skin nameIOException
- if an error occurs when manipulating filesTransformerConfigurationException
- if something goes wrong when generating the model fileSAXException
- if an error occurs while saxingpublic Map<String,Object> updateColorTheme(String skinName, String themeId) throws IOException
skinName
- The skin namethemeId
- The theme idIOException
- if an error occurs when manipulating filespublic Map<String,Object> updateParameter(String skinName, String lang, String parameterId, String value, boolean uploaded) throws IOException
skinName
- The skin namelang
- The current languageparameterId
- The parameter id to updatevalue
- The new value for the parameteruploaded
- true
if the file was uploadedIOException
- if an error occurs when manipulating filespublic Map<String,Object> uploadLocalImage(String uploadId, String fileName, String skinName, String parameterId) throws IOException
uploadId
- The upload identifierfileName
- The name of uploaded fileskinName
- The skin nameparameterId
- The parameter id to updateIOException
- if an error occurs when manipulating filespublic Map<String,Object> getGalleryImages(String skinName, String paramId) throws IOException
skinName
- The skin nameparamId
- The parameter idIOException
- if an error occurs when manipulating filesprivate Map<String,Object> _uploadImages2JsonObject(File uploadDir, String skinName, ImageParameter imageParam)
private List<Object> _imageFiles2JsonObject(String imageDirPath, String libraryDirPath, File file, String modelName, boolean deep)
private File _getUploadDir(File tempDir, ImageParameter imgParam)
public List<Object> getGalleryVariants(String skinName, String paramId) throws IOException
skinName
- The skin nameparamId
- The parameter idIOException
- if an error occurs when manipulating filespublic Map<String,Object> getSkinModelParameters(String modelName)
modelName
- The model namepublic List<Object> getThemeColors(String siteName)
siteName
- The site name