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
8ccb036c
Unverified
Commit
8ccb036c
authored
Apr 15, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Cleanup code
parent
f46cdb6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
31 deletions
+27
-31
src/main/java/org/b3log/solo/filter/AuthFilter.java
src/main/java/org/b3log/solo/filter/AuthFilter.java
+0
-2
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
+3
-3
src/main/java/org/b3log/solo/filter/PermalinkFilter.java
src/main/java/org/b3log/solo/filter/PermalinkFilter.java
+22
-24
src/main/java/org/b3log/solo/plugin/list/ListHandler.java
src/main/java/org/b3log/solo/plugin/list/ListHandler.java
+2
-2
No files found.
src/main/java/org/b3log/solo/filter/AuthFilter.java
View file @
8ccb036c
...
...
@@ -15,7 +15,6 @@
*/
package
org
.
b3log
.
solo
.
filter
;
import
org.b3log.latke.ioc.LatkeBeanManager
;
import
org.b3log.latke.ioc.Lifecycle
;
import
org.b3log.latke.logging.Level
;
...
...
@@ -31,7 +30,6 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Authentication filter.
*
...
...
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
View file @
8ccb036c
...
...
@@ -59,10 +59,10 @@ public final class InitCheckFilter implements Filter {
/**
* If Solo has not been initialized, so redirects to /init.
*
* @param request the specified request
* @param request
the specified request
* @param response the specified response
* @param chain filter chain
* @throws IOException io exception
* @param chain
filter chain
* @throws IOException
io exception
* @throws ServletException servlet exception
*/
@Override
...
...
src/main/java/org/b3log/solo/filter/PermalinkFilter.java
View file @
8ccb036c
...
...
@@ -15,7 +15,6 @@
*/
package
org
.
b3log
.
solo
.
filter
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
...
...
@@ -44,16 +43,15 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Article/Page permalink filter.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.7, Jan 8, 2013
* @see org.b3log.solo.processor.ArticleProcessor#showArticle(org.b3log.latke.servlet.HTTPRequestContext,
* javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
* @see org.b3log.solo.processor.PageProcessor#showPage(org.b3log.latke.servlet.HTTPRequestContext)
* @since 0.3.1
* @see org.b3log.solo.processor.ArticleProcessor#showArticle(org.b3log.latke.servlet.HTTPRequestContext,
* javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
* @see org.b3log.solo.processor.PageProcessor#showPage(org.b3log.latke.servlet.HTTPRequestContext)
*/
public
final
class
PermalinkFilter
implements
Filter
{
...
...
@@ -63,20 +61,21 @@ public final class PermalinkFilter implements Filter {
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
PermalinkFilter
.
class
);
@Override
public
void
init
(
final
FilterConfig
filterConfig
)
throws
ServletException
{}
public
void
init
(
final
FilterConfig
filterConfig
)
throws
ServletException
{
}
/**
* Tries to dispatch request to article processor.
*
* @param request the specified request
* @param request
the specified request
* @param response the specified response
* @param chain filter chain
* @throws IOException io exception
* @param chain
filter chain
* @throws IOException
io exception
* @throws ServletException servlet exception
*/
@Override
public
void
doFilter
(
final
ServletRequest
request
,
final
ServletResponse
response
,
final
FilterChain
chain
)
throws
IOException
,
ServletException
{
throws
IOException
,
ServletException
{
final
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
request
;
final
HttpServletResponse
httpServletResponse
=
(
HttpServletResponse
)
response
;
...
...
@@ -103,10 +102,9 @@ public final class PermalinkFilter implements Filter {
final
ArticleRepository
articleRepository
=
beanManager
.
getReference
(
ArticleRepositoryImpl
.
class
);
article
=
articleRepository
.
getByPermalink
(
permalink
);
if
(
null
==
article
)
{
final
PageRepository
pageRepository
=
beanManager
.
getReference
(
PageRepositoryImpl
.
class
);
page
=
pageRepository
.
getByPermalink
(
permalink
);
}
...
...
@@ -129,7 +127,7 @@ public final class PermalinkFilter implements Filter {
if
(
null
!=
article
&&
articleQueryService
.
needViewPwd
(
httpServletRequest
,
article
))
{
try
{
httpServletResponse
.
sendRedirect
(
Latkes
.
getServePath
()
+
"/console/article-pwd?articleId="
+
article
.
optString
(
Keys
.
OBJECT_ID
));
Latkes
.
getServePath
()
+
"/console/article-pwd?articleId="
+
article
.
optString
(
Keys
.
OBJECT_ID
));
return
;
}
catch
(
final
Exception
e
)
{
httpServletResponse
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
...
...
@@ -141,20 +139,20 @@ public final class PermalinkFilter implements Filter {
}
/**
* Dispatches the specified request to the specified article or page
* Dispatches the specified request to the specified article or page
* processor with the specified response.
*
* @param request the specified request
*
* @param request
the specified request
* @param response the specified response
* @param article the specified article
* @param page the specified page
* @param article
the specified article
* @param page
the specified page
* @throws ServletException servlet exception
* @throws IOException io exception
* @see
HTTPRequestDispatcher#dispatch(org.b3log.latke.servlet.HTTPRequestContext)
* @throws IOException
io exception
* @see
DispatcherServlet#result(HTTPRequestContext)
*/
private
void
dispatchToArticleOrPageProcessor
(
final
ServletRequest
request
,
final
ServletResponse
response
,
final
JSONObject
article
,
final
JSONObject
page
)
throws
ServletException
,
IOException
{
final
JSONObject
article
,
final
JSONObject
page
)
throws
ServletException
,
IOException
{
final
HTTPRequestContext
context
=
new
HTTPRequestContext
();
context
.
setRequest
((
HttpServletRequest
)
request
);
...
...
@@ -171,7 +169,6 @@ public final class PermalinkFilter implements Filter {
request
.
setAttribute
(
Keys
.
HttpRequest
.
REQUEST_METHOD
,
HTTPRequestMethod
.
GET
.
name
());
final
HttpControl
httpControl
=
new
HttpControl
(
DispatcherServlet
.
SYS_HANDLER
.
iterator
(),
context
);
try
{
httpControl
.
nextHandler
();
}
catch
(
final
Exception
e
)
{
...
...
@@ -182,5 +179,6 @@ public final class PermalinkFilter implements Filter {
}
@Override
public
void
destroy
()
{}
public
void
destroy
()
{
}
}
src/main/java/org/b3log/solo/plugin/list/ListHandler.java
View file @
8ccb036c
...
...
@@ -78,8 +78,8 @@ public class ListHandler extends AbstractEventListener<JSONObject> {
element
.
before
(
"<span id='"
+
id
+
"'></span>"
);
listBuilder
.
append
(
"<li class='b3-solo-list-"
).
append
(
tagName
).
append
(
"'><a href='#"
).
append
(
id
).
append
(
"'>"
).
append
(
text
).
append
(
"</a></li>"
);
listBuilder
.
append
(
"<li class='b3-solo-list-"
).
append
(
tagName
).
append
(
"'><a href='#"
).
append
(
id
).
append
(
"'>"
).
append
(
text
).
append
(
"</a></li>"
);
}
listBuilder
.
append
(
"</ul>"
);
...
...
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