com.jalios.jcmsplugin.bookmarks
Class BookmarkManager

java.lang.Object
  extended by com.jalios.jcmsplugin.bookmarks.BookmarkManager
All Implemented Interfaces:
JPropertiesListener

public class BookmarkManager
extends Object
implements JPropertiesListener


Field Summary
 
Fields inherited from interface com.jalios.util.JPropertiesListener
REVISION
 
Method Summary
 Bookmark addBookmark(Member author, Data data)
          Adds the given bookmark.
 Bookmark addBookmark(Member author, String title, String url)
          Adds the given bookmark.
 void deleteAllBookmarks(Data data)
          Delete all the bookmarks for the given data.
protected  String extractFavIcon(String url)
           
protected  String extractFavIconFromContent(String content, String url)
           
 List<Bookmark> getAllBookmarks(Data data)
          Returns all the bookmarks for the given data.
 Bookmark getBookmark(Member author, Data data)
          Returns the bookmark of the given member for the given data.
 Bookmark getBookmark(Member author, int index)
          Returns the bookmark of the given member at the given index.
 int getBookmarkCount(Member author)
          Counts the bookmarks of the given author.
 List<Bookmark> getBookmarkList(Member author)
          Returns the bookmarks of the given member.
 String getIcon(String url)
          Returns the bookmark icon (ie the favicon) of the given URL.
static BookmarkManager getInstance()
           
 int getMaxBookmark()
           
 int getMaxIndex(Member author)
          Return the greatest index of the bookmarks of the given member.
 boolean isBookmarked(Member author, Data data)
          Returns true if the given data has been bookmarked by the given author.
 void processAjaxRequest(JcmsJspContext jcmsContext)
          Processes the given Ajax request (called by doPortletBookmarksFullDisplay.jsp)
 void propertiesChange(JProperties properties)
           
 void removeBookmark(Member author, Long rowId)
          Remove the bookmark of the given member.
 void updateBookmark(Member author, Long rowId, String title, String url)
          Update the given bookmark
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BookmarkManager getInstance()

propertiesChange

public void propertiesChange(JProperties properties)
Specified by:
propertiesChange in interface JPropertiesListener

getMaxBookmark

public int getMaxBookmark()

getBookmarkList

public List<Bookmark> getBookmarkList(Member author)
Returns the bookmarks of the given member.

Parameters:
author - the member
Returns:
the bookmarks of the given member.
Since:
jcms-6.0.0

getBookmark

public Bookmark getBookmark(Member author,
                            int index)
Returns the bookmark of the given member at the given index.

Parameters:
author - the author of the bookmark
index - the index of the bookmark.
Returns:
the bookmark of the given member at the given index.
Since:
jcms-6.0.0

getBookmark

public Bookmark getBookmark(Member author,
                            Data data)
Returns the bookmark of the given member for the given data.

Parameters:
author - the author of the bookmark
data - the data.
Returns:
the bookmark of the given member for the given data.
Since:
jcms-6.0.0

isBookmarked

public boolean isBookmarked(Member author,
                            Data data)
Returns true if the given data has been bookmarked by the given author.

Parameters:
author - the author of the bookmark
data - the data.
Returns:
true if the given data has been bookmarked by the given author.
Since:
jcms-6.0.0

getBookmarkCount

public int getBookmarkCount(Member author)
Counts the bookmarks of the given author.

Parameters:
author - the author of the bookmarks
Returns:
the count of bookmark
Since:
jcms-6.0.0

addBookmark

public Bookmark addBookmark(Member author,
                            String title,
                            String url)
Adds the given bookmark.

Parameters:
author - the author of the bookmark
title - the title of the bookmark
url - the url of the bookmark
Returns:
the new bookmark (or null if no bookmark has been created)
Since:
jcms-6.0.0

addBookmark

public Bookmark addBookmark(Member author,
                            Data data)
Adds the given bookmark.

Parameters:
author - the author of the bookmark
data - the data to be bookmarked
Returns:
the new bookmark (or null if no bookmark has been created)
Since:
jcms-6.0.0

updateBookmark

public void updateBookmark(Member author,
                           Long rowId,
                           String title,
                           String url)
Update the given bookmark

Parameters:
author - the member
rowId - the identifier of the bookmark
Since:
jcms-6.0.0

removeBookmark

public void removeBookmark(Member author,
                           Long rowId)
Remove the bookmark of the given member.

Parameters:
author - the member
rowId - the identifier of the bookmark
Since:
jcms-6.0.0

getMaxIndex

public int getMaxIndex(Member author)
Return the greatest index of the bookmarks of the given member.

Parameters:
author - the member
Returns:
the greatest index of the bookmarks of the given member.
Since:
jcms-6.0.0

getAllBookmarks

public List<Bookmark> getAllBookmarks(Data data)
Returns all the bookmarks for the given data.

Parameters:
data - the bookmarked data
Returns:
all the bookmarks for the given data.
Since:
jcms-6.0.0

deleteAllBookmarks

public void deleteAllBookmarks(Data data)
Delete all the bookmarks for the given data.

Parameters:
data - the bookmarked data
Since:
jcms-6.0.0

processAjaxRequest

public void processAjaxRequest(JcmsJspContext jcmsContext)
                        throws IOException
Processes the given Ajax request (called by doPortletBookmarksFullDisplay.jsp)

Parameters:
jcmsContext - the JCMS context
Throws:
IOException
Since:
jcms-6.0.0

getIcon

public String getIcon(String url)
Returns the bookmark icon (ie the favicon) of the given URL.

Parameters:
url - the URL to get the icon
Returns:
the bookmark icon (ie the favicon) of the given URL.
Since:
jcms-6.0.0

extractFavIcon

protected String extractFavIcon(String url)

extractFavIconFromContent

protected String extractFavIconFromContent(String content,
                                           String url)


Copyright © 2001-2007 Jalios SA. All Rights Reserved.