Package io.wcm.handler.media.spi
Class MediaHandlerConfig
- java.lang.Object
-
- io.wcm.handler.media.spi.MediaHandlerConfig
-
- All Implemented Interfaces:
io.wcm.sling.commons.caservice.ContextAwareService
@ConsumerType public abstract class MediaHandlerConfig extends Object implements io.wcm.sling.commons.caservice.ContextAwareService
MediaHandlerConfigOSGi services provide application-specific configuration for media handling. Applications can set service properties or bundle headers as defined inContextAwareServiceto apply this configuration only for resources that match the relevant resource paths.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_JPEG_QUALITYDefault value for JPEG quality.
-
Constructor Summary
Constructors Constructor Description MediaHandlerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringgetDamRootPath(@NotNull com.day.cq.wcm.api.Page page)Get root path for picking assets using path field widgets.doublegetDefaultImageQuality(String mimeType)Get the default quality for images in this app generated with the Layer API.@NotNull List<Class<? extends MediaMarkupBuilder>>getMarkupBuilders()@NotNull StringgetMediaAltTextProperty()@NotNull StringgetMediaCropProperty()@NotNull StringgetMediaInlineNodeName()@NotNull StringgetMediaMapProperty()@NotNull StringgetMediaRefProperty()@NotNull StringgetMediaRotationProperty()@NotNull List<Class<? extends MediaProcessor>>getPostProcessors()@NotNull List<Class<? extends MediaProcessor>>getPreProcessors()@NotNull List<Class<? extends MediaSource>>getSources()booleanincludeAssetWebRenditionsByDefault()booleanuseAdobeStandardNames()With this switch it's possible to switch all used property and node names from (legacy) wcm.io Handler standard to Adobe Standard (as used e.g. in Adobe Core WCM Components) - e.g.
-
-
-
Field Detail
-
DEFAULT_JPEG_QUALITY
public static final double DEFAULT_JPEG_QUALITY
Default value for JPEG quality.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSources
@NotNull public @NotNull List<Class<? extends MediaSource>> getSources()
- Returns:
- Supported media sources
-
getMarkupBuilders
@NotNull public @NotNull List<Class<? extends MediaMarkupBuilder>> getMarkupBuilders()
- Returns:
- Available media markup builders
-
getPreProcessors
@NotNull public @NotNull List<Class<? extends MediaProcessor>> getPreProcessors()
- Returns:
- List of media metadata pre processors (optional). The processors are applied in list order.
-
getPostProcessors
@NotNull public @NotNull List<Class<? extends MediaProcessor>> getPostProcessors()
- Returns:
- List of media metadata post processors (optional). The processors are applied in list order.
-
getDefaultImageQuality
public double getDefaultImageQuality(String mimeType)
Get the default quality for images in this app generated with the Layer API. The meaning of the quality parameter for the different image formats is described inLayer.write(String, double, java.io.OutputStream).- Parameters:
mimeType- MIME-type of the output format- Returns:
- Quality factor
-
useAdobeStandardNames
public boolean useAdobeStandardNames()
With this switch it's possible to switch all used property and node names from (legacy) wcm.io Handler standard to Adobe Standard (as used e.g. in Adobe Core WCM Components) - e.g. using "fileReference" instead of property name "mediaRef" for the asset reference.The benefit of the wcm.io Handler standard was that it supported storage multiple asset references in one single node - but this it not well supported by the Touch UI anyway, so it's not of much use nowadays.
For new projects it is recommended to always use the Adobe standard names. But for backward compatibility the default values is false.
- Returns:
- If true, Adobe standard property and node names are used.
-
getMediaRefProperty
@NotNull public @NotNull String getMediaRefProperty()
- Returns:
- Default property name for reference to media library item
-
getMediaCropProperty
@NotNull public @NotNull String getMediaCropProperty()
- Returns:
- Default property name for cropping parameters
-
getMediaRotationProperty
@NotNull public @NotNull String getMediaRotationProperty()
- Returns:
- Default property name for rotate parameter
-
getMediaMapProperty
@NotNull public @NotNull String getMediaMapProperty()
- Returns:
- Default property name for map parameter
-
getMediaAltTextProperty
@NotNull public @NotNull String getMediaAltTextProperty()
- Returns:
- Default property name for media alt. text
-
getMediaInlineNodeName
@NotNull public @NotNull String getMediaInlineNodeName()
- Returns:
- Default node name for inline media item stored in node within the content page
-
includeAssetWebRenditionsByDefault
public boolean includeAssetWebRenditionsByDefault()
- Returns:
- If set to true, web renditions generated by the DAM asset workflows (with cq5dam.web prefix) are taken into account by default when trying to resolve the media request.
-
getDamRootPath
@NotNull public @NotNull String getDamRootPath(@NotNull @NotNull com.day.cq.wcm.api.Page page)
Get root path for picking assets using path field widgets.- Parameters:
page- Context page- Returns:
- DAM root path
-
-