Début du management d'article
This commit is contained in:
@@ -108,6 +108,7 @@ button.OK=OK
|
|||||||
|
|
||||||
|
|
||||||
listarticle.title=Article's list
|
listarticle.title=Article's list
|
||||||
|
manageArticle.title=Manage your article
|
||||||
|
|
||||||
|
|
||||||
preference.title=Choose the preference for articles
|
preference.title=Choose the preference for articles
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<h4><fmt:message key="menu.author.title" /></h4>
|
<h4><fmt:message key="menu.author.title" /></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li>
|
<li><a href="<c:url value="submissionArticle.htm"/>"><fmt:message key="menu.author.article.submission" /></a></li>
|
||||||
<li><a href="<c:url value="#"/>"><fmt:message key="menu.author.article.modify" /></a></li>
|
<li><a href="<c:url value="manageArticle.htm"/>"><fmt:message key="menu.author.article.modify" /></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="footer"></div>
|
<div id="footer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
59
YACOSWeb/WebContent/WEB-INF/jsp/manageArticle.jsp
Normal file
59
YACOSWeb/WebContent/WEB-INF/jsp/manageArticle.jsp
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<%@ include file="/WEB-INF/decorators/include.jsp"%>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script type='text/javascript' src='./javascripts/prototype.js'></script>
|
||||||
|
<script type='text/javascript' src='./javascripts/scriptaculous.js'></script>
|
||||||
|
<script type='text/javascript' src='./javascripts/effects.js'></script>
|
||||||
|
<script type='text/javascript' src='./dwr/engine.js'></script>
|
||||||
|
<script type='text/javascript' src='./dwr/util.js'></script>
|
||||||
|
<script type='text/javascript' src='./dwr/interface/ManagerArticleJS.js'></script>
|
||||||
|
<script type='text/javascript'
|
||||||
|
src='./javascripts/yacos/manageArticle.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h4 class="title"><fmt:message key="manageArticle.title" /></h4>
|
||||||
|
|
||||||
|
<div id="authorList" class="dynamicList" align="center">
|
||||||
|
<div class="dynamicListHeader"><fmt:message
|
||||||
|
key="listarticle.title" /></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div id="articleDetails" style="display: none;">
|
||||||
|
<table border="1" id="tableArticle">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Details</th>
|
||||||
|
<th>Download</th>
|
||||||
|
<th>Modify</th>
|
||||||
|
<th>Suppress</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<ul class="article">
|
||||||
|
<li class="title"><b><span id="articleTitle">Title</span></b></li>
|
||||||
|
<li class="author">Author: <b><span id="articleAuthor">Author</span></b></li>
|
||||||
|
<li class="secondaryAuthors">Secondary Authors: <span
|
||||||
|
id="secondaryAuthor">Secondary</span></li>
|
||||||
|
<li class="topic">Topic: <b><span id="articleTopic">Topic</span></b></li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td><a id="articleURL" href="" />Download the article</a></td>
|
||||||
|
<td><a id="modifyArticle" href="" />Modify the article</a></td>
|
||||||
|
<td><a id="suppressArticle" href="" />Suppress the article</a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -28,6 +28,9 @@
|
|||||||
<prop key="/listArticle.htm">
|
<prop key="/listArticle.htm">
|
||||||
ListArticleController
|
ListArticleController
|
||||||
</prop>
|
</prop>
|
||||||
|
<prop key="/manageArticle.htm">
|
||||||
|
ManageArticleController
|
||||||
|
</prop>
|
||||||
<prop key="/registerUser.htm">
|
<prop key="/registerUser.htm">
|
||||||
SUserRegistrationController
|
SUserRegistrationController
|
||||||
</prop>
|
</prop>
|
||||||
@@ -89,6 +92,12 @@
|
|||||||
<property name="articleManager" ref="articleManager" />
|
<property name="articleManager" ref="articleManager" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="ManageArticleController"
|
||||||
|
class="org.yacos.web.author.controller.ManageArticleController">
|
||||||
|
<dwr:remote javascript="ManagerArticleJS" />
|
||||||
|
<property name="articleManager" ref="articleManager" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean id="ArticleDownloadController" class="org.yacos.web.system.controller.ArticleDownloadController">
|
<bean id="ArticleDownloadController" class="org.yacos.web.system.controller.ArticleDownloadController">
|
||||||
<property name="articleManager" ref="articleManager" />
|
<property name="articleManager" ref="articleManager" />
|
||||||
<property name="downloadDirPath" value="${download.dir.path}"/>
|
<property name="downloadDirPath" value="${download.dir.path}"/>
|
||||||
@@ -248,6 +257,10 @@
|
|||||||
class="org.yacos.web.chairman.form.FormConference">
|
class="org.yacos.web.chairman.form.FormConference">
|
||||||
</dwr:convert>
|
</dwr:convert>
|
||||||
|
|
||||||
|
<dwr:convert type="bean"
|
||||||
|
class="org.yacos.web.author.form.ArticleBean">
|
||||||
|
</dwr:convert>
|
||||||
|
|
||||||
<dwr:convert type="bean"
|
<dwr:convert type="bean"
|
||||||
class="org.yacos.web.chairman.controller.CriterionBean">
|
class="org.yacos.web.chairman.controller.CriterionBean">
|
||||||
</dwr:convert>
|
</dwr:convert>
|
||||||
|
|||||||
63
YACOSWeb/WebContent/javascripts/yacos/manageArticle.js
Normal file
63
YACOSWeb/WebContent/javascripts/yacos/manageArticle.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
var listArticleGlobal = { }
|
||||||
|
|
||||||
|
var AuthorManager = Class.create({
|
||||||
|
lastRef: 0,
|
||||||
|
selectedArticle: true,
|
||||||
|
initialize: function() {
|
||||||
|
|
||||||
|
ManagerArticleJS.getListArticle(function(listArticle) {
|
||||||
|
|
||||||
|
var article, id;
|
||||||
|
listArticle.sort(function(a1, a2) { return a1.title.localeCompare(a2.title); });
|
||||||
|
listArticleGlobal = listArticle;
|
||||||
|
|
||||||
|
// g<>rer ici s'il n'y a pas d'articles
|
||||||
|
//if (listArticle.length == 0)
|
||||||
|
//$("tableCriterion").style.display = "none";
|
||||||
|
|
||||||
|
for (var i = 0; i < listArticle.length; i++) {
|
||||||
|
article = listArticle[i];
|
||||||
|
|
||||||
|
var ref = this.lastRef++;
|
||||||
|
var elemName = "liste"+ref;
|
||||||
|
var value = article.title;
|
||||||
|
var hidden = new Element('input',{'id':elemName,'name':elemName,'type':'hidden','value':value});
|
||||||
|
var elem = new Element('div',
|
||||||
|
{ 'class':'dynamicListItem',
|
||||||
|
'id':elemName}).update(value).insert(hidden);
|
||||||
|
elem.observe('click', this.SelectArticle.bindAsEventListener());
|
||||||
|
$('authorList').insert(elem);
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
SelectArticle: function(event){
|
||||||
|
var item = event.element();
|
||||||
|
|
||||||
|
if(item.hasClassName('selected')){
|
||||||
|
item.removeClassName('selected');
|
||||||
|
$('articleDetails').fade({duration:0.5});
|
||||||
|
} else {
|
||||||
|
$('authorList').select('div.selected').invoke('removeClassName','selected');
|
||||||
|
item.addClassName('selected');
|
||||||
|
selectedArticle = true;
|
||||||
|
ShowArticleDetails(item.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function ShowArticleDetails(id) {
|
||||||
|
id = id.substring(5);
|
||||||
|
dwr.util.setValues({
|
||||||
|
articleTitle:listArticleGlobal[id].title,
|
||||||
|
articleAuthor:listArticleGlobal[id].mainAuthor,
|
||||||
|
articleTopic:listArticleGlobal[id].topic});
|
||||||
|
$('articleURL').href = listArticleGlobal[id].URL_article;
|
||||||
|
if(! $('articleDetails').visible() ){
|
||||||
|
$('articleDetails').appear({duration:0.5});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Event.observe(window,'load', function() {
|
||||||
|
new AuthorManager()
|
||||||
|
});
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package org.yacos.web.author.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.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.yacos.web.author.form.ArticleBean;
|
||||||
|
import org.yacos.web.system.controller.NoConferenceSelectedException;
|
||||||
|
import org.yacos.web.system.session.SessionService;
|
||||||
|
import org.yacos.core.article.Article;
|
||||||
|
import org.yacos.core.article.IArticleManager;
|
||||||
|
|
||||||
|
public class ManageArticleController extends SimpleFormController {
|
||||||
|
|
||||||
|
protected final Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
|
private IArticleManager articleManager;
|
||||||
|
|
||||||
|
private List<ArticleBean> listArticleBean;
|
||||||
|
|
||||||
|
public List<ArticleBean> getListArticle() {
|
||||||
|
return listArticleBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListArticle(List<ArticleBean> listArticleBean) {
|
||||||
|
this.listArticleBean = listArticleBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
throws ServletException, IOException, NoConferenceSelectedException {
|
||||||
|
|
||||||
|
logger.info("Returning manageArticle view");
|
||||||
|
|
||||||
|
listArticleBean = new ArrayList<ArticleBean>();
|
||||||
|
|
||||||
|
List<Article> listArticle;
|
||||||
|
listArticle = articleManager.getArticleOfAuthor(SessionService.getInstance().getCurrentConferenceId(), SessionService.getInstance().getCurrentUserLogin());
|
||||||
|
|
||||||
|
for (Article a : listArticle) {
|
||||||
|
ArticleBean ab = new ArticleBean();
|
||||||
|
ab.setId(a.getId());
|
||||||
|
ab.setMainAuthor(a.getMainAuthor().getFirstName() + " " + a.getMainAuthor().getLastName());
|
||||||
|
ab.setSecondaryAuthors(a.getSecondaryAuthors());
|
||||||
|
ab.setTitle(a.getTitle());
|
||||||
|
ab.setTopic(a.getTopic());
|
||||||
|
String fullUrl = request.getContextPath()+"/download.htm?articleId="+a.getId();
|
||||||
|
ab.setURL_article(fullUrl);
|
||||||
|
ab.setState(a.getState().toString());
|
||||||
|
|
||||||
|
listArticleBean.add(ab);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ModelAndView("manageArticle");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public IArticleManager getArticleManager() {
|
||||||
|
return articleManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleManager(IArticleManager articleManager) {
|
||||||
|
this.articleManager = articleManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
62
YACOSWeb/src/org/yacos/web/author/form/ArticleBean.java
Normal file
62
YACOSWeb/src/org/yacos/web/author/form/ArticleBean.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package org.yacos.web.author.form;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class ArticleBean {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String title;
|
||||||
|
private String topic;
|
||||||
|
private String URL_article;
|
||||||
|
private String mainAuthor;
|
||||||
|
private ArrayList<String> secondaryAuthors;
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticleBean() {}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
public String getTopic() {
|
||||||
|
return topic;
|
||||||
|
}
|
||||||
|
public void setTopic(String topic) {
|
||||||
|
this.topic = topic;
|
||||||
|
}
|
||||||
|
public String getURL_article() {
|
||||||
|
return URL_article;
|
||||||
|
}
|
||||||
|
public void setURL_article(String url_article) {
|
||||||
|
URL_article = url_article;
|
||||||
|
}
|
||||||
|
public String getMainAuthor() {
|
||||||
|
return mainAuthor;
|
||||||
|
}
|
||||||
|
public void setMainAuthor(String mainAuthor) {
|
||||||
|
this.mainAuthor = mainAuthor;
|
||||||
|
}
|
||||||
|
public ArrayList<String> getSecondaryAuthors() {
|
||||||
|
return secondaryAuthors;
|
||||||
|
}
|
||||||
|
public void setSecondaryAuthors(ArrayList<String> secondaryAuthors) {
|
||||||
|
this.secondaryAuthors = secondaryAuthors;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user