-
-
Howdy, I'm in Section 1.
-
-
-
Howdy, I'm in Section 2.
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
Mongodb
-
- MongoDB is a NoSQL...
-
-
-
-
-

-
-
jQuery
-
- jQuery controls the DOM elements...
-
-
-
-
-

-
-
Bootstrap
-
- Boostrap is a tool to design the website...
-
-
-
-
-
-
‹
-
›
-
-
-
+
-
-
-
Thanks To
-
All The Lovely OpenSource Project
-
-

-

-

-

-
-

-

-

-

-
-

-
-

-

-
+ <%
+ Object object = request.getSession().getAttribute("_const_cas_assertion_");
+ Assertion assertion = (Assertion) object;
+ String loginName = "";
+ String name = "";
+ String email = "";
+ String weibo_url = "";
+ String github_url = "";
+ String interests = "";
+ String homepage = "";
+ if (object != null) {
+ loginName = assertion.getPrincipal().getName();
+ Map
map = assertion.getPrincipal().getAttributes();
+ name = (String) map.get("name");
+ email = (String) map.get("email");
+ weibo_url = (String) map.get("weibo_url");
+ github_url = (String) map.get("github_url");
+ interests = (String) map.get("interests");
+ homepage = (String) map.get("homepage");
+ }
+ %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AcademicSearchEngine/WebContent/index.jsp b/AcademicSearchEngine/WebContent/index.jsp
index 23e1765..4019334 100644
--- a/AcademicSearchEngine/WebContent/index.jsp
+++ b/AcademicSearchEngine/WebContent/index.jsp
@@ -34,7 +34,7 @@
Discover
- Share
+ About
@@ -88,7 +88,7 @@
登录使用的是CAS的单点登录,请跳转到server登录
-
去登录
+
去登录
diff --git a/AcademicSearchEngine/src/dcd/academic/action/CofieldAction.java b/AcademicSearchEngine/src/dcd/academic/action/CofieldAction.java
index 6b26c7e..f352f0a 100644
--- a/AcademicSearchEngine/src/dcd/academic/action/CofieldAction.java
+++ b/AcademicSearchEngine/src/dcd/academic/action/CofieldAction.java
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import net.sf.json.JSONObject;
+import dcd.academic.DAO.DAOfactory;
+import dcd.academic.DAO.SaveDAO;
import dcd.academic.recommend.BtwAuthor;
import com.opensymphony.xwork2.ActionSupport;
@@ -15,11 +17,17 @@ public class CofieldAction extends ActionSupport{
@Override
public String execute() throws Exception {
-
- BtwAuthor ba = new BtwAuthor();
- ArrayList
list = ba.findCoAuthorsByField(field, 40, 30);
- json = ba.getCoauthorJson(list);
-
+ DAOfactory factory = new DAOfactory();
+ SaveDAO dao = factory.getSaveDAO();
+ String s = dao.getDiscover(field, "field");
+ if ( s != null) {
+ json = JSONObject.fromObject(s);
+ } else {
+ BtwAuthor ba = new BtwAuthor();
+ ArrayList list = ba.findCoAuthorsByField(field, 0, 30);
+ json = ba.getCoauthorJson(list);
+ dao.saveDiscover(field, "field", json.toString());
+ }
return SUCCESS;
}
diff --git a/AcademicSearchEngine/src/dcd/academic/action/CoplaceAction.java b/AcademicSearchEngine/src/dcd/academic/action/CoplaceAction.java
index 1e648cf..729940e 100644
--- a/AcademicSearchEngine/src/dcd/academic/action/CoplaceAction.java
+++ b/AcademicSearchEngine/src/dcd/academic/action/CoplaceAction.java
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import net.sf.json.JSONObject;
+import dcd.academic.DAO.DAOfactory;
+import dcd.academic.DAO.SaveDAO;
import dcd.academic.recommend.BtwAuthor;
import com.opensymphony.xwork2.ActionSupport;
@@ -15,11 +17,17 @@ public class CoplaceAction extends ActionSupport{
@Override
public String execute() throws Exception {
-
- BtwAuthor ba = new BtwAuthor();
- ArrayList list = ba.findCoAuthorsByPlace(place, 20, 30);
- json = ba.getCoauthorJson(list);
-
+ DAOfactory factory = new DAOfactory();
+ SaveDAO dao = factory.getSaveDAO();
+ String s = dao.getDiscover(place, "place");
+ if ( s != null) {
+ json = JSONObject.fromObject(s);
+ } else {
+ BtwAuthor ba = new BtwAuthor();
+ ArrayList list = ba.findCoAuthorsByPlace(place, 0, 30);
+ json = ba.getCoauthorJson(list);
+ dao.saveDiscover(place, "place", json.toString());
+ }
return SUCCESS;
}