@Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class})
@ProviderType
public final class InternalLinkType
extends LinkType
LinkType for internal links.
Internal links are links to content pages inside the CMS.
This link type ensures all links target only pages inside the same inner-most configuration scope, which is usually
the same site/language. All link paths referencing pages outside this content subtree are rewritten via
UrlHandler.rewritePathToContext(Resource) with the root path of the inner-most configuration scope/site and
then resolved.
| Constructor and Description |
|---|
InternalLinkType() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(LinkRequest linkRequest)
Checks whether a link reference can be handled by this link type
|
boolean |
accepts(String linkRef)
Checks whether a link reference string can be handled by this link type
|
String |
getId() |
String |
getPrimaryLinkRefProperty() |
static org.apache.sling.api.resource.Resource |
getSyntheticLinkResource(org.apache.sling.api.resource.ResourceResolver resourceResolver,
String pageRef)
Get synthetic link resource for this link type.
|
Link |
resolveLink(Link link)
Resolves a link
|
String |
toString() |
public static final String ID
public String getId()
public String getPrimaryLinkRefProperty()
getPrimaryLinkRefProperty in class LinkTypepublic boolean accepts(String linkRef)
LinkTypepublic boolean accepts(LinkRequest linkRequest)
LinkTypepublic Link resolveLink(Link link)
LinkTyperesolveLink in class LinkTypelink - Link metadatapublic static org.apache.sling.api.resource.Resource getSyntheticLinkResource(org.apache.sling.api.resource.ResourceResolver resourceResolver,
String pageRef)
resourceResolver - Resource resolverpageRef - Path to target pageCopyright © 2014–2017 wcm.io. All rights reserved.