Package org.ametys.web.skin
Class SkinOptionalSourceFallback
java.lang.Object
org.ametys.web.skin.SkinOptionalSourceFallback
- All Implemented Interfaces:
OptionalSourceFallback
,FileReloader
,Initializable
,Component
,Contextualizable
,Serviceable
public class SkinOptionalSourceFallback
extends Object
implements OptionalSourceFallback, Component, Serviceable, Initializable, Contextualizable, FileReloader
This implementation will read its configuration from the current skin in conf/optional-source-fallbacks.xml
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) Fallback to a default value if the uri is not supportedGet an unique ID for this File Reloadervoid
void
service
(ServiceManager manager) void
updateFile
(String sourceUrl, Source source, InputStream is) Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it
-
Constructor Details
-
SkinOptionalSourceFallback
public SkinOptionalSourceFallback()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
fallback
Description copied from interface:OptionalSourceFallback
Fallback to a default value if the uri is not supported- Specified by:
fallback
in interfaceOptionalSourceFallback
- Parameters:
uri
- The uri that is not supported- Returns:
- The fallback url if any or null otherwise
-
updateFile
Description copied from interface:FileReloader
Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFile
in interfaceFileReloader
- Parameters:
sourceUrl
- the url of the file.source
- the source to read, can be null if no file was readis
- the input stream to read, can be null if no file was read- Throws:
Exception
- something went wrong while reading the inputstream
-
getId
Description copied from interface:FileReloader
Get an unique ID for this File Reloader- Specified by:
getId
in interfaceFileReloader
- Parameters:
sourceUrl
- this is passed as an argument if your class read multiple files. If it reads only one file, the full class name can be a good enough ID- Returns:
- an unique ID
-