Commit 32cef8b2 authored by Liang Ding's avatar Liang Ding

#12401

parent ba23e796
<?xml version="1.0" encoding="UTF-8"?>
<!--
Description: Solo POM.
Version: 3.18.2.54, Feb 13, 2018
Version: 3.18.2.55, Mar 3, 2018
Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a>
Author: <a href="http://vanessa.b3log.org">Vanessa</a>
......@@ -76,7 +76,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.b3log.latke.version>2.3.17</org.b3log.latke.version>
<org.b3log.latke.version>2.3.19</org.b3log.latke.version>
<servlet.version>3.1.0</servlet.version>
<slf4j.version>1.7.5</slf4j.version>
......
......@@ -44,7 +44,7 @@ import javax.servlet.http.HttpServletResponse;
* Plugin console request processing.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.3, Sep 21, 2017
* @version 1.0.0.4, Mar 3, 2018
* @since 0.4.0
*/
@RequestProcessor
......@@ -91,27 +91,29 @@ public class PageConsole {
* </pre>
* </p>
*
* @param request the specified http servlet request, for example,
* {
* "page": {
* "oId": "",
* "pageTitle": "",
* "pageContent": "",
* "pageOrder": int,
* "pageCommentCount": int,
* "pagePermalink": "",
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "oId": "",
* "pageTitle": "",
* "pageContent": "",
* "pageOrder": int,
* "pageCommentCount": int,
* "pagePermalink": "",
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified reuqest json object
* @throws Exception exception
*/
@RequestProcessing(value = "/console/page/", method = HTTPRequestMethod.PUT)
public void updatePage(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context)
public void updatePage(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context,
final JSONObject requestJSONObject)
throws Exception {
if (!userQueryService.isAdminLoggedIn(request)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
......@@ -125,8 +127,6 @@ public class PageConsole {
final JSONObject ret = new JSONObject();
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
pageMgmtService.updatePage(requestJSONObject);
ret.put(Keys.STATUS_CODE, true);
......@@ -203,24 +203,26 @@ public class PageConsole {
* </pre>
* </p>
*
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "pageTitle": "",
* "pageContent": "",
* "pagePermalink": "" // optional,
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "pageTitle": "",
* "pageContent": "",
* "pagePermalink": "" // optional,
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing(value = "/console/page/", method = HTTPRequestMethod.POST)
public void addPage(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response)
public void addPage(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response,
final JSONObject requestJSONObject)
throws Exception {
if (!userQueryService.isAdminLoggedIn(request)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
......@@ -234,8 +236,6 @@ public class PageConsole {
final JSONObject ret = new JSONObject();
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
final String pageId = pageMgmtService.addPage(requestJSONObject);
ret.put(Keys.OBJECT_ID, pageId);
......@@ -265,17 +265,19 @@ public class PageConsole {
* </pre>
* </p>
*
* @param request the specified http servlet request, for example,
* {
* "oId": "",
* "direction": "" // "up"/"down"
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "oId": "",
* "direction": "" // "up"/"down"
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing(value = "/console/page/order/", method = HTTPRequestMethod.PUT)
public void changeOrder(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context)
public void changeOrder(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context,
final JSONObject requestJSONObject)
throws Exception {
if (!userQueryService.isAdminLoggedIn(request)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
......@@ -289,7 +291,6 @@ public class PageConsole {
final JSONObject ret = new JSONObject();
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
final String linkId = requestJSONObject.getString(Keys.OBJECT_ID);
final String direction = requestJSONObject.getString(Common.DIRECTION);
......
......@@ -27,7 +27,6 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import org.b3log.latke.servlet.annotation.RequestProcessing;
import org.b3log.latke.servlet.annotation.RequestProcessor;
import org.b3log.latke.servlet.renderer.JSONRenderer;
import org.b3log.latke.util.Requests;
import org.b3log.solo.model.Option;
import org.b3log.solo.model.Sign;
import org.b3log.solo.model.Skin;
......@@ -44,7 +43,7 @@ import javax.servlet.http.HttpServletResponse;
* Preference console request processing.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.10, May 2, 2017
* @version 1.2.0.11, May 2, 2018
* @since 0.4.0
*/
@RequestProcessor
......@@ -148,19 +147,21 @@ public class PreferenceConsole {
/**
* Updates reply template.
*
* @param request the specified http servlet request, for example,
* "replyNotificationTemplate": {
* "subject": "",
* "body": ""
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "replyNotificationTemplate": {
* "subject": "",
* "body": ""
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing(value = "/console/reply/notification/template", method = HTTPRequestMethod.PUT)
public void updateReplyNotificationTemplate(final HttpServletRequest request,
final HttpServletResponse response,
final HTTPRequestContext context) throws Exception {
final HTTPRequestContext context,
final JSONObject requestJSONObject) throws Exception {
if (!userQueryService.isLoggedIn(request, response)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
......@@ -170,7 +171,6 @@ public class PreferenceConsole {
context.setRenderer(renderer);
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
final JSONObject replyNotificationTemplate = requestJSONObject.getJSONObject("replyNotificationTemplate");
preferenceMgmtService.updateReplyNotificationTemplate(replyNotificationTemplate);
......@@ -340,47 +340,48 @@ public class PreferenceConsole {
/**
* Updates the preference by the specified request.
*
* @param request the specified http servlet request, for example,
* "preference": {
* "mostViewArticleDisplayCount": int,
* "recentCommentDisplayCount": int,
* "mostUsedTagDisplayCount": int,
* "articleListDisplayCount": int,
* "articleListPaginationWindowSize": int,
* "mostCommentArticleDisplayCount": int,
* "externalRelevantArticlesDisplayCount": int,
* "relevantArticlesDisplayCount": int,
* "randomArticlesDisplayCount": int,
* "blogTitle": "",
* "blogSubtitle": "",
* "skinDirName": "",
* "localeString": "",
* "timeZoneId": "",
* "noticeBoard": "",
* "footerContent": "",
* "htmlHead": "",
* "metaKeywords": "",
* "metaDescription": "",
* "enableArticleUpdateHint": boolean,
* "signs": [{
* "oId": "",
* "signHTML": ""
* }, ...],
* "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "articleListStyle": "",
* "editorType": "",
* "commentable": boolean,
* "feedOutputMode: "",
* "feedOutputCnt": int
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "preference": {
* "mostViewArticleDisplayCount": int,
* "recentCommentDisplayCount": int,
* "mostUsedTagDisplayCount": int,
* "articleListDisplayCount": int,
* "articleListPaginationWindowSize": int,
* "mostCommentArticleDisplayCount": int,
* "externalRelevantArticlesDisplayCount": int,
* "relevantArticlesDisplayCount": int,
* "randomArticlesDisplayCount": int,
* "blogTitle": "",
* "blogSubtitle": "",
* "skinDirName": "",
* "localeString": "",
* "timeZoneId": "",
* "noticeBoard": "",
* "footerContent": "",
* "htmlHead": "",
* "metaKeywords": "",
* "metaDescription": "",
* "enableArticleUpdateHint": boolean,
* "signs": [{
* "oId": "",
* "signHTML": ""
* }, ...],
* "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "articleListStyle": "",
* "editorType": "",
* "commentable": boolean,
* "feedOutputMode: "",
* "feedOutputCnt": int
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified reuqest json object
* @throws Exception exception
*/
@RequestProcessing(value = PREFERENCE_URI_PREFIX, method = HTTPRequestMethod.PUT)
public void updatePreference(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context)
throws Exception {
public void updatePreference(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context,
final JSONObject requestJSONObject) throws Exception {
if (!userQueryService.isAdminLoggedIn(request)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
......@@ -390,7 +391,6 @@ public class PreferenceConsole {
context.setRenderer(renderer);
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
final JSONObject preference = requestJSONObject.getJSONObject(Option.CATEGORY_C_PREFERENCE);
final JSONObject ret = new JSONObject();
renderer.setJSONObject(ret);
......@@ -472,18 +472,19 @@ public class PreferenceConsole {
/**
* Updates the Qiniu preference by the specified request.
*
* @param request the specified http servlet request, for example,
* "qiniuAccessKey": "",
* "qiniuSecretKey": "",
* "qiniuDomain": "",
* "qiniuBucket": ""
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "qiniuAccessKey": "",
* "qiniuSecretKey": "",
* "qiniuDomain": "",
* "qiniuBucket": ""
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing(value = PREFERENCE_URI_PREFIX + "qiniu", method = HTTPRequestMethod.PUT)
public void updateQiniu(final HttpServletRequest request, final HttpServletResponse response,
final HTTPRequestContext context) throws Exception {
final HTTPRequestContext context, final JSONObject requestJSONObject) throws Exception {
if (!userQueryService.isAdminLoggedIn(request)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
......@@ -494,8 +495,6 @@ public class PreferenceConsole {
context.setRenderer(renderer);
try {
final JSONObject requestJSONObject = Requests.parseRequestJSONObject(request, response);
final String accessKey = requestJSONObject.optString(Option.ID_C_QINIU_ACCESS_KEY).trim();
final String secretKey = requestJSONObject.optString(Option.ID_C_QINIU_SECRET_KEY).trim();
String domain = requestJSONObject.optString(Option.ID_C_QINIU_DOMAIN).trim();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment