Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
ab9a3dfd
Commit
ab9a3dfd
authored
Nov 07, 2012
by
Liang Ding
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from b3log/0.5.5
0.5.5
parents
cf566c0f
eba75ced
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
37 deletions
+44
-37
core/src/main/java/org/b3log/solo/event/rhythm/ArticleSender.java
.../main/java/org/b3log/solo/event/rhythm/ArticleSender.java
+2
-2
core/src/main/java/org/b3log/solo/processor/CommentProcessor.java
.../main/java/org/b3log/solo/processor/CommentProcessor.java
+33
-26
war/bae/src/main/resources/latke.properties
war/bae/src/main/resources/latke.properties
+1
-1
war/gae/src/main/resources/latke.properties
war/gae/src/main/resources/latke.properties
+1
-1
war/mysql/src/main/resources/latke.properties
war/mysql/src/main/resources/latke.properties
+3
-3
war/src/main/webapp/plugins/symphony-news-getter/plugin.ftl
war/src/main/webapp/plugins/symphony-news-getter/plugin.ftl
+2
-2
war/src/main/webapp/plugins/symphony-news-getter/plugin.properties
...ain/webapp/plugins/symphony-news-getter/plugin.properties
+2
-2
No files found.
core/src/main/java/org/b3log/solo/event/rhythm/ArticleSender.java
View file @
ab9a3dfd
...
@@ -41,7 +41,7 @@ import org.json.JSONObject;
...
@@ -41,7 +41,7 @@ import org.json.JSONObject;
* This listener is responsible for sending article to B3log Rhythm.
* This listener is responsible for sending article to B3log Rhythm.
*
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.
1, Oct 18
, 2012
* @version 1.0.2.
2, Nov 2
, 2012
* @since 0.3.1
* @since 0.3.1
*/
*/
public
final
class
ArticleSender
extends
AbstractEventListener
<
JSONObject
>
{
public
final
class
ArticleSender
extends
AbstractEventListener
<
JSONObject
>
{
...
@@ -61,7 +61,7 @@ public final class ArticleSender extends AbstractEventListener<JSONObject> {
...
@@ -61,7 +61,7 @@ public final class ArticleSender extends AbstractEventListener<JSONObject> {
/**
/**
* B3log Rhythm address.
* B3log Rhythm address.
*/
*/
public
static
final
String
B3LOG_RHYTHM_ADDRESS
=
"http://rhythm.b3log.org:
1100
0"
;
public
static
final
String
B3LOG_RHYTHM_ADDRESS
=
"http://rhythm.b3log.org:
8
0"
;
/**
/**
* URL of adding article to Rhythm.
* URL of adding article to Rhythm.
*/
*/
...
...
core/src/main/java/org/b3log/solo/processor/CommentProcessor.java
View file @
ab9a3dfd
...
@@ -23,8 +23,6 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -23,8 +23,6 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.RuntimeEnv
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
...
@@ -37,13 +35,14 @@ import org.b3log.solo.model.Common;
...
@@ -37,13 +35,14 @@ import org.b3log.solo.model.Common;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.service.CommentMgmtService
;
import
org.b3log.solo.service.CommentMgmtService
;
import
org.b3log.solo.util.Comments
;
import
org.b3log.solo.util.Comments
;
import
org.b3log.solo.util.Users
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
/**
/**
* Comment processor.
* Comment processor.
*
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.1.0.
8, Sep 10
, 2012
* @version 1.1.0.
9, Nov 2
, 2012
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -115,21 +114,25 @@ public final class CommentProcessor {
...
@@ -115,21 +114,25 @@ public final class CommentProcessor {
return
;
return
;
}
}
if
(
RuntimeEnv
.
BAE
!=
Latkes
.
getRuntimeEnv
())
{
final
HttpSession
session
=
httpServletRequest
.
getSession
(
false
);
final
String
captcha
=
requestJSONObject
.
optString
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
session
)
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
final
HttpSession
session
=
httpServletRequest
.
getSession
(
false
);
return
;
if
(
null
!=
session
)
{
}
final
String
storedCaptcha
=
(
String
)
session
.
getAttribute
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
storedCaptcha
||
!
storedCaptcha
.
equals
(
captcha
))
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
return
;
if
(!
Users
.
getInstance
().
isLoggedIn
(
httpServletRequest
,
httpServletResponse
))
{
}
final
String
storedCaptcha
=
(
String
)
session
.
getAttribute
(
CaptchaProcessor
.
CAPTCHA
);
final
String
captcha
=
requestJSONObject
.
optString
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
storedCaptcha
||
!
storedCaptcha
.
equals
(
captcha
))
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
session
.
removeAttribute
(
CaptchaProcessor
.
CAPTCHA
)
;
return
;
}
}
session
.
removeAttribute
(
CaptchaProcessor
.
CAPTCHA
);
}
}
try
{
try
{
...
@@ -198,23 +201,27 @@ public final class CommentProcessor {
...
@@ -198,23 +201,27 @@ public final class CommentProcessor {
return
;
return
;
}
}
if
(
RuntimeEnv
.
BAE
!=
Latkes
.
getRuntimeEnv
())
{
final
HttpSession
session
=
httpServletRequest
.
getSession
(
false
);
final
String
captcha
=
requestJSONObject
.
optString
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
session
)
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
final
HttpSession
session
=
httpServletRequest
.
getSession
(
false
);
return
;
if
(
null
!=
session
)
{
}
final
String
storedCaptcha
=
(
String
)
session
.
getAttribute
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
storedCaptcha
||
!
storedCaptcha
.
equals
(
captcha
))
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
return
;
if
(!
Users
.
getInstance
().
isLoggedIn
(
httpServletRequest
,
httpServletResponse
))
{
}
final
String
storedCaptcha
=
(
String
)
session
.
getAttribute
(
CaptchaProcessor
.
CAPTCHA
);
final
String
captcha
=
requestJSONObject
.
optString
(
CaptchaProcessor
.
CAPTCHA
);
if
(
null
==
storedCaptcha
||
!
storedCaptcha
.
equals
(
captcha
))
{
jsonObject
.
put
(
Keys
.
STATUS_CODE
,
false
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"captchaErrorLabel"
));
session
.
removeAttribute
(
CaptchaProcessor
.
CAPTCHA
)
;
return
;
}
}
session
.
removeAttribute
(
CaptchaProcessor
.
CAPTCHA
);
}
}
try
{
try
{
final
JSONObject
addResult
=
commentMgmtService
.
addArticleComment
(
requestJSONObject
);
final
JSONObject
addResult
=
commentMgmtService
.
addArticleComment
(
requestJSONObject
);
...
...
war/bae/src/main/resources/latke.properties
View file @
ab9a3dfd
...
@@ -49,4 +49,4 @@ cache=BAE
...
@@ -49,4 +49,4 @@ cache=BAE
userService
=
LOCAL
userService
=
LOCAL
#### Static resource version ####
#### Static resource version ####
staticResourceVersion
=
201206280945
staticResourceVersion
=
201211021410
\ No newline at end of file
\ No newline at end of file
war/gae/src/main/resources/latke.properties
View file @
ab9a3dfd
...
@@ -48,4 +48,4 @@ cache=GAE
...
@@ -48,4 +48,4 @@ cache=GAE
userService
=
LOCAL
userService
=
LOCAL
#### Static resource version ####
#### Static resource version ####
staticResourceVersion
=
201206280945
staticResourceVersion
=
201211021410
\ No newline at end of file
\ No newline at end of file
war/mysql/src/main/resources/latke.properties
View file @
ab9a3dfd
...
@@ -24,10 +24,10 @@
...
@@ -24,10 +24,10 @@
# Configures the followings before deploy
# Configures the followings before deploy
serverScheme
=
http
serverScheme
=
http
serverHost
=
localhost
serverHost
=
localhost
serverPort
=
11099
serverPort
=
8080
staticServerScheme
=
http
staticServerScheme
=
http
staticServerHost
=
localhost
staticServerHost
=
localhost
staticServerPort
=
11099
staticServerPort
=
8080
# Note: The context path and static path should be "" if deploy app on ROOT. For other cases, starts with '/'
# Note: The context path and static path should be "" if deploy app on ROOT. For other cases, starts with '/'
# and not ends with '/', for example, /blog
# and not ends with '/', for example, /blog
contextPath
=
contextPath
=
...
@@ -48,4 +48,4 @@ cache=LOCAL
...
@@ -48,4 +48,4 @@ cache=LOCAL
userService
=
LOCAL
userService
=
LOCAL
#### Static resource version ####
#### Static resource version ####
staticResourceVersion
=
201206280945
staticResourceVersion
=
201211021410
\ No newline at end of file
\ No newline at end of file
war/src/main/webapp/plugins/symphony-news-getter/plugin.ftl
View file @
ab9a3dfd
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent");
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent");
$.ajax({
$.ajax({
url: "http://
symphony.b3log.org:80/get-
news",
url: "http://
localhost:8080/apis/
news",
type: "GET",
type: "GET",
dataType:"jsonp",
dataType:"jsonp",
jsonp: "callback",
jsonp: "callback",
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
var article = articles[i];
var article = articles[i];
var articleLiHtml = "<li>"
var articleLiHtml = "<li>"
+ "<a target='_blank' href='" + article.articlePermalink + "'>"
+ "<a target='_blank' href='" + article.articlePermalink + "'>"
+ article.articleTitle + "</a> <span class='date'>" + $.bowknot.getDate(article.articleCreate
Dat
e, 1); + "</span></li>"
+ article.articleTitle + "</a> <span class='date'>" + $.bowknot.getDate(article.articleCreate
Tim
e, 1); + "</span></li>"
listHTML += articleLiHtml
listHTML += articleLiHtml
}
}
listHTML += "</ul>";
listHTML += "</ul>";
...
...
war/src/main/webapp/plugins/symphony-news-getter/plugin.properties
View file @
ab9a3dfd
...
@@ -16,13 +16,13 @@
...
@@ -16,13 +16,13 @@
#
#
# Description: Description of plugin symphony-news-getter.
# Description: Description of plugin symphony-news-getter.
# Version: 1.0.0.
1, Oct 30, 2011
# Version: 1.0.0.
2, Nov 8, 2012
# Author: Liang Ding
# Author: Liang Ding
#
#
author
=
<a href="http://88250.b3log.org">88250</a> & <a href="http://vanessa.b3log.org">Vanessa</a>
author
=
<a href="http://88250.b3log.org">88250</a> & <a href="http://vanessa.b3log.org">Vanessa</a>
name
=
Symphony News Getter
name
=
Symphony News Getter
version
=
0.0.
2
version
=
0.0.
3
types
=
ADMIN
types
=
ADMIN
classesDirPath
=
/WEB-INF/classes/
classesDirPath
=
/WEB-INF/classes/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment