Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
com.ibm.workplace.wcm.api
Interface LibraryLinkComponent
- All Superinterfaces:
- Document, Editable, EditableLibraryComponent, LibraryComponent, WorkflowedDocument
public interface LibraryLinkComponent- extends EditableLibraryComponent
Represents a Link component that exists in the Component Library.
A LibraryLinkComponent is a LibraryComponent and must be stored as a separate entity in the repository.
A LibraryLinkComponent represents a HTML anchor tag. (e.g. ) It can contain a reference to a Site, SiteArea, Content, LibraryImageComponent, LibraryFileComponent or another LibraryLinkComponent. It can also refer to an external URL. This class provides methods to retrieve the URL that the reference presents and setup the properties of the HTML anchor tag generated by this component.
note: since v6.0.0, a LibraryComponent is referred to as a "Component" in the Authoring UI.
- See Also:
- LibraryComponent
Field Summary static int TEXT_HTML
A format for the Link.static int TEXT_LIBRARYIMAGE
A format for the Link.static int TEXT_PLAINTEXT
A format for the Link.static int TYPE_EXISTINGLINK
A type of Link.static int TYPE_EXTERNALURL
A type of Link.static int TYPE_MANAGEDCONTENT
A type of Link.
Method Summary java.lang.String getAdditionalAttribute()
Get Additional Attribute for HTML anchor tag properties.DocumentId getDocumentReference()
Retrieve the Document Reference of this Component.java.lang.String getHTMLBody()
Retrieves the HTML written between the start and end anchor tags when this link is rendered.java.lang.String getLinkDescription()
Retrieves link description for title attribute of anchor tagjava.lang.String getLinkTargetName()
Retrieves the target window name.java.lang.String getLinkTargetString()
Retrive the target attribute.java.lang.String getLinkText()
Retrieves the text written between the start and end anchor tags when this link is rendered.DocumentId getLinkTextImage()
Retrieves the Link Text Image DocumentId, this image is written between the start and end anchor tags when this link is rendered.int getLinkTextType()
Retrieves the Link Text Typeint getLinkType()
Retrieves the Link Typejava.lang.String getQueryString()
Return the QueryStringjava.lang.String getReferenceDisplayName()
Retrieves the reference display name as it show in the Authoring UI.java.lang.String getURL()
Retrieves the URL of the Link that this Component referring toboolean isClearable()
Checks if the link can be cleared.boolean isUseReferenceDescription()
Checks if we use the referenced Document description as the anchor tag title attributeboolean isUseReferenceLinkText()
Checks if we use the referenced Document title as the default Link Textvoid setAdditionalAttribute(java.lang.String attribute)
Sets Additional Attribute for HTML anchor tag properties.void setAllowClear(boolean isAllow)
Enable/Disable whether link may be clearedvoid setDocumentReference(DocumentId id)
Sets the Document Reference of this Component to the document provided.void setExternalReference(java.lang.String url)
Sets the External URL Reference of this Component to the URL provided.void setHTMLBody(java.lang.String HTMLBody)
Sets the HTML to be written between the start and end anchor tags when this link is rendered.void setLinkDescription(java.lang.String description)
Sets Link description for title attribute of anchor tag.void setLinkTargetName(java.lang.String targetName)
Sets the target window name.void setLinkTargetString(java.lang.String target)
Sets the Target of the anchor tag target attributevoid setLinkText(java.lang.String linkText)
Sets the plain text to be written between the start and end anchor tags when this link is rendered.void setLinkTextImage(DocumentId id)
Sets the image of the DocumentId as the Link Text image.void setQueryString(java.lang.String queryString)
Sets the Query String to append to URLvoid setUseReferenceDescription(boolean isDefault)
Enable/Disable use of the referenced Document description as the anchor tag title attributevoid setUseReferenceLinkText(boolean isDefault)
Enable/Disable use of the referenced Document title as the Link Text
Field Detail TYPE_MANAGEDCONTENT
static final int TYPE_MANAGEDCONTENT
- A type of Link. This link points to Content Items managed by WCM.
- See Also:
- Constant Field Values
TYPE_EXTERNALURL
static final int TYPE_EXTERNALURL
- A type of Link. This link points at an external URL, (e.g. http://www.ibm.com )
- See Also:
- Constant Field Values
TYPE_EXISTINGLINK
static final int TYPE_EXISTINGLINK
- A type of Link. This link points to a LibraryLinkComponent
- See Also:
- Constant Field Values
TEXT_PLAINTEXT
static final int TEXT_PLAINTEXT
- A format for the Link. This link is formatted using plain text
- See Also:
- Constant Field Values
TEXT_LIBRARYIMAGE
static final int TEXT_LIBRARYIMAGE
- A format for the Link. This link is formatted using a LibraryImageComponent
- See Also:
- Constant Field Values
TEXT_HTML
static final int TEXT_HTML
- A format for the Link. This link is formatted using HTML
- See Also:
- Constant Field Values
Method Detail getDocumentReference
DocumentId getDocumentReference()
- Retrieve the Document Reference of this Component.
This Document can be any of the following WCM Objects:
Site, SiteArea, Content, LibraryImageComponent, LibraryFileComponent, LibraryLinkComponent.
- Returns:
- the DocumentId of the Reference
setDocumentReference
void setDocumentReference(DocumentId id) throws java.lang.IllegalArgumentException
- Sets the Document Reference of this Component to the document provided.
- Parameters:
- id - the DocumentId of the Reference
- Throws:
- java.lang.IllegalArgumentException - if the DocumentId is not an acceptable type
setExternalReference
void setExternalReference(java.lang.String url)
- Sets the External URL Reference of this Component to the URL provided.
When this method gets called, it sets the Link Type to LibraryLinkComponent.TYPE_EXTERNALURL.
- Parameters:
- url - the external URL as a String
- See Also:
- LibraryLinkComponent.getLinkType()
setHTMLBody
void setHTMLBody(java.lang.String HTMLBody) throws OperationFailedException
- Sets the HTML to be written between the start and end anchor tags when this link is rendered.
The HTML will only be rendered if the Link text type is LibraryLinkComponent.TEXT_HTML. When calling LibrayLinkComponent.setHTMLBody(), the Link Component text type will be set to LibraryLinkComponent.TEXT_HTML.
Use LibraryLinkComponent.setLinkText() when the Link Text is plain text
- Parameters:
- HTMLBody - HTML String
- Throws:
- OperationFailedException - if an error occurs while setting the HTML Body.
- See Also:
- LibraryLinkComponent.getHTMLBody()
getHTMLBody
java.lang.String getHTMLBody()
- Retrieves the HTML written between the start and end anchor tags when this link is rendered.
Use LibraryLinkComponent.getLinkText() to get link text when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_PLAINTEXT
Use LibraryLinkComponent.getLinkTextImage() to get HTML body when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_LIBRARYIMAGE
- Returns:
- HTML set for The Anchor tag body
- See Also:
- LibraryLinkComponent.setHTMLBody()
setUseReferenceLinkText
void setUseReferenceLinkText(boolean isDefault)
- Enable/Disable use of the referenced Document title as the Link Text
- Parameters:
- isDefault - boolean if true, use Reference Title as default LinkText
isUseReferenceLinkText
boolean isUseReferenceLinkText()
- Checks if we use the referenced Document title as the default Link Text
- Returns:
- boolean if true, use Reference Title as default LinkText
setUseReferenceDescription
void setUseReferenceDescription(boolean isDefault)
- Enable/Disable use of the referenced Document description as the anchor tag title attribute
- Parameters:
- isDefault - specifies whether to use the Reference Description as default description
isUseReferenceDescription
boolean isUseReferenceDescription()
- Checks if we use the referenced Document description as the anchor tag title attribute
- Returns:
- boolean if true, use Reference Title as default description
setAdditionalAttribute
void setAdditionalAttribute(java.lang.String attribute)
- Sets Additional Attribute for HTML anchor tag properties.
LibraryLinkComponent overwrites three properties, "title", "target", "href" of anchor tag properties, other properties are treated as Additonal Attributes, which can be manipulated via this method.
- Parameters:
- attribute - the additional attribute as String
getAdditionalAttribute
java.lang.String getAdditionalAttribute()
- Get Additional Attribute for HTML anchor tag properties.
LibraryLinkComponent overwrites three properties, "title", "target", "href" of achor tag properties, other properties are treated as Additonal Attribute
- Returns:
- attribute the additional attribute as String
setLinkDescription
void setLinkDescription(java.lang.String description)
- Sets Link description for title attribute of anchor tag.
Note that this setting will be overwritten if you have called setUseDefaultDescription(true)
- Parameters:
- description - the value to set for the title attribute of the anchor tag.
getLinkDescription
java.lang.String getLinkDescription()
- Retrieves link description for title attribute of anchor tag
- Returns:
- the Link description as a String.
setLinkText
void setLinkText(java.lang.String linkText)
- Sets the plain text to be written between the start and end anchor tags when this link is rendered.
The plain text will only be rendered if the Link text type is LibraryLinkComponent.TEXT_PLAINTEXT. When calling LibrarayLinkComponent.setLinkText(), the Link Component text type will be set to LibraryLinkComponent.TEXT_PLAINTEXT.
- Parameters:
- linkText - link text to set
- See Also:
- LibrarayLinkComponent.setHTMLBody()
getLinkText
java.lang.String getLinkText()
- Retrieves the text written between the start and end anchor tags when this link is rendered.
Use LibraryLinkComponent.getHTMLBody() to get link text when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_HTML
Use LibraryLinkComponent.getLinkTextImage() to get HTML body when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_LIBRARYIMAGE
- Returns:
- the Link Text as String
getLinkTextType
int getLinkTextType()
- Retrieves the Link Text Type
- Returns:
- the type of the Link Text in int it can be: LibraryLinkComponent.TEXT_PLAINTEXT LibraryLinkComponent.TEXT_LIBRARYIMAGE LibraryLinkComponent.TEXT_HTML
getLinkType
int getLinkType()
- Retrieves the Link Type
- Returns:
- the type of the Link in int it can be: LibraryLinkComponent.TYPE_MANAGEDCONTENT LibraryLinkComponent.TYPE_EXTERNALURL LibraryLinkComponent.TYPE_EXISTINGLINK
getURL
java.lang.String getURL()
- Retrieves the URL of the Link that this Component referring to
- Returns:
- url as String
setLinkTargetString
void setLinkTargetString(java.lang.String target)
- Sets the Target of the anchor tag target attribute
- Parameters:
- target - the String, it can be: - The name of target window - "_blank" - "_parent" - "_top" - "_self" - "none"
When target is "none", target attribute is reset to empty.
When target is the name of the window, target is set to name.
getLinkTargetString
java.lang.String getLinkTargetString()
- Retrive the target attribute. It is used for anchor tag target attribute
- Returns:
- the target in String it can be: - The name of target window - "_blank" - "_parent" - "_top" - "_self" - "none"
When target attribute is empty, it returns "none".
setLinkTargetName
void setLinkTargetName(java.lang.String targetName)
- Sets the target window name. Used for anchor tag target attribute
- Parameters:
- targetName - the Name of the target window
getLinkTargetName
java.lang.String getLinkTargetName()
- Retrieves the target window name. Used for anchor tag target attribute
- Returns:
- the name of the target window in String
setAllowClear
void setAllowClear(boolean isAllow)
- Enable/Disable whether link may be cleared
- Parameters:
- isAllow - true: allow link to be cleared otherwise do not allow link to be cleared.
setLinkTextImage
void setLinkTextImage(DocumentId id)
- Sets the image of the DocumentId as the Link Text image.
The plain text will only be rendered if the Link text type is LibraryLinkComponent.TEXT_LIBRARYIMAGE. When calling LibrarayLinkComponent.setLinkTextImage(), the Link Component text type will be set to LibraryLinkComponent.TEXT_LIBRARYIMAGE.
- Parameters:
- id - the DocumentId of the image
getLinkTextImage
DocumentId getLinkTextImage()
- Retrieves the Link Text Image DocumentId, this image is written between the start and end anchor tags when this link is rendered.
Use LibraryLinkComponent.getLinkText() to get link text when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_PLAINTEXT
Use LibraryLinkComponent.getHTMLBody() to get HTML body when LibraryLinkComponent.getLinkTextType() returns LibraryLinkComponent.TEXT_HTML
- Returns:
- DocumentId of the image, return null if there is no image set.
getReferenceDisplayName
java.lang.String getReferenceDisplayName()
- Retrieves the reference display name as it show in the Authoring UI.
It could be the Content title, resource file name or the LinkCmpnt name, if it is an external URL, it returns "--".
- Returns:
- the display Name as String
isClearable
boolean isClearable()
- Checks if the link can be cleared.
- Returns:
- true if the link can be cleared; false otherwise.
setQueryString
void setQueryString(java.lang.String queryString)
- Sets the Query String to append to URL
- Parameters:
- queryString - the String to be appended to URL
getQueryString
java.lang.String getQueryString()
- Return the QueryString
- Returns:
- QueryString as String
Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD