public class Linking extends com.tridion.services.ConfigurableBaseService implements ComponentLinkListener, BinaryLinkListener, PageLinkListener, Observer
Modifier and Type | Field and Description |
---|---|
protected static String |
PRODUCT_NAME |
Modifier and Type | Method and Description |
---|---|
void |
binaryLinkNotification(int publicationId,
int componentId,
String anchor,
String text,
String attributes,
boolean textOnFail,
String type,
boolean isComponent,
Link link)
Implement this method to process the parameters passed.
|
void |
componentLinkNotification(int publicationId,
int pageId,
int componentId,
int componentTemplateId,
String linkAttr,
String linkText,
boolean textOnFail,
boolean anchor,
Link returnLink)
Implement this method to process the parameters passed.
|
void |
configure(com.sdl.delivery.configuration.Configuration configuration)
Configures the
Linking class with a Configuration object. |
void |
dynamicComponentLinkNotification(int publicationId,
int pageId,
int componentId,
int componentTemplateId,
String attributes,
String text,
boolean textOnFail,
String parameters,
Link link)
Implement this method to process the parameters passed.
|
protected void |
flushInstance()
Calls the static synchronized method to set instance to null.
|
protected String |
getConfigFileName()
Gets the name of the configuration file.
|
protected String |
getConfigSchemaName()
Gets the name of the configuration schema file.
|
static Linking |
getInstance()
Standard singleton method to return an instance.
|
String |
getLicenseProductName()
Returns the official name of the child
Controller class. |
protected Map<Integer,Boolean> |
getLinkInfoEnabled() |
protected org.slf4j.Logger |
getLogger()
Returns the implementation's logger.
|
URL |
getManifestURL()
Returns the location of this
Linking 's manifest file as a URL . |
protected Map<Integer,String> |
getPresentationURLs() |
String |
getProductName()
Returns the official
Linking product name. |
String |
getPublicationURL(int publicationId)
Returns the fully qualified URL for a particular publication, as configured in the
configuration file, or null if the Domain attribute has not been entered.
|
boolean |
isComponentLinkInfoEnabled(int publicationId) |
protected com.sdl.delivery.configuration.Configuration |
loadConfiguration()
Loads the configuration from the configuration file and validates it
against the appropriate schema.
|
void |
pageLinkNotification(int publicationId,
int pageId,
String anchor,
String attributes,
String text,
boolean textOnFail,
String parameters,
Link link)
Implement this method to process the parameters passed.
|
void |
update(Observable observable,
Object updatedArg) |
getConfigurationLicenseFileName, getServiceConfiguration, setServiceConfiguration
protected static final String PRODUCT_NAME
public static Linking getInstance()
protected void flushInstance()
flushInstance
in class com.tridion.services.BaseService
protected com.sdl.delivery.configuration.Configuration loadConfiguration() throws com.sdl.delivery.configuration.ConfigurationException
com.tridion.services.ConfigurableBaseService
loadConfiguration
in class com.tridion.services.ConfigurableBaseService
Configuration
.com.sdl.delivery.configuration.ConfigurationException
- If the configuration could not be loaded. This may be because
the configuration file could not be found or the file is not
well-formed XML.public String getProductName()
Linking
product name.getProductName
in class com.tridion.services.BaseService
public String getLicenseProductName()
com.tridion.services.BaseService
Controller
class.
This is used for licensing as well as displaying when logging information
about this Controller
.getLicenseProductName
in class com.tridion.services.BaseService
public void configure(com.sdl.delivery.configuration.Configuration configuration) throws com.sdl.delivery.configuration.ConfigurationException
Linking
class with a Configuration
object.configure
in interface LinkListener
configure
in class com.tridion.services.ConfigurableBaseService
configuration
- The configuration object that holds configuration information.com.sdl.delivery.configuration.ConfigurationException
- If the supplied configuration is invalid or an error occurred during
configuration.protected String getConfigFileName()
getConfigFileName
in class com.tridion.services.BaseService
protected String getConfigSchemaName()
getConfigSchemaName
in class com.tridion.services.BaseService
public boolean isComponentLinkInfoEnabled(int publicationId)
public String getPublicationURL(int publicationId)
publicationId
- The Id of the publication which the page the link is trying to resolve to is in.public URL getManifestURL()
Linking
's manifest file as a URL
.getManifestURL
in class com.tridion.services.BaseService
public void componentLinkNotification(int publicationId, int pageId, int componentId, int componentTemplateId, String linkAttr, String linkText, boolean textOnFail, boolean anchor, Link returnLink)
ComponentLinkListener
com.tridion.linking.Linking
class will pass
all ComponentLinks which the system tries to resolve to the configured class, which will then be processed in
the configured
class.componentLinkNotification
in interface ComponentLinkListener
publicationId
- The Id of the publication which the Component the link is trying to resolve
to is in.pageId
- The Id of the page that you are linking from.componentId
- The Id of the Component you wish to try to resolve a link to.componentTemplateId
- The Id of the Component Template which will be excluded from link
resolution, and which
will be used to exclude other templates based on priority.linkAttr
- Attributes to include in the link.linkText
- The text to be displayed for the link.textOnFail
- Indicates if the linkText needs to be returned if no link can be resolved.anchor
- The anchor on the page where the link has to be pointing to.returnLink
- The Link
resolved by the ComponentLink
class.public void dynamicComponentLinkNotification(int publicationId, int pageId, int componentId, int componentTemplateId, String attributes, String text, boolean textOnFail, String parameters, Link link)
com.tridion.linking.Linking
class will pass
all DynamicComponentLinks which the system tries to resolve to the configured class, which will then be
processed in the configured
class.dynamicComponentLinkNotification
in interface ComponentLinkListener
publicationId
- The Id of the publication which the page the link is trying to resolve to is in.pageId
- The Id of the page the link is trying to resolve to.componentId
- The Id of the Component you wish to try to resolve a link to.componentTemplateId
- The Id of the Component Template to be used for DCP assembly.attributes
- Attributes to include in the link.text
- The text to be displayed for the link.textOnFail
- Indicates if the linkText needs to be returned if no link can be resolved.parameters
- HTTP parameters to be appended to the URL.link
- The Link resolved by the DynamicComponentLink class.public void binaryLinkNotification(int publicationId, int componentId, String anchor, String text, String attributes, boolean textOnFail, String type, boolean isComponent, Link link)
BinaryLinkListener
com.tridion.linking.Linking
class will pass
all BinaryLinks which the system tries to resolve to the configured class, which will then be processed in the
configured
class.binaryLinkNotification
in interface BinaryLinkListener
publicationId
- The Id of the publication which the Binary the link is trying to resolve to is in.componentId
- The Id of the Binary Component to link to.anchor
- The anchor on the page where the link has to be pointing to. Use an empty
String
or
null
for this in normal situations.text
- The text to be displayed for the link.attributes
- Optional query that should be placed in the anchor.textOnFail
- Indicates if the linkText needs to be returned if no link can be resolved.type
- The MIME type of the Binary.isComponent
- Whether this component is a MultiMedia component in the Management System.link
- The Link resolved by the BinaryLink class.public void pageLinkNotification(int publicationId, int pageId, String anchor, String attributes, String text, boolean textOnFail, String parameters, Link link)
PageLinkListener
com.tridion.linking.Linking
class will pass
all PageLinks which the system tries to resolve to the configured class, which will then be processed in the
configured
class.pageLinkNotification
in interface PageLinkListener
publicationId
- The Id of the publication which the page the link is trying to resolve to is in.pageId
- The Id of the page the link is trying to resolve to.anchor
- The anchor on the page where the link has to be pointing to.attributes
- Attributes to include in the link.text
- The text to be displayed for the link.textOnFail
- Indicates if the linkText needs to be returned if no link can be resolved.parameters
- HTTP parameters to be appended to the URL.link
- The Link resolved by the PageLink class.protected org.slf4j.Logger getLogger()
com.tridion.services.BaseService
getLogger
in class com.tridion.services.BaseService
public void update(Observable observable, Object updatedArg)
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries