Package io.wcm.handler.link.spi
Class LinkType
java.lang.Object
io.wcm.handler.link.spi.LinkType
- Direct Known Subclasses:
ExternalLinkType,InternalCrossContextLinkType,InternalLinkType,InvalidLinkType,MediaLinkType
Defines a link type supported by
LinkHandler.
This interface has to be implemented by a Sling Model class. The adaptables
should be SlingHttpServletRequest and Resource.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(@NotNull LinkRequest linkRequest) Checks whether a link reference can be handled by this link typeabstract booleanChecks 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.abstract @NotNull StringgetId()Get link type ID.@NotNull StringgetLabel()Get link type label.abstract @Nullable StringGet primary link reference property.booleanReturns true if a RTE plugin is available for this link type.abstract @NotNull LinkresolveLink(@NotNull Link link) Resolves a link
-
Constructor Details
-
LinkType
public LinkType()
-
-
Method Details
-
getId
Get link type ID.- Returns:
- Link type ID (is stored as identifier in repository)
-
getLabel
Get link type label.- Returns:
- Link type label (displayed in link dialogs)
-
getPrimaryLinkRefProperty
Get primary link reference property.- Returns:
- Name of the property in which the primary link reference is stored
-
accepts
Checks whether a link reference can be handled by this link type- Parameters:
linkRequest- Link reference- Returns:
- true if this link type can handle the given link reference
-
accepts
Checks whether a link reference string can be handled by this link type- Parameters:
linkRef- Link reference string- Returns:
- true if this link type can handle the given link reference
-
resolveLink
Resolves a link- Parameters:
link- Link metadata- Returns:
- Resolved link metadata. Never null.
-
getEditComponentResourceType
Granite UI component resource type to be used for editing this link type's properties in edit dialog.- Returns:
- Granite UI component resource type or null, if none is available
-
hasRichTextPlugin
public boolean hasRichTextPlugin()Returns 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.- Returns:
- true if a RTE plugin is available.
-