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
96da7dbb
Unverified
Commit
96da7dbb
authored
Mar 17, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12706
parent
862f4dc4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
12 deletions
+28
-12
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+4
-0
src/main/java/org/b3log/solo/processor/CategoryProcessor.java
...main/java/org/b3log/solo/processor/CategoryProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/ErrorProcessor.java
src/main/java/org/b3log/solo/processor/ErrorProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/IndexProcessor.java
src/main/java/org/b3log/solo/processor/IndexProcessor.java
+3
-8
src/main/java/org/b3log/solo/processor/PageProcessor.java
src/main/java/org/b3log/solo/processor/PageProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/SearchProcessor.java
src/main/java/org/b3log/solo/processor/SearchProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/TagProcessor.java
src/main/java/org/b3log/solo/processor/TagProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/UserTemplateProcessor.java
.../java/org/b3log/solo/processor/UserTemplateProcessor.java
+1
-0
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
...n/java/org/b3log/solo/processor/console/AdminConsole.java
+1
-1
src/main/java/org/b3log/solo/service/DataModelService.java
src/main/java/org/b3log/solo/service/DataModelService.java
+14
-3
No files found.
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
96da7dbb
...
@@ -224,6 +224,7 @@ public class ArticleProcessor {
...
@@ -224,6 +224,7 @@ public class ArticleProcessor {
Keys
.
fillRuntime
(
dataModel
);
Keys
.
fillRuntime
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
}
}
/**
/**
...
@@ -623,6 +624,7 @@ public class ArticleProcessor {
...
@@ -623,6 +624,7 @@ public class ArticleProcessor {
prepareShowAuthorArticles
(
pageNums
,
dataModel
,
pageCount
,
currentPageNum
,
articles
,
author
);
prepareShowAuthorArticles
(
pageNums
,
dataModel
,
pageCount
,
currentPageNum
,
articles
,
author
);
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
...
@@ -678,6 +680,7 @@ public class ArticleProcessor {
...
@@ -678,6 +680,7 @@ public class ArticleProcessor {
prepareShowArchiveArticles
(
preference
,
dataModel
,
articles
,
currentPageNum
,
pageCount
,
archiveDateString
,
archiveDate
);
prepareShowArchiveArticles
(
preference
,
dataModel
,
articles
,
currentPageNum
,
pageCount
,
archiveDateString
,
archiveDate
);
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
...
@@ -751,6 +754,7 @@ public class ArticleProcessor {
...
@@ -751,6 +754,7 @@ public class ArticleProcessor {
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
if
(!
StatisticMgmtService
.
hasBeenServed
(
context
,
response
))
{
if
(!
StatisticMgmtService
.
hasBeenServed
(
context
,
response
))
{
...
...
src/main/java/org/b3log/solo/processor/CategoryProcessor.java
View file @
96da7dbb
...
@@ -151,6 +151,7 @@ public class CategoryProcessor {
...
@@ -151,6 +151,7 @@ public class CategoryProcessor {
dataModel
.
put
(
Common
.
PATH
,
"/category/"
+
URLs
.
encode
(
categoryURI
));
dataModel
.
put
(
Common
.
PATH
,
"/category/"
+
URLs
.
encode
(
categoryURI
));
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
}
catch
(
final
ServiceException
|
JSONException
e
)
{
}
catch
(
final
ServiceException
|
JSONException
e
)
{
...
...
src/main/java/org/b3log/solo/processor/ErrorProcessor.java
View file @
96da7dbb
...
@@ -101,6 +101,7 @@ public class ErrorProcessor {
...
@@ -101,6 +101,7 @@ public class ErrorProcessor {
dataModel
.
putAll
(
langs
);
dataModel
.
putAll
(
langs
);
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
final
String
msg
=
(
String
)
context
.
attr
(
Keys
.
MSG
);
final
String
msg
=
(
String
)
context
.
attr
(
Keys
.
MSG
);
dataModel
.
put
(
Keys
.
MSG
,
msg
);
dataModel
.
put
(
Keys
.
MSG
,
msg
);
dataModel
.
put
(
Common
.
LOGIN_URL
,
userQueryService
.
getLoginURL
(
Common
.
ADMIN_INDEX_URI
));
dataModel
.
put
(
Common
.
LOGIN_URL
,
userQueryService
.
getLoginURL
(
Common
.
ADMIN_INDEX_URI
));
...
...
src/main/java/org/b3log/solo/processor/IndexProcessor.java
View file @
96da7dbb
...
@@ -129,6 +129,7 @@ public class IndexProcessor {
...
@@ -129,6 +129,7 @@ public class IndexProcessor {
dataModelService
.
fillIndexArticles
(
context
,
dataModel
,
currentPageNum
,
preference
);
dataModelService
.
fillIndexArticles
(
context
,
dataModel
,
currentPageNum
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
dataModel
.
put
(
Pagination
.
PAGINATION_CURRENT_PAGE_NUM
,
currentPageNum
);
dataModel
.
put
(
Pagination
.
PAGINATION_CURRENT_PAGE_NUM
,
currentPageNum
);
final
int
previousPageNum
=
currentPageNum
>
1
?
currentPageNum
-
1
:
0
;
final
int
previousPageNum
=
currentPageNum
>
1
?
currentPageNum
-
1
:
0
;
...
@@ -176,15 +177,8 @@ public class IndexProcessor {
...
@@ -176,15 +177,8 @@ public class IndexProcessor {
dataModel
.
put
(
Common
.
REFERER
,
referer
);
dataModel
.
put
(
Common
.
REFERER
,
referer
);
Keys
.
fillRuntime
(
dataModel
);
Keys
.
fillRuntime
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
dataModelService
.
fillFaviconURL
(
dataModel
,
optionQueryService
.
getPreference
());
Solos
.
addGoogleNoIndex
(
context
);
Solos
.
addGoogleNoIndex
(
context
);
try
{
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
}
}
}
/**
/**
...
@@ -217,6 +211,7 @@ public class IndexProcessor {
...
@@ -217,6 +211,7 @@ public class IndexProcessor {
dataModel
.
putAll
(
langs
);
dataModel
.
putAll
(
langs
);
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
Keys
.
fillServer
(
dataModel
);
Keys
.
fillServer
(
dataModel
);
Keys
.
fillRuntime
(
dataModel
);
Keys
.
fillRuntime
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
dataModelService
.
fillMinified
(
dataModel
);
...
...
src/main/java/org/b3log/solo/processor/PageProcessor.java
View file @
96da7dbb
...
@@ -136,6 +136,7 @@ public class PageProcessor {
...
@@ -136,6 +136,7 @@ public class PageProcessor {
Stopwatchs
.
end
();
Stopwatchs
.
end
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
...
...
src/main/java/org/b3log/solo/processor/SearchProcessor.java
View file @
96da7dbb
...
@@ -148,6 +148,7 @@ public class SearchProcessor {
...
@@ -148,6 +148,7 @@ public class SearchProcessor {
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
dataModel
.
put
(
Article
.
ARTICLES
,
articles
);
dataModel
.
put
(
Article
.
ARTICLES
,
articles
);
...
...
src/main/java/org/b3log/solo/processor/TagProcessor.java
View file @
96da7dbb
...
@@ -148,6 +148,7 @@ public class TagProcessor {
...
@@ -148,6 +148,7 @@ public class TagProcessor {
dataModel
.
put
(
Keys
.
OBJECT_ID
,
tagId
);
dataModel
.
put
(
Keys
.
OBJECT_ID
,
tagId
);
dataModel
.
put
(
Tag
.
TAG
,
tag
);
dataModel
.
put
(
Tag
.
TAG
,
tag
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
...
...
src/main/java/org/b3log/solo/processor/UserTemplateProcessor.java
View file @
96da7dbb
...
@@ -111,6 +111,7 @@ public class UserTemplateProcessor {
...
@@ -111,6 +111,7 @@ public class UserTemplateProcessor {
dataModel
.
putAll
(
langs
);
dataModel
.
putAll
(
langs
);
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillCommon
(
context
,
dataModel
,
preference
);
dataModelService
.
fillFaviconURL
(
dataModel
,
preference
);
dataModelService
.
fillUserTemplate
(
context
,
template
,
dataModel
,
preference
);
dataModelService
.
fillUserTemplate
(
context
,
template
,
dataModel
,
preference
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
Skins
.
fillLangs
(
preference
.
optString
(
Option
.
ID_C_LOCALE_STRING
),
(
String
)
context
.
attr
(
Keys
.
TEMAPLTE_DIR_NAME
),
dataModel
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
statisticMgmtService
.
incBlogViewCount
(
context
,
response
);
...
...
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
View file @
96da7dbb
...
@@ -160,7 +160,7 @@ public class AdminConsole {
...
@@ -160,7 +160,7 @@ public class AdminConsole {
dataModel
.
put
(
Common
.
UPLOAD_URL
,
upload
.
optString
(
Common
.
UPLOAD_URL
));
dataModel
.
put
(
Common
.
UPLOAD_URL
,
upload
.
optString
(
Common
.
UPLOAD_URL
));
dataModel
.
put
(
Common
.
UPLOAD_MSG
,
upload
.
optString
(
Common
.
UPLOAD_MSG
));
dataModel
.
put
(
Common
.
UPLOAD_MSG
,
upload
.
optString
(
Common
.
UPLOAD_MSG
));
}
}
dataModelService
.
fill
Common
(
context
,
dataModel
,
preference
);
dataModelService
.
fill
FaviconURL
(
dataModel
,
preference
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Admin index render failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Admin index render failed"
,
e
);
}
}
...
...
src/main/java/org/b3log/solo/service/DataModelService.java
View file @
96da7dbb
...
@@ -537,6 +537,20 @@ public class DataModelService {
...
@@ -537,6 +537,20 @@ public class DataModelService {
}
}
}
}
/**
* Fills favicon URL. 可配置 favicon 图标路径 https://github.com/b3log/solo/issues/12706
*
* @param dataModel the specified data model
* @param preference the specified preference
*/
public
void
fillFaviconURL
(
final
Map
<
String
,
Object
>
dataModel
,
final
JSONObject
preference
)
{
if
(
null
==
preference
)
{
dataModel
.
put
(
Common
.
FAVICON_URL
,
Option
.
DefaultPreference
.
DEFAULT_FAVICON_URL
);
}
else
{
dataModel
.
put
(
Common
.
FAVICON_URL
,
preference
.
optString
(
Option
.
ID_C_FAVICON_URL
));
}
}
/**
/**
* Fills common parts (header, side and footer).
* Fills common parts (header, side and footer).
*
*
...
@@ -568,9 +582,6 @@ public class DataModelService {
...
@@ -568,9 +582,6 @@ public class DataModelService {
// 使用 Marked 时代码高亮问题 https://github.com/b3log/solo/issues/12614
// 使用 Marked 时代码高亮问题 https://github.com/b3log/solo/issues/12614
dataModel
.
put
(
Common
.
MARKED_AVAILABLE
,
Markdowns
.
MARKDOWN_HTTP_AVAILABLE
);
dataModel
.
put
(
Common
.
MARKED_AVAILABLE
,
Markdowns
.
MARKDOWN_HTTP_AVAILABLE
);
// 可配置 favicon 图标路径 https://github.com/b3log/solo/issues/12706
dataModel
.
put
(
Common
.
FAVICON_URL
,
preference
.
optString
(
Option
.
ID_C_FAVICON_URL
));
}
}
/**
/**
...
...
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