Commit 4eb8f242 authored by Liang Ding's avatar Liang Ding

#12042

Option.Default 重命名为 Option.DefaultPreference
parent 2915ec7f
...@@ -122,7 +122,7 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -122,7 +122,7 @@ public final class SoloServletListener extends AbstractServletListener {
upgradeService.upgrade(); upgradeService.upgrade();
// Set default skin, loads from preference later // Set default skin, loads from preference later
Skins.setDirectoryForTemplateLoading(Option.Default.DEFAULT_SKIN_DIR_NAME); Skins.setDirectoryForTemplateLoading(Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
final OptionRepository optionRepository = beanManager.getReference(OptionRepositoryImpl.class); final OptionRepository optionRepository = beanManager.getReference(OptionRepositoryImpl.class);
......
...@@ -304,12 +304,12 @@ public final class Option { ...@@ -304,12 +304,12 @@ public final class Option {
* @version 2.1.0.9, Nov 23, 2015 * @version 2.1.0.9, Nov 23, 2015
* @since 0.3.1 * @since 0.3.1
*/ */
public static final class Default { public static final class DefaultPreference {
/** /**
* Logger. * Logger.
*/ */
private static final Logger LOGGER = Logger.getLogger(Default.class.getName()); private static final Logger LOGGER = Logger.getLogger(DefaultPreference.class.getName());
/** /**
* Default recent article display count. * Default recent article display count.
...@@ -503,7 +503,7 @@ public final class Option { ...@@ -503,7 +503,7 @@ public final class Option {
/** /**
* Private default constructor. * Private default constructor.
*/ */
private Default() { private DefaultPreference() {
} }
} }
......
...@@ -249,7 +249,7 @@ public class RepairProcessor { ...@@ -249,7 +249,7 @@ public class RepairProcessor {
final JSONObject preference = preferenceQueryService.getPreference(); final JSONObject preference = preferenceQueryService.getPreference();
final String originalSigns = preference.getString(Option.ID_C_SIGNS); final String originalSigns = preference.getString(Option.ID_C_SIGNS);
preference.put(Option.ID_C_SIGNS, Option.Default.DEFAULT_SIGNS); preference.put(Option.ID_C_SIGNS, Option.DefaultPreference.DEFAULT_SIGNS);
preferenceMgmtService.updatePreference(preference); preferenceMgmtService.updatePreference(preference);
......
...@@ -120,18 +120,18 @@ public class PreferenceMgmtService { ...@@ -120,18 +120,18 @@ public class PreferenceMgmtService {
if (!skinDirNames.contains(currentSkinDirName)) { if (!skinDirNames.contains(currentSkinDirName)) {
LOGGER.log(Level.WARN, "Configred skin[dirName={0}] can not find, try to use " + "default skin[dirName=" LOGGER.log(Level.WARN, "Configred skin[dirName={0}] can not find, try to use " + "default skin[dirName="
+ Option.Default.DEFAULT_SKIN_DIR_NAME + "] instead.", + Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME + "] instead.",
currentSkinDirName); currentSkinDirName);
if (!skinDirNames.contains(Option.Default.DEFAULT_SKIN_DIR_NAME)) { if (!skinDirNames.contains(Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME)) {
LOGGER.log(Level.ERROR, "Can not find skin[dirName=" + Option.Default.DEFAULT_SKIN_DIR_NAME + "]"); LOGGER.log(Level.ERROR, "Can not find skin[dirName=" + Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME + "]");
throw new IllegalStateException( throw new IllegalStateException(
"Can not find default skin[dirName=" + Option.Default.DEFAULT_SKIN_DIR_NAME "Can not find default skin[dirName=" + Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME
+ "], please redeploy your Solo and make sure contains this default skin!"); + "], please redeploy your Solo and make sure contains this default skin!");
} }
preference.put(SKIN_DIR_NAME, Option.Default.DEFAULT_SKIN_DIR_NAME); preference.put(SKIN_DIR_NAME, Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME);
preference.put(SKIN_NAME, Latkes.getSkinName(Option.Default.DEFAULT_SKIN_DIR_NAME)); preference.put(SKIN_NAME, Latkes.getSkinName(Option.DefaultPreference.DEFAULT_SKIN_DIR_NAME));
updatePreference(preference); updatePreference(preference);
} }
......
...@@ -402,7 +402,7 @@ public class UpgradeService { ...@@ -402,7 +402,7 @@ public class UpgradeService {
final JSONObject footerContentOpt = new JSONObject(); final JSONObject footerContentOpt = new JSONObject();
footerContentOpt.put(Keys.OBJECT_ID, Option.ID_C_FOOTER_CONTENT); footerContentOpt.put(Keys.OBJECT_ID, Option.ID_C_FOOTER_CONTENT);
footerContentOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE); footerContentOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
footerContentOpt.put(Option.OPTION_VALUE, Option.Default.DEFAULT_FOOTER_CONTENT); footerContentOpt.put(Option.OPTION_VALUE, Option.DefaultPreference.DEFAULT_FOOTER_CONTENT);
optionRepository.add(footerContentOpt); optionRepository.add(footerContentOpt);
final JSONObject replyNotificationTemplate = preferenceRepository.get("replyNotificationTemplate"); final JSONObject replyNotificationTemplate = preferenceRepository.get("replyNotificationTemplate");
...@@ -430,7 +430,7 @@ public class UpgradeService { ...@@ -430,7 +430,7 @@ public class UpgradeService {
final JSONObject allowRegisterOpt = new JSONObject(); final JSONObject allowRegisterOpt = new JSONObject();
allowRegisterOpt.put(Keys.OBJECT_ID, Option.ID_C_ALLOW_REGISTER); allowRegisterOpt.put(Keys.OBJECT_ID, Option.ID_C_ALLOW_REGISTER);
allowRegisterOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE); allowRegisterOpt.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_PREFERENCE);
allowRegisterOpt.put(Option.OPTION_VALUE, Option.Default.DEFAULT_ALLOW_REGISTER); allowRegisterOpt.put(Option.OPTION_VALUE, Option.DefaultPreference.DEFAULT_ALLOW_REGISTER);
optionRepository.add(allowRegisterOpt); optionRepository.add(allowRegisterOpt);
preference.put(Option.ID_C_VERSION, TO_VER); preference.put(Option.ID_C_VERSION, TO_VER);
......
...@@ -63,7 +63,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase { ...@@ -63,7 +63,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
JSONObject preference = preferenceQueryService.getPreference(); JSONObject preference = preferenceQueryService.getPreference();
Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE),
Option.Default.DEFAULT_BLOG_TITLE); Option.DefaultPreference.DEFAULT_BLOG_TITLE);
preference.put(Option.ID_C_BLOG_TITLE, "updated blog title"); preference.put(Option.ID_C_BLOG_TITLE, "updated blog title");
preferenceMgmtService.updatePreference(preference); preferenceMgmtService.updatePreference(preference);
...@@ -83,7 +83,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase { ...@@ -83,7 +83,7 @@ public class PreferenceMgmtServiceTestCase extends AbstractTestCase {
final PreferenceQueryService preferenceQueryService = getPreferenceQueryService(); final PreferenceQueryService preferenceQueryService = getPreferenceQueryService();
JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate(); JSONObject replyNotificationTemplate = preferenceQueryService.getReplyNotificationTemplate();
Assert.assertEquals(replyNotificationTemplate.toString(), Option.Default.DEFAULT_REPLY_NOTIFICATION_TEMPLATE); Assert.assertEquals(replyNotificationTemplate.toString(), Option.DefaultPreference.DEFAULT_REPLY_NOTIFICATION_TEMPLATE);
replyNotificationTemplate.put("subject", "updated subject"); replyNotificationTemplate.put("subject", "updated subject");
preferenceMgmtService.updateReplyNotificationTemplate(replyNotificationTemplate); preferenceMgmtService.updateReplyNotificationTemplate(replyNotificationTemplate);
......
...@@ -62,7 +62,7 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase { ...@@ -62,7 +62,7 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase {
= getPreferenceQueryService(); = getPreferenceQueryService();
final JSONObject preference = preferenceQueryService.getPreference(); final JSONObject preference = preferenceQueryService.getPreference();
Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), Option.Default.DEFAULT_BLOG_TITLE); Assert.assertEquals(preference.getString(Option.ID_C_BLOG_TITLE), Option.DefaultPreference.DEFAULT_BLOG_TITLE);
} }
/** /**
...@@ -77,6 +77,6 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase { ...@@ -77,6 +77,6 @@ public class PreferenceQueryServiceTestCase extends AbstractTestCase {
final JSONObject replyNotificationTemplate final JSONObject replyNotificationTemplate
= preferenceQueryService.getReplyNotificationTemplate(); = preferenceQueryService.getReplyNotificationTemplate();
Assert.assertEquals(replyNotificationTemplate.toString(), Option.Default.DEFAULT_REPLY_NOTIFICATION_TEMPLATE); Assert.assertEquals(replyNotificationTemplate.toString(), Option.DefaultPreference.DEFAULT_REPLY_NOTIFICATION_TEMPLATE);
} }
} }
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