|
|
@@ -79,6 +79,7 @@ public class ArticleService extends BaseTransaction {
|
|
|
"(?i)(?:https?:)?//(?:ht\\.gzhxtc\\.edu\\.cn|localhost|127\\.0\\.0\\.1|ffkj-[a-z0-9-]+\\.localhost)(?::\\d+)?(/web/upload/[^\"'<>\\s]*)");
|
|
|
private static final Long NAVIGATION_STYLE_TEXT_LIST = 10000L;
|
|
|
private static final Long NAVIGATION_STYLE_GRAPHIC_LIST = 10010L;
|
|
|
+ private static final String ARTICLE_DEFAULT_THUMBNAIL = "/main/images/article-default-thumbnail.jpg";
|
|
|
private static final String COLLEGE_RED_TEMPLATE_ID_CODE = "ffkjcollegered1";
|
|
|
private static final String ARTICLE_PUBLISHED_HISTORY_ROOT = "/web/upload/article-history/";
|
|
|
private static final String PUBLISHED_CONTENT_SNAPSHOT_FIELD = "publishedContentSnapshot";
|
|
|
@@ -265,10 +266,10 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
- if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
+ if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目", false)) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article, false)) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
if (!verifyArticleImageSources(content)) {
|
|
|
@@ -411,10 +412,10 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
- if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
+ if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目", false)) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article, false)) {
|
|
|
return DEFAULT_FORWARD;
|
|
|
}
|
|
|
if (!verifyArticleImageSources(content)) {
|
|
|
@@ -492,8 +493,8 @@ public class ArticleService extends BaseTransaction {
|
|
|
return wn;
|
|
|
}
|
|
|
|
|
|
- private boolean verifyArticleCopyNavigationList(GeneralDBAccess gdba, String navIdList, Article article)
|
|
|
- throws Exception {
|
|
|
+ private boolean verifyArticleCopyNavigationList(GeneralDBAccess gdba, String navIdList, Article article,
|
|
|
+ boolean allowLegacyDefaultThumbnail) throws Exception {
|
|
|
if (StringUtil.isNull(navIdList)) {
|
|
|
return true;
|
|
|
}
|
|
|
@@ -509,7 +510,8 @@ public class ArticleService extends BaseTransaction {
|
|
|
if (wn == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (!verifyNavigationThumbnailRequired(gdba, wn, article, "抄送栏目")) {
|
|
|
+ if (!verifyNavigationThumbnailRequired(gdba, wn, article, "抄送栏目",
|
|
|
+ allowLegacyDefaultThumbnail)) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -517,7 +519,7 @@ public class ArticleService extends BaseTransaction {
|
|
|
}
|
|
|
|
|
|
private boolean verifyNavigationThumbnailRequired(GeneralDBAccess gdba, WebsiteNavigation wn, Article article,
|
|
|
- String targetName) throws Exception {
|
|
|
+ String targetName, boolean allowLegacyDefaultThumbnail) throws Exception {
|
|
|
if (wn == null || NAVIGATION_STYLE_TEXT_LIST.equals(wn.getWnlscode())) {
|
|
|
return true;
|
|
|
}
|
|
|
@@ -526,6 +528,11 @@ public class ArticleService extends BaseTransaction {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ if (allowLegacyDefaultThumbnail && article != null) {
|
|
|
+ article.setThumbnail(ARTICLE_DEFAULT_THUMBNAIL);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
setResponsePackage(getResponseWarningMsgPackage(targetName + "排版样式不是文字列表时必须上传缩略图"));
|
|
|
return false;
|
|
|
}
|
|
|
@@ -657,16 +664,17 @@ public class ArticleService extends BaseTransaction {
|
|
|
String navIdList = getParameter("navIdList");
|
|
|
|
|
|
Article article = getArticleById(gdba, getParameterToLong("articleid"));
|
|
|
+ boolean legacyThumbnailMissing = StringUtil.isNull(article.getThumbnail());
|
|
|
PojoUtil.formatRequest(getRequest(), article);
|
|
|
|
|
|
WebsiteNavigation wn = getArticleTargetNavigation(gdba, article.getNavigationid(), "发布栏目");
|
|
|
if (wn == null) {
|
|
|
return TIPS_FORWARD;
|
|
|
}
|
|
|
- if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目")) {
|
|
|
+ if (!verifyNavigationThumbnailRequired(gdba, wn, article, "发布栏目", legacyThumbnailMissing)) {
|
|
|
return TIPS_FORWARD;
|
|
|
}
|
|
|
- if (!verifyArticleCopyNavigationList(gdba, navIdList, article)) {
|
|
|
+ if (!verifyArticleCopyNavigationList(gdba, navIdList, article, legacyThumbnailMissing)) {
|
|
|
return TIPS_FORWARD;
|
|
|
}
|
|
|
if (!verifyArticleImageSources(content)) {
|