Package io.wcm.handler.link.type
Class MediaLinkType
- java.lang.Object
-
- io.wcm.handler.link.spi.LinkType
-
- io.wcm.handler.link.type.MediaLinkType
-
@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class}) @ProviderType public final class MediaLinkType extends LinkTypeDefault implementation ofLinkTypefor media links. Media links are links to media items from media sources that implement theMediaSourceinterface.
-
-
Constructor Summary
Constructors Constructor Description MediaLinkType()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaccepts(@NotNull String linkRef)Checks whether a link reference string can be handled by this link type@NotNull StringgetId()@NotNull StringgetLabel()StringgetPrimaryLinkRefProperty()static @NotNull org.apache.sling.api.resource.ResourcegetSyntheticLinkResource(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String mediaRef)Deprecated.static @NotNull org.apache.sling.api.resource.ResourcegetSyntheticLinkResource(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String path, @NotNull String mediaRef)Get synthetic link resource for this link type.static booleanisDefaultMediaContentPath(String path)@NotNull LinkresolveLink(@NotNull Link link)Resolves a linkStringtoString()
-
-
-
Field Detail
-
ID
@NotNull public static final @NotNull String ID
Link type ID- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
@NotNull public @NotNull String getId()
-
getLabel
@NotNull public @NotNull String getLabel()
-
getPrimaryLinkRefProperty
public String getPrimaryLinkRefProperty()
- Specified by:
getPrimaryLinkRefPropertyin classLinkType- Returns:
- Name of the property in which the primary link reference is stored
-
accepts
public boolean accepts(@NotNull @NotNull String linkRef)Description copied from class:LinkTypeChecks whether a link reference string can be handled by this link type
-
resolveLink
@NotNull public @NotNull Link resolveLink(@NotNull @NotNull Link link)
Description copied from class:LinkTypeResolves a link- Specified by:
resolveLinkin classLinkType- Parameters:
link- Link metadata- Returns:
- Resolved link metadata. Never null.
-
isDefaultMediaContentPath
public static boolean isDefaultMediaContentPath(String path)
- Parameters:
path- Content path- Returns:
- true if Path is located below DAM default root folders.
-
getSyntheticLinkResource
@NotNull public static @NotNull org.apache.sling.api.resource.Resource getSyntheticLinkResource(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String path, @NotNull @NotNull String mediaRef)Get synthetic link resource for this link type.- Parameters:
resourceResolver- Resource resolverpath- Resource path. Can be a non-existing path, but the path should be located somewhere within the applications content paths to make sure the handler configuration looked up via context-aware services is the expected one.mediaRef- Media asset reference- Returns:
- Synthetic link resource
-
getSyntheticLinkResource
@Deprecated @NotNull public static @NotNull org.apache.sling.api.resource.Resource getSyntheticLinkResource(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull String mediaRef)
Deprecated.Get synthetic link resource for this link type.- Parameters:
resourceResolver- Resource resolvermediaRef- Media asset reference- Returns:
- Synthetic link resource
-
-