Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface LinkProvider

All Known Implementing Classes:
BaseContainerLinkProvider, BaseContentLinkProvider

public interface LinkProvider

Exposes methods which are useful for processing and creating links on the behalf of objects of this type.


Method Summary
 boolean allowsAttachmentLinks()
           If this object type allows links from other object types to it, this method should return true.
 Matcher getAnchorHrefMatcher(String href)
           Given a link anchor href, this method should construct a matcher object which can be further queried for matching groups representing attachment names/IDs, anchor links, object IDs, and so forth.
 String getAnchorLinkFromAnchorHrefMatcher(Matcher urlMatcher)
           Given the matcher previously constructed an anchor href, this method should extract any anchor links from the href being parsed by the matcher.
 String getAttachmentNameFromAnchorHrefMatcher(Matcher urlMatcher)
           Given the matcher previously constructed for an anchor href, this method should extract the attachment name from the href being parsed by the matcher.
 String getLinkCSS()
           The css class that will be used to format this object's links and other URLs on web forms were it is to be enabled.
 String getLinkDescriptionFromJiveObject(JiveObject jiveObject)
           Get the list of macros associated with this object type.
 String getLinkTextFromJiveObject(JiveObject jiveObject)
           Given a JiveObject, this method should extract the link text for a URL to be generated from the supplied JiveObject.
 String getLinkURLFromJiveObject(JiveObject jiveObject, boolean isAbsoluteURL)
           Given a JiveObject, this method should construct a relative, or full, URL (depending on the isAbsoluteURL) parameter.
 String getObjectIdFromAnchorHrefMatcher(Matcher urlMatcher)
           Given the matcher previously constructed for an anchor href, this method should extract the objectID from the href being parsed by the matcher.
 String parseRelativeURL(String href, String baseUrl)
           Returns the relative URL from the passed in href.
 

Method Detail

allowsAttachmentLinks

boolean allowsAttachmentLinks()
 If this object type allows links from other object types to it, this method should return true.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Returns:
true if this object type allows being linked from other object types.

getAnchorHrefMatcher

Matcher getAnchorHrefMatcher(String href)
 Given a link anchor href, this method should construct a matcher object which can be further queried for matching
 groups representing attachment names/IDs, anchor links, object IDs, and so forth.

 Hrefs could be as the following:
      -100
      -100#AnchorTarget

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
href - a link anchor href
Returns:
a matcher object
See Also:
com.jivesoftware.base.wiki.JiveLinkBuilder

getAttachmentNameFromAnchorHrefMatcher

String getAttachmentNameFromAnchorHrefMatcher(Matcher urlMatcher)
 Given the matcher previously constructed for an anchor href, this method should extract the attachment name from
 the href being parsed by the matcher. It may return null or empty.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
urlMatcher - matcher previously constructed for an anchor href
Returns:
the attachment name from the href being parsed by the matcher
See Also:
com.jivesoftware.base.wiki.JiveLinkBuilder

getAnchorLinkFromAnchorHrefMatcher

String getAnchorLinkFromAnchorHrefMatcher(Matcher urlMatcher)
 Given the matcher previously constructed an anchor href, this method should extract any anchor links from
 the href being parsed by the matcher. It may return null or empty.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
urlMatcher - matcher previously constructed for an anchor href
Returns:
any anchor links from the href being parsed by the matcher
See Also:
com.jivesoftware.base.wiki.JiveLinkBuilder

getObjectIdFromAnchorHrefMatcher

String getObjectIdFromAnchorHrefMatcher(Matcher urlMatcher)
 Given the matcher previously constructed for an anchor href, this method should extract the objectID from the href being
 parsed by the matcher. It may return null or empty.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
urlMatcher - the matcher previously constructed for an anchor href
Returns:
the objectID in the href being parsed by the matcher
See Also:
com.jivesoftware.base.wiki.JiveLinkBuilder

getLinkDescriptionFromJiveObject

String getLinkDescriptionFromJiveObject(JiveObject jiveObject)
 Get the list of macros associated with this object type.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
jiveObject - the object to retrieve the link description from
Returns:
the list of macros associated with this object type

getLinkTextFromJiveObject

String getLinkTextFromJiveObject(JiveObject jiveObject)
 Given a JiveObject, this method should extract the link text for a URL to be generated from the supplied JiveObject.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
jiveObject - the object to retrieve the link text from
Returns:
the link text for a URL to be generated from the supplied JiveObject

getLinkURLFromJiveObject

String getLinkURLFromJiveObject(JiveObject jiveObject,
                                boolean isAbsoluteURL)
 Given a JiveObject, this method should construct a relative, or full, URL (depending on the isAbsoluteURL)
 parameter.

 Primarily consumed by the com.jivesoftware.base.wiki.JiveLinkBuilder class.
 

Parameters:
jiveObject - the jive object to retrieve the link url from
isAbsoluteURL - whether or not the url is absolute
Returns:
a relative, or full, URL (depending on the isAbsoluteURL) parameter

getLinkCSS

String getLinkCSS()
 The css class that will be used to format this object's links and other URLs on web forms were it is to be
 enabled.
 

Returns:
the css class that will be used to format this object's links

parseRelativeURL

String parseRelativeURL(String href,
                        String baseUrl)
 Returns the relative URL from the passed in href.

 Should return empty or NULL if a relative URL relating to the content type cannot be parsed from the input href.
 

Parameters:
href - a link anchor href
baseUrl - base resource of the url
Returns:
empty or NULL if a relative URL relating to the content type cannot be parsed from the input href

Jive Product Page

Copyright © 1999-2007 Jive Software.