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 TypeMethodDescriptionvoidcontextualize(Context context) Fallback to a default value if the uri is not supportedGet an unique ID for this File Reloadervoidvoidservice(ServiceManager manager) voidupdateFile(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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
fallback
Description copied from interface:OptionalSourceFallbackFallback to a default value if the uri is not supported- Specified by:
fallbackin interfaceOptionalSourceFallback- Parameters:
uri- The uri that is not supported- Returns:
- The fallback url if any or null otherwise
-
updateFile
Description copied from interface:FileReloaderUpdate the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFilein 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:FileReloaderGet an unique ID for this File Reloader- Specified by:
getIdin 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
-