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
1647e743
Unverified
Commit
1647e743
authored
Dec 07, 2018
by
Van
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/2.9.7-dev' into 2.9.7-dev
parents
d70799d7
4c16e7b5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
80 additions
and
78 deletions
+80
-78
pom.xml
pom.xml
+1
-1
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+3
-4
src/main/java/org/b3log/solo/processor/FeedProcessor.java
src/main/java/org/b3log/solo/processor/FeedProcessor.java
+2
-2
src/main/java/org/b3log/solo/processor/PageProcessor.java
src/main/java/org/b3log/solo/processor/PageProcessor.java
+4
-2
src/main/java/org/b3log/solo/processor/TagProcessor.java
src/main/java/org/b3log/solo/processor/TagProcessor.java
+2
-2
src/main/java/org/b3log/solo/processor/api/B3ArticleReceiver.java
.../java/org/b3log/solo/processor/api/B3ArticleReceiver.java
+38
-28
src/main/java/org/b3log/solo/processor/api/B3CommentReceiver.java
.../java/org/b3log/solo/processor/api/B3CommentReceiver.java
+24
-21
src/main/java/org/b3log/solo/processor/api/MetaWeblogAPI.java
...main/java/org/b3log/solo/processor/api/MetaWeblogAPI.java
+1
-1
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
...n/java/org/b3log/solo/processor/console/AdminConsole.java
+3
-15
src/test/java/org/b3log/solo/AbstractTestCase.java
src/test/java/org/b3log/solo/AbstractTestCase.java
+1
-1
src/test/java/org/b3log/solo/processor/MetaWeblogAPITestCase.java
.../java/org/b3log/solo/processor/MetaWeblogAPITestCase.java
+1
-1
No files found.
pom.xml
View file @
1647e743
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
</scm>
</scm>
<properties>
<properties>
<org.b3log.latke.version>
2.4.3
4
</org.b3log.latke.version>
<org.b3log.latke.version>
2.4.3
5
</org.b3log.latke.version>
<slf4j.version>
1.7.5
</slf4j.version>
<slf4j.version>
1.7.5
</slf4j.version>
<jsoup.version>
1.9.1
</jsoup.version>
<jsoup.version>
1.9.1
</jsoup.version>
...
...
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
1647e743
...
@@ -198,7 +198,6 @@ public class ArticleProcessor {
...
@@ -198,7 +198,6 @@ public class ArticleProcessor {
public
void
onArticlePwdForm
(
final
RequestContext
context
)
{
public
void
onArticlePwdForm
(
final
RequestContext
context
)
{
try
{
try
{
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
final
String
articleId
=
request
.
getParameter
(
"articleId"
);
final
String
articleId
=
request
.
getParameter
(
"articleId"
);
final
String
pwdTyped
=
request
.
getParameter
(
"pwdTyped"
);
final
String
pwdTyped
=
request
.
getParameter
(
"pwdTyped"
);
...
@@ -216,12 +215,12 @@ public class ArticleProcessor {
...
@@ -216,12 +215,12 @@ public class ArticleProcessor {
session
.
setAttribute
(
Common
.
ARTICLES_VIEW_PWD
,
viewPwds
);
session
.
setAttribute
(
Common
.
ARTICLES_VIEW_PWD
,
viewPwds
);
}
}
response
.
sendRedirect
(
Latkes
.
getServePath
()
+
article
.
getString
(
Article
.
ARTICLE_PERMALINK
));
context
.
sendRedirect
(
Latkes
.
getServePath
()
+
article
.
getString
(
Article
.
ARTICLE_PERMALINK
));
return
;
return
;
}
}
response
.
sendRedirect
(
Latkes
.
getServePath
()
+
"/console/article-pwd?articleId="
+
article
.
optString
(
Keys
.
OBJECT_ID
)
+
"&msg=1"
);
context
.
sendRedirect
(
Latkes
.
getServePath
()
+
"/console/article-pwd?articleId="
+
article
.
optString
(
Keys
.
OBJECT_ID
)
+
"&msg=1"
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Processes article view password form submits failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Processes article view password form submits failed"
,
e
);
...
@@ -509,7 +508,7 @@ public class ArticleProcessor {
...
@@ -509,7 +508,7 @@ public class ArticleProcessor {
final
JSONObject
authorRet
=
userQueryService
.
getUser
(
authorId
);
final
JSONObject
authorRet
=
userQueryService
.
getUser
(
authorId
);
if
(
null
==
authorRet
)
{
if
(
null
==
authorRet
)
{
context
.
getResponse
().
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
...
src/main/java/org/b3log/solo/processor/FeedProcessor.java
View file @
1647e743
...
@@ -168,7 +168,6 @@ public class FeedProcessor {
...
@@ -168,7 +168,6 @@ public class FeedProcessor {
*/
*/
@RequestProcessing
(
value
=
"/rss.xml"
,
method
=
{
HttpMethod
.
GET
,
HttpMethod
.
HEAD
})
@RequestProcessing
(
value
=
"/rss.xml"
,
method
=
{
HttpMethod
.
GET
,
HttpMethod
.
HEAD
})
public
void
blogArticlesRSS
(
final
RequestContext
context
)
{
public
void
blogArticlesRSS
(
final
RequestContext
context
)
{
final
HttpServletResponse
response
=
context
.
getResponse
();
final
RssRenderer
renderer
=
new
RssRenderer
();
final
RssRenderer
renderer
=
new
RssRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
...
@@ -177,7 +176,8 @@ public class FeedProcessor {
...
@@ -177,7 +176,8 @@ public class FeedProcessor {
try
{
try
{
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
if
(
null
==
preference
)
{
if
(
null
==
preference
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
...
src/main/java/org/b3log/solo/processor/PageProcessor.java
View file @
1647e743
...
@@ -108,7 +108,8 @@ public class PageProcessor {
...
@@ -108,7 +108,8 @@ public class PageProcessor {
try
{
try
{
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
if
(
null
==
preference
)
{
if
(
null
==
preference
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
@@ -117,7 +118,8 @@ public class PageProcessor {
...
@@ -117,7 +118,8 @@ public class PageProcessor {
// See PermalinkFilter#dispatchToArticleOrPageProcessor()
// See PermalinkFilter#dispatchToArticleOrPageProcessor()
final
JSONObject
page
=
(
JSONObject
)
request
.
getAttribute
(
Page
.
PAGE
);
final
JSONObject
page
=
(
JSONObject
)
request
.
getAttribute
(
Page
.
PAGE
);
if
(
null
==
page
)
{
if
(
null
==
page
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
...
src/main/java/org/b3log/solo/processor/TagProcessor.java
View file @
1647e743
...
@@ -120,7 +120,7 @@ public class TagProcessor {
...
@@ -120,7 +120,7 @@ public class TagProcessor {
LOGGER
.
log
(
Level
.
DEBUG
,
"Tag [title={0}, currentPageNum={1}]"
,
tagTitle
,
currentPageNum
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Tag [title={0}, currentPageNum={1}]"
,
tagTitle
,
currentPageNum
);
final
JSONObject
result
=
tagQueryService
.
getTagByTitle
(
tagTitle
);
final
JSONObject
result
=
tagQueryService
.
getTagByTitle
(
tagTitle
);
if
(
null
==
result
)
{
if
(
null
==
result
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
@@ -135,7 +135,7 @@ public class TagProcessor {
...
@@ -135,7 +135,7 @@ public class TagProcessor {
final
int
windowSize
=
preference
.
getInt
(
Option
.
ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE
);
final
int
windowSize
=
preference
.
getInt
(
Option
.
ID_C_ARTICLE_LIST_PAGINATION_WINDOW_SIZE
);
final
List
<
JSONObject
>
articles
=
articleQueryService
.
getArticlesByTag
(
tagId
,
currentPageNum
,
pageSize
);
final
List
<
JSONObject
>
articles
=
articleQueryService
.
getArticlesByTag
(
tagId
,
currentPageNum
,
pageSize
);
if
(
articles
.
isEmpty
())
{
if
(
articles
.
isEmpty
())
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
context
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
return
;
}
}
...
...
src/main/java/org/b3log/solo/api/B3ArticleReceiver.java
→
src/main/java/org/b3log/solo/
processor/
api/B3ArticleReceiver.java
View file @
1647e743
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
*/
package
org
.
b3log
.
solo
.
api
;
package
org
.
b3log
.
solo
.
processor
.
api
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.ioc.Inject
;
import
org.b3log.latke.ioc.Inject
;
...
@@ -37,7 +37,7 @@ import org.b3log.solo.service.UserQueryService;
...
@@ -37,7 +37,7 @@ import org.b3log.solo.service.UserQueryService;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
/**
/**
*
Article receiver from B3log Symphony
.
*
Receiving articles from B3log community. Visits <a href="https://hacpai.com/b3log">B3log 构思</a> for more details
.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.4.3, Sep 25, 2018
* @version 1.0.4.3, Sep 25, 2018
...
@@ -78,6 +78,21 @@ public class B3ArticleReceiver {
...
@@ -78,6 +78,21 @@ public class B3ArticleReceiver {
/**
/**
* Adds an article with the specified request.
* Adds an article with the specified request.
* <p>
* <p>
* Request json:
* <pre>
* {
* "article": {
* "oId": "",
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* Renders the response with a json object, for example,
* <pre>
* <pre>
* {
* {
...
@@ -88,24 +103,14 @@ public class B3ArticleReceiver {
...
@@ -88,24 +103,14 @@ public class B3ArticleReceiver {
* </pre>
* </pre>
* </p>
* </p>
*
*
* @param context the specified http request context
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* "article": {
* "oId": "",
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* @throws Exception exception
*/
*/
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
POST
)
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
POST
)
public
void
addArticle
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
public
void
addArticle
(
final
RequestContext
context
)
{
throws
Exception
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
try
{
try
{
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
...
@@ -151,6 +156,21 @@ public class B3ArticleReceiver {
...
@@ -151,6 +156,21 @@ public class B3ArticleReceiver {
/**
/**
* Updates an article with the specified request.
* Updates an article with the specified request.
* <p>
* <p>
* Request json:
* <pre>
* {
* "article": {
* "oId": "", // Symphony Article#clientArticleId
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* Renders the response with a json object, for example,
* <pre>
* <pre>
* {
* {
...
@@ -160,25 +180,15 @@ public class B3ArticleReceiver {
...
@@ -160,25 +180,15 @@ public class B3ArticleReceiver {
* </pre>
* </pre>
* </p>
* </p>
*
*
* @param context the specified http request context
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* "article": {
* "oId": "", // Symphony Article#clientArticleId
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* @throws Exception exception
*/
*/
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
PUT
)
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
PUT
)
public
void
updateArticle
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
public
void
updateArticle
(
final
RequestContext
context
)
{
throws
Exception
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
try
{
try
{
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
...
...
src/main/java/org/b3log/solo/api/B3CommentReceiver.java
→
src/main/java/org/b3log/solo/
processor/
api/B3CommentReceiver.java
View file @
1647e743
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
*/
package
org
.
b3log
.
solo
.
api
;
package
org
.
b3log
.
solo
.
processor
.
api
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
...
@@ -49,7 +49,7 @@ import java.net.URL;
...
@@ -49,7 +49,7 @@ import java.net.URL;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
*
Comment receiver from B3log Symphony
.
*
Receiving comments from B3log community. Visits <a href="https://hacpai.com/b3log">B3log 构思</a> for more details
.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.19, Nov 6, 2018
* @version 1.1.1.19, Nov 6, 2018
...
@@ -108,6 +108,25 @@ public class B3CommentReceiver {
...
@@ -108,6 +108,25 @@ public class B3CommentReceiver {
/**
/**
* Adds a comment with the specified request.
* Adds a comment with the specified request.
* <p>
* <p>
* Request json:
* <pre>
* {
* "comment": {
* "userB3Key": "",
* "oId": "",
* "commentSymphonyArticleId": "",
* "commentOnArticleId": "",
* "commentAuthorName": "",
* "commentAuthorEmail": "",
* "commentAuthorURL": "",
* "commentAuthorThumbnailURL": "",
* "commentContent": "",
* "commentOriginalCommentId": "" // optional, if exists this key, the comment is an reply
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* Renders the response with a json object, for example,
* <pre>
* <pre>
* {
* {
...
@@ -116,32 +135,16 @@ public class B3CommentReceiver {
...
@@ -116,32 +135,16 @@ public class B3CommentReceiver {
* </pre>
* </pre>
* </p>
* </p>
*
*
* @param context the specified http request context
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* {
* "comment": {
* "userB3Key": "",
* "oId": "",
* "commentSymphonyArticleId": "",
* "commentOnArticleId": "",
* "commentAuthorName": "",
* "commentAuthorEmail": "",
* "commentAuthorURL": "",
* "commentAuthorThumbnailURL": "",
* "commentContent": "",
* "commentOriginalCommentId": "" // optional, if exists this key, the comment is an reply
* }
* }
* @throws Exception exception
*/
*/
@RequestProcessing
(
value
=
"/apis/symphony/comment"
,
method
=
HttpMethod
.
PUT
)
@RequestProcessing
(
value
=
"/apis/symphony/comment"
,
method
=
HttpMethod
.
PUT
)
public
void
addComment
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
public
void
addComment
(
final
RequestContext
context
)
{
throws
Exception
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
Transaction
transaction
=
commentRepository
.
beginTransaction
();
final
Transaction
transaction
=
commentRepository
.
beginTransaction
();
try
{
try
{
final
JSONObject
symphonyCmt
=
requestJSONObject
.
optJSONObject
(
Comment
.
COMMENT
);
final
JSONObject
symphonyCmt
=
requestJSONObject
.
optJSONObject
(
Comment
.
COMMENT
);
...
...
src/main/java/org/b3log/solo/api/MetaWeblogAPI.java
→
src/main/java/org/b3log/solo/
processor/
api/MetaWeblogAPI.java
View file @
1647e743
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
*/
package
org
.
b3log
.
solo
.
api
;
package
org
.
b3log
.
solo
.
processor
.
api
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
...
...
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
View file @
1647e743
...
@@ -252,11 +252,7 @@ public class AdminConsole {
...
@@ -252,11 +252,7 @@ public class AdminConsole {
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
try
{
context
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
}
catch
(
final
Exception
e
)
{
// ignored
}
return
;
return
;
}
}
...
@@ -369,11 +365,7 @@ public class AdminConsole {
...
@@ -369,11 +365,7 @@ public class AdminConsole {
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
try
{
context
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
}
catch
(
final
Exception
e
)
{
// ignored
}
return
;
return
;
}
}
...
@@ -424,11 +416,7 @@ public class AdminConsole {
...
@@ -424,11 +416,7 @@ public class AdminConsole {
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
final
HttpServletResponse
response
=
context
.
getResponse
();
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
if
(!
Solos
.
isAdminLoggedIn
(
request
,
response
))
{
try
{
context
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
);
}
catch
(
final
Exception
e
)
{
// ignored
}
return
;
return
;
}
}
...
...
src/test/java/org/b3log/solo/AbstractTestCase.java
View file @
1647e743
...
@@ -27,7 +27,7 @@ import org.b3log.latke.repository.jdbc.util.Connections;
...
@@ -27,7 +27,7 @@ import org.b3log.latke.repository.jdbc.util.Connections;
import
org.b3log.latke.repository.jdbc.util.JdbcRepositories
;
import
org.b3log.latke.repository.jdbc.util.JdbcRepositories
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.util.Crypts
;
import
org.b3log.latke.util.Crypts
;
import
org.b3log.solo.api.MetaWeblogAPI
;
import
org.b3log.solo.
processor.
api.MetaWeblogAPI
;
import
org.b3log.solo.cache.*
;
import
org.b3log.solo.cache.*
;
import
org.b3log.solo.processor.MockDispatcherServlet
;
import
org.b3log.solo.processor.MockDispatcherServlet
;
import
org.b3log.solo.repository.*
;
import
org.b3log.solo.repository.*
;
...
...
src/test/java/org/b3log/solo/processor/MetaWeblogAPITestCase.java
View file @
1647e743
...
@@ -21,7 +21,7 @@ import org.apache.commons.lang.StringUtils;
...
@@ -21,7 +21,7 @@ import org.apache.commons.lang.StringUtils;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.AbstractTestCase
;
import
org.b3log.solo.MockHttpServletRequest
;
import
org.b3log.solo.MockHttpServletRequest
;
import
org.b3log.solo.MockHttpServletResponse
;
import
org.b3log.solo.MockHttpServletResponse
;
import
org.b3log.solo.api.MetaWeblogAPI
;
import
org.b3log.solo.
processor.
api.MetaWeblogAPI
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
...
...
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