public class PageLink extends AbstractLink
PageLink
class provides functionality to validate
and resolve links to Pages.
Constructor and Description |
---|
PageLink(int publicationId)
Creates a new PageLink instance.
|
PageLink(String publicationURI)
Creates a new PageLink instance.
|
PageLink(String namespace,
int publicationId,
boolean relativeLink)
Creates a new PageLink instance.
|
Modifier and Type | Method and Description |
---|---|
Link |
getLink(int targetPageId)
Create a new Link object targetting a page with just a page Id.
|
Link |
getLink(int targetPageId,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
Create a Link object targetting a page.
|
Link |
getLink(int targetPageId,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters)
Create a Link object targeting a page.
|
Link |
getLink(String targetPageURI)
Create a new Link object targetting a page with just a page URI.
|
Link |
getLink(String targetPageURI,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
Create a page link using a tcm:uri.
|
Link |
getLink(String targetPageURI,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters)
Create a page link using a tcm:uri.
|
Link |
getLink(String targetPageURI,
String targetURL,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters)
Create a page link as a String a tcm:uri.
|
String |
getLinkAsString(int targetPageId,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
Create a page link as a String.
|
String |
getLinkAsString(int targetPageId,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters)
Create a page link as a String, using a tcm:uri.
|
String |
getLinkAsString(int targetPageId,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters,
LinkStringStyle style)
Create a page link as a String, using a tcm:uri.
|
String |
getLinkAsString(String targetPageURI,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
Create a page link as a String using a tcm:uri.
|
String |
getLinkAsString(String targetPageURI,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters)
Create a page link as a String, using a tcm:uri.
|
String |
getLinkAsString(String targetPageURI,
String anchor,
String linkTagAttributes,
String linkText,
boolean showTextOnFail,
String parameters,
LinkStringStyle style)
Create a page link as a String, using a tcm:uri.
|
getBaseNamespaceId, getErrorList, getFullyQualifiedURL, getLinking, getNamespace, getNamespaceService, getPublicationId, getURL, isRelativeLink, isWrappedCacheDAO, setPublicationId
public PageLink(String namespace, int publicationId, boolean relativeLink)
namespace
- The namespace of the publication that is targetedpublicationId
- The id of the publication that is targeted.relativeLink
- If true then the realtive URL will be returned from a Link
object
despite on linking configuration.public PageLink(int publicationId)
publicationId
- The id of the publication that is targeted.public PageLink(String publicationURI)
publicationURI
- The tcm:uri of the publication that is targetted.public Link getLink(int targetPageId)
targetPageId
- Id for the targetpagepublic Link getLink(String targetPageURI)
targetPageURI
- The URI for the targetpagepublic Link getLink(int targetPageId, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters)
targetPageId
- Id for the targetpageanchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The linkText that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.public Link getLink(int targetPageId, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail)
targetPageId
- Id for the targetpageanchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The linkText that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.public Link getLink(String targetPageURI, String targetURL, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters)
targetPageURI
- The Id of the page where this link should link to.targetURL
- The targetURL for the targetpageanchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.public Link getLink(String targetPageURI, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters)
targetPageURI
- The Id of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.public Link getLink(String targetPageURI, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail)
targetPageURI
- The Id of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.public String getLinkAsString(int targetPageId, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail)
targetPageId
- The Id of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The linkText that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.public String getLinkAsString(int targetPageId, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters, LinkStringStyle style)
targetPageId
- The tcm:uri of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.style
- Link stylepublic String getLinkAsString(int targetPageId, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters)
targetPageId
- The tcm:uri of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.public String getLinkAsString(String targetPageURI, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters, LinkStringStyle style)
targetPageURI
- The tcm:uri of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.style
- Link stylepublic String getLinkAsString(String targetPageURI, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail, String parameters)
targetPageURI
- The tcm:uri of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.parameters
- HTTP parameters to be appended to the URL.public String getLinkAsString(String targetPageURI, String anchor, String linkTagAttributes, String linkText, boolean showTextOnFail)
targetPageURI
- The tcm:uri of the page where this link should link to.anchor
- The anchor on the page where the link has to be
pointing to.linkTagAttributes
- Attributes to include in the link.linkText
- The text that builds up the link.showTextOnFail
- Indicates if the linkText needs to be returned
in case no link can be build: an empty string is returned if false.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries