Package io.wcm.handler.media.markup
Class MediaMarkupBuilderUtil
- java.lang.Object
-
- io.wcm.handler.media.markup.MediaMarkupBuilderUtil
-
@ProviderType public final class MediaMarkupBuilderUtil extends Object
Helper methods forMediaMarkupBuilderimplementations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddDiffDecoration(@NotNull io.wcm.handler.commons.dom.HtmlElement<?> mediaElement, @NotNull org.apache.sling.api.resource.Resource resource, @NotNull String refProperty, @NotNull org.apache.sling.api.SlingHttpServletRequest request)static voidaddDiffDecoration(@NotNull io.wcm.handler.commons.dom.HtmlElement<?> mediaElement, @NotNull org.apache.sling.api.resource.Resource resource, @NotNull String refProperty, @NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable MediaHandlerConfig mediaHandlerConfig)Adds CSS classes that denote the changes to the media element when compared to a different version.static booleancanApplyDragDropSupport(@NotNull MediaRequest mediaRequest, @Nullable com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)Implements check whether to apply drag&drop support as described inDragDropSupport.static booleancanSetCustomIPECropRatios(@NotNull MediaRequest mediaRequest, @Nullable com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)Implements check whether to set customized IPE cropping ratios as described inIPERatioCustomize.static @NotNull DimensiongetMediaformatDimension(@NotNull Media media)Get dimension from first media format defined in media args.
-
-
-
Method Detail
-
addDiffDecoration
@Deprecated public static void addDiffDecoration(@NotNull @NotNull io.wcm.handler.commons.dom.HtmlElement<?> mediaElement, @NotNull @NotNull org.apache.sling.api.resource.Resource resource, @NotNull @NotNull String refProperty, @NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request)
Deprecated.Adds CSS classes that denote the changes to the media element when compared to a different version. If no diff has been requested by the WCM UI, there won't be any changes to the element.- Parameters:
mediaElement- Element to be decoratedresource- Resource pointing to JCR noderefProperty- Name of property for media library item reference. If null, default name is used.request- Servlet request
-
addDiffDecoration
public static void addDiffDecoration(@NotNull @NotNull io.wcm.handler.commons.dom.HtmlElement<?> mediaElement, @NotNull @NotNull org.apache.sling.api.resource.Resource resource, @NotNull @NotNull String refProperty, @NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @Nullable @Nullable MediaHandlerConfig mediaHandlerConfig)Adds CSS classes that denote the changes to the media element when compared to a different version. If no diff has been requested by the WCM UI, there won't be any changes to the element.- Parameters:
mediaElement- Element to be decoratedresource- Resource pointing to JCR noderefProperty- Name of property for media library item reference. If null, default name is used.request- Servlet requestmediaHandlerConfig- Media handler config (can be null, but should not be null)
-
getMediaformatDimension
@NotNull public static @NotNull Dimension getMediaformatDimension(@NotNull @NotNull Media media)
Get dimension from first media format defined in media args. Fall back to dummy min. dimension if none specified.- Parameters:
media- Media metadata- Returns:
- Dimension
-
canApplyDragDropSupport
public static boolean canApplyDragDropSupport(@NotNull @NotNull MediaRequest mediaRequest, @Nullable @Nullable com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)Implements check whether to apply drag&drop support as described inDragDropSupport.- Parameters:
mediaRequest- Media requestwcmComponentContext- WCM component context- Returns:
- true if drag&drop can be applied.
-
canSetCustomIPECropRatios
public static boolean canSetCustomIPECropRatios(@NotNull @NotNull MediaRequest mediaRequest, @Nullable @Nullable com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)Implements check whether to set customized IPE cropping ratios as described inIPERatioCustomize.- Parameters:
mediaRequest- Media requestwcmComponentContext- WCM component context- Returns:
- true if customized IP cropping ratios can be set
-
-