58
58
*
59
59
* @author <a href="http://88250.b3log.org">Liang Ding</a>
60
60
* @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
62
62
* @since 0.3.1
63
63
*/
64
64
@ Service
@@ -67,90 +67,108 @@ public class Filler {
67
67
/**
68
68
* Logger.
69
69
*/
70
- private static final Logger LOGGER = Logger .getLogger (Filler .class .getName ());
70
+ private static final Logger LOGGER = Logger .getLogger (Filler .class );
71
+
71
72
/**
72
73
* {@code true} for published.
73
74
*/
74
75
private static final boolean PUBLISHED = true ;
76
+
75
77
/**
76
78
* User service.
77
79
*/
78
80
private static UserService userService = UserServiceFactory .getUserService ();
81
+
79
82
/**
80
83
* Topbar utilities.
81
84
*/
82
85
@ Inject
83
86
private TopBars topBars ;
87
+
84
88
/**
85
89
* Article repository.
86
90
*/
87
91
@ Inject
88
92
private ArticleRepository articleRepository ;
93
+
89
94
/**
90
95
* Comment repository.
91
96
*/
92
97
@ Inject
93
98
private CommentRepository commentRepository ;
99
+
94
100
/**
95
101
* Archive date repository.
96
102
*/
97
103
@ Inject
98
104
private ArchiveDateRepository archiveDateRepository ;
105
+
99
106
/**
100
107
* Category repository.
101
108
*/
102
109
@ Inject
103
110
private CategoryRepository categoryRepository ;
111
+
104
112
/**
105
113
* Tag repository.
106
114
*/
107
115
@ Inject
108
116
private TagRepository tagRepository ;
117
+
109
118
/**
110
119
* Link repository.
111
120
*/
112
121
@ Inject
113
122
private LinkRepository linkRepository ;
123
+
114
124
/**
115
125
* Page repository.
116
126
*/
117
127
@ Inject
118
128
private PageRepository pageRepository ;
129
+
119
130
/**
120
131
* Statistic query service.
121
132
*/
122
133
@ Inject
123
134
private StatisticQueryService statisticQueryService ;
135
+
124
136
/**
125
137
* User repository.
126
138
*/
127
139
@ Inject
128
140
private UserRepository userRepository ;
141
+
129
142
/**
130
143
* Option query service..
131
144
*/
132
145
@ Inject
133
146
private OptionQueryService optionQueryService ;
147
+
134
148
/**
135
149
* Article query service.
136
150
*/
137
151
@ Inject
138
152
private ArticleQueryService articleQueryService ;
153
+
139
154
/**
140
155
* Tag query service.
141
156
*/
142
157
@ Inject
143
158
private TagQueryService tagQueryService ;
159
+
144
160
/**
145
161
* User query service.
146
162
*/
147
163
@ Inject
148
164
private UserQueryService userQueryService ;
165
+
149
166
/**
150
167
* Fill tag article..
151
168
*/
152
169
@ Inject
153
170
private FillTagArticles fillTagArticles ;
171
+
154
172
/**
155
173
* Event manager.
156
174
*/
@@ -685,6 +703,10 @@ public void fillBlogHeader(final HttpServletRequest request, final HttpServletRe
685
703
fillMinified (dataModel );
686
704
fillPageNavigations (dataModel );
687
705
fillStatistic (dataModel );
706
+
707
+ fillMostUsedTags (dataModel , preference );
708
+ fillArchiveDates (dataModel , preference );
709
+ fillMostUsedCategories (dataModel , preference );
688
710
} catch (final JSONException e ) {
689
711
LOGGER .log (Level .ERROR , "Fills blog header failed" , e );
690
712
throw new ServiceException (e );
@@ -756,26 +778,13 @@ public void fillSide(final HttpServletRequest request, final Map<String, Object>
756
778
fillRecentComments (dataModel , preference );
757
779
}
758
780
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
-
767
781
if (Templates .hasExpression (template , "<#list mostCommentArticles as article>" )) {
768
782
fillMostCommentArticles (dataModel , preference );
769
783
}
770
784
771
785
if (Templates .hasExpression (template , "<#list mostViewCountArticles as article>" )) {
772
786
fillMostViewCountArticles (dataModel , preference );
773
787
}
774
-
775
- if (Templates .hasExpression (template , "<#list archiveDates as archiveDate>" )) {
776
- fillArchiveDates (dataModel , preference );
777
- }
778
-
779
788
} catch (final ServiceException e ) {
780
789
LOGGER .log (Level .ERROR , "Fills side failed" , e );
781
790
throw new ServiceException (e );
@@ -811,14 +820,6 @@ public void fillUserTemplate(final HttpServletRequest request, final Template te
811
820
fillRecentComments (dataModel , preference );
812
821
}
813
822
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
-
822
823
if (Templates .hasExpression (template , "<#list mostCommentArticles as article>" )) {
823
824
fillMostCommentArticles (dataModel , preference );
824
825
}
@@ -827,10 +828,6 @@ public void fillUserTemplate(final HttpServletRequest request, final Template te
827
828
fillMostViewCountArticles (dataModel , preference );
828
829
}
829
830
830
- if (Templates .hasExpression (template , "<#list archiveDates as archiveDate>" )) {
831
- fillArchiveDates (dataModel , preference );
832
- }
833
-
834
831
if (Templates .hasExpression (template , "<#include \" side.ftl\" />" )) {
835
832
fillSide (request , dataModel , preference );
836
833
}
@@ -1024,11 +1021,9 @@ private void setArticleExProperties(final HttpServletRequest request,
1024
1021
/**
1025
1022
* Sets some extra properties into the specified article with the specified author and preference.
1026
1023
* <p>
1027
- * <p>
1028
1024
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject, JSONObject)}.
1029
1025
* </p>
1030
1026
* <p>
1031
- * <p>
1032
1027
* Article ext properties:
1033
1028
* <pre>
1034
1029
* {
@@ -1057,11 +1052,9 @@ public void setArticlesExProperties(final HttpServletRequest request,
1057
1052
/**
1058
1053
* Sets some extra properties into the specified article with the specified preference.
1059
1054
* <p>
1060
- * <p>
1061
1055
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject)}.
1062
1056
* </p>
1063
1057
* <p>
1064
- * <p>
1065
1058
* Article ext properties:
1066
1059
* <pre>
1067
1060
* {
@@ -1089,7 +1082,6 @@ public void setArticlesExProperties(final HttpServletRequest request,
1089
1082
/**
1090
1083
* Processes the abstract of the specified article with the specified preference.
1091
1084
* <p>
1092
- * <p>
1093
1085
* <ul>
1094
1086
* <li>If the abstract is {@code null}, sets it with ""</li>
1095
1087
* <li>If user configured preference "titleOnly", sets the abstract with ""</li>
0 commit comments