Commit c1a11d0f authored by Liang Ding's avatar Liang Ding

Fix #12042

parent 1c5da751
......@@ -4,9 +4,9 @@
## Introduction
Solo is a professional, simple, stable and good performance open source Java blogging system. You can setup it by yourself ([download](http://pan.baidu.com/share/link?shareid=541735&uk=3255126224)) or buy our provided service, see [here](http://b3log.org/services/#solo) for more details.
[Solo](https://github.com/b3log/solo) is a professional, simple, stable and good performance open source Java blogging system. You can setup it by yourself ([download](http://pan.baidu.com/share/link?shareid=541735&uk=3255126224)) or buy our provided service, see [here](http://b3log.org/services/#solo) for more details.
Solo 是一个专业、简约、稳定、极速的开源 Java 博客系统。你可以自己搭建使用([下载](http://pan.baidu.com/share/link?shareid=541735&uk=3255126224)),也可以通过购买我们搭建好的服务来直接使用,详情请看[这里](http://b3log.org/services/#solo)
[Solo](https://github.com/b3log/solo) 是一个专业、简约、稳定、极速的开源 Java 博客系统。你可以自己搭建使用([下载](http://pan.baidu.com/share/link?shareid=541735&uk=3255126224)),也可以通过购买我们搭建好的服务来直接使用,详情请看[这里](http://b3log.org/services/#solo)
> 加入[**黑客派**](http://hacpai.com/register),与其他程序员、设计师共同成长!
......
......@@ -56,7 +56,7 @@ import org.json.JSONObject;
* Solo Servlet listener.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.7.0.10, Nov 23, 2015
* @version 1.7.0.11, Dec 13, 2015
* @since 0.3.1
*/
public final class SoloServletListener extends AbstractServletListener {
......@@ -64,7 +64,7 @@ public final class SoloServletListener extends AbstractServletListener {
/**
* Solo version.
*/
public static final String VERSION = "1.2.0";
public static final String VERSION = "1.3.0";
/**
* Logger.
......
/*
* Copyright (c) 2010-2015, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.b3log.solo.repository;
import org.b3log.latke.repository.Repository;
/**
* Preference repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Aug 14, 2010
* @since 0.3.1
* @deprecated this class will be removed in 1.3.0, see issue
* <a href="https://github.com/b3log/solo/issues/12042">#12042</a>
* for more details
*/
public interface PreferenceRepository extends Repository {}
/*
* Copyright (c) 2010-2015, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.b3log.solo.repository.impl;
import org.b3log.latke.repository.AbstractRepository;
import org.b3log.latke.repository.RepositoryException;
import org.b3log.latke.repository.annotation.Repository;
import org.b3log.solo.model.Option;
import org.b3log.solo.repository.PreferenceRepository;
import org.json.JSONObject;
/**
* Preference repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.4, Nov 23, 2015
* @since 0.3.1
* @deprecated this class will be removed in 1.3.0, see issue
* <a href="https://github.com/b3log/solo/issues/12042">#12042</a>
* for more details
*/
@Repository
public class PreferenceRepositoryImpl extends AbstractRepository implements PreferenceRepository {
/**
* Public constructor.
*/
public PreferenceRepositoryImpl() {
super(Option.CATEGORY_C_PREFERENCE);
}
/**
* {@inheritDoc}
*
* <p>
* Bypasses {@linkplain org.b3log.latke.repository.Repositories validation} against the repository structure, adds
* the specified json object as preference directly.
* </p>
*/
@Override
public String add(final JSONObject jsonObject) throws RepositoryException {
return getUnderlyingRepository().add(jsonObject);
}
/**
* {@inheritDoc}
*
* <p>
* Bypasses {@linkplain org.b3log.latke.repository.Repositories validation} against the repository structure, adds
* the specified json object as preference directly.
* </p>
*/
@Override
public void update(final String id, final JSONObject jsonObject) throws RepositoryException {
getUnderlyingRepository().update(id, jsonObject);
}
}
......@@ -27,7 +27,6 @@ import org.b3log.latke.service.ServiceException;
import org.b3log.latke.service.annotation.Service;
import org.b3log.solo.model.Option;
import org.b3log.solo.repository.OptionRepository;
import org.b3log.solo.repository.PreferenceRepository;
import org.json.JSONArray;
import org.json.JSONObject;
......@@ -35,7 +34,7 @@ import org.json.JSONObject;
* Preference query service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.1, Nov 8, 2015
* @version 1.1.0.2, Dec 13, 2015
* @since 0.4.0
*/
@Service
......
{
"description": "Description of repository structures, for generation (DDL: http://en.wikipedia.org/wiki/Data_Definition_Language) of the relational database table and persistence validation.",
"version": "1.2.1.1, Nov 8, 2015",
"version": "1.3.1.1, Dec 13, 2015",
"authors": ["Liang Ding"],
"since": "0.4.0",
"repositories": [
......@@ -231,215 +231,6 @@
}
]
},
{
"name": "preference",
"keys": [
{
"name": "oId",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "adminEmail",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "allowVisitDraftViaPermalink",
"type": "boolean",
"nullable": true
},
{
"name": "commentable",
"type": "boolean",
"nullable": true
},
{
"name": "feedOutputMode",
"type": "String",
"length": 20,
"nullable": true
},
{
"name": "feedOutputCnt",
"type": "int",
"nullable": true
},
{
"name": "articleListDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "relevantArticlesDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "articleListPaginationWindowSize",
"type": "int",
"nullable": true
},
{
"name": "articleListStyle",
"type": "String",
"length": 20,
"nullable": true
},
{
"name": "blogSubtitle",
"type": "String",
"length": 512,
"nullable": true
},
{
"name": "blogTitle",
"type": "String",
"length": 512,
"nullable": true
},
{
"name": "enableArticleUpdateHint",
"type": "boolean",
"nullable": true
},
{
"name": "externalRelevantArticlesDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "htmlHead",
"type": "String",
"length": 2048,
"nullable": true
},
{
"name": "keyOfSolo",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "localeString",
"type": "String",
"length": 20,
"nullable": true
},
{
"name": "metaDescription",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "metaKeywords",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "mostCommentArticleDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "mostUsedTagDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "mostViewArticleDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "noticeBoard",
"type": "String",
"length": 10240,
"nullable": true
},
{
"name": "pageCacheEnabled",
"type": "boolean",
"nullable": true
},
{
"name": "randomArticlesDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "recentCommentDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "recentArticleDisplayCount",
"type": "int",
"nullable": true
},
{
"name": "signs",
"type": "String",
"length": 10240,
"nullable": true
},
{
"name": "skinDirName",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "skinName",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "skins",
"type": "String",
"length": 10240,
"nullable": true
},
{
"name": "timeZoneId",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "version",
"type": "String",
"length": 10,
"nullable": true
},
{
"name": "body",
"description": "Comment email template",
"type": "String",
"length": 10240,
"nullable": true
},
{
"name": "subject",
"description": "Comment email template subject",
"type": "String",
"length": 255,
"nullable": true
},
{
"name": "editorType",
"description": "Editor Type (TinyMCE, CodeMirror-Markdown, etc)",
"type": "String",
"length": 20,
"nullable": true
}
]
},
{
"name": "statistic",
"keys": [
......
......@@ -31,7 +31,6 @@ import org.b3log.solo.repository.LinkRepository;
import org.b3log.solo.repository.OptionRepository;
import org.b3log.solo.repository.PageRepository;
import org.b3log.solo.repository.PluginRepository;
import org.b3log.solo.repository.PreferenceRepository;
import org.b3log.solo.repository.StatisticRepository;
import org.b3log.solo.repository.TagArticleRepository;
import org.b3log.solo.repository.TagRepository;
......@@ -44,7 +43,6 @@ import org.b3log.solo.repository.impl.LinkRepositoryImpl;
import org.b3log.solo.repository.impl.OptionRepositoryImpl;
import org.b3log.solo.repository.impl.PageRepositoryImpl;
import org.b3log.solo.repository.impl.PluginRepositoryImpl;
import org.b3log.solo.repository.impl.PreferenceRepositoryImpl;
import org.b3log.solo.repository.impl.StatisticRepositoryImpl;
import org.b3log.solo.repository.impl.TagArticleRepositoryImpl;
import org.b3log.solo.repository.impl.TagRepositoryImpl;
......@@ -55,19 +53,19 @@ import org.testng.annotations.BeforeClass;
/**
* Abstract test case.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.8, Oct 14, 2013
* @see #beforeClass()
* @see #afterClass()
* @version 1.0.0.9, Dec 13, 2015
* @see #beforeClass()
* @see #afterClass()
*/
public abstract class AbstractTestCase {
/**
* Local service test helper.
*/
private final LocalServiceTestHelper localServiceTestHelper =
new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
private final LocalServiceTestHelper localServiceTestHelper
= new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
/**
* Bean manager.
......@@ -76,12 +74,13 @@ public abstract class AbstractTestCase {
/**
* Before class.
*
*
* <ol>
* <li>Sets up GAE unit test runtime environment</li>
* <li>Initializes Latke runtime</li>
* <li>Instantiates repositories</li>
* <li>Sets up GAE unit test runtime environment</li>
* <li>Initializes Latke runtime</li>
* <li>Instantiates repositories</li>
* </ol>
*
* @throws Exception exception
*/
@BeforeClass
......@@ -99,10 +98,10 @@ public abstract class AbstractTestCase {
/**
* After class.
*
*
* <ol>
* <li>Tears down GAE unit test runtime environment</li>
* <li>Shutdowns Latke runtime</li>
* <li>Tears down GAE unit test runtime environment</li>
* <li>Shutdowns Latke runtime</li>
* </ol>
*/
@AfterClass
......@@ -114,7 +113,7 @@ public abstract class AbstractTestCase {
/**
* Gets user repository.
*
*
* @return user repository
*/
public UserRepository getUserRepository() {
......@@ -123,7 +122,7 @@ public abstract class AbstractTestCase {
/**
* Gets link repository.
*
*
* @return link repository
*/
public LinkRepository getLinkRepository() {
......@@ -132,7 +131,7 @@ public abstract class AbstractTestCase {
/**
* Gets article repository.
*
*
* @return article repository
*/
public ArticleRepository getArticleRepository() {
......@@ -141,7 +140,7 @@ public abstract class AbstractTestCase {
/**
* Gets tag repository.
*
*
* @return tag repository
*/
public TagRepository getTagRepository() {
......@@ -150,7 +149,7 @@ public abstract class AbstractTestCase {
/**
* Gets tag-article repository.
*
*
* @return tag-article repository
*/
public TagArticleRepository getTagArticleRepository() {
......@@ -159,7 +158,7 @@ public abstract class AbstractTestCase {
/**
* Gets page repository.
*
*
* @return page repository
*/
public PageRepository getPageRepository() {
......@@ -168,7 +167,7 @@ public abstract class AbstractTestCase {
/**
* Gets comment repository.
*
*
* @return comment repository
*/
public CommentRepository getCommentRepository() {
......@@ -177,7 +176,7 @@ public abstract class AbstractTestCase {
/**
* Gets archive date repository.
*
*
* @return archive date repository
*/
public ArchiveDateRepository getArchiveDateRepository() {
......@@ -186,7 +185,7 @@ public abstract class AbstractTestCase {
/**
* Archive date article repository.
*
*
* @return archive date article repository
*/
public ArchiveDateArticleRepository getArchiveDateArticleRepository() {
......@@ -195,25 +194,16 @@ public abstract class AbstractTestCase {
/**
* Gets plugin repository.
*
*
* @return plugin repository
*/
public PluginRepository getPluginRepository() {
return beanManager.getReference(PluginRepositoryImpl.class);
}
/**
* Gets preference repository.
*
* @return preference repository
*/
public PreferenceRepository getPreferenceRepository() {
return beanManager.getReference(PreferenceRepositoryImpl.class);
}
/**
* Gets statistic repository.
*
*
* @return statistic repository
*/
public StatisticRepository getStatisticRepository() {
......@@ -222,7 +212,7 @@ public abstract class AbstractTestCase {
/**
* Gets option repository.
*
*
* @return option repository
*/
public OptionRepository getOptionRepository() {
......@@ -231,7 +221,7 @@ public abstract class AbstractTestCase {
/**
* Gets initialization service.
*
*
* @return initialization service
*/
public InitService getInitService() {
......@@ -240,7 +230,7 @@ public abstract class AbstractTestCase {
/**
* Gets user management service.
*
*
* @return user management service
*/
public UserMgmtService getUserMgmtService() {
......@@ -249,7 +239,7 @@ public abstract class AbstractTestCase {
/**
* Gets user query service.
*
*
* @return user query service
*/
public UserQueryService getUserQueryService() {
......@@ -258,7 +248,7 @@ public abstract class AbstractTestCase {
/**
* Gets article management service.
*
*
* @return article management service
*/
public ArticleMgmtService getArticleMgmtService() {
......@@ -267,7 +257,7 @@ public abstract class AbstractTestCase {
/**
* Gets article query service.
*
*
* @return article query service
*/
public ArticleQueryService getArticleQueryService() {
......@@ -276,7 +266,7 @@ public abstract class AbstractTestCase {
/**
* Gets page management service.
*
*
* @return page management service
*/
public PageMgmtService getPageMgmtService() {
......@@ -285,7 +275,7 @@ public abstract class AbstractTestCase {
/**
* Gets page query service.
*
*
* @return page query service
*/
public PageQueryService getPageQueryService() {
......@@ -294,7 +284,7 @@ public abstract class AbstractTestCase {
/**
* Gets link management service.
*
*
* @return link management service
*/
public LinkMgmtService getLinkMgmtService() {
......@@ -304,7 +294,7 @@ public abstract class AbstractTestCase {
/**
* Gets link query service.
*
* @return link query service
* @return link query service
*/
public LinkQueryService getLinkQueryService() {
return beanManager.getReference(LinkQueryService.class);
......@@ -312,7 +302,7 @@ public abstract class AbstractTestCase {
/**
* Gets preference management service.
*
*
* @return preference management service
*/
public PreferenceMgmtService getPreferenceMgmtService() {
......@@ -321,7 +311,7 @@ public abstract class AbstractTestCase {
/**
* Gets preference query service.
*
*
* @return preference query service
*/
public PreferenceQueryService getPreferenceQueryService() {
......@@ -330,7 +320,7 @@ public abstract class AbstractTestCase {
/**
* Gets tag query service.
*
*
* @return tag query service
*/
public TagQueryService getTagQueryService() {
......@@ -339,7 +329,7 @@ public abstract class AbstractTestCase {
/**
* Gets tag management service.
*
*
* @return tag management service
*/
public TagMgmtService getTagMgmtService() {
......@@ -348,7 +338,7 @@ public abstract class AbstractTestCase {
/**
* Gets comment query service.
*
*
* @return comment query service
*/
public CommentQueryService getCommentQueryService() {
......@@ -357,7 +347,7 @@ public abstract class AbstractTestCase {
/**
* Gets comment management service.
*
*
* @return comment management service
*/
public CommentMgmtService getCommentMgmtService() {
......@@ -366,7 +356,7 @@ public abstract class AbstractTestCase {
/**
* Gets archive date query service.
*
*
* @return archive date query service
*/
public ArchiveDateQueryService getArchiveDateQueryService() {
......@@ -375,7 +365,7 @@ public abstract class AbstractTestCase {
/**
* Gets option management service.
*
*
* @return option management service
*/
public OptionMgmtService getOptionMgmtService() {
......@@ -384,7 +374,7 @@ public abstract class AbstractTestCase {
/**
* Gets option query service.
*
*
* @return option query service
*/
public OptionQueryService getOptionQueryService() {
......
/*
* Copyright (c) 2010-2015, b3log.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.b3log.solo.repository.impl;
import org.b3log.solo.AbstractTestCase;
import org.b3log.solo.repository.PreferenceRepository;
import org.testng.annotations.Test;
/**
* {@link PreferenceRepositoryImpl} test case.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Dec 31, 2011
*/
@Test(suiteName = "repository")
public class PreferenceRepositoryImplTestCase extends AbstractTestCase {
/**
* Tests.
*
* @throws Exception exception
*/
@Test
public void test() throws Exception {
final PreferenceRepository preferenceRepository =
getPreferenceRepository();
}
}
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