Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
b47d4e45
Commit
b47d4e45
authored
May 21, 2017
by
Liang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/2.1.0-dev' into 2.1.0-dev
parents
6b5398e3
23bcc5ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
32 deletions
+24
-32
src/main/java/org/b3log/solo/processor/util/Filler.java
src/main/java/org/b3log/solo/processor/util/Filler.java
+24
-32
No files found.
src/main/java/org/b3log/solo/processor/util/Filler.java
View file @
b47d4e45
...
...
@@ -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://vanessa.b3log.org">Liyuan Li</a>
* @version 1.6.1
2.13, Apr 8
, 2017
* @version 1.6.1
3.13, May 21
, 2017
* @since 0.3.1
*/
@Service
...
...
@@ -67,90 +67,108 @@ public class Filler {
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
Filler
.
class
.
getName
());
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
Filler
.
class
);
/**
* {@code true} for published.
*/
private
static
final
boolean
PUBLISHED
=
true
;
/**
* User service.
*/
private
static
UserService
userService
=
UserServiceFactory
.
getUserService
();
/**
* Topbar utilities.
*/
@Inject
private
TopBars
topBars
;
/**
* Article repository.
*/
@Inject
private
ArticleRepository
articleRepository
;
/**
* Comment repository.
*/
@Inject
private
CommentRepository
commentRepository
;
/**
* Archive date repository.
*/
@Inject
private
ArchiveDateRepository
archiveDateRepository
;
/**
* Category repository.
*/
@Inject
private
CategoryRepository
categoryRepository
;
/**
* Tag repository.
*/
@Inject
private
TagRepository
tagRepository
;
/**
* Link repository.
*/
@Inject
private
LinkRepository
linkRepository
;
/**
* Page repository.
*/
@Inject
private
PageRepository
pageRepository
;
/**
* Statistic query service.
*/
@Inject
private
StatisticQueryService
statisticQueryService
;
/**
* User repository.
*/
@Inject
private
UserRepository
userRepository
;
/**
* Option query service..
*/
@Inject
private
OptionQueryService
optionQueryService
;
/**
* Article query service.
*/
@Inject
private
ArticleQueryService
articleQueryService
;
/**
* Tag query service.
*/
@Inject
private
TagQueryService
tagQueryService
;
/**
* User query service.
*/
@Inject
private
UserQueryService
userQueryService
;
/**
* Fill tag article..
*/
@Inject
private
FillTagArticles
fillTagArticles
;
/**
* Event manager.
*/
...
...
@@ -685,6 +703,10 @@ public class Filler {
fillMinified
(
dataModel
);
fillPageNavigations
(
dataModel
);
fillStatistic
(
dataModel
);
fillMostUsedTags
(
dataModel
,
preference
);
fillArchiveDates
(
dataModel
,
preference
);
fillMostUsedCategories
(
dataModel
,
preference
);
}
catch
(
final
JSONException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Fills blog header failed"
,
e
);
throw
new
ServiceException
(
e
);
...
...
@@ -756,14 +778,6 @@ public class Filler {
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>"
))
{
fillMostCommentArticles
(
dataModel
,
preference
);
}
...
...
@@ -771,11 +785,6 @@ public class Filler {
if
(
Templates
.
hasExpression
(
template
,
"<#list mostViewCountArticles as article>"
))
{
fillMostViewCountArticles
(
dataModel
,
preference
);
}
if
(
Templates
.
hasExpression
(
template
,
"<#list archiveDates as archiveDate>"
))
{
fillArchiveDates
(
dataModel
,
preference
);
}
}
catch
(
final
ServiceException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Fills side failed"
,
e
);
throw
new
ServiceException
(
e
);
...
...
@@ -811,14 +820,6 @@ public class Filler {
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>"
))
{
fillMostCommentArticles
(
dataModel
,
preference
);
}
...
...
@@ -827,10 +828,6 @@ public class Filler {
fillMostViewCountArticles
(
dataModel
,
preference
);
}
if
(
Templates
.
hasExpression
(
template
,
"<#list archiveDates as archiveDate>"
))
{
fillArchiveDates
(
dataModel
,
preference
);
}
if
(
Templates
.
hasExpression
(
template
,
"<#include \"side.ftl\"/>"
))
{
fillSide
(
request
,
dataModel
,
preference
);
}
...
...
@@ -1024,11 +1021,9 @@ public class Filler {
/**
* Sets some extra properties into the specified article with the specified author and preference.
* <p>
* <p>
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject, JSONObject)}.
* </p>
* <p>
* <p>
* Article ext properties:
* <pre>
* {
...
...
@@ -1057,11 +1052,9 @@ public class Filler {
/**
* Sets some extra properties into the specified article with the specified preference.
* <p>
* <p>
* The batch version of method {@linkplain #setArticleExProperties(HttpServletRequest, JSONObject, JSONObject)}.
* </p>
* <p>
* <p>
* Article ext properties:
* <pre>
* {
...
...
@@ -1089,7 +1082,6 @@ public class Filler {
/**
* Processes the abstract of the specified article with the specified preference.
* <p>
* <p>
* <ul>
* <li>If the abstract is {@code null}, sets it with ""</li>
* <li>If user configured preference "titleOnly", sets the abstract with ""</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment