From b4ef879c2cdd9782cdee832eae243e0cc5266d6d Mon Sep 17 00:00:00 2001 From: pelick <369447122@qq.com> Date: Tue, 7 May 2013 17:42:40 +0800 Subject: [PATCH] reconstruct project --- .../WebContent/WEB-INF/web.xml | 21 +- AcademicSearchEngine/WebContent/about.jsp | 104 +++++++++ AcademicSearchEngine/WebContent/discover.jsp | 2 +- AcademicSearchEngine/WebContent/home.jsp | 197 ++++++++++-------- AcademicSearchEngine/WebContent/index.jsp | 4 +- AcademicSearchEngine/WebContent/js/index.js | 4 +- .../WebContent/researcher.jsp | 2 +- AcademicSearchEngine/WebContent/share.jsp | 133 ------------ AcademicSearchEngine/WebContent/smallhead.jsp | 16 +- .../dcd/academic/action/CofieldAction.java | 18 +- .../dcd/academic/action/CoplaceAction.java | 18 +- 11 files changed, 260 insertions(+), 259 deletions(-) create mode 100644 AcademicSearchEngine/WebContent/about.jsp delete mode 100644 AcademicSearchEngine/WebContent/share.jsp diff --git a/AcademicSearchEngine/WebContent/WEB-INF/web.xml b/AcademicSearchEngine/WebContent/WEB-INF/web.xml index 3529406..5ae4ea3 100644 --- a/AcademicSearchEngine/WebContent/WEB-INF/web.xml +++ b/AcademicSearchEngine/WebContent/WEB-INF/web.xml @@ -5,7 +5,7 @@ id="WebApp_ID" version="2.5"> AcademicSearchEngine - home.jsp + about.jsp @@ -28,10 +28,6 @@ CAS Single Sign Out Filter org.jasig.cas.client.session.SingleSignOutFilter - - CAS Single Sign Out Filter - /* - @@ -100,26 +96,29 @@ - + + CAS Single Sign Out Filter + /* + CAS Authentication Filter - /share.jsp + /home.jsp CAS Validation Filter - /share.jsp + /home.jsp CAS HttpServletRequest Wrapper Filter - /share.jsp + /home.jsp CAS Assertion Thread Local Filter - /share.jsp + /home.jsp AutoSetUserAdapterFilter - /share.jsp + /home.jsp \ No newline at end of file diff --git a/AcademicSearchEngine/WebContent/about.jsp b/AcademicSearchEngine/WebContent/about.jsp new file mode 100644 index 0000000..ecec8f0 --- /dev/null +++ b/AcademicSearchEngine/WebContent/about.jsp @@ -0,0 +1,104 @@ +<%@ page language="java" contentType="text/html; charset=utf-8" + pageEncoding="utf-8"%> +<%@ taglib prefix="s" uri="/struts-tags"%> + + + + + About Academic Search Engine + + + + + + + + + + +
+
+ +
+
+

Howdy, I'm in Section 1.

+
+
+

Howdy, I'm in Section 2.

+
+
+
+
+ + +
+ + +
+ +
+
+

Thanks To

+

All The Lovely OpenSource Project

+
+ + + + +
+ + + + +
+ +
+ + +
+
+
+ + \ No newline at end of file diff --git a/AcademicSearchEngine/WebContent/discover.jsp b/AcademicSearchEngine/WebContent/discover.jsp index 1262ad7..848484f 100644 --- a/AcademicSearchEngine/WebContent/discover.jsp +++ b/AcademicSearchEngine/WebContent/discover.jsp @@ -33,7 +33,7 @@ Discover
  • - Share + About
  • diff --git a/AcademicSearchEngine/WebContent/home.jsp b/AcademicSearchEngine/WebContent/home.jsp index a191cdb..e87a64b 100644 --- a/AcademicSearchEngine/WebContent/home.jsp +++ b/AcademicSearchEngine/WebContent/home.jsp @@ -1,104 +1,133 @@ <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> +<%@ page language="java" import="org.jasig.cas.client.validation.Assertion" %> +<%@ page language="java" import="java.util.*" %> - Academic Homepage + Home - + + - - - - -
    -
    - -
    -
    -

    Howdy, I'm in Section 1.

    -
    -
    -

    Howdy, I'm in Section 2.

    -
    + + + - - -
    - - -
    +
    -
    -
    -

    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"); + } + %> +
    +

    <%=name%>

    +

    <%=email%>

    +

    I`m interested in <%=interests%>. You can + <%=email%>.

    + Follow Me on Weibo + Follow Me on Github +
    + + + +
    +
    +

    Favor Authors

    + +
    +

    View details »

    +
    +

    Favor Papers

    + +
    +

    View details »

    +
    +
    + + + +
    +
    +

    Discover History

    + +

    View details »

    +
    +
    +

    Search History

    + +

    View details »

    +
    +
    + + + +
    +
    +

    My Share

    + +

    View details »

    +
    +
    +

    My Friend

    + +

    View details »

    +
    +
    +
    \ 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
  • 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; }