From fdesbois@users.chorem.org Mon Apr  2 11:29:44 2012
From: fdesbois@users.chorem.org
To: pollen-commits@list.chorem.org
Subject: [Pollen-commits] r3223 - in branches/pollen-1.2.6-struts2:
	pollen-persistence/src/main/java/org/chorem/pollen/entities/migration
	pollen-persistence/src/main/xmi
	pollen-services/src/main/java/org/chorem/pollen/services/impl
	pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/json
	pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll
	pollen-ui-struts2/src/main/resources/i18n
	pollen-ui-struts2/src/main/resources/org/chorem/pollen/ui/actions/poll
	pollen-ui-struts2/src/main/webapp/WEB-INF/js
Date: Mon, 02 Apr 2012 11:29:44 +0200
Message-ID: <20120402092944.861871582A@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0708414404515210062=="

--===============0708414404515210062==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Author: fdesbois
Date: 2012-04-02 11:29:44 +0200 (Mon, 02 Apr 2012)
New Revision: 3223

Url: http://chorem.org/repositories/revision/pollen/3223

Log:
- add comment author new column
- improve pollAccount link with comment
- add comment validation in action instead of xml

Removed:
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/cho=
rem/pollen/ui/actions/poll/AddComment-addComment-validation.xml
Modified:
   branches/pollen-1.2.6-struts2/pollen-persistence/src/main/java/org/chorem/=
pollen/entities/migration/PollenMigrationCallbackV1_2_6.java
   branches/pollen-1.2.6-struts2/pollen-persistence/src/main/xmi/pollen.zargo
   branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/pol=
len/services/impl/PollCommentService.java
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/p=
ollen/ui/actions/json/GetPollComments.java
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/p=
ollen/ui/actions/poll/AbstractVoteAction.java
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/p=
ollen/ui/actions/poll/AddComment.java
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/po=
llen-ui-struts2_en_GB.properties
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/po=
llen-ui-struts2_fr_FR.properties
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/js=
p/poll/confirmDeletePollComment.jsp
   branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/js=
p/poll/vote.jsp

Modified: branches/pollen-1.2.6-struts2/pollen-persistence/src/main/java/org/=
chorem/pollen/entities/migration/PollenMigrationCallbackV1_2_6.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-persistence/src/main/java/org/chorem=
/pollen/entities/migration/PollenMigrationCallbackV1_2_6.java	2012-04-02 09:2=
9:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-persistence/src/main/java/org/chorem=
/pollen/entities/migration/PollenMigrationCallbackV1_2_6.java	2012-04-02 09:2=
9:44 UTC (rev 3223)
@@ -82,8 +82,20 @@
=20
         // add foreign key indexes
         addForeignKeyIndexes(queries);
+
+        // add author column for Comment
+        addCommentAuthorColumn(queries);
     }
+   =20
+    private void addCommentAuthorColumn(List<String> queries) {
=20
+        queries.add("ALTER TABLE comment ADD COLUMN author VARCHAR(255);");
+       =20
+        queries.add("UPDATE comment c SET c.author =3D (SELECT p.votingId FR=
OM pollAccount p WHERE c.pollAccount =3D p.topiaId);");
+
+        queries.add("ALTER TABLE comment ALTER COLUMN author VARCHAR(255) NO=
T NULL;");
+    }
+
     private void addForeignKeyIndexes(List<String> queries) {
=20
         queries.add("CREATE INDEX idx_PollAccount_pollsCreated ON poll(creat=
or);");

Modified: branches/pollen-1.2.6-struts2/pollen-persistence/src/main/xmi/polle=
n.zargo
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/cho=
rem/pollen/services/impl/PollCommentService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/po=
llen/services/impl/PollCommentService.java	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-services/src/main/java/org/chorem/po=
llen/services/impl/PollCommentService.java	2012-04-02 09:29:44 UTC (rev 3223)
@@ -29,7 +29,6 @@
 import org.chorem.pollen.business.persistence.CommentDAO;
 import org.chorem.pollen.business.persistence.Poll;
 import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.business.persistence.PollAccountDAO;
 import org.chorem.pollen.business.persistence.PollDAO;
 import org.chorem.pollen.business.persistence.UserAccount;
 import org.chorem.pollen.services.PollenServiceSupport;
@@ -52,31 +51,42 @@
         Preconditions.checkNotNull(poll);
=20
         PollDAO pollDAO =3D getDAO(Poll.class);
-        PollAccountDAO pollAccountDAO =3D getDAO(PollAccount.class);
         CommentDAO dao =3D getDAO(Comment.class);
=20
         try {
=20
-            // creates poll account
-            PollAccount pollAccountCreated =3D
-                    pollAccountDAO.create(comment.getPollAccount());
-
             // get last version of the poll
             Poll pollToUpdate =3D pollDAO.findByTopiaId(poll.getTopiaId());
=20
             // creates the poll comment
             Comment commentCreated =3D dao.create(
-                    Comment.PROPERTY_POLL_ACCOUNT, pollAccountCreated,
                     Comment.PROPERTY_POLL, pollToUpdate,
                     Comment.PROPERTY_POST_DATE, comment.getPostDate(),
+                    Comment.PROPERTY_AUTHOR, comment.getAuthor(),
                     Comment.PROPERTY_TEXT, comment.getText()
             );
=20
             // add it to poll
             pollToUpdate.addComment(commentCreated);
=20
-            commitTransaction("Could not create comment " + comment.getText(=
));
+            // attach poll account if exists
+            PollAccount pollAccount =3D comment.getPollAccount();
+            if (pollAccount.getTopiaId() !=3D null) {
=20
+                PollAccount pollAccountLoaded =3D getEntityById(PollAccount.=
class, pollAccount.getTopiaId());
+
+                // attach the userAccount
+                if (pollAccountLoaded.getUserAccount() =3D=3D null && pollAc=
count.getUserAccount() !=3D null) {
+                    String userId =3D pollAccount.getUserAccount().getTopiaI=
d();
+                    UserAccount userAccountLoaded =3D getEntityById(UserAcco=
unt.class, userId);
+                    pollAccountLoaded.setUserAccount(userAccountLoaded);
+                }
+
+                commentCreated.setPollAccount(pollAccountLoaded);
+            }
+
+            commitTransaction("Could not create comment (" + comment.getAuth=
or() + ") " + comment.getText());
+
             // feed notification
=20
             PollService pollService =3D newService(PollService.class);
@@ -105,7 +115,6 @@
                 throw new PollCommentNotFound();
             }
=20
-            //FIXME Should we also delete the associated pollAccount ?
             dao.delete(comment);
=20
             commitTransaction("Could not delete comment " + comment.getText(=
));
@@ -115,7 +124,7 @@
         }
     }
