Commit 678a6eba authored by Liang Ding's avatar Liang Ding

--no commit message

--no commit message
parent a7d7d7ad
This diff is collapsed.
This diff is collapsed.
B3log Solo is an open source Java blogging program. B3log Solo is an open source Java blogging program.
Project home: http://b3log-solo.googlecode.com Project home: http://b3log-solo.googlecode.com
Request features/Report bugs: http://code.google.com/b3log-solo/issues/list Request features/Report bugs: http://code.google.com/b3log-solo/issues/list
* QQ Qun: 13139268 * QQ Qun: 13139268
* User Guide: http://code.google.com/p/b3log-solo/wiki/UserGuide * User Guide: http://code.google.com/p/b3log-solo/wiki/UserGuide
* Dev Guide: http://code.google.com/p/b3log-solo/wiki/pre_dev * Dev Guide: http://code.google.com/p/b3log-solo/wiki/pre_dev
* Skin Dev Guide: http://code.google.com/p/b3log-solo/wiki/develop_steps * Skin Dev Guide: http://code.google.com/p/b3log-solo/wiki/develop_steps
* Plugin Dev Guide: https://docs.google.com/document/pub?id=15H7Q3EBo-44v61Xp_epiYY7vK_gPJLkQaT7T1gkE64w&pli=1 * Plugin Dev Guide: https://docs.google.com/document/pub?id=15H7Q3EBo-44v61Xp_epiYY7vK_gPJLkQaT7T1gkE64w&pli=1
==== ====
B3log Index: http://www.b3log.org B3log Index: http://www.b3log.org
B3log Team: http://code.google.com/p/b3log-solo/wiki/about_us B3log Team: http://code.google.com/p/b3log-solo/wiki/about_us
Join B3log Team: http://code.google.com/p/b3log-solo/wiki/join_us Join B3log Team: http://code.google.com/p/b3log-solo/wiki/join_us
==== ====
平等,自由,奔放 平等,自由,奔放
Equality, Freedom, Passion Equality, Freedom, Passion
;-) ;-)
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration> <project-shared-configuration>
<!-- <!--
This file contains additional configuration written by modules in the NetBeans IDE. This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout. therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether. Without this configuration present, some functionality in the IDE may be limited or fail altogether.
--> -->
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1"> <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
<word>Admin</word> <word>Admin</word>
<word>app</word> <word>app</word>
<word>blog</word> <word>blog</word>
<word>blogger</word> <word>blogger</word>
<word>blogging</word> <word>blogging</word>
<word>captcha</word> <word>captcha</word>
<word>Captcha</word> <word>Captcha</word>
<word>cron</word> <word>cron</word>
<word>datastore</word> <word>datastore</word>
<word>ftl</word> <word>ftl</word>
<word>Gmail</word> <word>Gmail</word>
<word>http</word> <word>http</word>
<word>json</word> <word>json</word>
<word>Latke</word> <word>Latke</word>
<word>loc</word> <word>loc</word>
<word>memcache</word> <word>memcache</word>
<word>permalink</word> <word>permalink</word>
<word>permalinks</word> <word>permalinks</word>
<word>Picasa</word> <word>Picasa</word>
<word>Plugin</word> <word>Plugin</word>
<word>plugin</word> <word>plugin</word>
<word>Pluginable</word> <word>Pluginable</word>
<word>Plugins</word> <word>Plugins</word>
<word>plugins</word> <word>plugins</word>
<word>servlet</word> <word>servlet</word>
<word>servlets</word> <word>servlets</word>
<word>sitemap</word> <word>sitemap</word>
<word>struct</word> <word>struct</word>
<word>structs</word> <word>structs</word>
<word>Upgrader</word> <word>Upgrader</word>
<word>Upgraders</word> <word>Upgraders</word>
</spellchecker-wordlist> </spellchecker-wordlist>
</project-shared-configuration> </project-shared-configuration>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<actions> <actions>
<action> <action>
<actionName>CUSTOM-cobertura-cobertura</actionName> <actionName>CUSTOM-cobertura-cobertura</actionName>
<displayName>cobertura-cobertura</displayName> <displayName>cobertura-cobertura</displayName>
<goals> <goals>
<goal>cobertura:cobertura</goal> <goal>cobertura:cobertura</goal>
</goals> </goals>
</action> </action>
</actions> </actions>
This diff is collapsed.
/** /**
* Admin index.ftl template and upload/download processing, . * Admin index.ftl template and upload/download processing, .
*/ */
package org.b3log.solo.action; package org.b3log.solo.action;
/** /**
* <a href="http://www.xmlrpc.com/metaWeblogApi">MetaWeblog API</a> requests * <a href="http://www.xmlrpc.com/metaWeblogApi">MetaWeblog API</a> requests
* processing. * processing.
*/ */
package org.b3log.solo.api.metaweblog; package org.b3log.solo.api.metaweblog;
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.b3log.solo.dev; package org.b3log.solo.dev;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.b3log.latke.Latkes; import org.b3log.latke.Latkes;
import org.b3log.latke.RuntimeMode; import org.b3log.latke.RuntimeMode;
import org.b3log.latke.annotation.RequestProcessing; import org.b3log.latke.annotation.RequestProcessing;
import org.b3log.latke.annotation.RequestProcessor; import org.b3log.latke.annotation.RequestProcessor;
import org.b3log.latke.model.User; import org.b3log.latke.model.User;
import org.b3log.latke.servlet.HTTPRequestContext; import org.b3log.latke.servlet.HTTPRequestContext;
import org.b3log.latke.servlet.HTTPRequestMethod; import org.b3log.latke.servlet.HTTPRequestMethod;
import org.b3log.latke.util.Stopwatchs; import org.b3log.latke.util.Stopwatchs;
import org.b3log.solo.model.Article; import org.b3log.solo.model.Article;
import org.b3log.solo.service.ArticleMgmtService; import org.b3log.solo.service.ArticleMgmtService;
import org.b3log.solo.service.UserQueryService; import org.b3log.solo.service.UserQueryService;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* Generates some dummy articles for development testing. * Generates some dummy articles for development testing.
* *
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.3, May 21, 2012 * @version 1.0.0.3, May 21, 2012
* @since 0.4.0 * @since 0.4.0
*/ */
@RequestProcessor @RequestProcessor
public final class ArticleGenerator { public final class ArticleGenerator {
/** /**
* Logger. * Logger.
*/ */
private static final Logger LOGGER = private static final Logger LOGGER =
Logger.getLogger(ArticleGenerator.class.getName()); Logger.getLogger(ArticleGenerator.class.getName());
/** /**
* Generates some dummy articles with the specified context. * Generates some dummy articles with the specified context.
* *
* @param context the specified context * @param context the specified context
* @param request the specified request * @param request the specified request
* @param response the specified response * @param response the specified response
* @throws IOException io exception * @throws IOException io exception
*/ */
@RequestProcessing(value = "/dev/articles/gen/*", method = HTTPRequestMethod.GET) @RequestProcessing(value = "/dev/articles/gen/*", method = HTTPRequestMethod.GET)
public void genArticles(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response) public void genArticles(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response)
throws IOException { throws IOException {
if (RuntimeMode.DEVELOPMENT != Latkes.getRuntimeMode()) { if (RuntimeMode.DEVELOPMENT != Latkes.getRuntimeMode()) {
LOGGER.log(Level.WARNING, "Article generation just for development mode, " + "current runtime mode is [{0}]", LOGGER.log(Level.WARNING, "Article generation just for development mode, " + "current runtime mode is [{0}]",
Latkes.getRuntimeMode()); Latkes.getRuntimeMode());
response.sendRedirect("/"); response.sendRedirect("/");
return; return;
} }
Stopwatchs.start("Gen Articles"); Stopwatchs.start("Gen Articles");
final String requestURI = request.getRequestURI(); final String requestURI = request.getRequestURI();
final int num = Integer.valueOf(requestURI.substring((Latkes.getContextPath() + "/dev/articles/gen/").length())); final int num = Integer.valueOf(requestURI.substring((Latkes.getContextPath() + "/dev/articles/gen/").length()));
try { try {
final ArticleMgmtService articleMgmtService = ArticleMgmtService.getInstance(); final ArticleMgmtService articleMgmtService = ArticleMgmtService.getInstance();
final UserQueryService userQueryService = UserQueryService.getInstance(); final UserQueryService userQueryService = UserQueryService.getInstance();
final JSONObject admin = userQueryService.getAdmin(); final JSONObject admin = userQueryService.getAdmin();
final String authorEmail = admin.optString(User.USER_EMAIL); final String authorEmail = admin.optString(User.USER_EMAIL);
for (int i = 0; i < num; i++) { for (int i = 0; i < num; i++) {
final JSONObject article = new JSONObject(); final JSONObject article = new JSONObject();
// XXX: http://en.wikipedia.org/wiki/Markov_chain // XXX: http://en.wikipedia.org/wiki/Markov_chain
article.put(Article.ARTICLE_TITLE, "article title" + i); article.put(Article.ARTICLE_TITLE, "article title" + i);
article.put(Article.ARTICLE_ABSTRACT, "article" + i + " abstract"); article.put(Article.ARTICLE_ABSTRACT, "article" + i + " abstract");
article.put(Article.ARTICLE_TAGS_REF, "tag1,tag2"); article.put(Article.ARTICLE_TAGS_REF, "tag1,tag2");
article.put(Article.ARTICLE_AUTHOR_EMAIL, authorEmail); article.put(Article.ARTICLE_AUTHOR_EMAIL, authorEmail);
article.put(Article.ARTICLE_COMMENT_COUNT, 0); article.put(Article.ARTICLE_COMMENT_COUNT, 0);
article.put(Article.ARTICLE_VIEW_COUNT, 0); article.put(Article.ARTICLE_VIEW_COUNT, 0);
article.put(Article.ARTICLE_CONTENT, "article content"); article.put(Article.ARTICLE_CONTENT, "article content");
article.put(Article.ARTICLE_PERMALINK, "article" + i + " permalink"); article.put(Article.ARTICLE_PERMALINK, "article" + i + " permalink");
article.put(Article.ARTICLE_HAD_BEEN_PUBLISHED, true); article.put(Article.ARTICLE_HAD_BEEN_PUBLISHED, true);
article.put(Article.ARTICLE_IS_PUBLISHED, true); article.put(Article.ARTICLE_IS_PUBLISHED, true);
article.put(Article.ARTICLE_PUT_TOP, false); article.put(Article.ARTICLE_PUT_TOP, false);
article.put(Article.ARTICLE_CREATE_DATE, new Date()); article.put(Article.ARTICLE_CREATE_DATE, new Date());
article.put(Article.ARTICLE_UPDATE_DATE, new Date()); article.put(Article.ARTICLE_UPDATE_DATE, new Date());
article.put(Article.ARTICLE_RANDOM_DOUBLE, Math.random()); article.put(Article.ARTICLE_RANDOM_DOUBLE, Math.random());
article.put(Article.ARTICLE_COMMENTABLE, true); article.put(Article.ARTICLE_COMMENTABLE, true);
article.put(Article.ARTICLE_VIEW_PWD, ""); article.put(Article.ARTICLE_VIEW_PWD, "");
article.put(Article.ARTICLE_SIGN_ID, "1"); article.put(Article.ARTICLE_SIGN_ID, "1");
articleMgmtService.addArticle(new JSONObject().put(Article.ARTICLE, article)); articleMgmtService.addArticle(new JSONObject().put(Article.ARTICLE, article));
} }
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e); LOGGER.log(Level.SEVERE, e.getMessage(), e);
} }
Stopwatchs.end(); Stopwatchs.end();
response.sendRedirect("/"); response.sendRedirect("/");
} }
} }
/** /**
* Development usage. * Development usage.
* *
* <p> * <p>
* All functions in this package just for development mode. * All functions in this package just for development mode.
* </p> * </p>
*/ */
package org.b3log.solo.dev; package org.b3log.solo.dev;
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.b3log.solo.event; package org.b3log.solo.event;
/** /**
* Event types. * Event types.
* *
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.6, Oct 19, 2011 * @version 1.0.0.6, Oct 19, 2011
* @since 0.3.1 * @since 0.3.1
*/ */
public final class EventTypes { public final class EventTypes {
/** /**
* Indicates a add article event. * Indicates a add article event.
*/ */
public static final String ADD_ARTICLE = "Add Article"; public static final String ADD_ARTICLE = "Add Article";
/** /**
* Indicates a update article event. * Indicates a update article event.
*/ */
public static final String UPDATE_ARTICLE = "Update Article"; public static final String UPDATE_ARTICLE = "Update Article";
/** /**
* Indicates a remove article event. * Indicates a remove article event.
*/ */
public static final String REMOVE_ARTICLE = "Remove Article"; public static final String REMOVE_ARTICLE = "Remove Article";
/** /**
* Indicates an add comment to article event. * Indicates an add comment to article event.
*/ */
public static final String ADD_COMMENT_TO_ARTICLE = "Add Comment To Article"; public static final String ADD_COMMENT_TO_ARTICLE = "Add Comment To Article";
/** /**
* Indicates an add comment to page event. * Indicates an add comment to page event.
*/ */
public static final String ADD_COMMENT_TO_PAGE = "Add Comment To Page"; public static final String ADD_COMMENT_TO_PAGE = "Add Comment To Page";
/** /**
* Indicates a remove comment event. * Indicates a remove comment event.
*/ */
public static final String REMOVE_COMMENT = "Remove Comment"; public static final String REMOVE_COMMENT = "Remove Comment";
/** /**
* Private default constructor. * Private default constructor.
*/ */
private EventTypes() { private EventTypes() {
} }
} }
/** /**
* Event processors. * Event processors.
*/ */
package org.b3log.solo.event; package org.b3log.solo.event;
/** /**
* Filters for page caching, URL transformation. * Filters for page caching, URL transformation.
*/ */
package org.b3log.solo.filter; package org.b3log.solo.filter;
/** /**
* Keys. * Keys.
*/ */
package org.b3log.solo.model; package org.b3log.solo.model;
/** /**
* <a href="http://b3log-solo.googlecode.com">B3log Solo</a>. * <a href="http://b3log-solo.googlecode.com">B3log Solo</a>.
*/ */
package org.b3log.solo; package org.b3log.solo;
/** /**
* Plugins. * Plugins.
*/ */
package org.b3log.solo.plugin; package org.b3log.solo.plugin;
/** /**
* Console requests (Articles, Comments, Preference, etc, management) processing. * Console requests (Articles, Comments, Preference, etc, management) processing.
*/ */
package org.b3log.solo.processor.console; package org.b3log.solo.processor.console;
/** /**
* HTTP request processing. * HTTP request processing.
*/ */
package org.b3log.solo.processor; package org.b3log.solo.processor;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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