public class DynamicComponentLink extends AbstractLink
DynamicComponentLink
validates links to Dynamic
Component Presentations on Pages. This can be useful when it is
known that a certain page can assemble Component Presentations but
it is not known if both the page and the Component Presentation are
available on the Delivery Server. The receiving page should implement the retrieval of
HTTP-GET-parameters and use them to assemble the ComponentPresentation on the page.
For this the ComponentPresentationAssembler
can be used.Constructor and Description |
---|
DynamicComponentLink(int publicationId)
Creates a new instance using an id for the Publication.
|
DynamicComponentLink(String publicationURI)
Creates a new ComponentLink instance using a tcm:uri for the Publication.
|
DynamicComponentLink(String namespace,
int publicationId,
boolean relativeLink)
Creates a new DynamicComponentLink instance.
|
Modifier and Type | Method and Description |
---|---|
Link |
getLink(int targetPageId,
int targetComponentId,
int targetTemplateId,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
This method tries to validate a link to a Dynamic Component Presentation on a Page.
|
Link |
getLink(String targetPageURI,
String targetComponentURI,
String targetTemplateURI,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
This method tries to validate a link to a Dynamic Component Presentation on a Page.
|
String |
getLinkAsString(int targetPageId,
int targetComponentId,
int targetTemplateId,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
This method tries to validate a link to a Dynamic Component Presentation on a Page.
|
String |
getLinkAsString(String targetPageURI,
String targetComponentURI,
String targetTemplateURI,
String linkTagAttributes,
String linkText,
boolean showTextOnFail)
This method tries to validate a link to a Dynamic Component Presentation
on a Page.
|
getBaseNamespaceId, getErrorList, getFullyQualifiedURL, getLinking, getNamespace, getNamespaceService, getPublicationId, getURL, isRelativeLink, isWrappedCacheDAO, setPublicationId
public DynamicComponentLink(int publicationId)
publicationId
- The ID of the publication that is targeted.public DynamicComponentLink(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 DynamicComponentLink(String publicationURI)
publicationURI
- The TCM:URI of the publication that is targeted.public Link getLink(int targetPageId, int targetComponentId, int targetTemplateId, String linkTagAttributes, String linkText, boolean showTextOnFail)
Link
object.targetPageId
- The id of the Page that is able to assemble Dynamic Component Presentations.targetComponentId
- The id of the Component of the targetted Dynamic Component Presentation.targetTemplateId
- The id of the Component Template of the targetted Dynamic Component Presentation.linkTagAttributes
- Any linkTagAttributes that should be added to the link, for instance an
onMouseOver
or
style
attribute.linkText
- The that should be placed inside the anchor tags.showTextOnFail
- This parameter indicates if a linkText should be returned if the link cannot be
resolved.null
if there was an error.Link
public Link getLink(String targetPageURI, String targetComponentURI, String targetTemplateURI, String linkTagAttributes, String linkText, boolean showTextOnFail)
Link
object.targetPageURI
- The tcm:uri of the Page that is able to assemble Dynamic Component Presentations.targetComponentURI
- The tcm:uri of the Component of the targetted Dynamic Component Presentation.targetTemplateURI
- The tcm:uri of the Component Template of the targetted Dynamic Component Presentation.linkTagAttributes
- Any linkTagAttributes that should be added to the link, for instance an
onMouseOver
or style
attribute.linkText
- The text that should be placed inside the anchor tags.showTextOnFail
- This parameter indicates if a text should be returned if the link cannot be resolved.Link
public String getLinkAsString(String targetPageURI, String targetComponentURI, String targetTemplateURI, String linkTagAttributes, String linkText, boolean showTextOnFail)
java.lang.String
object.targetPageURI
- The tcm:uri of the Page that is able to assemble Dynamic Component Presentations.targetComponentURI
- The tcm:uri of the Component of the targetted Dynamic Component Presentation.targetTemplateURI
- The tcm:uri of the Component Template of the targetted Dynamic Component Presentation.linkTagAttributes
- Any linkTagAttributes that should be added to the link, for instance an
onMouseOver
or style
attribute.linkText
- The text that should be placed inside the anchor tags.showTextOnFail
- This parameter indicates if a text should be returned if the link cannot be resolved.public String getLinkAsString(int targetPageId, int targetComponentId, int targetTemplateId, String linkTagAttributes, String linkText, boolean showTextOnFail)
java.lang.String
object.targetPageId
- The id of the Page that is able to assemble Dynamic Component Presentations.targetComponentId
- The id of the Component of the targetted Dynamic Component Presentation.targetTemplateId
- The id of the Component Template of the targetted Dynamic Component Presentation.linkTagAttributes
- Any linkTagAttributes that should be added to the link, for instance an
onMouseOver
or style
attribute.linkText
- The that should be placed inside the anchor tags.showTextOnFail
- This parameter indicates if a text should be returned if the link cannot be resolved.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries