| |
|
| java.lang.Object com.sun.portal.discussions.providers.Comments
Comments | public class Comments (Code) | | Class which mainly deals with clustering of comments and storing
and retrieving of comment properties
Input is one or more discussion streams which is the SOIFInputStream
Discussion stream is normally be sorted by a particular field handled
by the search request. The Comments class maintains the sorting hence
each subtree is sorted. Currently Comments class handles a single cluster
given an input comment url. The comment url may or may not be the main item
or the discussion id. Methods based on properties of a comment stream.
Main functions available are to cluster the nodes and
create a tree structure by fixing the depth for display purpose
|
Comments | public Comments()(Code) | | public constructor
|
clusterComments | public void clusterComments(SOIFInputStream s)(Code) | | For multiple clusters
Find all the main items in the SOIF stream and store in hashmap
cluster the comments for each main item and store in list
like in a single cluster
|
clusterComments | public void clusterComments(SOIFInputStream s, String rooturl) throws Exception(Code) | | Input is a SOIF stream which may be sorted by anything
url is the the discussion url which may not be the main item
Can be used to get the discussion subtree from search results
e.g url = xyz
SOIF can have reference_id= ROOT xyz(main item or discussionID is xyz)
OR SOIF can have reference_id=abc pqr xyz(main item has url=abc) subtree
cluster the comments by their reference-id
may be sorted by last-modified date most of the time
|
findDepth | public int findDepth(SOIF comment)(Code) | | given a soif find the depth based on
reference-id.
convenience method
|
findRoot | public int findRoot(List l, String url)(Code) | | Given a list of SOIFs, returns a list minus the root node.
root node is stored in RootSOIF
|
findRootSOIFDepth | public int findRootSOIFDepth()(Code) | | Find the depth of root node. Convenience method
REMOVE if unnecessary
|
getCommentstream | public SOIFInputStream getCommentstream()(Code) | | get the raw stream
Good for debugging or if extra manipulation is needed
|
getDiscussionID | public String getDiscussionID() throws Exception(Code) | | Extracts the discussionID from rootSOIF
Not really valid for multiple clusters
|
getRootSOIF | public SOIF getRootSOIF() throws Exception(Code) | | Get the Root of the comment tree
may or may not be the main item
rootSOIF value is set during clustering.
throws: exception - if rootSOIF is null |
getUnclusteredComments | public List getUnclusteredComments()(Code) | | Method mainly for debugging
|
hasComments | public boolean hasComments()(Code) | | |
resetSortByDate | public void resetSortByDate()(Code) | | Default value of sortByDate is true
If the input soif stream is sorted by field other than date
then this method should be called.
clustering uses an optimization if the stream is sorted by date
|
setSearchServer | public void setSearchServer(String servername)(Code) | | temporary method to create comment url
REMOVE later
|
|
|
|