Changement du Filler : création de plusieurs articles par user
Changement du tableau manageArticle Policy failures: Code warning - failed on resource ManageArticleController.java. Reason: The import java.util.ArrayList is never used, line 4 - failed on resource ManageArticleController.java. Reason: The import org.yacos.web.author.form.ArticleBean is never used, line 1 Override reason: yess
This commit is contained in:
@@ -8,52 +8,50 @@
|
||||
<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>
|
||||
<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="dynamicFredList">
|
||||
<!-- <div id="authorList" class="dynamicFredList">
|
||||
<div class="dynamicListHeader" align="center"><fmt:message
|
||||
key="listarticle.title" /></div>
|
||||
</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>
|
||||
<div id="articleList" class="dynamicFredList">
|
||||
<c:forEach var="article" items="${listArticle}" varStatus="i">
|
||||
|
||||
<div id="articleLine${i.index}" align="center" class="articleLine">${article.title}</div>
|
||||
|
||||
<div id="articleDetails${i.index}" style="display: none;">
|
||||
<table>
|
||||
<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>
|
||||
<li>Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></li>
|
||||
<li>Secondary Authors:
|
||||
<c:forEach var="sAuthor" items="${article.secondaryAuthors}">
|
||||
${sAuthor}
|
||||
</c:forEach>
|
||||
</li>
|
||||
<li>Topic: <b>${article.topic}</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>
|
||||
<td><a id="articleURL${i.index}" href="${article.URL_article}" />Download the article</a></td>
|
||||
<td><a id="modifyArticle${i.index}" href="" />Modify the article</a></td>
|
||||
<td><a id="suppressArticle${i.index}" href="" />Suppress the article</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,74 +1,43 @@
|
||||
var listArticleGlobal = { }
|
||||
|
||||
var AuthorManager = Class.create({
|
||||
lastRef: 0,
|
||||
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':'dynamicFredListItem',
|
||||
'id':elemName, 'align':'center'}).update(value).insert(hidden);
|
||||
elem.observe('click', this.SelectArticle.bindAsEventListener());
|
||||
$('authorList').insert(elem);
|
||||
|
||||
var elem2 = $('articleDetails').cloneNode(true);
|
||||
elem2.id = 'articleDetails' + ref;
|
||||
elem.insert(elem2);
|
||||
//var node = $('authorList').select('div#articleDetails');
|
||||
//node[i].id = 'articleDetails' + ref;
|
||||
|
||||
var listElem = $('articleList').select('.articleLine');
|
||||
for (var i = 0; i < listElem.length; i++) {
|
||||
listElem[i].observe('click', this.SelectArticle.bindAsEventListener());
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
},
|
||||
SelectArticle: function(event){
|
||||
var item = event.element();
|
||||
//var item = event.element().select("div").first();
|
||||
|
||||
if(item.hasClassName('selected')){
|
||||
item.removeClassName('selected');
|
||||
id = item.id.substring(5);
|
||||
$('articleDetails' + id).style.display = "none";
|
||||
var item = "articleDetails";
|
||||
item = item + event.element().id.substring(11);
|
||||
|
||||
if(! $(item).visible() ){
|
||||
$(item).style.display = "";
|
||||
}
|
||||
else {
|
||||
$(item).style.display = "none";
|
||||
}
|
||||
|
||||
item = "articleLine";
|
||||
item = item + event.element().id.substring(11);
|
||||
if($(item).hasClassName('selected')){
|
||||
$(item).removeClassName('selected');
|
||||
} else {
|
||||
$('authorList').select('div.selected').invoke('removeClassName','selected');
|
||||
item.addClassName('selected');
|
||||
ShowArticleDetails(item.id);
|
||||
}
|
||||
$(item).addClassName('selected');
|
||||
}
|
||||
|
||||
/*if(! $(item.id).visible() ){
|
||||
$(item.id).style.display = "";
|
||||
}
|
||||
else {
|
||||
$(item.id).style.display = "none";
|
||||
}*/
|
||||
}
|
||||
});
|
||||
|
||||
function ShowArticleDetails(id) {
|
||||
id = id.substring(5);
|
||||
/*dwr.util.setValues({
|
||||
articleTitle:listArticleGlobal[id].title,
|
||||
articleAuthor:listArticleGlobal[id].mainAuthor,
|
||||
articleTopic:listArticleGlobal[id].topic});*/
|
||||
|
||||
$('articleTitle').value = listArticleGlobal[id].title;
|
||||
$('articleAuthor').value = listArticleGlobal[id].mainAuthor;
|
||||
$('articleTopic').value = listArticleGlobal[id].topic
|
||||
|
||||
$('articleURL').href = listArticleGlobal[id].URL_article;
|
||||
if(! $('articleDetails' + id).visible() ){
|
||||
$('articleDetails' + id).style.display = "";
|
||||
}
|
||||
}
|
||||
|
||||
Event.observe(window,'load', function() {
|
||||
new AuthorManager()
|
||||
});
|
||||
@@ -24,7 +24,7 @@ public class ManageArticleController extends SimpleFormController {
|
||||
|
||||
private IArticleManager articleManager;
|
||||
|
||||
private List<ArticleBean> listArticleBean;
|
||||
/*private List<ArticleBean> listArticleBean;
|
||||
|
||||
public List<ArticleBean> getListArticle() {
|
||||
return listArticleBean;
|
||||
@@ -32,19 +32,19 @@ public class ManageArticleController extends SimpleFormController {
|
||||
|
||||
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>();
|
||||
//listArticleBean = new ArrayList<ArticleBean>();
|
||||
|
||||
List<Article> listArticle;
|
||||
listArticle = articleManager.getArticleOfAuthor(SessionService.getInstance().getCurrentConferenceId(), SessionService.getInstance().getCurrentUserLogin());
|
||||
|
||||
for (Article a : listArticle) {
|
||||
/*for (Article a : listArticle) {
|
||||
ArticleBean ab = new ArticleBean();
|
||||
ab.setId(a.getId());
|
||||
ab.setMainAuthor(a.getMainAuthor().getFirstName() + " " + a.getMainAuthor().getLastName());
|
||||
@@ -56,9 +56,9 @@ public class ManageArticleController extends SimpleFormController {
|
||||
ab.setState(a.getState().toString());
|
||||
|
||||
listArticleBean.add(ab);
|
||||
}
|
||||
}*/
|
||||
|
||||
return new ModelAndView("manageArticle");
|
||||
return new ModelAndView("manageArticle", "listArticle", listArticle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user