diff --git a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties index ce5c304..9e1a2a9 100644 --- a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties +++ b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties @@ -15,6 +15,9 @@ button.reset=Reset button.OK=OK +listarticle.title=Article's list + + preference.title=Choose the preference for articles preference.like=Like preference.indifferent=Indifferent diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/choosePreference.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/choosePreference.jsp index 91fe165..ff3a83b 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/choosePreference.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/choosePreference.jsp @@ -12,8 +12,7 @@ - - +
 
diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/include.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/include.jsp index cad6eaf..e40da43 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/include.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/include.jsp @@ -1,5 +1,5 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> \ No newline at end of file diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp new file mode 100644 index 0000000..42964a0 --- /dev/null +++ b/YACOSWeb/WebContent/WEB-INF/jsp/listArticle.jsp @@ -0,0 +1,39 @@ +<%@ include file="/WEB-INF/jsp/include.jsp"%> +<%@ page session="false" %> + + + + + + <fmt:message key="title"/> + + + + + + +
+
 
+
+ + +
+ + + + +
    +
  • ${article.title}
  • +
  • ${article.mainAuthor}
  • +
  • ${article.topic}
  • +
  • ${article.URL_article}
  • +
+
+ +
+
+ +
+ + + \ No newline at end of file diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/menu.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/menu.jsp index 024ca4c..b9df6b7 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/menu.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/menu.jsp @@ -4,6 +4,7 @@
Menu
    +
  • ">
  • ">
  • ">
  • ">
  • diff --git a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml index 63a8982..90ad6c3 100644 --- a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml +++ b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml @@ -21,6 +21,10 @@ + + + + diff --git a/YACOSWeb/WebContent/stylesheets/base.css b/YACOSWeb/WebContent/stylesheets/base.css index 8a1746b..35b3c73 100644 --- a/YACOSWeb/WebContent/stylesheets/base.css +++ b/YACOSWeb/WebContent/stylesheets/base.css @@ -113,4 +113,27 @@ body { #main_content { display: table-cell; + width: 640px; } + +ul.article { + border-bottom : thin solid #666; + width: 100%; +} + +ul.article li { + width: 100%; + list-style: none; +} + +ul.article .title { + font-size: large; +} + +ul.article .author { + font-size: small; +} + +ul.article .article_url { + font-size: smaller; +} \ No newline at end of file diff --git a/YACOSWeb/src/org/yacos/web/PCmember/controller/ListArticleController.java b/YACOSWeb/src/org/yacos/web/PCmember/controller/ListArticleController.java new file mode 100644 index 0000000..14da99b --- /dev/null +++ b/YACOSWeb/src/org/yacos/web/PCmember/controller/ListArticleController.java @@ -0,0 +1,45 @@ +package org.yacos.web.PCmember.controller; + +import org.springframework.web.servlet.mvc.SimpleFormController; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.io.IOException; +import java.util.Date; +import java.util.List; + +import org.yacos.core.article.*; + +public class ListArticleController extends SimpleFormController { + + protected final Log logger = LogFactory.getLog(getClass()); + + private IArticleManager articleManager; + + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + logger.info("Returning listArticle view"); + + List
    listArticle = articleManager.getArticles(); + + getServletContext().setAttribute("listArticle", listArticle); + + return new ModelAndView("listArticle"); + } + + public IArticleManager getArticleManager() { + return articleManager; + } + + public void setArticleManager(IArticleManager articleManager) { + this.articleManager = articleManager; + } + +} \ No newline at end of file