| org.apache.roller.business.WeblogManager
All known Subclasses: org.apache.roller.business.hibernate.HibernateWeblogManagerImpl,
WeblogManager | public interface WeblogManager (Code) | | Interface to weblog entry, category and comment management.
|
Method Summary | |
public void | applyCommentDefaultsToEntries(WebsiteData website) Apply comment default settings from website to all of website's entries. | public String | createAnchor(WeblogEntryData data) Create unique anchor for weblog entry. | public List | getAllWeblogCategoryDecscendentAssocs(WeblogCategoryData data) Get all descendent associations for a category. | public CommentData | getComment(String id) Get comment by id. | public List | getComments(WebsiteData website, WeblogEntryData entry, String searchString, Date startDate, Date endDate, Boolean pending, Boolean approved, Boolean spam, boolean reverseChrono, int offset, int length) Generic comments query method. | public HitCountData | getHitCount(String id) Get a HitCountData by id.
Parameters: id - The HitCountData id. | public HitCountData | getHitCountByWeblog(WebsiteData weblog) Get a HitCountData by weblog.
Parameters: weblog - The WebsiteData that you want the hit count for. | public List | getHotWeblogs(int sinceDays, int offset, int length) Get HitCountData objects for the hotest weblogs.
The results may be constrained to a certain number of days back from the
current time, as well as pagable via the offset and length params.
The results are ordered by highest counts in descending order, and any
weblogs which are not active or enabled are not included.
Parameters: sinceDays - Number of days in the past to consider. Parameters: offset - What index in the results to begin from. Parameters: length - The number of results to return. | public List | getMostCommentedWeblogEntries(WebsiteData website, Date startDate, Date endDate, int offset, int length) Get weblog enties ordered by descending number of comments. | public List | getNextEntries(WeblogEntryData entry, String catName, String locale, int maxEntries) Get entries next after current entry. | public WeblogEntryData | getNextEntry(WeblogEntryData current, String catName, String locale) Get the WeblogEntry following, chronologically, the current entry. | public String | getPath(WeblogCategoryData category) Get absolute path to category, appropriate for use by getWeblogCategoryByPath().
Parameters: category - WeblogCategoryData. | public List | getPopularTags(WebsiteData website, Date startDate, int limit) Get list of TagStat. | public List | getPreviousEntries(WeblogEntryData entry, String catName, String locale, int maxEntries) Get entries previous to current entry. | public WeblogEntryData | getPreviousEntry(WeblogEntryData current, String catName, String locale) Get the WeblogEntry prior to, chronologically, the current entry. | public WeblogCategoryData | getRootWeblogCategory(WebsiteData website) Get top level categories for a website. | public boolean | getTagComboExists(List tags, WebsiteData weblog) Does the specified tag combination exist? Optionally confined to a specific weblog.
This tests if the intersection of the tags listed will yield any results
and returns a true/false value if so. | public List | getTags(WebsiteData website, String sortBy, String startsWith, int limit) Get list of TagStat. | public List | getWeblogCategories(WebsiteData website) Get WebLogCategory objects for a website. | public List | getWeblogCategories(WebsiteData website, boolean includeRoot) Get WebLogCategory objects for a website. | public WeblogCategoryData | getWeblogCategory(String id) Get category by id. | public List | getWeblogCategoryAncestorAssocs(WeblogCategoryData data) Get all ancestor associates for a category. | public WeblogCategoryData | getWeblogCategoryByPath(WebsiteData website, String categoryPath) Get category specified by website and categoryPath. | public WeblogCategoryData | getWeblogCategoryByPath(WebsiteData wd, WeblogCategoryData category, String string) Get sub-category by path relative to specified category.
Parameters: category - Root of path or null to start at top of category tree. Parameters: path - Path of category to be located. Parameters: website - Website of categories. | public List | getWeblogCategoryChildAssocs(WeblogCategoryData data) Get child associations for a category. | public Assoc | getWeblogCategoryParentAssoc(WeblogCategoryData data) Get parent association for a category. | public List | getWeblogEntries(WebsiteData website, UserData user, Date startDate, Date endDate, String catName, List tags, String status, String sortBy, String locale, int offset, int range) Get WeblogEntries by offset/length as list in reverse chronological order. | public List | getWeblogEntries(WeblogCategoryData cat, boolean subcats) Get weblog entries with given category or, optionally, any sub-category
of that category. | public List | getWeblogEntriesPinnedToMain(Integer max) Get specified number of most recent pinned and published Weblog Entries.
Parameters: max - Maximum number to return. | public WeblogEntryData | getWeblogEntry(String id) Get weblog entry by id. | public WeblogEntryData | getWeblogEntryByAnchor(WebsiteData website, String anchor) Get weblog entry by anchor. | public Map | getWeblogEntryObjectMap(WebsiteData website, Date startDate, Date endDate, String catName, List tags, String status, String locale, int offset, int range) Get Weblog Entries grouped by day. | public Map | getWeblogEntryStringMap(WebsiteData website, Date startDate, Date endDate, String catName, List tags, String status, String locale, int offset, int range) Get Weblog Entry date strings grouped by day. | public Date | getWeblogLastPublishTime(WebsiteData website) | public Date | getWeblogLastPublishTime(WebsiteData website, String catName) Gets returns most recent pubTime, optionally restricted by category. | public void | incrementHitCount(WebsiteData weblog, int amount) Increment the hit count for a weblog by a certain amount. | public boolean | isDescendentOf(WeblogCategoryData child, WeblogCategoryData ancestor) Returns true if ancestor is truly an ancestor of child. | public boolean | isDuplicateWeblogCategoryName(WeblogCategoryData data) Check for duplicate category name. | public boolean | isWeblogCategoryInUse(WeblogCategoryData data) Check if weblog category is in use. | public void | moveWeblogCategoryContents(WeblogCategoryData srcCat, WeblogCategoryData destCat) Recategorize all entries with one category to another. | public void | release() Release all resources held by manager. | public void | removeComment(CommentData comment) Remove comment. | public void | removeHitCount(HitCountData hitCount) Remove a HitCountData object. | public int | removeMatchingComments(WebsiteData website, WeblogEntryData entry, String searchString, Date startDate, Date endDate, Boolean pending, Boolean approved, Boolean spam) Deletes comments that match paramters. | public void | removeWeblogCategory(WeblogCategoryData cat) Remove weblog category. | public void | removeWeblogEntry(WeblogEntryData entry) Remove weblog entry. | public void | resetAllHitCounts() Reset the hit counts for all weblogs. | public void | resetHitCount(WebsiteData weblog) Reset the hit counts for a single weblog. | public void | saveComment(CommentData comment) Save comment. | public void | saveHitCount(HitCountData hitCount) Save a HitCountData object. | public void | saveWeblogCategory(WeblogCategoryData cat) Save weblog category. | public void | saveWeblogEntry(WeblogEntryData entry) Save weblog entry. | public void | updateTagCount(String name, WebsiteData website, int amount) This method maintains the tag aggregate table up-to-date with total counts. |
applyCommentDefaultsToEntries | public void applyCommentDefaultsToEntries(WebsiteData website) throws RollerException(Code) | | Apply comment default settings from website to all of website's entries.
|
getComments | public List getComments(WebsiteData website, WeblogEntryData entry, String searchString, Date startDate, Date endDate, Boolean pending, Boolean approved, Boolean spam, boolean reverseChrono, int offset, int length) throws RollerException(Code) | | Generic comments query method.
Parameters: website - Website or null for all comments on site Parameters: entry - Entry or null to include all comments Parameters: startDate - Start date or null for no restriction Parameters: endDate - End date or null for no restriction Parameters: pending - Pending flag value or null for no restriction Parameters: approved - Approved flag value or null for no restriction Parameters: reverseChrono - True for results in reverse chrono order Parameters: spam - Spam flag value or null for no restriction Parameters: offset - Offset into results for paging Parameters: length - Max comments to return (or -1 for no limit) |
getHitCountByWeblog | public HitCountData getHitCountByWeblog(WebsiteData weblog) throws RollerException(Code) | | Get a HitCountData by weblog.
Parameters: weblog - The WebsiteData that you want the hit count for. The HitCountData object, or null if it wasn't found. throws: RollerException - If there was a problem with the backend. |
getHotWeblogs | public List getHotWeblogs(int sinceDays, int offset, int length) throws RollerException(Code) | | Get HitCountData objects for the hotest weblogs.
The results may be constrained to a certain number of days back from the
current time, as well as pagable via the offset and length params.
The results are ordered by highest counts in descending order, and any
weblogs which are not active or enabled are not included.
Parameters: sinceDays - Number of days in the past to consider. Parameters: offset - What index in the results to begin from. Parameters: length - The number of results to return. The list of HitCountData objects ranked by hit count, descending. throws: RollerException - If there was a problem with the backend. |
getMostCommentedWeblogEntries | public List getMostCommentedWeblogEntries(WebsiteData website, Date startDate, Date endDate, int offset, int length) throws RollerException(Code) | | Get weblog enties ordered by descending number of comments.
Parameters: website - Weblog or null to get for all weblogs. Parameters: startDate - Start date or null for no start date. Parameters: endDate - End date or null for no end date. Parameters: offset - Offset into results for paging Parameters: length - Max comments to return (or -1 for no limit) |
getNextEntries | public List getNextEntries(WeblogEntryData entry, String catName, String locale, int maxEntries) throws RollerException(Code) | | Get entries next after current entry.
Parameters: entry - Current entry. Parameters: catName - Only return entries in this category (if not null). Parameters: maxEntries - Maximum number of entries to return. |
getNextEntry | public WeblogEntryData getNextEntry(WeblogEntryData current, String catName, String locale) throws RollerException(Code) | | Get the WeblogEntry following, chronologically, the current entry.
Restrict by the Category, if named.
Parameters: current - The "current" WeblogEntryData Parameters: catName - The value of the requested Category Name |
getPath | public String getPath(WeblogCategoryData category) throws RollerException(Code) | | Get absolute path to category, appropriate for use by getWeblogCategoryByPath().
Parameters: category - WeblogCategoryData. Forward slash separated path string. |
getPopularTags | public List getPopularTags(WebsiteData website, Date startDate, int limit) throws RollerException(Code) | | Get list of TagStat. There's no offset/length params just a limit.
Parameters: website - Weblog or null to get for all weblogs. Parameters: startDate - Date or null of the most recent time a tag was used. Parameters: limit - Max TagStats to return (or -1 for no limit) throws: RollerException - |
getPreviousEntries | public List getPreviousEntries(WeblogEntryData entry, String catName, String locale, int maxEntries) throws RollerException(Code) | | Get entries previous to current entry.
Parameters: entry - Current entry. Parameters: catName - Only return entries in this category (if not null). Parameters: maxEntries - Maximum number of entries to return. |
getPreviousEntry | public WeblogEntryData getPreviousEntry(WeblogEntryData current, String catName, String locale) throws RollerException(Code) | | Get the WeblogEntry prior to, chronologically, the current entry.
Restrict by the Category, if named.
Parameters: current - The "current" WeblogEntryData. Parameters: catName - The value of the requested Category Name. |
getTagComboExists | public boolean getTagComboExists(List tags, WebsiteData weblog) throws RollerException(Code) | | Does the specified tag combination exist? Optionally confined to a specific weblog.
This tests if the intersection of the tags listed will yield any results
and returns a true/false value if so. This means that if the tags list
is "foo", "bar" and only the tag "foo" has been used then this method
should return false.
Parameters: tags - The List of tags to check for. Parameters: weblog - The weblog to confine the check to. True if tags exist, false otherwise. throws: RollerException - If there is any problem doing the operation. |
getTags | public List getTags(WebsiteData website, String sortBy, String startsWith, int limit) throws RollerException(Code) | | Get list of TagStat. There's no offset/length params just a limit.
Parameters: website - Weblog or null to get for all weblogs. Parameters: sortBy - Sort by either 'name' or 'count' (null for name) Parameters: startsWith - Prefix for tags to be returned (null or a string of length > 0) Parameters: limit - Max TagStats to return (or -1 for no limit) throws: RollerException - |
getWeblogCategoryByPath | public WeblogCategoryData getWeblogCategoryByPath(WebsiteData website, String categoryPath) throws RollerException(Code) | | Get category specified by website and categoryPath.
Parameters: website - Website of WeblogCategory. Parameters: categoryPath - Path of WeblogCategory, relative to category root. |
getWeblogCategoryByPath | public WeblogCategoryData getWeblogCategoryByPath(WebsiteData wd, WeblogCategoryData category, String string) throws RollerException(Code) | | Get sub-category by path relative to specified category.
Parameters: category - Root of path or null to start at top of category tree. Parameters: path - Path of category to be located. Parameters: website - Website of categories. Category specified by path or null if not found. |
getWeblogEntries | public List getWeblogEntries(WebsiteData website, UserData user, Date startDate, Date endDate, String catName, List tags, String status, String sortBy, String locale, int offset, int range) throws RollerException(Code) | | Get WeblogEntries by offset/length as list in reverse chronological order.
The range offset and list arguments enable paging through query results.
Parameters: website - Weblog or null to get for all weblogs. Parameters: user - User or null to get for all users. Parameters: startDate - Start date or null for no start date. Parameters: endDate - End date or null for no end date. Parameters: catName - Category path or null for all categories. Parameters: status - Status of DRAFT, PENDING, PUBLISHED or null for all Parameters: sortBy - Sort by either 'pubTime' or 'updateTime' (null for pubTime) Parameters: offset - Offset into results for paging Parameters: length - Max comments to return (or -1 for no limit) List of WeblogEntryData objects in reverse chrono order. throws: RollerException - |
getWeblogEntries | public List getWeblogEntries(WeblogCategoryData cat, boolean subcats) throws RollerException(Code) | | Get weblog entries with given category or, optionally, any sub-category
of that category.
Parameters: cat - Category Parameters: subcats - True if sub-categories are to be fetched List of weblog entries in category |
getWeblogEntriesPinnedToMain | public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException(Code) | | Get specified number of most recent pinned and published Weblog Entries.
Parameters: max - Maximum number to return. Collection of WeblogEntryData objects. |
getWeblogEntryObjectMap | public Map getWeblogEntryObjectMap(WebsiteData website, Date startDate, Date endDate, String catName, List tags, String status, String locale, int offset, int range) throws RollerException(Code) | | Get Weblog Entries grouped by day. This method returns a Map that
contains Lists, each List contains WeblogEntryData objects, and the
Lists are keyed by Date objects.
Parameters: website - Weblog or null to get for all weblogs. Parameters: startDate - Start date or null for no start date. Parameters: endDate - End date or null for no end date. Parameters: catName - Category path or null for all categories. Parameters: status - Status of DRAFT, PENDING, PUBLISHED or null for all Parameters: offset - Offset into results for paging Parameters: length - Max comments to return (or -1 for no limit) Map of Lists, keyed by Date, and containing WeblogEntryData. throws: RollerException - |
getWeblogEntryStringMap | public Map getWeblogEntryStringMap(WebsiteData website, Date startDate, Date endDate, String catName, List tags, String status, String locale, int offset, int range) throws RollerException(Code) | | Get Weblog Entry date strings grouped by day. This method returns a Map
that contains Lists, each List contains YYYYMMDD date strings objects,
and the Lists are keyed by Date objects.
Parameters: website - Weblog or null to get for all weblogs. Parameters: startDate - Start date or null for no start date. Parameters: endDate - End date or null for no end date. Parameters: catName - Category path or null for all categories. Parameters: status - Status of DRAFT, PENDING, PUBLISHED or null for all Parameters: offset - Offset into results for paging Parameters: length - Max comments to return (or -1 for no limit) Map of Lists, keyed by Date, and containing date strings. throws: RollerException - |
getWeblogLastPublishTime | public Date getWeblogLastPublishTime(WebsiteData website, String catName) throws RollerException(Code) | | Gets returns most recent pubTime, optionally restricted by category.
Parameters: handle - Handle of website or null for all users Parameters: catName - Category name of posts or null for all categories Date Of last publish time |
incrementHitCount | public void incrementHitCount(WebsiteData weblog, int amount) throws RollerException(Code) | | Increment the hit count for a weblog by a certain amount.
This is basically a convenience method for doing a lookup, modify, save
of a HitCountData object.
Parameters: weblog - The WebsiteData object to increment the count for. Parameters: amount - How much to increment by. throws: RollerException - If there was a problem with the backend. |
release | public void release()(Code) | | Release all resources held by manager.
|
removeHitCount | public void removeHitCount(HitCountData hitCount) throws RollerException(Code) | | Remove a HitCountData object.
Parameters: hitCount - The HitCountData object to remove. throws: RollerException - If there was a problem with the backend. |
removeMatchingComments | public int removeMatchingComments(WebsiteData website, WeblogEntryData entry, String searchString, Date startDate, Date endDate, Boolean pending, Boolean approved, Boolean spam) throws RollerException(Code) | | Deletes comments that match paramters.
Parameters: website - Website or null for all comments on site Parameters: entry - Entry or null to include all comments Parameters: startDate - Start date or null for no restriction Parameters: endDate - End date or null for no restriction Parameters: approved - Pending flag value or null for no restriction Parameters: pending - Approved flag value or null for no restriction Number of comments deleted |
resetAllHitCounts | public void resetAllHitCounts() throws RollerException(Code) | | Reset the hit counts for all weblogs. This sets the counts back to 0.
throws: RollerException - If there was a problem with the backend. |
resetHitCount | public void resetHitCount(WebsiteData weblog) throws RollerException(Code) | | Reset the hit counts for a single weblog. This sets the count to 0.
Parameters: weblog - The WebsiteData object to reset the count for. throws: RollerException - If there was a problem with the backend. |
updateTagCount | public void updateTagCount(String name, WebsiteData website, int amount) throws RollerException(Code) | | This method maintains the tag aggregate table up-to-date with total counts. More
specifically every time this method is called it will act upon exactly two rows
in the database (tag,website,count), one with website matching the argument passed
and one where website is null. If the count ever reaches zero, the row must be deleted.
Parameters: name - The tag name Parameters: website - The website to used when updating the stats. Parameters: amount - The amount to increment the tag count (it can be positive or negative). throws: RollerException - |
|
|