)
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.
- Since:
- 6.0
- See Also:
LibraryComponent
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 tag |
java.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 Type |
int |
getLinkType()
Retrieves the Link Type |
java.lang.String |
getQueryString()
Return the QueryString |
java.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 to |
boolean |
isClearable()
Checks if the link can be cleared. |
boolean |
isUseReferenceDescription()
Checks if we use the referenced Document description as the anchor tag title attribute |
boolean |
isUseReferenceLinkText()
Checks if we use the referenced Document title as the default Link Text |
void |
setAdditionalAttribute(java.lang.String attribute)
Sets Additional Attribute for HTML anchor tag properties. |
void |
setAllowClear(boolean isAllow)
Enable/Disable whether link may be cleared |
void |
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 attribute |
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. |
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 URL |
void |
setUseReferenceDescription(boolean isDefault)
Enable/Disable use of the referenced Document description as the anchor tag title attribute |
void |
setUseReferenceLinkText(boolean isDefault)
Enable/Disable use of the referenced Document title as the Link Text |
Methods inherited from interface com.ibm.workplace.wcm.api.Editable |
addAuthors, addCategoryIds, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addMembersForAccess, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeCategoryIds, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeMembersForAccess, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescriptionTextProviderKey, setDescriptionTextProviderName, setEditorAccessInheritance, setInheritance, setKeywords, setManagerAccessInheritance, setPropagation, setTitleTextProviderKey, setTitleTextProviderName, setUserAccessInheritance |
Methods inherited from interface com.ibm.workplace.wcm.api.Document |
getAuthors, getCategoryIds, getContributorAccessMembers, getCreator, getDeleteAccessMembers, getDescription, getDescriptionTextProviderKey, getDescriptionTextProviderName, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getKeywords, getLastModifier, getLiveAccessMembers, getManagerAccessMembers, getMembersForAccess, getMembersForInheritedAccess, getOwnerLibrary, getOwners, getProject, getReadAccessMembers, getSourceWorkspace, getTitle, getTitleTextProviderKey, getTitleTextProviderName, getUserAccessMembers, getVersionCatalog, getVersionStrategy, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasProfile, hasProject, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isInherited, isManagerAccessInherited, isNew, isPropagated, isUserAccessInherited, isWorkflowed |
Methods inherited from interface com.ibm.workplace.wcm.api.WorkflowedDocument |
addAdditionalViewers, addApprovers, approve, cancelDraftDocument, clearApprovers, createDraftDocument, decline, decline, getAdditionalViewers, getCurrentApprovers, getDateEnteredStage, getEffectiveDate, getExpiryDate, getGeneralDateOne, getGeneralDateTwo, getPendingWorkflowStatus, getPublishedDate, getPublishedId, getWorkflowId, getWorkflowStageId, getWorkflowStatus, hasApproverAccess, hasApproverAccess, hasDraft, isDraft, isDraftOfPublishedDocument, isExpired, isPublished, isWorkflowMovingBackward, nextWorkflowStage, nextWorkflowStage, nextWorkflowStage, previousWorkflowStage, previousWorkflowStage, removeAdditionalViewers, removeApprovers, restartWorkflow, setEffectiveDate, setExpiryDate, setGeneralDateOne, setGeneralDateTwo, setWorkflowId, setWorkflowId |
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
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
setHTMLBody
void setHTMLBody(java.lang.String HTMLBody)
throws com.ibm.workplace.wcm.api.exceptions.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:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException
- if an error occurs while setting the HTML Body.
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
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
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:
- "_blank"
- "_parent"
- "_top"
- "_self"
- "none"
When target is "none", target attribute is reset to empty.
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