Class InlineMediaSource
- java.lang.Object
-
- io.wcm.handler.media.spi.MediaSource
-
- io.wcm.handler.mediasource.inline.InlineMediaSource
-
@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class}) @ProviderType public final class InlineMediaSource extends MediaSource
Default implementation for media references to binaries stored in a node inside the content page.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull java.lang.String
ID
Media source ID
-
Constructor Summary
Constructors Constructor Description InlineMediaSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(@NotNull MediaRequest mediaRequest)
Checks whether a media request can be handled by this media sourceboolean
accepts(@Nullable java.lang.String mediaRef)
Checks whether a media request string can be handled by this media sourcevoid
enableMediaDrop(@NotNull io.wcm.handler.commons.dom.HtmlElement element, @NotNull MediaRequest mediaRequest)
Create a drop area for given HTML element to enable drag and drop of DAM assets from content finder to this element.@NotNull java.lang.String
getId()
@Nullable java.lang.String
getPrimaryMediaRefProperty()
@NotNull Media
resolveMedia(@NotNull Media media)
Resolves a media requestjava.lang.String
toString()
-
Methods inherited from class io.wcm.handler.media.spi.MediaSource
getMediaCropDimension, getMediaCropProperty, getMediaMap, getMediaMapProperty, getMediaRef, getMediaRefProperty, getMediaRotation, getMediaRotationProperty, resolveRenditions, setCustomIPECropRatios, updateMediaArgsFromResource
-
-
-
-
Field Detail
-
ID
@NotNull public static final @NotNull java.lang.String ID
Media source ID- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
@NotNull public @NotNull java.lang.String getId()
- Specified by:
getId
in classMediaSource
- Returns:
- Media source ID
-
accepts
public boolean accepts(@NotNull @NotNull MediaRequest mediaRequest)
Description copied from class:MediaSource
Checks whether a media request can be handled by this media source- Overrides:
accepts
in classMediaSource
- Parameters:
mediaRequest
- Media request- Returns:
- true if this media source can handle the given media request
-
accepts
public boolean accepts(@Nullable @Nullable java.lang.String mediaRef)
Description copied from class:MediaSource
Checks whether a media request string can be handled by this media source- Specified by:
accepts
in classMediaSource
- Parameters:
mediaRef
- Media request string- Returns:
- true if this media source can handle the given media request
-
getPrimaryMediaRefProperty
@Nullable public @Nullable java.lang.String getPrimaryMediaRefProperty()
- Specified by:
getPrimaryMediaRefProperty
in classMediaSource
- Returns:
- Name of the property in which the primary media request is stored
-
resolveMedia
@NotNull public @NotNull Media resolveMedia(@NotNull @NotNull Media media)
Description copied from class:MediaSource
Resolves a media request- Specified by:
resolveMedia
in classMediaSource
- Parameters:
media
- Media metadata- Returns:
- Resolved media metadata. Never null.
-
enableMediaDrop
public void enableMediaDrop(@NotNull @NotNull io.wcm.handler.commons.dom.HtmlElement element, @NotNull @NotNull MediaRequest mediaRequest)
Description copied from class:MediaSource
Create a drop area for given HTML element to enable drag and drop of DAM assets from content finder to this element.- Specified by:
enableMediaDrop
in classMediaSource
- Parameters:
element
- Html elementmediaRequest
- Media request to detect media args and property names
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-