Package org.ametys.web.skin
Class SkinConfigurationHelper
- java.lang.Object
-
- org.ametys.web.skin.SkinConfigurationHelper
-
- All Implemented Interfaces:
Component
,Serviceable
public class SkinConfigurationHelper extends Object implements Component, Serviceable
Helper to read a skin configuration file that will handle inheritance
-
-
Field Summary
Fields Modifier and Type Field Description private SAXParser
_saxParser
private SkinsManager
_skinsManager
static String
ROLE
The avalon role
-
Constructor Summary
Constructors Constructor Description SkinConfigurationHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
_getInheritanceMergedFile(Skin skin, String relativeConfigurationFileUri, Templates mergeXSL)
private String
_getLocalOnlyFileContent(Skin skin, String relativeConfigurationFileUri)
private String
_merge(String strongFile, String weakFile, Templates mergeXSL)
Configuration
getInheritanceMergedConfiguration(Skin skin, String relativeConfigurationFileUri, InputStream mergeXSLIS)
Get the configuration representing a file in a skin taking in account the inheritance processvoid
service(ServiceManager manager)
-
-
-
Field Detail
-
_skinsManager
private SkinsManager _skinsManager
-
_saxParser
private SAXParser _saxParser
-
-
Constructor Detail
-
SkinConfigurationHelper
public SkinConfigurationHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getInheritanceMergedConfiguration
public Configuration getInheritanceMergedConfiguration(Skin skin, String relativeConfigurationFileUri, InputStream mergeXSLIS) throws IOException, ConfigurationException, SAXException
Get the configuration representing a file in a skin taking in account the inheritance process- Parameters:
skin
- The skin to considerrelativeConfigurationFileUri
- The configuration file uri relative to the skin. For example : "conf/tags.xml"mergeXSLIS
- The XSL file used to merge two configuration file- Returns:
- The configuration or null if the configuration file does not exists
- Throws:
IOException
- If an error occurred while opening the configuration fileConfigurationException
- If the configuration file contains errorsSAXException
- If a XML parsing error occurred in the configuration file
-
_getInheritanceMergedFile
private String _getInheritanceMergedFile(Skin skin, String relativeConfigurationFileUri, Templates mergeXSL) throws IOException, SAXException
- Throws:
IOException
SAXException
-
_merge
private String _merge(String strongFile, String weakFile, Templates mergeXSL) throws IOException, SAXException
- Throws:
IOException
SAXException
-
_getLocalOnlyFileContent
private String _getLocalOnlyFileContent(Skin skin, String relativeConfigurationFileUri) throws IOException
- Throws:
IOException
-
-