Commit b47d4e45 authored by Liang's avatar Liang

Merge remote-tracking branch 'origin/2.1.0-dev' into 2.1.0-dev

parents 6b5398e3 23bcc5ac
...@@ -58,7 +58,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT; ...@@ -58,7 +58,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.6.12.13, Apr 8, 2017 * @version 1.6.13.13, May 21, 2017
* @since 0.3.1 * @since 0.3.1
*/ */
@Service @Service
...@@ -67,90 +67,108 @@ public class Filler { ...@@ -67,90 +67,108 @@ public class Filler {
/** /**
* Logger. * Logger.
*/ */
private static final Logger LOGGER = Logger.getLogger(Filler.class.getName()); private static final Logger LOGGER = Logger.getLogger(Filler.class);
/** /**
* {@code true} for published. * {@code true} for published.
*/ */
private static final boolean PUBLISHED = true; private static final boolean PUBLISHED = true;
/** /**
* User service. * User service.
*/ */
private static UserService userService = UserServiceFactory.getUserService(); private static UserService userService = UserServiceFactory.getUserService();
/** /**
* Topbar utilities. * Topbar utilities.
*/ */
@Inject @Inject
private TopBars topBars; private TopBars topBars;
/** /**
* Article repository. * Article repository.
*/ */
@Inject @Inject
private ArticleRepository articleRepository; private ArticleRepository articleRepository;
/** /**
* Comment repository. * Comment repository.
*/ */
@Inject @Inject
private CommentRepository commentRepository; private CommentRepository commentRepository;
/** /**
* Archive date repository. * Archive date repository.
*/ */
@Inject @Inject
private ArchiveDateRepository archiveDateRepository; private ArchiveDateRepository archiveDateRepository;
/** /**
* Category repository. * Category repository.
*/ */
@Inject @Inject
private CategoryRepository categoryRepository; private CategoryRepository categoryRepository;
/** /**
* Tag repository. * Tag repository.
*/ */
@Inject @Inject
private TagRepository tagRepository; private TagRepository tagRepository;
/** /**
* Link repository. * Link repository.
*/ */
@Inject @Inject
private LinkRepository linkRepository; private LinkRepository linkRepository;
/** /**
* Page repository. * Page repository.
*/ */
@Inject @Inject
private PageRepository pageRepository; private PageRepository pageRepository;
/** /**
* Statistic query service. * Statistic query service.
*/ */
@Inject @Inject
private StatisticQueryService statisticQueryService; private StatisticQueryService statisticQueryService;
/** /**
* User repository. * User repository.
*/ */
@Inject @Inject
private UserRepository userRepository; private UserRepository userRepository;
/** /**
* Option query service.. * Option query service..
*/ */
@Inject @Inject
private OptionQueryService optionQueryService; private OptionQueryService optionQueryService;
/** /**
* Article query service. * Article query service.
*/ */
@Inject @Inject
private ArticleQueryService articleQueryService; private ArticleQueryService articleQueryService;
/** /**
* Tag query service. * Tag query service.
*/ */
@Inject @Inject
private TagQueryService tagQueryService; private TagQueryService tagQueryService;
/** /**
* User query service. * User query service.
*/ */
@Inject @Inject
private UserQueryService userQueryService; private UserQueryService userQueryService;
/** /**
* Fill tag article.. * Fill tag article..
*/ */
@Inject @Inject
private FillTagArticles fillTagArticles; private FillTagArticles fillTagArticles;
/** /**
* Event manager. * Event manager.
*/ */
...@@ -685,6 +703,10 @@ public class Filler { ...@@ -685,6 +703,10 @@ public class Filler {
fillMinified(dataModel); fillMinified(dataModel);
fillPageNavigations(dataModel); fillPageNavigations(dataModel);
fillStatistic(dataModel); fillStatistic(dataModel);
fillMostUsedTags(dataModel, preference);
fillArchiveDates(dataModel, preference);
fillMostUsedCategories(dataModel, preference);
} catch (final JSONException e) { } catch (final JSONException e) {
LOGGER.log(Level.ERROR, "Fills blog header failed", e); LOGGER.log(Level.ERROR, "Fills blog header failed", e);
throw new ServiceException(e); throw new ServiceException(e);
...@@ -756,14 +778,6 @@ public class Filler { ...@@ -756,14 +778,6 @@ public class Filler {
fillRecentComments(dataModel, preference); fillRecentComments(dataModel, preference);
} }
if (Templates.hasExpression(template, "<#list mostUsedCategories as category>")) {
fillMostUsedCategories(dataModel, preference);
}
if (Templates.hasExpression(template, "<#list mostUsedTags as tag>")) {
fillMostUsedTags(dataModel, preference);
}
if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) { if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) {
fillMostCommentArticles(dataModel, preference); fillMostCommentArticles(dataModel, preference);
} }
...@@ -771,11 +785,6 @@ public class Filler { ...@@ -771,11 +785,6 @@ public class Filler {
if (Templates.hasExpression(template, "<#list mostViewCountArticles as article>")) { if (Templates.hasExpression(template, "<#list mostViewCountArticles as article>")) {
fillMostViewCountArticles(dataModel, preference); fillMostViewCountArticles(dataModel, preference);
} }
if (Templates.hasExpression(template, "<#list archiveDates as archiveDate>")) {
fillArchiveDates(dataModel, preference);
}
} catch (final ServiceException e) { } catch (final ServiceException e) {
LOGGER.log(Level.ERROR, "Fills side failed", e); LOGGER.log(Level.ERROR, "Fills side failed", e);
throw new ServiceException(e); throw new ServiceException(e);
...@@ -811,14 +820,6 @@ public class Filler { ...@@ -811,14 +820,6 @@ public class Filler {
fillRecentComments(dataModel, preference); fillRecentComments(dataModel, preference);
} }
if (Templates.hasExpression(template, "<#list mostUsedCategories as category>")) {
fillMostUsedCategories(dataModel, preference);
}
if (Templates.hasExpression(template, "<#list mostUsedTags as tag>")) {
fillMostUsedTags(dataModel, preference);
}
if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) { if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) {
fillMostCommentArticles(dataModel, preference); fillMostCommentArticles(dataModel, preference);
} }
...@@ -827,10 +828,6 @@ public class Filler { ...@@ -827,10 +828,6 @@ public class Filler {
fillMostViewCountArticles(dataModel, preference); fillMostViewCountArticles(dataModel, preference);
} }
if (Templates.hasExpression(template, "<#list archiveDates as archiveDate>")) {
fillArchiveDates(dataModel, preference);
}
if (Templates.hasExpression(template, "<#include \"side.ftl\"/>")) { if (Templates.hasExpression(template, "<#include \"side.ftl\"/>")) {
fillSide(request, dataModel, preference); fillSide(request, dataModel, preference);
} }
...@@ -1024,11 +1021,9 @@ public class Filler { ...@@ -1024,11 +1021,9 @@ public class Filler {
/** /**
* Sets some extra properties into the specified article with the specified author and preference. * Sets some extra properties into the specified article with the specified author and preference.
* <p> * <p>
* <p>
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject, JSONObject)}. * The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject, JSONObject)}.
* </p> * </p>
* <p> * <p>
* <p>
* Article ext properties: * Article ext properties:
* <pre> * <pre>
* { * {
...@@ -1057,11 +1052,9 @@ public class Filler { ...@@ -1057,11 +1052,9 @@ public class Filler {
/** /**
* Sets some extra properties into the specified article with the specified preference. * Sets some extra properties into the specified article with the specified preference.
* <p> * <p>
* <p>
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject)}. * The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject)}.
* </p> * </p>
* <p> * <p>
* <p>
* Article ext properties: * Article ext properties:
* <pre> * <pre>
* { * {
...@@ -1089,7 +1082,6 @@ public class Filler { ...@@ -1089,7 +1082,6 @@ public class Filler {
/** /**
* Processes the abstract of the specified article with the specified preference. * Processes the abstract of the specified article with the specified preference.
* <p> * <p>
* <p>
* <ul> * <ul>
* <li>If the abstract is {@code null}, sets it with ""</li> * <li>If the abstract is {@code null}, sets it with ""</li>
* <li>If user configured preference "titleOnly", sets the abstract with ""</li> * <li>If user configured preference "titleOnly", sets the abstract with ""</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment