Author: lucaa
Date: 2008-02-06 20:21:32 +0100 (Wed, 06 Feb 2008)
New Revision: 7322
Modified:
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/PressReview
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
Log:
XWATCH-13: Allow to send a press review by email
* Added comments checkbox in PressReviewEmailDialog
* Configured comments inclusion in PressReview
Modified:
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
2008-02-06 19:21:32 UTC (rev 7322)
@@ -462,7 +462,7 @@
public void sendEmail(FilterStatus filterStatus, String sendEmailPage,
String mailSubject,
String[] mailTo, String mailContent, boolean
withArticlesContent,
- AsyncCallback cb) {
+ boolean withArticlesComments, AsyncCallback cb) {
Map map = filterStatus.getMap();
map.put("space", watch.getWatchSpace());
map.put("address", mailTo);
@@ -470,7 +470,14 @@
map.put("content", mailContent);
if (withArticlesContent) {
map.put("withcontent", "1");
+ } else {
+ map.put("withcontent", "0");
}
+ if (withArticlesComments) {
+ map.put("withcomments", "1");
+ } else {
+ map.put("withcomments", "0");
+ }
watch.getXWikiServiceInstance().getDocumentContent(sendEmailPage,
true, map, cb);
}
}
Modified:
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/PressReviewMailDialog.java
2008-02-06 19:21:32 UTC (rev 7322)
@@ -35,6 +35,7 @@
protected TextBox mailToTextBox;
protected TextArea mailContentTextArea;
protected CheckBox articlesContentCheckBox;
+ protected CheckBox articlesCommentsCheckBox;
public PressReviewMailDialog(Watch watch, String dialogName, int
buttonModes) {
super(watch, dialogName, buttonModes);
@@ -94,6 +95,12 @@
articlesContentCheckBox.setStyleName(getCSSName("withcontent"));
paramsPanel.add(articlesContentCheckBox);
+ articlesCommentsCheckBox = new CheckBox();
+
articlesCommentsCheckBox.setText(app.getTranslation(getDialogTranslationName()
+ + ".articleswithcomments"));
+ articlesCommentsCheckBox.setStyleName(getCSSName("withcomments"));
+ paramsPanel.add(articlesCommentsCheckBox);
+
return paramsPanel;
}
@@ -113,9 +120,11 @@
String mailSubject = this.mailSubjectTextBox.getText();
String mailContent = this.mailContentTextArea.getText();
boolean withContent = this.articlesContentCheckBox.isChecked();
+ boolean withComments = this.articlesCommentsCheckBox.isChecked();
((Watch)app).getDataManager().sendEmail(((Watch)app).getFilterStatus(),
Constants.DEFAULT_CODE_SPACE + "." +
Constants.PAGE_EMAIL_PRESSREVIEW,
- mailSubject, emailsArray, mailContent, withContent, new
XWikiAsyncCallback(app) {
+ mailSubject, emailsArray, mailContent, withContent,
withComments,
+ new XWikiAsyncCallback(app) {
public void onSuccess(Object result) {
super.onSuccess(result);
setCurrentResult(result);
Modified:
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
===================================================================
---
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/public/Watch.css
2008-02-06 19:21:32 UTC (rev 7322)
@@ -693,14 +693,15 @@
width: 380px;
margin: 0 10px;
}
-span.watch-email-withcontent {
+span.watch-email-withcontent, span.watch-email-withcomments {
margin: 0 10px;
width: 380px;
+ display: block;
}
-span.watch-email-withcontent label {
+span.watch-email-withcontent label, span.watch-email-withcomments label {
margin: 10px 0 0 10px;
}
-span.watch-email-withcontent input {
+span.watch-email-withcontent input, span.watch-email-withcomments input {
margin: 10px 0 0 0;
}
select.gwt-ListBox
Modified:
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/PressReview
===================================================================
---
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/PressReview
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/PressReview
2008-02-06 19:21:32 UTC (rev 7322)
@@ -99,15 +99,17 @@
println "</p>"
}
def comments = itemdoc.getComments(true)
+ if (!"0".equals(request.withcomments)) {
if (comments.size()>0) {
println "<ul class='article-comments'>"
for (comment in comments) {
itemdoc.use(comment)
author = xwiki.getLocalUserName(itemdoc.display("author", "view"))
- println "<li>" + itemdoc.display("comment", "view") + "</li>"
+ println "<li><span class='article-comment'>" +
itemdoc.display("comment", "view") + "</span>
$msg.get("watch.pressreview.by") <span class='article-comment-author'>" +
author + "</span></li>"
}
println "</ul>"
}
+ }
println "</div>"
}
println "{/pre}"
Modified:
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
===================================================================
---
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations
2008-02-06 19:21:32 UTC (rev 7322)
@@ -243,7 +243,8 @@
watch.pressreview.caption=XWiki Watch Press Review
watch.pressreview.invitation=Here is the list of Articles matching the Filters
that were Activated before generating the Press Review:
watch.pressreview.noselection=There is no other Article in this Press Review
-watch.pressreview.in=in
+watch.pressreview.in=in
+watch.pressreview.by=by
watch.articlelist_noarticles=There are no articles for this filter
@@ -305,6 +306,7 @@
watch.email.noaddress=There are no addresses to send email to
watch.email.error=Press Review email sending failed due to the following
reason:
watch.email.articleswithcontent=Include articles content in the Press Review
+watch.email.articleswithcomments=Include articles comments in the Press Review
watch.pressreviewforspace=XWiki Watch Press Review for Space
Modified:
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
===================================================================
---
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
2008-02-06 18:15:08 UTC (rev 7321)
+++
xwiki-products/xwiki-watch/trunk/wiki/src/main/resources/WatchCode/Translations.fr
2008-02-06 19:21:32 UTC (rev 7322)
@@ -231,7 +231,8 @@
watch.pressreview.caption=XWiki Watch Revue de Presse
watch.pressreview.invitation=Voici la liste d'articles correspondant � votre
filtre:
watch.pressreview.noselection=Il n'y a pas de flux dans votre revue de presse
-watch.pressreview.in = dans
+watch.pressreview.in = dans
+watch.pressreview.by=par
watch.articlelist_noarticles=Il n'y a pas d'articles pour ce filtre
@@ -292,6 +293,7 @@
watch.email.noaddress=Vous n'avez renseign� aucune adresse mail
watch.email.error=L'envoi email de la revue de presse a echou� pour la raison
suivante:
watch.email.articleswithcontent = Inclure le contenu des articles dans la
revue de presse
+watch.email.articleswithcomments=Inclure les commentaires sur les articles
dans la revue de presse
watch.pressreviewforspace=XWiki Watch Revue de Presse pour l'espace
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications