Search in sources :

Example 6 with RepositoryException

use of org.b3log.latke.repository.RepositoryException in project solo by b3log.

the class StatisticMgmtService method decPublishedBlogCommentCount.

/**
     * Blog statistic comment(published article) count -1.
     *
     * @throws JSONException json exception
     * @throws RepositoryException repository exception
     */
public void decPublishedBlogCommentCount() throws JSONException, RepositoryException {
    final JSONObject statistic = statisticRepository.get(Statistic.STATISTIC);
    if (null == statistic) {
        throw new RepositoryException("Not found statistic");
    }
    statistic.put(Statistic.STATISTIC_PUBLISHED_BLOG_COMMENT_COUNT, statistic.getInt(Statistic.STATISTIC_PUBLISHED_BLOG_COMMENT_COUNT) - 1);
    statisticRepository.update(Statistic.STATISTIC, statistic);
}
Also used : JSONObject(org.json.JSONObject) RepositoryException(org.b3log.latke.repository.RepositoryException)

Example 7 with RepositoryException

use of org.b3log.latke.repository.RepositoryException in project solo by b3log.

the class StatisticMgmtService method decBlogArticleCount.

/**
     * Blog statistic article count -1.
     *
     * @throws JSONException json exception
     * @throws RepositoryException repository exception
     */
public void decBlogArticleCount() throws JSONException, RepositoryException {
    final JSONObject statistic = statisticRepository.get(Statistic.STATISTIC);
    if (null == statistic) {
        throw new RepositoryException("Not found statistic");
    }
    statistic.put(Statistic.STATISTIC_BLOG_ARTICLE_COUNT, statistic.getInt(Statistic.STATISTIC_BLOG_ARTICLE_COUNT) - 1);
    statisticRepository.update(Statistic.STATISTIC, statistic);
}
Also used : JSONObject(org.json.JSONObject) RepositoryException(org.b3log.latke.repository.RepositoryException)

Example 8 with RepositoryException

use of org.b3log.latke.repository.RepositoryException in project solo by b3log.

the class StatisticMgmtService method incPublishedBlogCommentCount.

/**
     * Blog statistic comment(published article) count +1.
     *
     * @throws JSONException json exception
     * @throws RepositoryException repository exception
     */
public void incPublishedBlogCommentCount() throws JSONException, RepositoryException {
    final JSONObject statistic = statisticRepository.get(Statistic.STATISTIC);
    if (null == statistic) {
        throw new RepositoryException("Not found statistic");
    }
    statistic.put(Statistic.STATISTIC_PUBLISHED_BLOG_COMMENT_COUNT, statistic.getInt(Statistic.STATISTIC_PUBLISHED_BLOG_COMMENT_COUNT) + 1);
    statisticRepository.update(Statistic.STATISTIC, statistic);
}
Also used : JSONObject(org.json.JSONObject) RepositoryException(org.b3log.latke.repository.RepositoryException)

Example 9 with RepositoryException

use of org.b3log.latke.repository.RepositoryException in project solo by b3log.

the class StatisticMgmtService method decBlogCommentCount.

/**
     * Blog statistic comment count -1.
     *
     * @throws JSONException json exception
     * @throws RepositoryException repository exception
     */
public void decBlogCommentCount() throws JSONException, RepositoryException {
    final JSONObject statistic = statisticRepository.get(Statistic.STATISTIC);
    if (null == statistic) {
        throw new RepositoryException("Not found statistic");
    }
    statistic.put(Statistic.STATISTIC_BLOG_COMMENT_COUNT, statistic.getInt(Statistic.STATISTIC_BLOG_COMMENT_COUNT) - 1);
    statisticRepository.update(Statistic.STATISTIC, statistic);
}
Also used : JSONObject(org.json.JSONObject) RepositoryException(org.b3log.latke.repository.RepositoryException)

Example 10 with RepositoryException

use of org.b3log.latke.repository.RepositoryException in project solo by b3log.

the class StatisticMgmtService method incBlogCommentCount.

/**
     * Blog statistic comment count +1.
     *
     * @throws JSONException json exception
     * @throws RepositoryException repository exception
     */
public void incBlogCommentCount() throws JSONException, RepositoryException {
    final JSONObject statistic = statisticRepository.get(Statistic.STATISTIC);
    if (null == statistic) {
        throw new RepositoryException("Not found statistic");
    }
    statistic.put(Statistic.STATISTIC_BLOG_COMMENT_COUNT, statistic.getInt(Statistic.STATISTIC_BLOG_COMMENT_COUNT) + 1);
    statisticRepository.update(Statistic.STATISTIC, statistic);
}
Also used : JSONObject(org.json.JSONObject) RepositoryException(org.b3log.latke.repository.RepositoryException)

Aggregations

RepositoryException (org.b3log.latke.repository.RepositoryException)35 JSONObject (org.json.JSONObject)32 ServiceException (org.b3log.latke.service.ServiceException)14 JSONArray (org.json.JSONArray)10 Query (org.b3log.latke.repository.Query)8 Transaction (org.b3log.latke.repository.Transaction)8 Date (java.util.Date)5 ParseException (java.text.ParseException)4 PropertyFilter (org.b3log.latke.repository.PropertyFilter)4 JSONException (org.json.JSONException)4 EventException (org.b3log.latke.event.EventException)2 ArchiveDate (org.b3log.solo.model.ArchiveDate)2 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 LatkeBeanManager (org.b3log.latke.ioc.LatkeBeanManager)1 GeneralUser (org.b3log.latke.user.GeneralUser)1 ArticleRepository (org.b3log.solo.repository.ArticleRepository)1 PageRepository (org.b3log.solo.repository.PageRepository)1