=20
-    public Comment getNewComment(PollAccount account, String text) {
+    public Comment getNewComment(PollAccount account, String author, String =
text) {
=20
         CommentDAO dao =3D getDAO(Comment.class);
         Comment result =3D newInstance(dao);
@@ -123,49 +132,35 @@
         if (account !=3D null) {
             result.setPollAccount(account);
         }
+        result.setAuthor(author);
         result.setText(text);
         result.setPostDate(serviceContext.getCurrentTime());
         return result;
     }
=20
-    public PollAccount getNewPollAccount(UserAccount user, String votingId) {
-        PollAccountDAO dao =3D getDAO(PollAccount.class);
-        PollAccount result =3D newInstance(dao);
-        if (user !=3D null) {
-            result.setVotingId(user.getDisplayName());
-            result.setAccountId(serviceContext.createPollenUrlId());
-            result.setEmail(user.getEmail());
-            result.setUserAccount(user);
-        }
-        if (votingId !=3D null) {
-            result.setVotingId(votingId);
-        }
-        return result;
-    }
-
     public boolean isCanDeleteComment(Comment comment,
+                                      PollAccount pollAccount,
                                       UserAccount userAccount) {
=20
-        boolean result =3D false;
+        boolean result;
=20
+        PollAccount commentAccount =3D comment.getPollAccount();
+
+        // loggued
         if (userAccount !=3D null) {
=20
-            // loggued
+            boolean isAdmin =3D userAccount.isAdministrator();
+            boolean isCommentAccount =3D userAccount.equals(commentAccount.g=
etUserAccount());
=20
-            if (userAccount.isAdministrator()) {
+            result =3D isAdmin || isCommentAccount;
=20
-                // administrator can always delete everything
-                result =3D true;
+        } else if (pollAccount !=3D null) {
=20
-            } else {
+            result =3D pollAccount.equals(commentAccount);
=20
-                PollAccount pollAccount =3D comment.getPollAccount();
-                if (userAccount.equals(pollAccount.getUserAccount())) {
-                    result =3D true;
-                }
-            }
+        } else {
+            result =3D false;
         }
-
         return result;
     }
=20

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/c=
horem/pollen/ui/actions/json/GetPollComments.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/json/GetPollComments.java	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/json/GetPollComments.java	2012-04-02 09:29:44 UTC (rev 3223)
@@ -117,6 +117,7 @@
                                             UserAccount userAccount) {
         Set<String> result =3D Sets.newHashSet();
         boolean canDelete =3D pollService.isCanDeleteComment(comment,
+                                                           null,
                                                            userAccount);
         if (canDelete) {
             result.add("delete");

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/c=
horem/pollen/ui/actions/poll/AbstractVoteAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/poll/AbstractVoteAction.java	2012-04-02 09:29:31 UTC (rev 3=
222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/poll/AbstractVoteAction.java	2012-04-02 09:29:44 UTC (rev 3=
223)
@@ -39,6 +39,7 @@
 import org.chorem.pollen.common.ChoiceType;
 import org.chorem.pollen.common.PollType;
 import org.chorem.pollen.common.VoteCountingType;
+import org.chorem.pollen.services.exceptions.PollAccountNotFound;
 import org.chorem.pollen.services.exceptions.PollNotFoundException;
 import org.chorem.pollen.services.impl.PollCommentService;
 import org.chorem.pollen.services.impl.PollFeedService;
@@ -70,6 +71,8 @@
     private transient PollService pollService;
=20
     private transient VoteService voteService;
+   =20
+    private transient PollCommentService pollCommentService;
=20
     private Poll poll;
=20
@@ -87,7 +90,7 @@
    =20
     private Vote vote;
    =20
-    private String commentName;
+    private String commentAuthor;
=20
     private String voteSizeMessage;
=20
@@ -123,6 +126,13 @@
         return voteService;
     }
=20
+    protected PollCommentService getPollCommentService() {
+        if (pollCommentService =3D=3D null) {
+            pollCommentService =3D newService(PollCommentService.class);
+        }
+        return pollCommentService;
+    }
+
     @Override
     public void setParameters(Map<String, String[]> parameters) {
         this.parameters =3D parameters;
@@ -248,19 +258,19 @@
         return poll.getEndDate() !=3D null && poll.getEndDate().before(now);
     }
=20
-    public String getCommentName() {
-        return commentName;
+    public String getCommentAuthor() {
+        if (commentAuthor =3D=3D null) {
+            // Use current pollAccount name for comment
+            commentAuthor =3D getPollAccount().getVotingId();
+        }
+        return commentAuthor;
     }
=20
-    public void setCommentName(String commentName) {
-        this.commentName =3D commentName;
+    public void setCommentAuthor(String commentAuthor) {
+        this.commentAuthor =3D commentAuthor;
     }
-   =20
-    public void resetCommentName() {
-        setCommentName(getPollAccount().getVotingId());
-    }
=20
-    public void prepareVotePage() throws Exception {
+    public String prepareVotePage() throws Exception {
=20
         loadPoll();
=20
@@ -269,7 +279,7 @@
                 DateFormat.SHORT, getLocale()));
=20
         // Current poll account
-        pollAccount =3D getPollService().getPollAccountEditable(getAccountId=
(), getPollenUserAccount(), poll);
+        loadPollAccount();
=20
         // All votes
         // TODO no pagination for the moment, need to retrieve the correct p=
age depends on current pollAccount
@@ -309,8 +319,6 @@
         creatorUser =3D getPollenUserAccount() !=3D null &&
                       getPollenUserAccount().equals(poll.getCreator().getUse=
rAccount());
=20
-        resetCommentName();
-
         if (log.isInfoEnabled()) {
             Date now =3D serviceContext.getCurrentTime();
             log.info("pollChoiceOrVoteStarted =3D " + isPollChoiceOrVoteStar=
ted());
@@ -319,6 +327,7 @@
             log.info("accountFieldDisplayed   =3D " + isAccountFieldDisplaye=
d());
             log.info("creatorUser             =3D " + creatorUser);
         }
+        return INPUT;
     }
=20
     public String getResultValue(Choice choice) {
@@ -362,6 +371,10 @@
         return getVoteService().isVoteAllowed(getPoll(), getPollAccount());
     }
=20
+    public boolean isDeleteCommentAllowed(Comment comment) {
+        return isCreatorUser() || getPollCommentService().isCanDeleteComment=
(comment, getPollAccount(), getPollenUserAccount());
+    }
+
     public String escapeLineBreak(String text) {
         return text;
     }
@@ -370,6 +383,12 @@
         return formatDate(new Date(Long.valueOf(choice.getName())));
     }
=20
+    protected void loadPollAccount() throws PollAccountNotFound {
+
+        // Current poll account
+        pollAccount =3D getPollService().getPollAccountEditable(getAccountId=
(), getPollenUserAccount(), poll);
+    }
+
     protected void loadPoll() throws PollNotFoundException {
=20
         // Ensure uri for poll and pollAccount loading

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/c=
horem/pollen/ui/actions/poll/AddComment.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/poll/AddComment.java	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/=
pollen/ui/actions/poll/AddComment.java	2012-04-02 09:29:44 UTC (rev 3223)
@@ -23,11 +23,10 @@
  */
 package org.chorem.pollen.ui.actions.poll;
=20
-import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.Preparable;
 import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import org.apache.commons.lang3.StringUtils;
 import org.chorem.pollen.business.persistence.Comment;
-import org.chorem.pollen.business.persistence.PollAccount;
-import org.chorem.pollen.services.impl.PollCommentService;
=20
 /**
  * To add a poll comment.
@@ -35,43 +34,50 @@
  * @author tchemit <chemit@codelutin.com>
  * @since 1.2.6
  */
-public class AddComment extends AbstractVoteAction {
+public class AddComment extends AbstractVoteAction implements Preparable {
=20
     private static final long serialVersionUID =3D 1L;
+   =20
+    private String commentText;
=20
-    /** Text of the comment. */
-    protected String commentText;
+    public void setCommentText(String commentText) {
+        this.commentText =3D commentText;
+    }
=20
     public String getCommentText() {
         return commentText;
     }
=20
-    public void setCommentText(String commentText) {
-        this.commentText =3D commentText;
+    @Override
+    public void prepare() throws Exception {
+
+        loadPoll();
+        loadPollAccount();
     }
=20
-    @InputConfig(methodName =3D "prepareVotePage")
     @Override
-    public String execute() throws Exception {
+    public void validate() {
=20
-        loadPoll();
+        if (StringUtils.isBlank(getCommentAuthor())) {
+            addFieldError("commentAuthor", _("pollen.error.comment.name.empt=
y"));
+        }
=20
-        Preconditions.checkNotNull(getCommentName());
-        Preconditions.checkNotNull(getCommentText());
+        if (StringUtils.isBlank(getCommentText())) {
+            addFieldError("commentText", _("pollen.error.comment.text.empty"=
));
+        }
+    }
=20
-        PollCommentService service =3D newService(PollCommentService.class);
+    @InputConfig(methodName =3D "prepareVotePage")
+    @Override
+    public String execute() throws Exception {
=20
-        // prepare a new poll account for the comment
-        PollAccount pollAccount =3D service.getNewPollAccount(
-                getPollenUserAccount(), getCommentName());
-
         // prepare a new comment
-        Comment comment =3D service.getNewComment(pollAccount, getCommentTex=
t());
+        Comment comment =3D getPollCommentService().getNewComment(
+                getPollAccount(), getCommentAuthor(), getCommentText());
=20
         // create the comment
-        service.createComment(getPoll(), comment);
+        getPollCommentService().createComment(getPoll(), comment);
=20
         return SUCCESS;
     }
-
 }

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/=
i18n/pollen-ui-struts2_en_GB.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/p=
ollen-ui-struts2_en_GB.properties	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/p=
ollen-ui-struts2_en_GB.properties	2012-04-02 09:29:44 UTC (rev 3223)
@@ -53,7 +53,7 @@
 pollen.common.choice.date=3DDate
 pollen.common.choice.image=3DImage
 pollen.common.choice.text=3DLabel
-pollen.common.commentName=3DName
+pollen.common.commentAuthor=3DName
 pollen.common.commentText=3DComment
 pollen.common.comments=3DComments about this poll
 pollen.common.csvImport=3DCSV import

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/=
i18n/pollen-ui-struts2_fr_FR.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/p=
ollen-ui-struts2_fr_FR.properties	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/p=
ollen-ui-struts2_fr_FR.properties	2012-04-02 09:29:44 UTC (rev 3223)
@@ -58,7 +58,7 @@
 pollen.common.choice.date=3DDate
 pollen.common.choice.image=3DImage
 pollen.common.choice.text=3DLibell=C3=A9
-pollen.common.commentName=3DNom
+pollen.common.commentAuthor=3DNom
 pollen.common.commentText=3DCommentaire
 pollen.common.comments=3DCommentaire =C3=A0 propos du sondage
 pollen.common.csvImport=3DImport CSV

Deleted: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/o=
rg/chorem/pollen/ui/actions/poll/AddComment-addComment-validation.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/ch=
orem/pollen/ui/actions/poll/AddComment-addComment-validation.xml	2012-04-02 0=
9:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/org/ch=
orem/pollen/ui/actions/poll/AddComment-addComment-validation.xml	2012-04-02 0=
9:29:44 UTC (rev 3223)
@@ -1,46 +0,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<!--
-  #%L
-  Pollen :: UI (strust2)
- =20
-  $Id$
-  $HeadURL$
-  %%
-  Copyright (C) 2009 - 2012 CodeLutin
-  %%
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Affero General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or
-  (at your option) any later version.
- =20
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
- =20
-  You should have received a copy of the GNU Affero General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  #L%
-  -->
-
-
-<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
-  "http://www.opensymphony.com/xwork/xwork-validator-1.0.3.dtd">
-
-<validators>
-
-  <field name=3D"commentName">
-
-    <field-validator type=3D"requiredstring">
-      <message key=3D"pollen.error.comment.name.empty"/>
-    </field-validator>
-  </field>
-
-  <field name=3D"commentText">
-
-    <field-validator type=3D"requiredstring">
-      <message key=3D"pollen.error.comment.text.empty"/>
-    </field-validator>
-  </field>
-
-</validators>
\ No newline at end of file

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB=
-INF/jsp/poll/confirmDeletePollComment.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/j=
sp/poll/confirmDeletePollComment.jsp	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/j=
sp/poll/confirmDeletePollComment.jsp	2012-04-02 09:29:44 UTC (rev 3223)
@@ -33,8 +33,8 @@
   <s:textfield key=3D'comment.postDate' readonly=3D"true" size=3D"50"
                label=3D"%{getText('pollen.common.postDate')}"/>
=20
-  <s:textfield key=3D'comment.pollAccount.votingId' readonly=3D"true" size=
=3D"50"
-               label=3D"%{getText('pollen.common.commentName')}"/>
+  <s:textfield key=3D'comment.author' readonly=3D"true" size=3D"50"
+               label=3D"%{getText('pollen.common.commentAuthor')}"/>
=20
   <s:textarea key=3D'comment.text' readonly=3D"true" rows=3D"3"
               label=3D"%{getText('pollen.common.commentText')}"/>

Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB=
-INF/jsp/poll/vote.jsp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/j=
sp/poll/vote.jsp	2012-04-02 09:29:31 UTC (rev 3222)
+++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/j=
sp/poll/vote.jsp	2012-04-02 09:29:44 UTC (rev 3223)
@@ -472,7 +472,7 @@
         <s:if test=3D"#status.even">class=3D"even"</s:if>
         <s:else>class=3D"odd"</s:else>
         >
-        <s:if test=3D"creatorUser">
+        <s:if test=3D"isDeleteCommentAllowed(#comment)">
           <span class=3D"cmd">
             <s:a href=3D"#"
                  onclick=3D"return openDeleteCommentDialog('%{#comment.topia=
Id}');">
@@ -482,7 +482,7 @@
             </s:a>
           </span>
         </s:if>
-        <span class=3D"name"><s:property value=3D'pollAccount.votingId'/></s=
pan> :
+        <span class=3D"name"><s:property value=3D'#comment.author'/></span> :
         <span class=3D"date">
           <s:property value=3D'%{formatDateTime(postDate)}'/>
         </span>
@@ -530,8 +530,8 @@
   <div id=3D"commentFormDiv">
=20
     <s:form id=3D'addCommentForm' method=3D"POST" namespace=3D"/poll" valida=
te=3D"true">
-      <s:textfield key=3D"commentName" required=3D"true" size=3D"78"
-                   label=3D"%{getText('pollen.common.commentName')}"/>
+      <s:textfield key=3D"commentAuthor" required=3D"true" size=3D"78"
+                   label=3D"%{getText('pollen.common.commentAuthor')}"/>
       <s:textarea key=3D"commentText" required=3D"true" value=3D''
                   label=3D"%{getText('pollen.common.commentText')}"/>
=20


--===============0708414404515210062==--


