Package io.wcm.handler.link.type
Class ExternalLinkType
java.lang.Object
io.wcm.handler.link.spi.LinkType
io.wcm.handler.link.type.ExternalLinkType
@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class})
@ProviderType
public final class ExternalLinkType
extends LinkType
Default implementation of
LinkType for external links.
External links are links to destinations outside the CMS.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether a link reference string can be handled by this link type@Nullable StringGranite UI component resource type to be used for editing this link type's properties in edit dialog.@NotNull StringgetId()Get link type ID.@NotNull StringgetLabel()Get link type label.Get primary link reference property.static @NotNull org.apache.sling.api.resource.ResourcegetSyntheticLinkResource(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull String path, @NotNull String url) Get synthetic link resource for this link type.booleanReturns true if a RTE plugin is available for this link type.@NotNull LinkresolveLink(@NotNull Link link) Resolves a linktoString()
-
Field Details
-
ID
Link type ID- See Also:
-
-
Constructor Details
-
ExternalLinkType
public ExternalLinkType()
-
-
Method Details
-
getId
Description copied from class:LinkTypeGet link type ID. -
getLabel
Description copied from class:LinkTypeGet link type label. -
getPrimaryLinkRefProperty
Description copied from class:LinkTypeGet primary link reference property.- Specified by:
getPrimaryLinkRefPropertyin classLinkType- Returns:
- Name of the property in which the primary link reference is stored
-
getEditComponentResourceType
Description copied from class:LinkTypeGranite UI component resource type to be used for editing this link type's properties in edit dialog.- Overrides:
getEditComponentResourceTypein classLinkType- Returns:
- Granite UI component resource type or null, if none is available
-
hasRichTextPlugin
public boolean hasRichTextPlugin()Description copied from class:LinkTypeReturns true if a RTE plugin is available for this link type. If not, it is not possible to select this link type in the rich text editor.- Overrides:
hasRichTextPluginin classLinkType- Returns:
- true if a RTE plugin is available.
-
accepts
Description copied from class:LinkTypeChecks whether a link reference string can be handled by this link type -
resolveLink
Description copied from class:LinkTypeResolves a link- Specified by:
resolveLinkin classLinkType- Parameters:
link- Link metadata- Returns:
- Resolved link metadata. Never null.
-
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 url) 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.url- Link URL- Returns:
- Synthetic link resource
-
toString
-