| java.lang.Object org.blojsom.fetcher.database.DatabaseFetcher
DatabaseFetcher | public class DatabaseFetcher implements Fetcher,Listener(Code) | | Database fetcher
author: David Czarnecki version: $Id: DatabaseFetcher.java,v 1.34 2007/01/17 02:35:17 czarneckid Exp $ since: blojsom 3.0 |
Method Summary | |
public Integer | countEntries(Blog blog) | protected String | createPostSlug(Blog blog, Entry entry) | public void | deleteBlog(Blog blog) | public void | deleteCategory(Blog blog, Category category) | public void | deleteComment(Blog blog, Comment comment) | public void | deleteEntry(Blog blog, Entry entry) | public void | deletePingback(Blog blog, Pingback pingback) | public void | deleteTrackback(Blog blog, Trackback trackback) | public void | deleteUser(Blog blog, Integer userID) | public void | destroy() | public Category[] | fetchCategories(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Blog blog, String flavor, Map context) | public Entry[] | fetchEntries(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Blog blog, String flavor, Map context) Fetch a set of
org.blojsom.blog.Entry objects. | public Entry[] | findEntries(Blog blog, String query) | public Entry[] | findEntriesBetweenDates(Blog blog, Date startDate, Date endDate) | public Entry[] | findEntriesByMetadataKeyValue(Blog blog, String metadataKey, String metadataValue, boolean pre, boolean post) | public Entry[] | findEntriesWithMetadataKey(Blog blog, String metadataKey) | public List | findResponsesByQuery(Blog blog, String query) Find the responses (comments, trackbacks, pingbacks) for a given
Blog matching some query
Parameters: blog - Blog Parameters: query - Query which will match on various items such as commenter name, e-mail, IP address, etc. | public List | findResponsesByStatus(Blog blog, String[] status) | protected String | getBlogCategory(Blog blog, HttpServletRequest httpServletRequest) | public User[] | getUsers(Blog blog) | public void | handleEvent(Event event) | public void | init() Initialize this fetcher. | public Category[] | loadAllCategories(Blog blog) | public Entry[] | loadAllEntriesForCategory(Blog blog, Integer categoryId) | public Blog | loadBlog(String blogId) | public Blog | loadBlog(Integer id) | public String[] | loadBlogIDs() | public Category | loadCategory(Blog blog, Integer categoryId) | public Category | loadCategory(Blog blog, String name) | public void | loadCategory(Blog blog, Category category) | public void | loadComment(Blog blog, Comment comment) | public Entry[] | loadEntries(Blog blog, int pageSize, int page) | public Entry[] | loadEntries(int pageSize, int page, Category specificCategory, Category[] defaultCategories) | public Entry[] | loadEntriesForCategory(Blog blog, Integer categoryId, Integer limit) | public Entry | loadEntry(Blog blog, Integer entryId) | public Entry | loadEntry(Blog blog, String postSlug) | public void | loadEntry(Blog blog, Entry entry) | public void | loadPingback(Blog blog, Pingback pingback) | public Pingback | loadPingback(Blog blog, String sourceURI, String targetURI) | public List | loadRecentComments(Blog blog) | public List | loadRecentPingbacks(Blog blog) | public List | loadRecentTrackbacks(Blog blog) | public void | loadTrackback(Blog blog, Trackback trackback) | public User | loadUser(Blog blog, String userLogin) | public User | loadUser(Blog blog, Integer userID) | public Blog | newBlog() | public Category | newCategory() | public Comment | newComment() | public Entry | newEntry() | public Pingback | newPingback() | public Trackback | newTrackback() | public User | newUser() | public void | processEvent(Event event) | public void | saveBlog(Blog blog) | public void | saveCategory(Blog blog, Category category) | public void | saveComment(Blog blog, Comment comment) | public void | saveEntry(Blog blog, Entry entry) | public void | savePingback(Blog blog, Pingback pingback) | public void | saveTrackback(Blog blog, Trackback trackback) | public User | saveUser(Blog blog, User user) | public void | setBlojsomProperties(Properties blojsomProperties) | public void | setEventBroadcaster(EventBroadcaster eventBroadcaster) | public void | setServletConfig(ServletConfig servletConfig) | public void | setSessionFactory(SessionFactory sessionFactory) |
_logger | protected Log _logger(Code) | | |
_sessionFactory | protected SessionFactory _sessionFactory(Code) | | |
DatabaseFetcher | public DatabaseFetcher()(Code) | | Create a new instance of the database fetcher
|
createPostSlug | protected String createPostSlug(Blog blog, Entry entry)(Code) | | Create a unique post slug
Parameters: blog - Blog Parameters: entry - Entry Unique post slug |
findEntries | public Entry[] findEntries(Blog blog, String query) throws FetcherException(Code) | | Find entries which have the search query in their title or description
Parameters: blog - Blog Parameters: query - Search query Blog entries which have the search query in their title or descirption throws: FetcherException - If there is an error searching through entries |
findEntriesBetweenDates | public Entry[] findEntriesBetweenDates(Blog blog, Date startDate, Date endDate) throws FetcherException(Code) | | Find entries between a start and end date
Parameters: blog - Blog Parameters: startDate - Start date Parameters: endDate - End date Entries between a start and end date throws: FetcherException - If there is an error searching for entries between the dates |
findEntriesByMetadataKeyValue | public Entry[] findEntriesByMetadataKeyValue(Blog blog, String metadataKey, String metadataValue, boolean pre, boolean post) throws FetcherException(Code) | | Find entries by a metadata key/value pair
Parameters: blog - Blog Parameters: metadataKey - Metadata key Parameters: metadataValue - Metadata value Parameters: pre - If the search should use % before the metadata value (match anything before) Parameters: post - If the search should use % after the metadata value (match antthing after) Entries matching metadata key and value using LIKE syntax for metadata value throws: FetcherException - If there is an error searching through entries |
findEntriesWithMetadataKey | public Entry[] findEntriesWithMetadataKey(Blog blog, String metadataKey) throws FetcherException(Code) | | Find entries with a given metadata key
Parameters: blog - Blog Parameters: metadataKey - Metadata key Entries with the given metadata key throws: FetcherException - If there is an error searching through entries |
findResponsesByQuery | public List findResponsesByQuery(Blog blog, String query) throws FetcherException(Code) | | Find the responses (comments, trackbacks, pingbacks) for a given
Blog matching some query
Parameters: blog - Blog Parameters: query - Query which will match on various items such as commenter name, e-mail, IP address, etc. List of responses (comments, trackbacks, pingbacks) matching query throws: FetcherException - If there is an error loading the responses |
findResponsesByStatus | public List findResponsesByStatus(Blog blog, String[] status) throws FetcherException(Code) | | Load the responses (comments, trackbacks, pingbacks) for a given
Blog matching one of a set of status codes
Parameters: blog - Blog Parameters: status - List of status codes to load List of responses (comments, trackbacks, pingbacks) matching one of a set of status codes throws: FetcherException - If there is an error loading the responses |
getBlogCategory | protected String getBlogCategory(Blog blog, HttpServletRequest httpServletRequest)(Code) | | Determine the blog category based on the request
Parameters: blog - Blog Parameters: httpServletRequest - Request Category of the requested category |
getUsers | public User[] getUsers(Blog blog)(Code) | | Retrieve the users for a given blog
Parameters: blog - Blog List of Users for a blog |
loadAllEntriesForCategory | public Entry[] loadAllEntriesForCategory(Blog blog, Integer categoryId) throws FetcherException(Code) | | Load all the entries for a given category
Parameters: blog - Blog Parameters: categoryId - Category ID Blog entries for a given category throws: FetcherException - If there is an error loading the entries |
loadEntries | public Entry[] loadEntries(Blog blog, int pageSize, int page) throws FetcherException(Code) | | Load a set of entries using a given page size and page in which to retrieve the entries
Parameters: blog - Blog Parameters: pageSize - Page size Parameters: page - Page Blog entries throws: FetcherException - If there is an error loading the entries |
loadEntries | public Entry[] loadEntries(int pageSize, int page, Category specificCategory, Category[] defaultCategories) throws FetcherException(Code) | | Load a set of entries using a given page size and page in which to retrieve the entries
Parameters: pageSize - Page size Parameters: page - Page Parameters: specificCategory - Category Parameters: defaultCategories - Default categories to use for requesting entries from the blogs Blog entries throws: FetcherException - If there is an error loading the entries |
loadEntriesForCategory | public Entry[] loadEntriesForCategory(Blog blog, Integer categoryId, Integer limit) throws FetcherException(Code) | | Load all the entries for a given category
Parameters: blog - Blog Parameters: categoryId - Category ID Parameters: limit - Limit on number of entries to return Blog entries for a given category throws: FetcherException - If there is an error loading the entries |
loadPingback | public Pingback loadPingback(Blog blog, String sourceURI, String targetURI) throws FetcherException(Code) | | Load a pingback given the source URI and target URI
Parameters: blog - Blog Parameters: sourceURI - Source URI Parameters: targetURI - Target URI Pingback given the source and target URIs or null if not found throws: FetcherException - If there was an erorr loading the pingback |
setBlojsomProperties | public void setBlojsomProperties(Properties blojsomProperties)(Code) | | Set the default blojsom properties
Parameters: blojsomProperties - Default blojsom properties |
setSessionFactory | public void setSessionFactory(SessionFactory sessionFactory)(Code) | | Set the
SessionFactory Parameters: sessionFactory - SessionFactory |
|
|