Commit 7af50222 authored by Liang Ding's avatar Liang Ding

#12509 存档表名

parent 33198d0c
...@@ -931,12 +931,12 @@ public class ArticleProcessor { ...@@ -931,12 +931,12 @@ public class ArticleProcessor {
final JSONObject article = (JSONObject) request.getAttribute(Article.ARTICLE); final JSONObject article = (JSONObject) request.getAttribute(Article.ARTICLE);
if (null == article) { if (null == article) {
response.sendError(HttpServletResponse.SC_NOT_FOUND); response.sendError(HttpServletResponse.SC_NOT_FOUND);
return; return;
} }
final String articleId = article.optString(Keys.OBJECT_ID); final String articleId = article.optString(Keys.OBJECT_ID);
LOGGER.log(Level.DEBUG, "Article [id={0}]", articleId);
LOGGER.log(Level.DEBUG, "Article[id={0}]", articleId);
final AbstractFreeMarkerRenderer renderer = new SkinRenderer(request); final AbstractFreeMarkerRenderer renderer = new SkinRenderer(request);
context.setRenderer(renderer); context.setRenderer(renderer);
...@@ -944,7 +944,6 @@ public class ArticleProcessor { ...@@ -944,7 +944,6 @@ public class ArticleProcessor {
try { try {
final JSONObject preference = preferenceQueryService.getPreference(); final JSONObject preference = preferenceQueryService.getPreference();
final boolean allowVisitDraftViaPermalink = preference.getBoolean(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK); final boolean allowVisitDraftViaPermalink = preference.getBoolean(Option.ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK);
if (!article.optBoolean(Article.ARTICLE_IS_PUBLISHED) && !allowVisitDraftViaPermalink) { if (!article.optBoolean(Article.ARTICLE_IS_PUBLISHED) && !allowVisitDraftViaPermalink) {
response.sendError(HttpServletResponse.SC_NOT_FOUND); response.sendError(HttpServletResponse.SC_NOT_FOUND);
...@@ -952,13 +951,14 @@ public class ArticleProcessor { ...@@ -952,13 +951,14 @@ public class ArticleProcessor {
return; return;
} }
LOGGER.log(Level.TRACE, "Article[title={0}]", article.getString(Article.ARTICLE_TITLE)); LOGGER.log(Level.TRACE, "Article [title={0}]", article.getString(Article.ARTICLE_TITLE));
articleQueryService.markdown(article); articleQueryService.markdown(article);
article.put(Article.ARTICLE_T_CREATE_DATE, new Date(article.optLong(Article.ARTICLE_CREATED)));
// For <meta name="description" content="${article.articleAbstract}"/> // For <meta name="description" content="${article.articleAbstract}"/>
final String metaDescription = Jsoup.parse(article.optString(Article.ARTICLE_ABSTRACT)).text(); final String metaDescription = Jsoup.parse(article.optString(Article.ARTICLE_ABSTRACT)).text();
article.put(Article.ARTICLE_ABSTRACT, metaDescription); article.put(Article.ARTICLE_ABSTRACT, metaDescription);
if (preference.getBoolean(Option.ID_C_ENABLE_ARTICLE_UPDATE_HINT)) { if (preference.getBoolean(Option.ID_C_ENABLE_ARTICLE_UPDATE_HINT)) {
...@@ -1206,7 +1206,6 @@ public class ArticleProcessor { ...@@ -1206,7 +1206,6 @@ public class ArticleProcessor {
Stopwatchs.start("Get Previous Article"); Stopwatchs.start("Get Previous Article");
LOGGER.debug("Getting the previous article...."); LOGGER.debug("Getting the previous article....");
final JSONObject previousArticle = articleQueryService.getPreviousArticle(articleId); final JSONObject previousArticle = articleQueryService.getPreviousArticle(articleId);
if (null != previousArticle) { if (null != previousArticle) {
dataModel.put(Common.PREVIOUS_ARTICLE_PERMALINK, previousArticle.getString(Article.ARTICLE_PERMALINK)); dataModel.put(Common.PREVIOUS_ARTICLE_PERMALINK, previousArticle.getString(Article.ARTICLE_PERMALINK));
dataModel.put(Common.PREVIOUS_ARTICLE_TITLE, previousArticle.getString(Article.ARTICLE_TITLE)); dataModel.put(Common.PREVIOUS_ARTICLE_TITLE, previousArticle.getString(Article.ARTICLE_TITLE));
...@@ -1218,10 +1217,8 @@ public class ArticleProcessor { ...@@ -1218,10 +1217,8 @@ public class ArticleProcessor {
Stopwatchs.start("Get Article CMTs"); Stopwatchs.start("Get Article CMTs");
LOGGER.debug("Getting article's comments...."); LOGGER.debug("Getting article's comments....");
final int cmtCount = article.getInt(Article.ARTICLE_COMMENT_COUNT); final int cmtCount = article.getInt(Article.ARTICLE_COMMENT_COUNT);
if (0 != cmtCount) { if (0 != cmtCount) {
final List<JSONObject> articleComments = commentQueryService.getComments(articleId); final List<JSONObject> articleComments = commentQueryService.getComments(articleId);
dataModel.put(Article.ARTICLE_COMMENTS_REF, articleComments); dataModel.put(Article.ARTICLE_COMMENTS_REF, articleComments);
} else { } else {
dataModel.put(Article.ARTICLE_COMMENTS_REF, Collections.emptyList()); dataModel.put(Article.ARTICLE_COMMENTS_REF, Collections.emptyList());
...@@ -1229,8 +1226,7 @@ public class ArticleProcessor { ...@@ -1229,8 +1226,7 @@ public class ArticleProcessor {
LOGGER.debug("Got article's comments"); LOGGER.debug("Got article's comments");
Stopwatchs.end(); Stopwatchs.end();
dataModel.put(Option.ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT, dataModel.put(Option.ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT, preference.getInt(Option.ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT));
preference.getInt(Option.ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT));
dataModel.put(Option.ID_C_RANDOM_ARTICLES_DISPLAY_CNT, preference.getInt(Option.ID_C_RANDOM_ARTICLES_DISPLAY_CNT)); dataModel.put(Option.ID_C_RANDOM_ARTICLES_DISPLAY_CNT, preference.getInt(Option.ID_C_RANDOM_ARTICLES_DISPLAY_CNT));
dataModel.put(Option.ID_C_RELEVANT_ARTICLES_DISPLAY_CNT, preference.getInt(Option.ID_C_RELEVANT_ARTICLES_DISPLAY_CNT)); dataModel.put(Option.ID_C_RELEVANT_ARTICLES_DISPLAY_CNT, preference.getInt(Option.ID_C_RELEVANT_ARTICLES_DISPLAY_CNT));
} }
......
...@@ -32,7 +32,7 @@ import org.json.JSONObject; ...@@ -32,7 +32,7 @@ import org.json.JSONObject;
* Archive date-Article relation repository. * Archive date-Article relation repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.6, Nov 9, 2011 * @version 1.0.0.7, Sep 16, 2018
* @since 0.3.1 * @since 0.3.1
*/ */
@Repository @Repository
...@@ -42,7 +42,7 @@ public class ArchiveDateArticleRepositoryImpl extends AbstractRepository impleme ...@@ -42,7 +42,7 @@ public class ArchiveDateArticleRepositoryImpl extends AbstractRepository impleme
* Public constructor. * Public constructor.
*/ */
public ArchiveDateArticleRepositoryImpl() { public ArchiveDateArticleRepositoryImpl() {
super(ArchiveDate.ARCHIVE_DATE + "_" + Article.ARTICLE); super((ArchiveDate.ARCHIVE_DATE + "_" + Article.ARTICLE).toLowerCase());
} }
@Override @Override
......
...@@ -36,7 +36,7 @@ import java.util.List; ...@@ -36,7 +36,7 @@ import java.util.List;
* Archive date repository. * Archive date repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.10, Aug 27, 2018 * @version 1.0.0.11, Sep 16, 2018
* @since 0.3.1 * @since 0.3.1
*/ */
@Repository @Repository
...@@ -51,7 +51,7 @@ public class ArchiveDateRepositoryImpl extends AbstractRepository implements Arc ...@@ -51,7 +51,7 @@ public class ArchiveDateRepositoryImpl extends AbstractRepository implements Arc
* Public constructor. * Public constructor.
*/ */
public ArchiveDateRepositoryImpl() { public ArchiveDateRepositoryImpl() {
super(ArchiveDate.ARCHIVE_DATE); super(ArchiveDate.ARCHIVE_DATE.toLowerCase());
} }
@Override @Override
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
] ]
}, },
{ {
"name": "archiveDate", "name": "archivedate",
"description": "存档日期表", "description": "存档日期表",
"keys": [ "keys": [
{ {
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
] ]
}, },
{ {
"name": "archiveDate_article", "name": "archivedate_article",
"description": "存档-文章关联表", "description": "存档-文章关联表",
"keys": [ "keys": [
{ {
......
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