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/engine.js'></script>
|
||||||
<script type='text/javascript' src='./dwr/util.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='./dwr/interface/ManagerArticleJS.js'></script>
|
||||||
<script type='text/javascript'
|
<script type='text/javascript' src='./javascripts/yacos/manageArticle.js'></script>
|
||||||
src='./javascripts/yacos/manageArticle.js'></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h4 class="title"><fmt:message key="manageArticle.title" /></h4>
|
<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
|
<div class="dynamicListHeader" align="center"><fmt:message
|
||||||
key="listarticle.title" /></div>
|
key="listarticle.title" /></div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div id="articleDetails" style="display: none;">
|
<div id="articleList" class="dynamicFredList">
|
||||||
<table border="1" id="tableArticle">
|
<c:forEach var="article" items="${listArticle}" varStatus="i">
|
||||||
<thead>
|
|
||||||
<tr>
|
<div id="articleLine${i.index}" align="center" class="articleLine">${article.title}</div>
|
||||||
<th>Details</th>
|
|
||||||
<th>Download</th>
|
<div id="articleDetails${i.index}" style="display: none;">
|
||||||
<th>Modify</th>
|
<table>
|
||||||
<th>Suppress</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<ul class="article">
|
<ul>
|
||||||
<li class="title"><b><span id="articleTitle">Title</span></b></li>
|
<li>Author: <b>${article.mainAuthor.firstName} ${article.mainAuthor.lastName}</b></li>
|
||||||
<li class="author">Author: <b><span id="articleAuthor">Author</span></b></li>
|
<li>Secondary Authors:
|
||||||
<li class="secondaryAuthors">Secondary Authors: <span
|
<c:forEach var="sAuthor" items="${article.secondaryAuthors}">
|
||||||
id="secondaryAuthor">Secondary</span></li>
|
${sAuthor}
|
||||||
<li class="topic">Topic: <b><span id="articleTopic">Topic</span></b></li>
|
</c:forEach>
|
||||||
|
</li>
|
||||||
|
<li>Topic: <b>${article.topic}</b></li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
<td><a id="articleURL" href="" />Download the article</a></td>
|
<td><a id="articleURL${i.index}" href="${article.URL_article}" />Download the article</a></td>
|
||||||
<td><a id="modifyArticle" href="" />Modify the article</a></td>
|
<td><a id="modifyArticle${i.index}" href="" />Modify the article</a></td>
|
||||||
<td><a id="suppressArticle" href="" />Suppress the article</a></td>
|
<td><a id="suppressArticle${i.index}" href="" />Suppress the article</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,74 +1,43 @@
|
|||||||
var listArticleGlobal = { }
|
|
||||||
|
|
||||||
var AuthorManager = Class.create({
|
var AuthorManager = Class.create({
|
||||||
lastRef: 0,
|
lastRef: 0,
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
|
||||||
ManagerArticleJS.getListArticle(function(listArticle) {
|
var listElem = $('articleList').select('.articleLine');
|
||||||
|
for (var i = 0; i < listElem.length; i++) {
|
||||||
var article, id;
|
listElem[i].observe('click', this.SelectArticle.bindAsEventListener());
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}.bind(this));
|
|
||||||
},
|
},
|
||||||
SelectArticle: function(event){
|
SelectArticle: function(event){
|
||||||
var item = event.element();
|
//var item = event.element().select("div").first();
|
||||||
|
|
||||||
if(item.hasClassName('selected')){
|
var item = "articleDetails";
|
||||||
item.removeClassName('selected');
|
item = item + event.element().id.substring(11);
|
||||||
id = item.id.substring(5);
|
|
||||||
$('articleDetails' + id).style.display = "none";
|
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 {
|
} else {
|
||||||
$('authorList').select('div.selected').invoke('removeClassName','selected');
|
$(item).addClassName('selected');
|
||||||
item.addClassName('selected');
|
|
||||||
ShowArticleDetails(item.id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*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() {
|
Event.observe(window,'load', function() {
|
||||||
new AuthorManager()
|
new AuthorManager()
|
||||||
});
|
});
|
||||||
@@ -24,7 +24,7 @@ public class ManageArticleController extends SimpleFormController {
|
|||||||
|
|
||||||
private IArticleManager articleManager;
|
private IArticleManager articleManager;
|
||||||
|
|
||||||
private List<ArticleBean> listArticleBean;
|
/*private List<ArticleBean> listArticleBean;
|
||||||
|
|
||||||
public List<ArticleBean> getListArticle() {
|
public List<ArticleBean> getListArticle() {
|
||||||
return listArticleBean;
|
return listArticleBean;
|
||||||
@@ -32,19 +32,19 @@ public class ManageArticleController extends SimpleFormController {
|
|||||||
|
|
||||||
public void setListArticle(List<ArticleBean> listArticleBean) {
|
public void setListArticle(List<ArticleBean> listArticleBean) {
|
||||||
this.listArticleBean = listArticleBean;
|
this.listArticleBean = listArticleBean;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
|
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException, NoConferenceSelectedException {
|
throws ServletException, IOException, NoConferenceSelectedException {
|
||||||
|
|
||||||
logger.info("Returning manageArticle view");
|
logger.info("Returning manageArticle view");
|
||||||
|
|
||||||
listArticleBean = new ArrayList<ArticleBean>();
|
//listArticleBean = new ArrayList<ArticleBean>();
|
||||||
|
|
||||||
List<Article> listArticle;
|
List<Article> listArticle;
|
||||||
listArticle = articleManager.getArticleOfAuthor(SessionService.getInstance().getCurrentConferenceId(), SessionService.getInstance().getCurrentUserLogin());
|
listArticle = articleManager.getArticleOfAuthor(SessionService.getInstance().getCurrentConferenceId(), SessionService.getInstance().getCurrentUserLogin());
|
||||||
|
|
||||||
for (Article a : listArticle) {
|
/*for (Article a : listArticle) {
|
||||||
ArticleBean ab = new ArticleBean();
|
ArticleBean ab = new ArticleBean();
|
||||||
ab.setId(a.getId());
|
ab.setId(a.getId());
|
||||||
ab.setMainAuthor(a.getMainAuthor().getFirstName() + " " + a.getMainAuthor().getLastName());
|
ab.setMainAuthor(a.getMainAuthor().getFirstName() + " " + a.getMainAuthor().getLastName());
|
||||||
@@ -56,9 +56,9 @@ public class ManageArticleController extends SimpleFormController {
|
|||||||
ab.setState(a.getState().toString());
|
ab.setState(a.getState().toString());
|
||||||
|
|
||||||
listArticleBean.add(ab);
|
listArticleBean.add(ab);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return new ModelAndView("manageArticle");
|
return new ModelAndView("manageArticle", "listArticle", listArticle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user