Commit 3f6e8ead authored by Liang Ding's avatar Liang Ding

Merge pull request #11986 from b3log/0.6.7

0.6.7
parents 8170e377 c3adcd30
...@@ -10,4 +10,8 @@ ...@@ -10,4 +10,8 @@
.idea/ .idea/
.DS_Store .DS_Store
/target/ /target/
\ No newline at end of file
war/src/main/webapp/skins/*
!war/src/main/webapp/skins/ease
!war/src/main/webapp/skins/mobile
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Description: B3log Solo core. Description: B3log Solo core.
Version: 2.0.1.6, Apr 24, 2014 Version: 2.0.1.7, Oct 16, 2014
Author: Liang Ding Author: Liang Ding
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<parent> <parent>
<groupId>org.b3log</groupId> <groupId>org.b3log</groupId>
<artifactId>solo</artifactId> <artifactId>solo</artifactId>
<version>0.6.6</version> <version>0.6.7</version>
</parent> </parent>
<dependencies> <dependencies>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.b3log:latke:1.0.10" level="project" /> <orderEntry type="library" name="Maven: org.b3log:latke:1.0.15" level="project" />
<orderEntry type="library" name="Maven: javax.enterprise:cdi-api:1.0" level="project" /> <orderEntry type="library" name="Maven: javax.enterprise:cdi-api:1.0" level="project" />
<orderEntry type="library" name="Maven: org.jboss.interceptor:jboss-interceptor-api:1.1" level="project" /> <orderEntry type="library" name="Maven: org.jboss.interceptor:jboss-interceptor-api:1.1" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" /> <orderEntry type="library" name="Maven: javax.annotation:jsr250-api:1.0" level="project" />
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.12" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.6" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.6" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.5.2" level="project" /> <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.5.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.b3log:latke-gae:1.0.10" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.b3log:latke-gae:1.0.15" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-1.0-sdk:1.8.1.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-1.0-sdk:1.8.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-labs:1.8.1.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-labs:1.8.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-stubs:1.8.1.1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: com.google.appengine:appengine-api-stubs:1.8.1.1" level="project" />
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package org.b3log.solo; package org.b3log.solo;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextEvent;
import javax.servlet.ServletRequestEvent; import javax.servlet.ServletRequestEvent;
...@@ -52,12 +51,11 @@ import org.b3log.solo.service.StatisticMgmtService; ...@@ -52,12 +51,11 @@ import org.b3log.solo.service.StatisticMgmtService;
import org.b3log.solo.util.Skins; import org.b3log.solo.util.Skins;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* B3log Solo servlet listener. * B3log Solo servlet listener.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.3, Apr 24, 2014 * @version 1.1.0.4, Oct 16, 2014
* @since 0.3.1 * @since 0.3.1
*/ */
public final class SoloServletListener extends AbstractServletListener { public final class SoloServletListener extends AbstractServletListener {
...@@ -65,7 +63,7 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -65,7 +63,7 @@ public final class SoloServletListener extends AbstractServletListener {
/** /**
* B3log Solo version. * B3log Solo version.
*/ */
public static final String VERSION = "0.6.6"; public static final String VERSION = "0.6.7";
/** /**
* Logger. * Logger.
...@@ -151,11 +149,13 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -151,11 +149,13 @@ public final class SoloServletListener extends AbstractServletListener {
} }
@Override @Override
public void sessionCreated(final HttpSessionEvent httpSessionEvent) {} public void sessionCreated(final HttpSessionEvent httpSessionEvent) {
}
// Note: This method will never invoked on GAE production environment // Note: This method will never invoked on GAE production environment
@Override @Override
public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) {} public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) {
}
@Override @Override
public void requestInitialized(final ServletRequestEvent servletRequestEvent) { public void requestInitialized(final ServletRequestEvent servletRequestEvent) {
...@@ -175,7 +175,7 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -175,7 +175,7 @@ public final class SoloServletListener extends AbstractServletListener {
final HttpSession session = httpServletRequest.getSession(); final HttpSession session = httpServletRequest.getSession();
LOGGER.log(Level.DEBUG, "Gets a session[id={0}, remoteAddr={1}, User-Agent={2}, isNew={3}]", session.getId(), LOGGER.log(Level.DEBUG, "Gets a session[id={0}, remoteAddr={1}, User-Agent={2}, isNew={3}]", session.getId(),
httpServletRequest.getRemoteAddr(), httpServletRequest.getHeader("User-Agent"), session.isNew()); httpServletRequest.getRemoteAddr(), httpServletRequest.getHeader("User-Agent"), session.isNew());
// Online visitor count // Online visitor count
final StatisticMgmtService statisticMgmtService = beanManager.getReference(StatisticMgmtService.class); final StatisticMgmtService statisticMgmtService = beanManager.getReference(StatisticMgmtService.class);
...@@ -197,9 +197,9 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -197,9 +197,9 @@ public final class SoloServletListener extends AbstractServletListener {
/** /**
* Loads preference. * Loads preference.
* *
* <p> * <p>
* Loads preference from repository, loads skins from skin directory then sets it into preference if the skins changed. * Loads preference from repository, loads skins from skin directory then sets it into preference if the skins changed.
* </p> * </p>
*/ */
private void loadPreference() { private void loadPreference() {
...@@ -264,7 +264,7 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -264,7 +264,7 @@ public final class SoloServletListener extends AbstractServletListener {
/** /**
* Resolve skin (template) for the specified HTTP servlet request. * Resolve skin (template) for the specified HTTP servlet request.
* *
* @param httpServletRequest the specified HTTP servlet request * @param httpServletRequest the specified HTTP servlet request
*/ */
private void resolveSkinDir(final HttpServletRequest httpServletRequest) { private void resolveSkinDir(final HttpServletRequest httpServletRequest) {
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -39,6 +39,7 @@ import org.b3log.latke.urlfetch.URLFetchService; ...@@ -39,6 +39,7 @@ import org.b3log.latke.urlfetch.URLFetchService;
import org.b3log.latke.urlfetch.URLFetchServiceFactory; import org.b3log.latke.urlfetch.URLFetchServiceFactory;
import org.b3log.latke.util.Requests; import org.b3log.latke.util.Requests;
import org.b3log.latke.util.Strings; import org.b3log.latke.util.Strings;
import org.b3log.solo.SoloServletListener;
import org.b3log.solo.event.EventTypes; import org.b3log.solo.event.EventTypes;
import org.b3log.solo.model.Article; import org.b3log.solo.model.Article;
import org.b3log.solo.model.Comment; import org.b3log.solo.model.Comment;
...@@ -58,7 +59,7 @@ import org.json.JSONObject; ...@@ -58,7 +59,7 @@ import org.json.JSONObject;
* Comment receiver (from B3log Symphony). * Comment receiver (from B3log Symphony).
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.8, Aug 29, 2013 * @version 1.1.0.8, Jul 10, 2014
* @since 0.5.5 * @since 0.5.5
*/ */
@RequestProcessor @RequestProcessor
...@@ -149,6 +150,7 @@ public class CommentReceiver { ...@@ -149,6 +150,7 @@ public class CommentReceiver {
* } * }
* } * }
* </pre> * </pre>
*
* @param response the specified http servlet response * @param response the specified http servlet response
* @param context the specified http request context * @param context the specified http request context
* @throws Exception exception * @throws Exception exception
...@@ -207,8 +209,9 @@ public class CommentReceiver { ...@@ -207,8 +209,9 @@ public class CommentReceiver {
final String commentId = symphonyCmt.optString(Keys.OBJECT_ID); final String commentId = symphonyCmt.optString(Keys.OBJECT_ID);
String commentContent = symphonyCmt.getString(Comment.COMMENT_CONTENT); String commentContent = symphonyCmt.getString(Comment.COMMENT_CONTENT);
commentContent += "<br/><br/><p style='font-size: 12px;'><i>该评论同步自 <a href='http://symphony.b3log.org/article/" commentContent += "<p class='cmtFromSym'><i>该评论同步自 <a href='" + SoloServletListener.B3LOG_SYMPHONY_SERVE_PATH
+ symphonyCmt.optString("commentSymphonyArticleId") + "#" + commentId + "' target='_blank'>B3log 社区</a></i></p>"; + "/article/" + symphonyCmt.optString("commentSymphonyArticleId") + "#" + commentId
+ "' target='_blank'>B3log 社区</a></i></p>";
final String originalCommentId = symphonyCmt.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID); final String originalCommentId = symphonyCmt.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID);
// Step 1: Add comment // Step 1: Add comment
final JSONObject comment = new JSONObject(); final JSONObject comment = new JSONObject();
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -20,7 +20,7 @@ package org.b3log.solo.event; ...@@ -20,7 +20,7 @@ package org.b3log.solo.event;
* Event types. * Event types.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.7, Oct 17, 2012 * @version 1.1.0.7, May 30, 2014
* @since 0.3.1 * @since 0.3.1
*/ */
public final class EventTypes { public final class EventTypes {
...@@ -39,6 +39,11 @@ public final class EventTypes { ...@@ -39,6 +39,11 @@ public final class EventTypes {
* 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 a before render article event.
*/
public static final String BEFORE_RENDER_ARTICLE = "Before Render Article";
/** /**
* Indicates an add comment to article event. * Indicates an add comment to article event.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, B3log Team
*
* 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.plugin.list;
import org.b3log.latke.Latkes;
import org.b3log.latke.event.AbstractEventListener;
import org.b3log.latke.event.Event;
import org.b3log.latke.event.EventException;
import org.b3log.latke.logging.Logger;
import org.b3log.solo.event.EventTypes;
import org.b3log.solo.model.Article;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
* List (table of contents of an article) handler.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, May 30, 2014
* @since 0.6.7
*/
public class ListHandler extends AbstractEventListener<JSONObject> {
/**
* Logger.
*/
private static final Logger LOGGER = Logger.getLogger(ListHandler.class.getName());
@Override
public String getEventType() {
return EventTypes.BEFORE_RENDER_ARTICLE;
}
@Override
public void action(final Event<JSONObject> event) throws EventException {
final JSONObject data = event.getData();
final JSONObject article = data.optJSONObject(Article.ARTICLE);
String content = article.optString(Article.ARTICLE_CONTENT);
final Document doc = Jsoup.parse(content);
final StringBuilder listBuilder = new StringBuilder();
listBuilder.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + Latkes.getStaticPath() + "/plugins/list/style.css\" />");
final Elements hs = doc.select("h1, h2, h3, h4, h5");
listBuilder.append("<ul class='b3-solo-list'>");
for (int i = 0; i < hs.size(); i++) {
final Element element = hs.get(i);
final String tagName = element.tagName().toLowerCase();
final String text = element.text();
final String id = "b3_solo_" + tagName + "_" + i;
element.before("<span id='" + id + "'></span>");
listBuilder.append("<li class='b3-solo-list-").append(tagName).append("'><a href='#").append(id).append("'>").append(text).append(
"</a></li>");
}
listBuilder.append("</ul>");
final Element body = doc.getElementsByTag("body").get(0);
content = listBuilder.toString() + body.html();
article.put(Article.ARTICLE_CONTENT, content);
}
}
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -17,18 +17,28 @@ package org.b3log.solo.processor; ...@@ -17,18 +17,28 @@ package org.b3log.solo.processor;
import javax.inject.Inject; import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.b3log.latke.Keys;
import org.b3log.latke.Latkes; import org.b3log.latke.Latkes;
import org.b3log.latke.RuntimeEnv; import org.b3log.latke.RuntimeEnv;
import org.b3log.latke.model.Pagination;
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.servlet.annotation.RequestProcessing; import org.b3log.latke.servlet.annotation.RequestProcessing;
import org.b3log.latke.servlet.annotation.RequestProcessor; import org.b3log.latke.servlet.annotation.RequestProcessor;
import org.b3log.latke.servlet.renderer.JSONRenderer; import org.b3log.latke.servlet.renderer.JSONRenderer;
import org.b3log.latke.util.MD5;
import org.b3log.latke.util.Strings;
import org.b3log.solo.SoloServletListener; import org.b3log.solo.SoloServletListener;
import org.b3log.solo.model.Article;
import org.b3log.solo.model.Statistic; import org.b3log.solo.model.Statistic;
import org.b3log.solo.service.ArticleQueryService; import org.b3log.solo.service.ArticleQueryService;
import org.b3log.solo.service.StatisticQueryService; import org.b3log.solo.service.StatisticQueryService;
import org.b3log.solo.service.TagQueryService; import org.b3log.solo.service.TagQueryService;
import org.b3log.solo.service.UserQueryService;
import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -36,7 +46,7 @@ import org.json.JSONObject; ...@@ -36,7 +46,7 @@ import org.json.JSONObject;
* Blog processor. * Blog processor.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.2, Jan 29, 2013 * @version 1.1.0.3, Jul 18, 2014
* @since 0.4.6 * @since 0.4.6
*/ */
@RequestProcessor @RequestProcessor
...@@ -60,23 +70,29 @@ public class BlogProcessor { ...@@ -60,23 +70,29 @@ public class BlogProcessor {
@Inject @Inject
private StatisticQueryService statisticQueryService; private StatisticQueryService statisticQueryService;
/**
* User query service.
*/
@Inject
private UserQueryService userQueryService;
/** /**
* Gets blog information. * Gets blog information.
* *
* <ul> * <ul>
* <li>Time of the recent updated article</li> * <li>Time of the recent updated article</li>
* <li>Article count</li> * <li>Article count</li>
* <li>Comment count</li> * <li>Comment count</li>
* <li>Tag count</li> * <li>Tag count</li>
* <li>Serve path</li> * <li>Serve path</li>
* <li>Static serve path</li> * <li>Static serve path</li>
* <li>Solo version</li> * <li>Solo version</li>
* <li>Runtime environment (GAE/LOCAL)</li> * <li>Runtime environment (GAE/LOCAL)</li>
* <li>Locale</li> * <li>Locale</li>
* </ul> * </ul>
* *
* @param context the specified context * @param context the specified context
* @throws Exception exception * @throws Exception exception
*/ */
@RequestProcessing(value = "/blog/info", method = HTTPRequestMethod.GET) @RequestProcessing(value = "/blog/info", method = HTTPRequestMethod.GET)
public void getBlogInfo(final HTTPRequestContext context) throws Exception { public void getBlogInfo(final HTTPRequestContext context) throws Exception {
...@@ -106,4 +122,95 @@ public class BlogProcessor { ...@@ -106,4 +122,95 @@ public class BlogProcessor {
jsonObject.put("runtimeDatabase", Latkes.getRuntimeDatabase()); jsonObject.put("runtimeDatabase", Latkes.getRuntimeDatabase());
} }
} }
/**
* Gets tags of all articles.
*
* <pre>
* {
* "data": [
* ["tag1", "tag2", ....], // tags of one article
* ["tagX", "tagY", ....], // tags of another article
* ....
* ]
* }
* </pre>
*
* @param context the specified context
* @param request the specified HTTP servlet request
* @param response the specified HTTP servlet response
* @throws Exception io exception
*/
@RequestProcessing(value = "/blog/articles-tags", method = HTTPRequestMethod.GET)
public void getArticlesTags(final HTTPRequestContext context, final HttpServletRequest request, final HttpServletResponse response)
throws Exception {
final String pwd = request.getParameter("pwd");
if (Strings.isEmptyOrNull(pwd)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
final JSONObject admin = userQueryService.getAdmin();
if (!MD5.hash(pwd).equals(admin.getString(User.USER_PASSWORD))) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
final JSONObject requestJSONObject = new JSONObject();
requestJSONObject.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, 1);
requestJSONObject.put(Pagination.PAGINATION_PAGE_SIZE, Integer.MAX_VALUE);
requestJSONObject.put(Pagination.PAGINATION_WINDOW_SIZE, Integer.MAX_VALUE);
requestJSONObject.put(Article.ARTICLE_IS_PUBLISHED, true);
final JSONArray excludes = new JSONArray();
excludes.put(Article.ARTICLE_CONTENT);
excludes.put(Article.ARTICLE_UPDATE_DATE);
excludes.put(Article.ARTICLE_CREATE_DATE);
excludes.put(Article.ARTICLE_AUTHOR_EMAIL);
excludes.put(Article.ARTICLE_HAD_BEEN_PUBLISHED);
excludes.put(Article.ARTICLE_IS_PUBLISHED);
excludes.put(Article.ARTICLE_RANDOM_DOUBLE);
requestJSONObject.put(Keys.EXCLUDES, excludes);
final JSONObject result = articleQueryService.getArticles(requestJSONObject);
final JSONArray articles = result.optJSONArray(Article.ARTICLES);
final JSONRenderer renderer = new JSONRenderer();
context.setRenderer(renderer);
final JSONObject ret = new JSONObject();
renderer.setJSONObject(ret);
final JSONArray data = new JSONArray();
ret.put("data", data);
for (int i = 0; i < articles.length(); i++) {
final JSONObject article = articles.optJSONObject(i);
final String tagString = article.optString(Article.ARTICLE_TAGS_REF);
final JSONArray tagArray = new JSONArray();
data.put(tagArray);
final String[] tags = tagString.split(",");
for (final String tag : tags) {
final String trim = tag.trim();
if (!Strings.isEmptyOrNull(trim)) {
tagArray.put(tag);
}
}
}
}
} }
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -47,7 +47,7 @@ import org.json.JSONObject; ...@@ -47,7 +47,7 @@ import org.json.JSONObject;
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a> * @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a>
* @version 1.1.1.12, Apr 24, 2014 * @version 1.1.1.13, Oct 16, 2014
* @since 0.3.1 * @since 0.3.1
*/ */
@RequestProcessor @RequestProcessor
...@@ -95,7 +95,7 @@ public class UpgradeProcessor { ...@@ -95,7 +95,7 @@ public class UpgradeProcessor {
/** /**
* Whether the email has been sent. * Whether the email has been sent.
*/ */
private boolean sent = false; private static boolean sent = false;
/** /**
* Language service. * Language service.
...@@ -106,7 +106,7 @@ public class UpgradeProcessor { ...@@ -106,7 +106,7 @@ public class UpgradeProcessor {
/** /**
* Old version. * Old version.
*/ */
private static final String FROM_VER = "0.6.5"; private static final String FROM_VER = "0.6.6";
/** /**
* New version. * New version.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
...@@ -68,7 +68,7 @@ import org.json.JSONObject; ...@@ -68,7 +68,7 @@ import org.json.JSONObject;
* Filler utilities. * Filler utilities.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.6.10, Feb 11, 2014 * @version 1.0.7.10, Jul 3, 2014
* @since 0.3.1 * @since 0.3.1
*/ */
@Service @Service
...@@ -369,7 +369,9 @@ public class Filler { ...@@ -369,7 +369,9 @@ public class Filler {
archiveDates2.add(archiveDates.get(0)); archiveDates2.add(archiveDates.get(0));
if (1 < archiveDates.size()) { // XXX: Workaround, remove the duplicated archive dates if (1 < archiveDates.size()) { // XXX: Workaround, remove the duplicated archive dates
for (final JSONObject archiveDate : archiveDates) { for (int i = 1; i < archiveDates.size(); i++) {
final JSONObject archiveDate = archiveDates.get(i);
final long time = archiveDate.getLong(ArchiveDate.ARCHIVE_TIME); final long time = archiveDate.getLong(ArchiveDate.ARCHIVE_TIME);
final String dateString = DateFormatUtils.format(time, "yyyy/MM"); final String dateString = DateFormatUtils.format(time, "yyyy/MM");
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
/* /*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 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.
......
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