Package org.ametys.web.skin
Class ImageCropPreviewsComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.skin.ImageCropPreviewsComponent
- All Implemented Interfaces:
FileReloader,LogEnabled,Initializable,Component,Serviceable
public class ImageCropPreviewsComponent
extends AbstractLogEnabled
implements Component, Initializable, Serviceable, FileReloader
Component to get the crop image previews brought by the skins
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a preview for an image crop, with its dimensions, label and content types conditions -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SkinsManagerThe skins managerprotected SourceResolverThe source resolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates the cachesgetCropPreviews(String skinName) Get the list ofImageCropPreviewsComponent.ImageCropPreviewdefined by the skingetCropPreviewsForContent(String contentId) Get the image crop previews defined by the current skin for a given contentGet an unique ID for this File Reloadervoidvoidservice(ServiceManager smanager) 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 itMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_skinsManager
The skins manager -
_srcResolver
The source resolver
-
-
Constructor Details
-
ImageCropPreviewsComponent
public ImageCropPreviewsComponent()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
_createCaches
Creates the caches -
getCropPreviewsForContent
Get the image crop previews defined by the current skin for a given content- Parameters:
contentId- the content id- Returns:
- the image crop previews as json
-
getCropPreviews
Get the list ofImageCropPreviewsComponent.ImageCropPreviewdefined by the skin- Parameters:
skinName- The skin name- Returns:
- The list of
ImageCropPreviewsComponent.ImageCropPreview
-
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
-