Skip to content

Commit 4fbd811

Browse files
committed
🐛 Fix b3log#12295
1 parent c331d3d commit 4fbd811

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed

src/main/java/org/b3log/solo/processor/util/Filler.java

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
*
5959
* @author <a href="http://88250.b3log.org">Liang Ding</a>
6060
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
61-
* @version 1.6.12.13, Apr 8, 2017
61+
* @version 1.6.13.13, May 21, 2017
6262
* @since 0.3.1
6363
*/
6464
@Service
@@ -67,90 +67,108 @@ public class Filler {
6767
/**
6868
* Logger.
6969
*/
70-
private static final Logger LOGGER = Logger.getLogger(Filler.class.getName());
70+
private static final Logger LOGGER = Logger.getLogger(Filler.class);
71+
7172
/**
7273
* {@code true} for published.
7374
*/
7475
private static final boolean PUBLISHED = true;
76+
7577
/**
7678
* User service.
7779
*/
7880
private static UserService userService = UserServiceFactory.getUserService();
81+
7982
/**
8083
* Topbar utilities.
8184
*/
8285
@Inject
8386
private TopBars topBars;
87+
8488
/**
8589
* Article repository.
8690
*/
8791
@Inject
8892
private ArticleRepository articleRepository;
93+
8994
/**
9095
* Comment repository.
9196
*/
9297
@Inject
9398
private CommentRepository commentRepository;
99+
94100
/**
95101
* Archive date repository.
96102
*/
97103
@Inject
98104
private ArchiveDateRepository archiveDateRepository;
105+
99106
/**
100107
* Category repository.
101108
*/
102109
@Inject
103110
private CategoryRepository categoryRepository;
111+
104112
/**
105113
* Tag repository.
106114
*/
107115
@Inject
108116
private TagRepository tagRepository;
117+
109118
/**
110119
* Link repository.
111120
*/
112121
@Inject
113122
private LinkRepository linkRepository;
123+
114124
/**
115125
* Page repository.
116126
*/
117127
@Inject
118128
private PageRepository pageRepository;
129+
119130
/**
120131
* Statistic query service.
121132
*/
122133
@Inject
123134
private StatisticQueryService statisticQueryService;
135+
124136
/**
125137
* User repository.
126138
*/
127139
@Inject
128140
private UserRepository userRepository;
141+
129142
/**
130143
* Option query service..
131144
*/
132145
@Inject
133146
private OptionQueryService optionQueryService;
147+
134148
/**
135149
* Article query service.
136150
*/
137151
@Inject
138152
private ArticleQueryService articleQueryService;
153+
139154
/**
140155
* Tag query service.
141156
*/
142157
@Inject
143158
private TagQueryService tagQueryService;
159+
144160
/**
145161
* User query service.
146162
*/
147163
@Inject
148164
private UserQueryService userQueryService;
165+
149166
/**
150167
* Fill tag article..
151168
*/
152169
@Inject
153170
private FillTagArticles fillTagArticles;
171+
154172
/**
155173
* Event manager.
156174
*/
@@ -685,6 +703,10 @@ public void fillBlogHeader(final HttpServletRequest request, final HttpServletRe
685703
fillMinified(dataModel);
686704
fillPageNavigations(dataModel);
687705
fillStatistic(dataModel);
706+
707+
fillMostUsedTags(dataModel, preference);
708+
fillArchiveDates(dataModel, preference);
709+
fillMostUsedCategories(dataModel, preference);
688710
} catch (final JSONException e) {
689711
LOGGER.log(Level.ERROR, "Fills blog header failed", e);
690712
throw new ServiceException(e);
@@ -756,26 +778,13 @@ public void fillSide(final HttpServletRequest request, final Map<String, Object>
756778
fillRecentComments(dataModel, preference);
757779
}
758780

759-
if (Templates.hasExpression(template, "<#list mostUsedCategories as category>")) {
760-
fillMostUsedCategories(dataModel, preference);
761-
}
762-
763-
if (Templates.hasExpression(template, "<#list mostUsedTags as tag>")) {
764-
fillMostUsedTags(dataModel, preference);
765-
}
766-
767781
if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) {
768782
fillMostCommentArticles(dataModel, preference);
769783
}
770784

771785
if (Templates.hasExpression(template, "<#list mostViewCountArticles as article>")) {
772786
fillMostViewCountArticles(dataModel, preference);
773787
}
774-
775-
if (Templates.hasExpression(template, "<#list archiveDates as archiveDate>")) {
776-
fillArchiveDates(dataModel, preference);
777-
}
778-
779788
} catch (final ServiceException e) {
780789
LOGGER.log(Level.ERROR, "Fills side failed", e);
781790
throw new ServiceException(e);
@@ -811,14 +820,6 @@ public void fillUserTemplate(final HttpServletRequest request, final Template te
811820
fillRecentComments(dataModel, preference);
812821
}
813822

814-
if (Templates.hasExpression(template, "<#list mostUsedCategories as category>")) {
815-
fillMostUsedCategories(dataModel, preference);
816-
}
817-
818-
if (Templates.hasExpression(template, "<#list mostUsedTags as tag>")) {
819-
fillMostUsedTags(dataModel, preference);
820-
}
821-
822823
if (Templates.hasExpression(template, "<#list mostCommentArticles as article>")) {
823824
fillMostCommentArticles(dataModel, preference);
824825
}
@@ -827,10 +828,6 @@ public void fillUserTemplate(final HttpServletRequest request, final Template te
827828
fillMostViewCountArticles(dataModel, preference);
828829
}
829830

830-
if (Templates.hasExpression(template, "<#list archiveDates as archiveDate>")) {
831-
fillArchiveDates(dataModel, preference);
832-
}
833-
834831
if (Templates.hasExpression(template, "<#include \"side.ftl\"/>")) {
835832
fillSide(request, dataModel, preference);
836833
}
@@ -1024,11 +1021,9 @@ private void setArticleExProperties(final HttpServletRequest request,
10241021
/**
10251022
* Sets some extra properties into the specified article with the specified author and preference.
10261023
* <p>
1027-
* <p>
10281024
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject, JSONObject)}.
10291025
* </p>
10301026
* <p>
1031-
* <p>
10321027
* Article ext properties:
10331028
* <pre>
10341029
* {
@@ -1057,11 +1052,9 @@ public void setArticlesExProperties(final HttpServletRequest request,
10571052
/**
10581053
* Sets some extra properties into the specified article with the specified preference.
10591054
* <p>
1060-
* <p>
10611055
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject)}.
10621056
* </p>
10631057
* <p>
1064-
* <p>
10651058
* Article ext properties:
10661059
* <pre>
10671060
* {
@@ -1089,7 +1082,6 @@ public void setArticlesExProperties(final HttpServletRequest request,
10891082
/**
10901083
* Processes the abstract of the specified article with the specified preference.
10911084
* <p>
1092-
* <p>
10931085
* <ul>
10941086
* <li>If the abstract is {@code null}, sets it with ""</li>
10951087
* <li>If user configured preference "titleOnly", sets the abstract with ""</li>

0 commit comments

Comments
 (0)