Vradi-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
June 2011
- 5 participants
- 30 discussions
r112 - in trunk/vradi-web/src/main: java/org/chorem/vradi java/org/chorem/vradi/actions resources/i18n webapp/WEB-INF/jsp webapp/WEB-INF/jsp/inc
by sletellier@users.chorem.org 30 Jun '11
by sletellier@users.chorem.org 30 Jun '11
30 Jun '11
Author: sletellier
Date: 2011-06-30 16:22:30 +0200 (Thu, 30 Jun 2011)
New Revision: 112
Url: http://chorem.org/repositories/revision/vradi/112
Log:
- Send request email
- Add link to user preference
Added:
trunk/vradi-web/src/main/java/org/chorem/vradi/EmailType.java
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp
Added: trunk/vradi-web/src/main/java/org/chorem/vradi/EmailType.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/EmailType.java (rev 0)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/EmailType.java 2011-06-30 14:22:30 UTC (rev 112)
@@ -0,0 +1,71 @@
+package org.chorem.vradi;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.entities.VradiUser;
+import org.chorem.vradi.services.managers.MailingManager;
+import org.nuiton.i18n.I18n;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import static org.nuiton.i18n.I18n.n_;
+
+public enum EmailType {
+
+ THESAURUS_NEW_CHILD(n_("vradi.template.thesaurus.new.child")),
+ THESAURUS_RENAMED(n_("vradi.template.thesaurus.renamed")),
+ WEBHARVEST(n_("vradi.template.webHarvest")),
+ RSS(n_("vradi.template.rss")),
+ REQUEST(n_("vradi.template.request"));
+
+ protected static final Log log = LogFactory.getLog(EmailType.class);
+ public static final String TITLE_PREFIX = ".title";
+ private String key;
+
+ EmailType(String key) {
+ this.key = key;
+ }
+
+ public boolean sendEmailToAdmins(VradiUser user, String comment, String... args) {
+ List<String> adminEmail = VradiWebConfig.getAdminEmail();
+ return sendEmail(adminEmail, user, comment, args);
+ }
+
+ /**
+ * We consider that i18n is created for key with login and more in args
+ *
+ * @param user ask to send msg
+ * @param comment commentaire à ajouter
+ * @param args to add in message
+ * @return true if send
+ */
+ public boolean sendEmail(Collection<String> recipients, VradiUser user, String comment, String... args) {
+ String title = I18n._(key + TITLE_PREFIX);
+
+ List<String> argsList = new ArrayList<String>();
+ argsList.add(user.getLogin());
+ argsList.add(comment);
+ argsList.addAll(Arrays.asList(args));
+
+ String msg = I18n._(key, argsList.toArray(new String[argsList.size()]));
+ for (String recipient : recipients) {
+ try {
+ MailingManager.postMail(VradiWebConfig.getConfig(), recipient, title, false, msg);
+ if (log.isDebugEnabled()) {
+ log.debug("Mail is sent from '" + user.getLogin() +
+ "' to '" + recipient + "' with title '" +
+ title + "' and body : " + msg);
+ }
+ } catch (Exception eee) {
+ log.error("Failed to send email from '" + user.getLogin() +
+ "' to '" + recipient + "' with title '" +
+ title + "' and body : " + msg, eee);
+ return false;
+ }
+ }
+ return true;
+ }
+}
\ No newline at end of file
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-30 14:22:30 UTC (rev 112)
@@ -69,22 +69,6 @@
}
/**
- * Envoi un mail a chaque recipient avec comme contenu du mail mailContent.
- * Le senders est une adresse on les reponses ne sont pas possible
- * (vradi-noresponse(a)vradi.chorem.org)
- *
- * @param recipient
- * @param mailContent
- */
- public static void sendEmail(Set<String> recipient, String mailContent) {
- String sender = "vradi-noresponse(a)vradi.chorem.org";
- String subject = "Vradi invitation";
- for (String email : recipient) {
- // FIXME poussin 20110601 implanter l'envoi d'email
- }
- }
-
- /**
* Converti le rst dans le format demande
* @param resultType
* @param rst
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java 2011-06-30 14:22:30 UTC (rev 112)
@@ -1,17 +1,10 @@
package org.chorem.vradi.actions;
import org.apache.commons.lang.StringUtils;
-import org.chorem.vradi.VradiWebConfig;
-import org.chorem.vradi.entities.VradiUser;
-import org.chorem.vradi.services.managers.MailingManager;
+import org.chorem.vradi.EmailType;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import static org.nuiton.i18n.I18n._;
-
/**
* Action used for vradi web options page
*
@@ -90,22 +83,22 @@
boolean sent = true;
if (!StringUtils.isEmpty(thesaurusNewChildName)) {
// User propose new thesaurus child
- sent &= EmailType.THESAURUS_NEW_CHILD.sendEmail(getUser(), comment, thesaurusPath, thesaurusNewChildName);
+ sent &= EmailType.THESAURUS_NEW_CHILD.sendEmailToAdmins(getUser(), comment, thesaurusPath, thesaurusNewChildName);
}
if (!StringUtils.isEmpty(thesaurusRenamed)) {
// User propose to rename thesaurus
- sent &= EmailType.THESAURUS_RENAMED.sendEmail(getUser(), comment, thesaurusPath, thesaurusName, thesaurusRenamed);
+ sent &= EmailType.THESAURUS_RENAMED.sendEmailToAdmins(getUser(), comment, thesaurusPath, thesaurusName, thesaurusRenamed);
}
if (webHarvestScript != null) {
// Upload file
String uri = getVradiSession().getFileService().uploadWebHarvestScript(webHarvestScript);
// User propose to add a webharvest script
- sent &= EmailType.WEBHARVEST.sendEmail(getUser(), comment, uri);
+ sent &= EmailType.WEBHARVEST.sendEmailToAdmins(getUser(), comment, uri);
}
if (!StringUtils.isEmpty(rssUrl)) {
// User propose to add an rss
- sent &= EmailType.RSS.sendEmail(getUser(), comment, rssUrl);
+ sent &= EmailType.RSS.sendEmailToAdmins(getUser(), comment, rssUrl);
}
if (sent) {
@@ -115,54 +108,4 @@
}
}
- public enum EmailType {
- THESAURUS_NEW_CHILD("vradi.template.thesaurus.new.child"),
- THESAURUS_RENAMED("vradi.template.thesaurus.renamed"),
- WEBHARVEST("vradi.template.webHarvest"),
- RSS("vradi.template.rss");
-
- public static final String TITLE_PREFIX = ".title";
- private String key;
-
- EmailType(String key) {
- this.key = key;
- }
-
- /**
- * We consider that i18n is created for key with login and more in args
- *
- * @param user ask to send msg
- * @param comment commentaire à ajouter
- * @param args to add in message
- * @return true if send
- */
- public boolean sendEmail(VradiUser user, String comment, String... args) {
- String title = _(key + TITLE_PREFIX);
-
- List<String> argsList = new ArrayList<String>();
- argsList.add(user.getLogin());
- argsList.add(comment);
- argsList.addAll(Arrays.asList(args));
-
- String msg = _(key, argsList.toArray(new String[argsList.size()]));
-
- List<String> adminEmail = VradiWebConfig.getAdminEmail();
- for (String recipient : adminEmail) {
- try {
- MailingManager.postMail(VradiWebConfig.getConfig(), recipient, title, false, msg);
- if (log.isDebugEnabled()) {
- log.debug("Mail is sent from '" + user.getLogin() +
- "' to '" + recipient + "' with title '" +
- title + "' and body : " + msg);
- }
- } catch (Exception eee) {
- log.error("Failed to send email from '" + user.getLogin() +
- "' to '" + recipient + "' with title '" +
- title + "' and body : " + msg, eee);
- return false;
- }
- }
- return true;
- }
- }
}
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 14:22:30 UTC (rev 112)
@@ -9,6 +9,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.EmailType;
import org.chorem.vradi.VradiWebConfig;
import org.chorem.vradi.VradiWebHelper;
import org.chorem.vradi.entities.FormNote;
@@ -181,25 +182,8 @@
log.error(String.format("Url forged for invitation is to long for some navigator '%s'", url));
}
- StringBuilder mailContent = new StringBuilder();
- mailContent.append("Bonjour,\n");
- mailContent.append("\n");
- mailContent.append("Ceci est une invitation pour participer à la creation\n");
- mailContent.append("commune d'information sur un formulaire Vradi.\n");
- mailContent.append("\n");
- mailContent.append("Cette invitation provient de:\n");
- mailContent.append(sender.getInfo());
- mailContent.append("\n\n");
- mailContent.append("Avec le message:\n");
- mailContent.append(message);
- mailContent.append("\n\n");
- mailContent.append("Pour répondre à cette demande veuillez aller sur la page:\n");
- mailContent.append(url);
- mailContent.append("\n\n");
- mailContent.append("Cordialement,");
+ EmailType.REQUEST.sendEmail(recipient, sender, message, url, sender.getInfo());
- VradiWebHelper.sendEmail(recipient, mailContent.toString());
-
return result;
}
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 14:22:30 UTC (rev 112)
@@ -89,3 +89,5 @@
vradi.showInvitation.accept=Accept
vradi.showInvitation.reject=Reject
vradi.showInvitation.noReceived=Do not receved other request from this person
+vradi.noEmail=No email
+vradi.userPreference=User preference
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 14:22:30 UTC (rev 112)
@@ -40,6 +40,7 @@
vradi.login.title=Connection
vradi.logout.submit=Déconnection
vradi.new.formNote=Nouvelle réponse
+vradi.noEmail=Pas d'email
vradi.options=Options
vradi.options.comment=Commentaires
vradi.options.rssUrl=Ajout d'un flux RSS
@@ -73,7 +74,7 @@
vradi.seekingPartners.title=Recherche de partenaires
vradi.send=Envoyer
vradi.sendInvitation.count=Nombre d'invitations envoyés
-vradi.sendInvitation.title=Envoie d'invitation
+vradi.sendInvitation.title=Envoi d'invitation
vradi.show=Afficher
vradi.showInvitation.accept=Accepter
vradi.showInvitation.from=L'invitation provient de \:
@@ -83,17 +84,20 @@
vradi.showInvitation.requestMsg=Le message de l'invitation est \:
vradi.showInvitation.title=Visualisation de l'invitation
vradi.summary=Résumé
-vradi.template.rss=L'utilisateur %1$s à fait la demande d'ajout du flux RSS '%3$s' avec le commentaire suivant \: %2$s
+vradi.template.request=Bonjour,\n\nCeci est une invitation pour participer à la creation commune d'information sur un formulaire Vradi.\n\nCette invitation provient de\:\n%4$s\n\nAvec le message\:\n%2$s\n\nPour répondre à cette demande veuillez aller sur la page\:'%3$s'\n"\n\nCordialement.
+vradi.template.request.title=[Vradi web] Vradi invitation
+vradi.template.rss=L'utilisateur %1$s à fait la demande d'ajout du flux RSS '%3$s' avec le commentaire suivant \: \n%2$s
vradi.template.rss.title=[Vradi web] Demande d'ajout d'un flux RSS
-vradi.template.thesaurus.new.child=L'utilisateur %1$s à fait la demande d'ajout d'un thesaurus pour le chemin '%3$s' qui aura pour nom '%4$s' avec le commentaire suivant \: %2$s
+vradi.template.thesaurus.new.child=L'utilisateur %1$s à fait la demande d'ajout d'un thesaurus pour le chemin '%3$s' qui aura pour nom '%4$s' avec le commentaire suivant \: \n%2$s
vradi.template.thesaurus.new.child.title=[Vradi web] Demande d'ajout d'un thesaurus
-vradi.template.thesaurus.renamed=L'utilisateur %1$s à fait la demande de renomage d'un thesaurus pour le chemin '%3$s' qui avais le nom '%4$s' avec pour nouveau nom '%5$s' avec le commentaire suivant \: %2$s
+vradi.template.thesaurus.renamed=L'utilisateur %1$s à fait la demande de renomage d'un thesaurus pour le chemin '%3$s' qui avais le nom '%4$s' avec pour nouveau nom '%5$s' avec le commentaire suivant \: \n%2$s
vradi.template.thesaurus.renamed.title=[Vradi web] Demande de renomage d'un thesaurus
-vradi.template.webHarvest=L'utilisateur %1$s à fait la demande d'ajout du script webHarvest disponible à l'adresse '%3$s' avec le commentaire suivant \: %2$s
+vradi.template.webHarvest=L'utilisateur %1$s à fait la demande d'ajout du script webHarvest disponible à l'adresse '%3$s' avec le commentaire suivant \: \n%2$s
vradi.template.webHarvest.title=[Vradi web] Demande d'ajout d'un script webHarvest
vradi.thesaurus.path=Chemin du descripteur \:
vradi.thesaurus.thesaurusNewChildName=Nom du nouveau fils pour le descripteur séléctionné
vradi.thesaurus.thesaurusRenamed=Nouveau nom du descripteur séléctionné
vradi.title=Vradi Web
-vradi.user.noinfo=
+vradi.user.noinfo=Pas d'info
+vradi.userPreference=Préférence de l'utilisateur
vradi.userPreference.info=Text complémentaire à envoyer en plus de l'abstract lors de la demande
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp 2011-06-30 14:22:30 UTC (rev 112)
@@ -10,6 +10,9 @@
VradiSession vradiSession = VradiSession.getVradiSession(session);
VradiUser user = vradiSession.getUser();
ActionContext.getContext().put("logged", user != null);
+ if (user != null) {
+ ActionContext.getContext().put("userId", user.getWikittyId());
+ }
String requestURI = request.getRequestURI();
boolean isSearchView = requestURI.contains("searchView");
@@ -17,6 +20,9 @@
boolean isOption = requestURI.contains("option");
ActionContext.getContext().put("isNotOptionPage", !isOption);
+
+ boolean isNotUserPreferencePage = requestURI.contains("userPreference");
+ ActionContext.getContext().put("isNotUserPreferencePage", !isNotUserPreferencePage);
%>
<div id="titlePanel">
<h1><s:text name="vradi.title" /></h1>
@@ -29,6 +35,12 @@
<s:text name="vradi.options"/>
</s:a>
</s:if>
+ <s:if test="isNotUserPreferencePage">
+ <s:a id="options"
+ href="/userPreference/%{userId}.action">
+ <s:text name="vradi.userPreference"/>
+ </s:a>
+ </s:if>
<s:if test="isNotSearchViewPage">
<s:a id="searchLink"
action="searchView">
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp 2011-06-30 14:22:30 UTC (rev 112)
@@ -40,8 +40,11 @@
<form id="partnersForm" action="/fragment/userInfo.action">
<s:select size="5" name="userId" list="partners" listKey="wikittyId" listValue="login"/>
+ <s:set id="showText">
+ <s:text name="vradi.show"/>
+ </s:set>
<sj:submit id="partnersSubmit"
- value="Show"
+ value="%{showText}"
targets="partnersInfo" indicator="indicator-partnersInfo"
button="true" buttonIcon="ui-icon-gear"/>
</form>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp 2011-06-30 13:14:25 UTC (rev 111)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp 2011-06-30 14:22:30 UTC (rev 112)
@@ -5,8 +5,8 @@
--%>
<%@page import="org.chorem.vradi.actions.RestoreUserAction"%>
-<%@page import="com.opensymphony.xwork2.ActionContext"%>
<%@page import="org.chorem.vradi.entities.VradiUser"%>
+<%@ page import="static org.nuiton.i18n.I18n._" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
@@ -14,7 +14,7 @@
<%
RestoreUserAction action = RestoreUserAction.getAction();
VradiUser user = action.getUser();
-String email = "no email";
+String email = _("vrado.noEmail");
String info = action.getInfoHtml();
if (user != null) {
email = user.getLogin();
1
0
r111 - in trunk/vradi-web/src: main/java/org/chorem/vradi main/java/org/chorem/vradi/actions main/resources/i18n main/webapp/WEB-INF/jsp test/java/org/chorem/vradi
by sletellier@users.chorem.org 30 Jun '11
by sletellier@users.chorem.org 30 Jun '11
30 Jun '11
Author: sletellier
Date: 2011-06-30 15:14:25 +0200 (Thu, 30 Jun 2011)
New Revision: 111
Url: http://chorem.org/repositories/revision/vradi/111
Log:
- Fix show invitation traduction
- Debug decode method : url was alrady decode by navigator
- Fix npe in escapeSciptBalises method
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
trunk/vradi-web/src/test/java/org/chorem/vradi/VradiWebHelperTest.java
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-30 13:14:25 UTC (rev 111)
@@ -2,15 +2,15 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Set;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.jrst.JRST;
import org.nuiton.util.GZUtil;
-import sun.misc.BASE64Decoder;
-import sun.misc.BASE64Encoder;
/**
* Utilities class
@@ -25,6 +25,9 @@
public static String escapeSciptBalises(String txt) {
// (?s) activ dotall (http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#D…)
+ if (StringUtils.isEmpty(txt)){
+ return StringUtils.EMPTY;
+ }
return txt.replaceAll("(?s)<script.*?>.*</script>", "");
}
@@ -34,10 +37,11 @@
*/
public static String encode(String s) throws IOException {
String encType = "UTF-8";
- BASE64Encoder b64enc = new BASE64Encoder();
+// BASE64Encoder b64enc = new BASE64Encoder();
byte[] gz = GZUtil.stringToBytes(s);
- String gzs = b64enc.encode(gz);
+ byte[] encoded = Base64.encodeBase64(gz);
+ String gzs = new String(encoded, encType);
String result = URLEncoder.encode(gzs, encType);
return result;
@@ -53,10 +57,12 @@
*/
public static String decode(String enc) throws UnsupportedEncodingException, IOException {
String encType = "UTF-8";
- BASE64Decoder b64dec = new BASE64Decoder();
+// BASE64Decoder b64dec = new BASE64Decoder();
- String gzs2 = URLDecoder.decode(enc, encType);
- byte[] gz2 = b64dec.decodeBuffer(gzs2);
+ // Le navigateur decode deja l'url
+// String gzs2 = URLDecoder.decode(enc, encType);
+ byte[] bytes = enc.getBytes(encType);
+ byte[] gz2 = Base64.decodeBase64(bytes);
String result = GZUtil.bytesToString(gz2);
return result;
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 13:14:25 UTC (rev 111)
@@ -175,7 +175,7 @@
info.append(message);
String param = VradiWebHelper.encode(info.toString());
- String url = String.format("http://%s/showInvitation.action?p=%s",
+ String url = String.format("%s/showInvitation.action?p=%s",
VradiWebConfig.getVradiWebServerUrl(), param);
if (url.length() > 2000) {
log.error(String.format("Url forged for invitation is to long for some navigator '%s'", url));
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 13:14:25 UTC (rev 111)
@@ -82,3 +82,10 @@
vradi.userPreference.info=Additional text to be sent in addition to the summary when applying
vradi.sendInvitation.title=Send request
vradi.sendInvitation.count=Number of sended requests
+vradi.showInvitation.title=View request
+vradi.showInvitation.from=Request from \:
+vradi.showInvitation.otherPartners=Other partners are \:
+vradi.showInvitation.requestMsg=Request message \:
+vradi.showInvitation.accept=Accept
+vradi.showInvitation.reject=Reject
+vradi.showInvitation.noReceived=Do not receved other request from this person
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 13:14:25 UTC (rev 111)
@@ -72,7 +72,16 @@
vradi.seekingPartners.seeker=Ceux qui recherche des partenaires pour cette appel d'offre
vradi.seekingPartners.title=Recherche de partenaires
vradi.send=Envoyer
+vradi.sendInvitation.count=Nombre d'invitations envoyés
+vradi.sendInvitation.title=Envoie d'invitation
vradi.show=Afficher
+vradi.showInvitation.accept=Accepter
+vradi.showInvitation.from=L'invitation provient de \:
+vradi.showInvitation.noReceived=Ne plus recevoir d'invitation de cette personne
+vradi.showInvitation.otherPartners=Les autres partenaires sur le projet sont \:
+vradi.showInvitation.reject=Rejeter
+vradi.showInvitation.requestMsg=Le message de l'invitation est \:
+vradi.showInvitation.title=Visualisation de l'invitation
vradi.summary=Résumé
vradi.template.rss=L'utilisateur %1$s à fait la demande d'ajout du flux RSS '%3$s' avec le commentaire suivant \: %2$s
vradi.template.rss.title=[Vradi web] Demande d'ajout d'un flux RSS
@@ -88,5 +97,3 @@
vradi.title=Vradi Web
vradi.user.noinfo=
vradi.userPreference.info=Text complémentaire à envoyer en plus de l'abstract lors de la demande
-vradi.sendInvitation.title=Envoie d'invitation
-vradi.sendInvitation.count=Nombre d'invitations envoyés
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp 2011-06-30 13:14:25 UTC (rev 111)
@@ -28,15 +28,16 @@
<body>
<h1><s:text name="vradi.showInvitation.title" /></h1>
- <div>L'invitation provient de: <%=action.getSender()%>
+ <div>
+ <s:text name="vradi.showInvitation.from"/><%=action.getSender().getLogin()%>
<p>
<%=action.getSenderInfo()%>
</p>
</div>
<div>
- Les autres partenaires sur le projet sont:
-
+ <s:text name="vradi.showInvitation.otherPartners"/>
+
<form id="partnersForm" action="/fragment/userInfo.action">
<s:select size="5" name="userId" list="partners" listKey="wikittyId" listValue="login"/>
<sj:submit id="partnersSubmit"
@@ -50,7 +51,9 @@
</div>
- <div>Le message de l'invitation est:
+ <div>
+ <s:text name="vradi.showInvitation.requestMsg"/>
+
<p><%=action.getMessage()%></p>
</div>
@@ -62,12 +65,12 @@
<sj:a id="rejectButton" href="/rejectInvitation/%{localNoteId}.action"
button="true" buttonIcon="ui-icon-gear">
- <s:text name="vradi.showInvitation.accept"/>
+ <s:text name="vradi.showInvitation.reject"/>
</sj:a>
<sj:a id="noReceivedButton" href="/noReceivedInvitation/%{localSenderId}.action"
button="true" buttonIcon="ui-icon-gear">
- <s:text name="vradi.showInvitation.accept"/>
+ <s:text name="vradi.showInvitation.noReceived"/>
</sj:a>
</div>
Modified: trunk/vradi-web/src/test/java/org/chorem/vradi/VradiWebHelperTest.java
===================================================================
--- trunk/vradi-web/src/test/java/org/chorem/vradi/VradiWebHelperTest.java 2011-06-30 10:27:24 UTC (rev 110)
+++ trunk/vradi-web/src/test/java/org/chorem/vradi/VradiWebHelperTest.java 2011-06-30 13:14:25 UTC (rev 111)
@@ -3,6 +3,8 @@
import junit.framework.Assert;
import org.junit.Test;
+import java.io.IOException;
+
/**
* @author sletellier
*/
1
0
r110 - in trunk/vradi-web/src/main: java/org/chorem/vradi/actions resources/i18n
by sletellier@users.chorem.org 30 Jun '11
by sletellier@users.chorem.org 30 Jun '11
30 Jun '11
Author: sletellier
Date: 2011-06-30 12:27:24 +0200 (Thu, 30 Jun 2011)
New Revision: 110
Url: http://chorem.org/repositories/revision/vradi/110
Log:
- Fix send request translations
- Fix npe
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 10:15:09 UTC (rev 109)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-30 10:27:24 UTC (rev 110)
@@ -84,14 +84,17 @@
}
protected boolean acceptReceiver(VradiUser sender, VradiUser recipient) {
- boolean result = !sender.getNoSend().contains(recipient.getWikittyId());
- result = result && !recipient.getNoReceived().contains(sender.getWikittyId());
+ boolean result = sender.getNoSend() == null ||
+ !sender.getNoSend().contains(recipient.getWikittyId());
+ result = result && (recipient.getNoReceived() == null ||
+ !recipient.getNoReceived().contains(sender.getWikittyId()));
return result;
}
+
/**
* En recherche toutes les personnes a qui envoyer la demande de parteneriat
* Si cette personne souhaite plus recevoir de demande de votre part
- * On que vous ne souhaiter plus lui en envoyer, elle ne sera pas
+ * Ou que vous ne souhaiter plus lui en envoyer, elle ne sera pas
* selectionnee. Ce critere ne s'applique que sur la personne faisant
* l'action de recherche de partenaire et non pas a la liste complete
* des partenaires deja present sur la note.
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 10:15:09 UTC (rev 109)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 10:27:24 UTC (rev 110)
@@ -80,3 +80,5 @@
vradi.seekingPartners.invite=Guests
vradi.seekingPartners.inviteEmail=Guest Email (separated by \',\')
vradi.userPreference.info=Additional text to be sent in addition to the summary when applying
+vradi.sendInvitation.title=Send request
+vradi.sendInvitation.count=Number of sended requests
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 10:15:09 UTC (rev 109)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 10:27:24 UTC (rev 110)
@@ -67,7 +67,7 @@
vradi.seekingPartners.desc=Envoyer la demande à \:
vradi.seekingPartners.formReceiver=Ceux qui ont recu l'appel d'offre
vradi.seekingPartners.invite=Invités
-vradi.seekingPartners.inviteEmail=Emails des invités (séparées par une ',')
+vradi.seekingPartners.inviteEmail=Emails des invités (séparées par des ',')
vradi.seekingPartners.partners=Des partenaires d'une autre réponse
vradi.seekingPartners.seeker=Ceux qui recherche des partenaires pour cette appel d'offre
vradi.seekingPartners.title=Recherche de partenaires
@@ -88,3 +88,5 @@
vradi.title=Vradi Web
vradi.user.noinfo=
vradi.userPreference.info=Text complémentaire à envoyer en plus de l'abstract lors de la demande
+vradi.sendInvitation.title=Envoie d'invitation
+vradi.sendInvitation.count=Nombre d'invitations envoyés
1
0
r109 - in trunk/vradi-web/src/main: java/org/chorem/vradi/actions resources/i18n webapp/WEB-INF/jsp
by sletellier@users.chorem.org 30 Jun '11
by sletellier@users.chorem.org 30 Jun '11
30 Jun '11
Author: sletellier
Date: 2011-06-30 12:15:09 +0200 (Thu, 30 Jun 2011)
New Revision: 109
Url: http://chorem.org/repositories/revision/vradi/109
Log:
Translate formNotes pages
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java
trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java 2011-06-30 09:54:09 UTC (rev 108)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/OptionsAction.java 2011-06-30 10:15:09 UTC (rev 109)
@@ -132,6 +132,7 @@
* We consider that i18n is created for key with login and more in args
*
* @param user ask to send msg
+ * @param comment commentaire à ajouter
* @param args to add in message
* @return true if send
*/
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 09:54:09 UTC (rev 108)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-30 10:15:09 UTC (rev 109)
@@ -54,4 +54,29 @@
vradi.template.thesaurus.renamed=User %1$s ask to rename thesaurus for path '%3$s' was name '%4$s' to name '%5$s' with comment \: %2$s
vradi.template.thesaurus.renamed.title=[Vradi web] Ask to rename thesuaurus
vradi.template.webHarvest=User %1$s ask to add webHarvest script '%3$s' with comment \: %2$s
-vradi.template.webHarvest.title=[Vradi web] Ask to add webHarvest script
\ No newline at end of file
+vradi.template.webHarvest.title=[Vradi web] Ask to add webHarvest script
+vradi.formNoteList.title=Form answers
+vradi.new.formNote=New answer
+vradi.formNote.title=Answer edition
+vradi.formNote.close=Close this answer
+vradi.delete=Delete
+vradi.show=Show
+vradi.formNote.seekingParetner=Seeking partners
+vradi.formNote.seekPartners=Seek partners
+vradi.summary=Summary
+vradi.edit=Edit
+vradi.save=Save
+vradi.files=Files
+vradi.add=Add
+vradi.send=Send
+vradi.addfiles.name=File name
+vradi.addfiles.description=File descrition
+vradi.addfiles.content=File to add
+vradi.seekingPartners.title=Partner search
+vradi.seekingPartners.desc=Send the request to :
+vradi.seekingPartners.formReceiver=Those who received the tender
+vradi.seekingPartners.seeker=Who is looking for partners for this tender
+vradi.seekingPartners.partners=Partners from another answer
+vradi.seekingPartners.invite=Guests
+vradi.seekingPartners.inviteEmail=Guest Email (separated by \',\')
+vradi.userPreference.info=Additional text to be sent in addition to the summary when applying
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 09:54:09 UTC (rev 108)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-30 10:15:09 UTC (rev 109)
@@ -1,6 +1,10 @@
vradi.action.locale.english=Anglais
vradi.action.locale.french=Français
vradi.action.submit=Soumettre aux administrateurs
+vradi.add=Ajouter
+vradi.addfiles.content=Fichier à ajouter
+vradi.addfiles.description=Descrition du fichier
+vradi.addfiles.name=Nom du fichier
vradi.authentification.error=Erreur lors de l'authentification
vradi.config.configFileName.description=Fichier de configuration de Vradi web
vradi.config.database.version.description=Version de la base de donnée
@@ -8,7 +12,11 @@
vradi.config.remote.endpoint.description=Url de l'addresse de Vradi service
vradi.config.ui.locale=Locale de l'instance de Vradi web
vradi.config.version.description=Version de Vradi web
+vradi.config.web.server.address.description=Adresse du server Vradi
+vradi.delete=Suppression
+vradi.edit=Edition
vradi.error.internal=Une erreur interne est survenue, merci de contacter un administrateur si cette erreur persiste
+vradi.files=Fichiers
vradi.footer.bugreport=Rapport de bug
vradi.footer.license=Licence AGPL
vradi.footer.userSupport=Support utilisateur
@@ -19,6 +27,11 @@
vradi.form.creationDate=Date de création
vradi.form.editAction=Editer
vradi.form.object=Objet
+vradi.formNote.close=Fermer la réponse
+vradi.formNote.seekPartners=Recherche de partenaires
+vradi.formNote.seekingPartner=Partenaires recherchés
+vradi.formNote.title=Edition de la réponse
+vradi.formNoteList.title=Réponses du formulaire
vradi.formView.title=Visualisation d'un formulaire
vradi.login.email=Email
vradi.login.password=Mot de passe
@@ -26,6 +39,7 @@
vradi.login.submit=Connection
vradi.login.title=Connection
vradi.logout.submit=Déconnection
+vradi.new.formNote=Nouvelle réponse
vradi.options=Options
vradi.options.comment=Commentaires
vradi.options.rssUrl=Ajout d'un flux RSS
@@ -40,6 +54,7 @@
vradi.register.pwdDontMatch=Les mots de passe sont différents
vradi.register.submit=S'enregistrer
vradi.register.title=S'enregistrer
+vradi.save=Sauvegarder
vradi.search.activateQuery=Activer
vradi.search.formNoteEdit=Edition des notes
vradi.search.link=Retour à la page de recherche
@@ -49,6 +64,16 @@
vradi.search.thesaurusFilterButton=Filtrer
vradi.search.title=Recherche
vradi.search.unActivateQuery=Desactiver
+vradi.seekingPartners.desc=Envoyer la demande à \:
+vradi.seekingPartners.formReceiver=Ceux qui ont recu l'appel d'offre
+vradi.seekingPartners.invite=Invités
+vradi.seekingPartners.inviteEmail=Emails des invités (séparées par une ',')
+vradi.seekingPartners.partners=Des partenaires d'une autre réponse
+vradi.seekingPartners.seeker=Ceux qui recherche des partenaires pour cette appel d'offre
+vradi.seekingPartners.title=Recherche de partenaires
+vradi.send=Envoyer
+vradi.show=Afficher
+vradi.summary=Résumé
vradi.template.rss=L'utilisateur %1$s à fait la demande d'ajout du flux RSS '%3$s' avec le commentaire suivant \: %2$s
vradi.template.rss.title=[Vradi web] Demande d'ajout d'un flux RSS
vradi.template.thesaurus.new.child=L'utilisateur %1$s à fait la demande d'ajout d'un thesaurus pour le chemin '%3$s' qui aura pour nom '%4$s' avec le commentaire suivant \: %2$s
@@ -62,3 +87,4 @@
vradi.thesaurus.thesaurusRenamed=Nouveau nom du descripteur séléctionné
vradi.title=Vradi Web
vradi.user.noinfo=
+vradi.userPreference.info=Text complémentaire à envoyer en plus de l'abstract lors de la demande
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-30 09:54:09 UTC (rev 108)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-30 10:15:09 UTC (rev 109)
@@ -60,8 +60,11 @@
<div>
<form id="partnersForm" action="/fragment/userInfo.action">
<s:select size="5" name="userId" list="partners" listKey="wikittyId" listValue="login"/>
+ <s:set id="showText">
+ <s:text name="vradi.show"/>
+ </s:set>
<sj:submit id="partnersSubmit"
- value="Show"
+ label="%{showText}"
targets="partnersInfo" indicator="indicator-partnersInfo"
button="true" buttonIcon="ui-icon-gear"/>
</form>
@@ -70,15 +73,32 @@
</div>
<s:a action="seekPartners/%{localNoteId}"><s:text name="vradi.formNote.seekPartners" /></s:a>
- <s:checkbox label="seeking partners" name="formNote.seekingPartners" value="%{localSeekingPartner}"
+
+ <s:set id="seekingPartnerText">
+ <s:text name="vradi.formNote.seekingPartner"/>
+ </s:set>
+ <s:checkbox label="%{seekingPartnerText}"
+ name="formNote.seekingPartners" value="%{localSeekingPartner}"
onchange="var url='/ajax/edit/%{localNoteId}.action?%{localFieldSeekingPartner}='+this.checked; var xhr=new XMLHttpRequest(); xhr.open('GET', url, true);xhr.send(null);"/>
</div>
+ <s:set id="saveText">
+ <s:text name="vradi.save"/>
+ </s:set>
+
+ <s:set id="summaryText">
+ <s:text name="vradi.summary"/>
+ </s:set>
+
+ <s:set id="editText">
+ <s:text name="vradi.edit"/>
+ </s:set>
+
<div>
<sj:tabbedpanel id="tabContainerSummary" animate="true"
collapsible="true" useSelectedTabCookie="true">
- <sj:tab id="tabHtmlSummary" target="htmlSummary" label="Summary"/>
- <sj:tab id="tabHtmlSummaryEdit" target="htmlSummaryEdit" label="Edit"/>
+ <sj:tab id="tabHtmlSummary" target="htmlSummary" label="%{summaryText}"/>
+ <sj:tab id="tabHtmlSummaryEdit" target="htmlSummaryEdit" label="%{editText}"/>
<sj:div id="htmlSummary"
href="/ajax/rst.action?id=%{localNoteId}&field=%{localFieldSummary}"
listenTopics="updateHtmlSummary">
@@ -90,7 +110,7 @@
<s:hidden name="field" value="%{localFieldSummary}"/>
<s:textarea name="rst" value="%{localSummary}"/>
<sj:submit id="htmlSummaryEditSubmit"
- value="Save"
+ value="%{saveText}"
targets="result"
onCompleteTopics="updateHtmlSummary"
indicator="indicator-htmlSummary"
@@ -103,9 +123,9 @@
<div>
<sj:tabbedpanel id="tabContainerContent" animate="true"
collapsible="true" useSelectedTabCookie="true">
- <sj:tab id="tabHtmlContent" target="htmlContent" label="Summary"/>
- <sj:tab id="tabHtmlContentEdit" target="htmlContentEdit" label="Edit"/>
- <div id="htmlContent" >
+ <sj:tab id="tabHtmlContent" target="htmlContent" label="%{summaryText}"/>
+ <sj:tab id="tabHtmlContentEdit" target="htmlContentEdit" label="%{editText}"/>
+ <div id="htmlContent">
<img id="indicator-htmlContent" src="/img/indicator.gif" alt="Loading..." style="display:none"/>
<%=action.getContent()%>
</div>
@@ -115,8 +135,9 @@
<s:hidden name="field" value="%{localFieldSummary}"/>
<s:textarea name="content" value="%{localContent}"/>
<sj:submit id="htmlContentEditSubmit" formIds="htmlContentEditForm"
- value="Save"
- targets="htmlContent" indicator="indicator-htmlContent"
+ value="%{saveText}"
+ targets="htmlContent"
+ indicator="indicator-htmlContent"
button="true" buttonIcon="ui-icon-gear"/>
</form>
</div>
@@ -126,8 +147,16 @@
<div>
<sj:tabbedpanel id="tabContainerFiles" animate="true"
collapsible="true" useSelectedTabCookie="true">
- <sj:tab id="tabFiles" target="files" label="Files"/>
- <sj:tab id="tabAddFiles" target="addFiles" label="Add"/>
+ <s:set id="filesText">
+ <s:text name="vradi.files"/>
+ </s:set>
+
+ <s:set id="addText">
+ <s:text name="vradi.add"/>
+ </s:set>
+
+ <sj:tab id="tabFiles" target="files" label="%{filesText}"/>
+ <sj:tab id="tabAddFiles" target="addFiles" label="%{addText}"/>
<div id="files">
<sj:div href="/fragment/attachmentList/%{localNoteId}.action"
indicator="indicator-files">
@@ -141,7 +170,7 @@
<s:textarea name="description" key="vradi.addfiles.description"/>
<s:file name="content" key="vradi.addfiles.content" required="true"/>
<sj:submit id="addFilesSubmit" formIds="addFilesForm"
- value="Save"
+ value="%{saveText}"
targets="files" onCompleteTopics=""
indicator="indicator-addFiles"
button="true" buttonIcon="ui-icon-gear"/>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp 2011-06-30 09:54:09 UTC (rev 108)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp 2011-06-30 10:15:09 UTC (rev 109)
@@ -36,11 +36,15 @@
<s:checkbox name="seeker" key="vradi.seekingPartners.seeker"/>
<s:checkbox name="partners" key="vradi.seekingPartners.partners"/>
<s:select size="5" multiple="true" name="userId" list="%{localPartners}" listKey="wikittyId" listValue="login"/>
+
+ <s:set id="showText">
+ <s:text name="vradi.show"/>
+ </s:set>
<sj:submit
id="partnersShowSubmit"
href="/fragment/partnerInfo.action"
targets="partnersShowResult"
- value="Show"
+ value="%{showText}"
indicator="indicator-partnersShowResult"
button="true"
/>
@@ -53,6 +57,10 @@
<s:textarea name="message"
value="%{localNoteSummary}" key="vradi.userPreference.info"/>
+ <s:set id="sendText">
+ <s:text name="vradi.send"/>
+ </s:set>
+ <s:submit value="%{sendText}"/>
</s:form>
</body>
</html>
1
0
r108 - trunk/vradi-services/src/test/java/org/chorem/vradi/services
by echatellier@users.chorem.org 30 Jun '11
by echatellier@users.chorem.org 30 Jun '11
30 Jun '11
Author: echatellier
Date: 2011-06-30 11:54:09 +0200 (Thu, 30 Jun 2011)
New Revision: 108
Url: http://chorem.org/repositories/revision/vradi/108
Log:
A mon avis le test ?\195?\169tait faux, il ne fonctionnait pas dans lucene
et je ne comprenait pas comment il pouvait fonctionner dans solr (mais il marchait)
Modified:
trunk/vradi-services/src/test/java/org/chorem/vradi/services/VradiStorageServiceTest.java
Modified: trunk/vradi-services/src/test/java/org/chorem/vradi/services/VradiStorageServiceTest.java
===================================================================
--- trunk/vradi-services/src/test/java/org/chorem/vradi/services/VradiStorageServiceTest.java 2011-06-29 15:30:49 UTC (rev 107)
+++ trunk/vradi-services/src/test/java/org/chorem/vradi/services/VradiStorageServiceTest.java 2011-06-30 09:54:09 UTC (rev 108)
@@ -1699,8 +1699,10 @@
Group testGroup = new GroupImpl();
testGroup.setName("Zahia fans");
+ // la requete porte sur le terme BETON qui est présent dans
+ // une des annonces
Query query = new QueryImpl();
- query.setContent("ALONZEAU");
+ query.setContent("BETON");
query.setName("tata");
query.setDescription("titi");
@@ -1720,8 +1722,9 @@
//Select form and try again
FormPagedResult formPagedResult = new FormPagedResult();
- QueryParameters queryParameters = new QueryParameters("ALONZEAU");
+ QueryParameters queryParameters = new QueryParameters("BETON");
formPagedResult = dataService.findForms(queryParameters, formPagedResult);
+ Assert.assertEquals(1, formPagedResult.getFormsIdsToShow().size());
List<String> formsIds = formPagedResult.getFormsIdsToShow();
List<Form> forms = wikittyProxy.restore(Form.class, formsIds);
for (Form form : forms) {
1
0
r107 - in trunk/vradi-web/src/main: java/org/chorem/vradi java/org/chorem/vradi/actions resources webapp/WEB-INF/jsp
by bpoussin@users.chorem.org 30 Jun '11
by bpoussin@users.chorem.org 30 Jun '11
30 Jun '11
Author: bpoussin
Date: 2011-06-29 17:30:49 +0200 (Wed, 29 Jun 2011)
New Revision: 107
Url: http://chorem.org/repositories/revision/vradi/107
Log:
commit pour que sylvain reprenne la suite
Added:
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RawAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SeekPartnersAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/ShowInvitationAction.java
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/sendInvitation.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebConfig.java
trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/AttachmentAddAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RSTAction.java
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java
trunk/vradi-web/src/main/resources/struts.xml
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/attachmentList.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userPreference.jsp
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebConfig.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebConfig.java 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebConfig.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -92,6 +92,10 @@
return getConfig().getOption(VradiWebOption.VRADI_VERSION.getKey());
}
+ public static String getVradiWebServerUrl() {
+ return getConfig().getOption(VradiWebOption.WEB_SERVER_URL.getKey());
+ }
+
/** Vradi option enum. */
public enum VradiWebOption implements ApplicationConfig.OptionDef {
@@ -122,6 +126,13 @@
Locale.FRANCE.toString(),
Locale.class, false, false),
+ // l'url public pour acceder au serveur web vradi (ex: http://vradi.chorem.org/vradi-web)
+ // il est possible d'avoir le port d'indique (ex: https://vradi.chorem.org:443)
+ WEB_SERVER_URL(
+ "vradi.web.server.address",
+ _("vradi.config.web.server.address.description"),
+ "http://localhost:8080", String.class, false, false),
+
// achitecture client serveur
REMOTE_ENDPOINT(
"vradi.remote.endpoint",
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/VradiWebHelper.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -1,5 +1,17 @@
package org.chorem.vradi;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jrst.JRST;
+import org.nuiton.util.GZUtil;
+import sun.misc.BASE64Decoder;
+import sun.misc.BASE64Encoder;
+
/**
* Utilities class
*
@@ -7,9 +19,86 @@
*/
public class VradiWebHelper {
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VradiWebHelper.class);
+
public static String escapeSciptBalises(String txt) {
// (?s) activ dotall (http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#D…)
- return txt.replaceAll("(?s)<script>.*</script>", "");
+ return txt.replaceAll("(?s)<script.*?>.*</script>", "");
}
+
+ /**
+ * Compresse en gzip la string passee en parametre, la passe en base64
+ * et l'encode pour passer comme parametre d'une url
+ */
+ public static String encode(String s) throws IOException {
+ String encType = "UTF-8";
+ BASE64Encoder b64enc = new BASE64Encoder();
+
+ byte[] gz = GZUtil.stringToBytes(s);
+ String gzs = b64enc.encode(gz);
+ String result = URLEncoder.encode(gzs, encType);
+
+ return result;
+ }
+
+ /**
+ * Methode inverse de {@link #encode(java.lang.String).
+ *
+ * @param enc la chaine a decoder
+ * @return
+ * @throws UnsupportedEncodingException
+ * @throws IOException
+ */
+ public static String decode(String enc) throws UnsupportedEncodingException, IOException {
+ String encType = "UTF-8";
+ BASE64Decoder b64dec = new BASE64Decoder();
+
+ String gzs2 = URLDecoder.decode(enc, encType);
+ byte[] gz2 = b64dec.decodeBuffer(gzs2);
+ String result = GZUtil.bytesToString(gz2);
+
+ return result;
+ }
+
+ /**
+ * Envoi un mail a chaque recipient avec comme contenu du mail mailContent.
+ * Le senders est une adresse on les reponses ne sont pas possible
+ * (vradi-noresponse(a)vradi.chorem.org)
+ *
+ * @param recipient
+ * @param mailContent
+ */
+ public static void sendEmail(Set<String> recipient, String mailContent) {
+ String sender = "vradi-noresponse(a)vradi.chorem.org";
+ String subject = "Vradi invitation";
+ for (String email : recipient) {
+ // FIXME poussin 20110601 implanter l'envoi d'email
+ }
+ }
+
+ /**
+ * Converti le rst dans le format demande
+ * @param resultType
+ * @param rst
+ * @return
+ */
+ public static String rstTo(String resultType, String rst) {
+ String result = rst;
+ try {
+ // si on arrive pas a faire la generation a partir du rst
+ // on renvoi le champs en brut
+ result = JRST.generate(resultType, rst);
+ } catch(Exception eee) {
+ log.info("Can't generate from RST", eee);
+ // on a pas reussi a genere le HTML, le texte doit donc etre mis
+ // dans un element <pre> pour une meilleur presentation
+ if (result == null) {
+ result = "Can't be generate from null string";
+ }
+ result = "<pre>" + escapeSciptBalises(rst) + "</pre>";
+ }
+ return result;
+ }
}
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/AttachmentAddAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/AttachmentAddAction.java 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/AttachmentAddAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -81,7 +81,7 @@
attachment.setName(name);
}
if (!StringUtils.isEmpty(description)) {
- attachment.setName(description);
+ attachment.setDescription(description);
}
proxy.store(attachment);
}
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RSTAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RSTAction.java 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RSTAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -4,6 +4,7 @@
import java.io.StringBufferInputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.VradiWebHelper;
import org.nuiton.jrst.JRST;
import org.nuiton.wikitty.WikittyProxy;
import org.nuiton.wikitty.entities.Wikitty;
@@ -85,36 +86,27 @@
@Override
public String execute() throws Exception {
// si on arrive pas a lire l'objet ou le champs on renvoie ca
- try {
- if (isAcceptable(field)) {
- WikittyProxy proxy = getProxy();
- Wikitty w = proxy.restore(getId());
- String ext = WikittyExtension.extractExtensionName(field);
- String fieldName = WikittyExtension.extractFieldName(field);
+ if (isAcceptable(field)) {
+ WikittyProxy proxy = getProxy();
+ Wikitty w = proxy.restore(getId());
+ String ext = WikittyExtension.extractExtensionName(field);
+ String fieldName = WikittyExtension.extractFieldName(field);
- if (rst != null) {
- // rst est renseigne, on commence par mettre a jour le champs
- w.setField(ext, fieldName, rst);
- proxy.store(w);
- }
- // on recupere la valeur du champs
- rst = w.getFieldAsString(ext, fieldName);
-
- // si on arrive pas a faire la generation a partir du champs
- // on renvoi le champs en brut
- rst = JRST.generate(rstResultType, rst);
- } else {
- rst = "<pre>Not acceptable field</pre>";
+ if (rst != null) {
+ // rst est renseigne, on commence par mettre a jour le champs
+ w.setField(ext, fieldName, rst);
+ proxy.store(w);
}
- } catch(Exception eee) {
- log.info("Can't generate HTML from RST", eee);
- // on a pas reussi a genere le HTML, le texte doit donc etre mis
- // dans un element <pre> pour une meilleur presentation
- if (rst == null) {
- rst = "Can't be generate";
- }
- rst = "<pre>" + rst + "</pre>";
+ // on recupere la valeur du champs
+ rst = w.getFieldAsString(ext, fieldName);
+
+ // si on arrive pas a faire la generation a partir du champs
+ // on renvoi le champs en brut
+ rst = VradiWebHelper.rstTo(rstResultType, rst);
+ } else {
+ rst = "<pre>Not acceptable field</pre>";
}
+
rstResult = new StringBufferInputStream(rst);
return SUCCESS;
}
Added: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RawAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RawAction.java (rev 0)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RawAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,103 @@
+package org.chorem.vradi.actions;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.entities.AttachmentHelper;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.entities.Wikitty;
+import org.nuiton.wikitty.entities.WikittyExtension;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class RawAction extends AbstractEditAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(RawAction.class);
+
+ protected String id;
+ protected String fqField;
+ protected String filename;
+ /** result stream */
+ protected InputStream content;
+ /** rstResultType */
+ protected String mimeType;
+ protected int contentLength;
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setFqField(String fqField) {
+ this.fqField = fqField;
+ }
+
+ public String getFilename() {
+ return filename;
+ }
+
+ public InputStream getContent() {
+ return content;
+ }
+
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ public int getContentLength() {
+ return contentLength;
+ }
+
+ @Override
+ public String execute() throws Exception {
+ String result = SUCCESS;
+ WikittyProxy proxy = getProxy();
+ Wikitty w = proxy.restore(id);
+ if (w == null) {
+ log.error(String.format("Wikitty with id '%s' doesn't exist", id));
+ } else {
+ try {
+ if (isAcceptable(fqField)) {
+ if (w.hasField(fqField)) {
+ String ext = WikittyExtension.extractExtensionName(fqField);
+ String field = WikittyExtension.extractFieldName(fqField);
+ byte[] b = w.getFieldAsBytes(ext, field);
+ content = new ByteArrayInputStream(b);
+ contentLength = b.length;
+ if (AttachmentHelper.hasExtension(w)) {
+ filename = AttachmentHelper.getName(w);
+ mimeType = AttachmentHelper.getMimetype(w);
+ }
+
+ if (filename == null) {
+ filename = "vradi-file";
+ }
+
+ if (mimeType == null) {
+ // default value
+ mimeType = "application/octet-stream";
+ }
+ } else {
+ log.error(String.format(
+ "field '%s' doesn't exist on this wikitty %s",
+ fqField, w));
+ }
+ }
+ } catch(Exception eee) {
+ log.error("Can't return data", eee);
+ result = ERROR;
+ }
+ }
+ return result;
+ }
+
+
+
+}
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -6,6 +6,7 @@
import java.util.Collections;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.VradiWebHelper;
import org.chorem.vradi.entities.VradiUser;
import org.nuiton.jrst.JRST;
import org.nuiton.wikitty.WikittyProxy;
@@ -64,12 +65,7 @@
if (user.getInfo() == null) {
infoHtml = "<pre>" + _("vradi.user.noinfo") + "</pre>";
} else {
- try {
- infoHtml = JRST.generate(JRST.TYPE_HTML_INNER_BODY, user.getInfo());
- } catch(Exception eee) {
- log.info("Can't generate HTML from RST", eee);
- infoHtml = "<pre>" + user.getInfo() + "</pre>";
- }
+ infoHtml = VradiWebHelper.rstTo(JRST.TYPE_HTML_INNER_BODY, user.getInfo());
}
}
Added: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SeekPartnersAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SeekPartnersAction.java (rev 0)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SeekPartnersAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,80 @@
+package org.chorem.vradi.actions;
+
+import com.opensymphony.xwork2.ActionContext;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.entities.FormNote;
+import org.chorem.vradi.entities.VradiUser;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Criteria;
+import org.nuiton.wikitty.search.PagedResult;
+import org.nuiton.wikitty.search.Search;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SeekPartnersAction extends VradiBaseAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(SeekPartnersAction.class);
+
+ static public SeekPartnersAction getAction() {
+ return (SeekPartnersAction)ActionContext.getContext().get(CONTEXT_ACTION_KEY);
+ }
+
+ protected String noteId;
+ protected FormNote note;
+ protected Set<VradiUser> partners;
+
+ public String getNoteId() {
+ return noteId;
+ }
+
+ public void setNoteId(String noteId) {
+ this.noteId = noteId;
+ }
+
+ public FormNote getNote() {
+ return note;
+ }
+
+ public Set<VradiUser> getPartners() {
+ return partners;
+ }
+
+ @Override
+ public String execute() throws Exception {
+ String result = SUCCESS;
+
+ WikittyProxy proxy = getProxy();
+ note = proxy.restore(FormNote.class, noteId);
+ VradiUser user = getVradiSession().getUser();
+ String userId = user.getWikittyId();
+
+ Criteria c = Search.query()
+ .eq(FormNote.FQ_FIELD_FORMNOTE_PARTNERS, userId)
+ .criteria();
+
+ PagedResult<FormNote> notes = proxy.findAllByCriteria(FormNote.class, c);
+
+ Set<String> partnersId = new HashSet<String>();
+ for (FormNote note : notes) {
+ partnersId.addAll(note.getPartners());
+ }
+
+ partners = proxy.restore(VradiUser.class, partnersId);
+
+ return result;
+ }
+
+
+}
Added: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java (rev 0)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/SendInvitationAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,204 @@
+package org.chorem.vradi.actions;
+
+import com.opensymphony.xwork2.ActionContext;
+import freemarker.template.utility.Collections12;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.VradiWebConfig;
+import org.chorem.vradi.VradiWebHelper;
+import org.chorem.vradi.entities.FormNote;
+import org.chorem.vradi.entities.VradiUser;
+import org.nuiton.util.CollectionUtil;
+import org.nuiton.wikitty.WikittyProxy;
+import org.nuiton.wikitty.search.Criteria;
+import org.nuiton.wikitty.search.PagedResult;
+import org.nuiton.wikitty.search.Search;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SendInvitationAction extends VradiBaseAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(SendInvitationAction.class);
+
+ static public SendInvitationAction getAction() {
+ return (SendInvitationAction)ActionContext.getContext().get(CONTEXT_ACTION_KEY);
+ }
+
+ protected String noteId;
+ protected boolean formReceiver;
+ protected boolean seeker;
+ protected boolean partners;
+ protected String[] userId;
+ protected boolean invite;
+ protected String inviteEmail;
+ protected String message;
+
+ protected int sendCount;
+
+ public void setNoteId(String noteId) {
+ this.noteId = noteId;
+ }
+
+ public void setFormReceiver(boolean formReceiver) {
+ this.formReceiver = formReceiver;
+ }
+
+ public void setSeeker(boolean seeker) {
+ this.seeker = seeker;
+ }
+
+ public void setPartners(boolean partners) {
+ this.partners = partners;
+ }
+
+ public void setUserId(String[] userId) {
+ this.userId = userId;
+ }
+
+ public void setInvite(boolean invite) {
+ this.invite = invite;
+ }
+
+ public void setInviteEmail(String inviteEmail) {
+ this.inviteEmail = inviteEmail;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public int getSendCount() {
+ return sendCount;
+ }
+
+ protected boolean acceptReceiver(VradiUser sender, VradiUser recipient) {
+ boolean result = !sender.getNoSend().contains(recipient.getWikittyId());
+ result = result && !recipient.getNoReceived().contains(sender.getWikittyId());
+ return result;
+ }
+ /**
+ * En recherche toutes les personnes a qui envoyer la demande de parteneriat
+ * Si cette personne souhaite plus recevoir de demande de votre part
+ * On que vous ne souhaiter plus lui en envoyer, elle ne sera pas
+ * selectionnee. Ce critere ne s'applique que sur la personne faisant
+ * l'action de recherche de partenaire et non pas a la liste complete
+ * des partenaires deja present sur la note.
+ *
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public String execute() throws Exception {
+ String result = SUCCESS;
+
+ WikittyProxy proxy = getProxy();
+ VradiUser sender = getVradiSession().getUser();
+ FormNote note = proxy.restore(FormNote.class, noteId);
+
+ Set<String> recipient = new HashSet<String>();
+
+ if (formReceiver) {
+ Criteria c = Search.query()
+ // FIXME ajouter le critere de recherche des personnes ayant recu ce formulaire
+ .criteria();
+
+ PagedResult<VradiUser> users = proxy.findAllByCriteria(VradiUser.class, c);
+ for (VradiUser user : users) {
+ if (acceptReceiver(sender, user)) {
+ String email = user.getEmail();
+ recipient.add(email);
+ }
+ }
+ }
+
+ if (seeker) {
+ Criteria c = Search.query()
+ // FIXME ajouter le critere de recherche des personnes ayant une note sur ce formulaire avec la case seekingPartners a true
+ .criteria();
+
+ PagedResult<FormNote> notes = proxy.findAllByCriteria(FormNote.class, c);
+ Set<String> userIds = new HashSet<String>();
+ for (FormNote n : notes) {
+ userIds.addAll(n.getPartners());
+ }
+ Set<VradiUser> users = proxy.restore(VradiUser.class, userIds);
+ for (VradiUser user : users) {
+ if (acceptReceiver(sender, user)) {
+ String email = user.getEmail();
+ recipient.add(email);
+ }
+ }
+ }
+
+ if (partners) {
+ List<VradiUser> users = proxy.restore(VradiUser.class, Arrays.asList(userId));
+ for (VradiUser user : users) {
+ if (acceptReceiver(sender, user)) {
+ String email = user.getEmail();
+ recipient.add(email);
+ }
+ }
+ }
+
+ if (invite) {
+ String[] inviteEmails = inviteEmail.split(",");
+ for (String email : inviteEmails) {
+ email = StringUtils.trimToNull(email);
+ if (email != null) {
+ recipient.add(email);
+ }
+ }
+ }
+
+ StringBuilder info = new StringBuilder();
+ info.append(noteId);
+ info.append("\n");
+ info.append(sender.getWikittyId());
+ info.append("\n");
+ info.append(StringUtils.join(note.getPartners(), ","));
+ info.append("\n");
+ info.append(message);
+
+ String param = VradiWebHelper.encode(info.toString());
+ String url = String.format("http://%s/showInvitation.action?p=%s",
+ VradiWebConfig.getVradiWebServerUrl(), param);
+ if (url.length() > 2000) {
+ log.error(String.format("Url forged for invitation is to long for some navigator '%s'", url));
+ }
+
+ StringBuilder mailContent = new StringBuilder();
+ mailContent.append("Bonjour,\n");
+ mailContent.append("\n");
+ mailContent.append("Ceci est une invitation pour participer à la creation\n");
+ mailContent.append("commune d'information sur un formulaire Vradi.\n");
+ mailContent.append("\n");
+ mailContent.append("Cette invitation provient de:\n");
+ mailContent.append(sender.getInfo());
+ mailContent.append("\n\n");
+ mailContent.append("Avec le message:\n");
+ mailContent.append(message);
+ mailContent.append("\n\n");
+ mailContent.append("Pour répondre à cette demande veuillez aller sur la page:\n");
+ mailContent.append(url);
+ mailContent.append("\n\n");
+ mailContent.append("Cordialement,");
+
+ VradiWebHelper.sendEmail(recipient, mailContent.toString());
+
+ return result;
+ }
+
+
+}
Added: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/ShowInvitationAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/ShowInvitationAction.java (rev 0)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/ShowInvitationAction.java 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,79 @@
+package org.chorem.vradi.actions;
+
+import com.opensymphony.xwork2.ActionContext;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.vradi.VradiWebHelper;
+import org.chorem.vradi.entities.VradiUser;
+import org.nuiton.jrst.JRST;
+import org.nuiton.wikitty.WikittyProxy;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ShowInvitationAction extends VradiBaseAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ShowInvitationAction.class);
+
+ static public ShowInvitationAction getAction() {
+ return (ShowInvitationAction)ActionContext.getContext().get(CONTEXT_ACTION_KEY);
+ }
+
+ protected String p;
+ protected String noteId;
+ protected VradiUser sender;
+ protected String senderInfo;
+ protected List<VradiUser> partners;
+ protected String message;
+
+ public void setP(String p) {
+ this.p = p;
+ }
+
+ public String getNoteId() {
+ return noteId;
+ }
+
+ public VradiUser getSender() {
+ return sender;
+ }
+
+ public String getSenderInfo() {
+ return senderInfo;
+ }
+
+ public List<VradiUser> getPartners() {
+ return partners;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String execute() throws Exception {
+ String result = SUCCESS;
+
+ WikittyProxy proxy = getProxy();
+
+ String datas = VradiWebHelper.decode(p);
+ String[] info = datas.split("\n", 4);
+
+ noteId = info[0];
+ sender = proxy.restore(VradiUser.class, info[1]);
+ senderInfo = VradiWebHelper.rstTo(JRST.TYPE_HTML_INNER_BODY, sender.getInfo());
+ String[] partnersTab = info[2].split(",");
+ partners = proxy.restore(VradiUser.class, Arrays.asList(partnersTab));
+ message = VradiWebHelper.rstTo(JRST.TYPE_HTML_INNER_BODY, info[3]);
+
+ return result;
+ }
+}
Modified: trunk/vradi-web/src/main/resources/struts.xml
===================================================================
--- trunk/vradi-web/src/main/resources/struts.xml 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/resources/struts.xml 2011-06-29 15:30:49 UTC (rev 107)
@@ -177,6 +177,25 @@
<param name="userId">{1}</param>
<result>/WEB-INF/jsp/userPreference.jsp</result>
</action>
+ <!--
+ | Affiche la page de recherche de partenaire
+ +-->
+ <action name="seekPartners/*" class="org.chorem.vradi.actions.SeekPartnersAction">
+ <param name="noteId">{1}</param>
+ <result>/WEB-INF/jsp/seekPartners.jsp</result>
+ </action>
+ <!--
+ | Envoi la demande de parteneriat aux personnes selectionnees
+ +-->
+ <action name="sendInvitation" class="org.chorem.vradi.actions.SendInvitationAction">
+ <result>/WEB-INF/jsp/sendInvitation.jsp</result>
+ </action>
+ <!--
+ | Affiche l'invitation grace au information de l'url (param p)
+ +-->
+ <action name="showInvitation" class="org.chorem.vradi.actions.ShowInvitationAction">
+ <result>/WEB-INF/jsp/showInvitation.jsp</result>
+ </action>
</package>
<!--
@@ -251,13 +270,30 @@
</package>
+ <!--
+ | Package pour des actions pour des appels ajax qui ne retourne pas du HTML
+ +-->
<package name="ajax" namespace="/ajax" extends="restrictedArea">
<!--
| Essai de generer du HTML a partir d'un champs d'un objet ou du
| parametre 'rst'
+-->
+ <action name="raw/*/*" class="org.chorem.vradi.actions.RawAction">
+ <param name="id">{1}</param>
+ <param name="fqField">{2}</param>
+ <param name="includes">Attachment\.content</param>
+ <result type="stream">
+ <param name="contentDisposition">filename="${filename}"</param>
+ <param name="contentType">${mimeType}</param>
+ <param name="inputName">content</param>
+ </result>
+ </action>
+ <!--
+ | Essai de generer du HTML a partir d'un champs d'un objet ou du
+ | parametre 'rst'
+ +-->
<action name="rst" class="org.chorem.vradi.actions.RSTAction">
- <param name="includes">FormNote\.summary,FormNote\.content</param>
+ <param name="includes">FormNote\.summary,FormNote\.content,VradiUser\.info</param>
<result type="stream">
<param name="contentType">${mimeType}</param>
<param name="inputName">rstResult</param>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/attachmentList.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/attachmentList.jsp 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/attachmentList.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -4,6 +4,7 @@
Author : poussin
--%>
+<%@page import="com.opensymphony.xwork2.ActionContext"%>
<%@page import="org.chorem.vradi.entities.Attachment"%>
<%@page import="org.chorem.vradi.actions.AttachmentListAction"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
@@ -15,12 +16,23 @@
AttachmentListAction action = AttachmentListAction.getAction();
%>
+<div id="actionResult" style="display: none;"></div>
+
<ul>
- <% for (Attachment a : action.getAttachments()) { %>
- <li><%=a.getDate()%> <%=a.getName()%>
- <s:a action="" label="vradi.attachment.update"></s:a>
- <s:a action="" label="vradi.attachment.history"></s:a>
- <s:a action="" label="vradi.attachment.delete"></s:a>
+ <% for (Attachment a : action.getAttachments()) {
+ ActionContext.getContext().put("localAttachmentId", a.getWikittyId());
+ %>
+
+ <li><%=a.getDate()%><a href="/ajax/raw/<%=a.getWikittyId()%>/Attachment.content.action"><%=a.getName()%></a>
+
+ <s:a action="/ajax/raw/%{}/Attachment.content" key="vradi.attachment.update"></s:a>
+ <s:a action="" key="vradi.attachment.history"></s:a>
+ <sj:a id="deleteAttachment-%{localAttachmentId}" href="/ajax/delete/%{localAttachmentId}"
+ targets="actionResult" indicator="indicator-deleteAttachment-%{localAttachmentId}"
+ button="true" buttonIcon="ui-icon-gear">
+ <s:text name="vradi.attachment.delete"/>
+ </sj:a>
+ <img id="indicator-deleteAttachment-<%=a.getWikittyId()%>" src="/img/indicator.gif" alt="deleting..." style="display:none"/>
</li>
<% } %>
</ul>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -71,7 +71,7 @@
<s:a action="seekPartners/%{localNoteId}"><s:text name="vradi.formNote.seekPartners" /></s:a>
<s:checkbox label="seeking partners" name="formNote.seekingPartners" value="%{localSeekingPartner}"
- onchange="var url='/ajax/edit/%{localNoteId}.action?%{localFieldSeekingPartner}='+this.checked; var xhr=new XMLHttpRequest(); xhr.open('GET', url, true);xhr.send(null); alert(url);"/>
+ onchange="var url='/ajax/edit/%{localNoteId}.action?%{localFieldSeekingPartner}='+this.checked; var xhr=new XMLHttpRequest(); xhr.open('GET', url, true);xhr.send(null);"/>
</div>
<div>
Added: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp (rev 0)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/seekPartners.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,58 @@
+<%--
+ Document : seekPartners
+ Created on : 31 mai 2011, 19:33:28
+ Author : poussin
+--%>
+
+<%@page import="com.opensymphony.xwork2.ActionContext"%>
+<%@page import="org.chorem.vradi.actions.SeekPartnersAction"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<%@taglib prefix="s" uri="/struts-tags"%>
+<%@taglib prefix="sj" uri="/struts-jquery-tags"%>
+
+<%
+SeekPartnersAction action = SeekPartnersAction.getAction();
+ActionContext.getContext().put("localPartners", action.getPartners());
+ActionContext.getContext().put("localNoteId", action.getNoteId());
+ActionContext.getContext().put("localNoteSummary", action.getNote().getSummary());
+
+%>
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title><s:text name="vradi.seekingPartners.title" /></title>
+ <s:head/>
+ <sj:head jquerytheme="sunny"/>
+ </head>
+ <body>
+ <h1><s:text name="vradi.seekingPartners.title" /></h1>
+
+ <s:form id="seekingPartnersForm" action="/sendInvitation.action" method="POST">
+ <s:hidden name="noteId" value="%{localNoteId}"/>
+ <s:checkbox name="formReceiver" key="vradi.seekingPartners.formReceiver"/>
+ <s:checkbox name="seeker" key="vradi.seekingPartners.seeker"/>
+ <s:checkbox name="partners" key="vradi.seekingPartners.partners"/>
+ <s:select size="5" multiple="true" name="userId" list="%{localPartners}" listKey="wikittyId" listValue="login"/>
+ <sj:submit
+ id="partnersShowSubmit"
+ href="/fragment/partnerInfo.action"
+ targets="partnersShowResult"
+ value="Show"
+ indicator="indicator-partnersShowResult"
+ button="true"
+ />
+ <div id="partnersShowResult">
+ <img id="indicator-partnersShowResult" src="/img/indicator.gif" alt="wait..." style="display:none"/>
+ </div>
+ <s:checkbox name="invite" key="vradi.seekingPartners.invite"/>
+ <s:textfield name="inviteEmail" key="vradi.seekingPartners.inviteEmail"/>
+
+ <s:textarea name="message"
+ value="%{localNoteSummary}" key="vradi.userPreference.info"/>
+
+ </s:form>
+ </body>
+</html>
Added: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/sendInvitation.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/sendInvitation.jsp (rev 0)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/sendInvitation.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,30 @@
+<%--
+ Document : sendInvitation
+ Created on : 1 juin 2011, 00:09:23
+ Author : poussin
+--%>
+
+<%@page import="org.chorem.vradi.actions.SendInvitationAction"%>
+<%@page import="com.opensymphony.xwork2.ActionContext"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<%@taglib prefix="s" uri="/struts-tags"%>
+<%@taglib prefix="sj" uri="/struts-jquery-tags"%>
+
+<%
+SendInvitationAction action = SendInvitationAction.getAction();
+%>
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title><s:text name="vradi.sendInvitation.title" /></title>
+ <s:head/>
+ <sj:head jquerytheme="sunny"/>
+ </head>
+ <body>
+ <h1><s:text name="vradi.sendInvitation.title" /></h1>
+ <s:text name="vradi.sendInvitation.count" />: <%=action.getSendCount()%>
+ </body>
+</html>
Added: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp (rev 0)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/showInvitation.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -0,0 +1,75 @@
+<%--
+ Document : showInvitation
+ Created on : 1 juin 2011, 01:42:32
+ Author : poussin
+--%>
+
+<%@page import="com.opensymphony.xwork2.ActionContext"%>
+<%@page import="org.chorem.vradi.actions.ShowInvitationAction"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<%@taglib prefix="s" uri="/struts-tags"%>
+<%@taglib prefix="sj" uri="/struts-jquery-tags"%>
+
+<%
+ShowInvitationAction action = ShowInvitationAction.getAction();
+ActionContext.getContext().put("localNoteId", action.getNoteId());
+ActionContext.getContext().put("localSenderId", action.getSender().getWikittyId());
+%>
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title><s:text name="vradi.showInvitation.title" /></title>
+ <s:head/>
+ <sj:head jquerytheme="sunny"/>
+ </head>
+ <body>
+ <h1><s:text name="vradi.showInvitation.title" /></h1>
+
+ <div>L'invitation provient de: <%=action.getSender()%>
+ <p>
+ <%=action.getSenderInfo()%>
+ </p>
+ </div>
+
+ <div>
+ Les autres partenaires sur le projet sont:
+
+ <form id="partnersForm" action="/fragment/userInfo.action">
+ <s:select size="5" name="userId" list="partners" listKey="wikittyId" listValue="login"/>
+ <sj:submit id="partnersSubmit"
+ value="Show"
+ targets="partnersInfo" indicator="indicator-partnersInfo"
+ button="true" buttonIcon="ui-icon-gear"/>
+ </form>
+ <div id="partnersInfo">
+ <img id="indicator-partnersInfo" src="/img/indicator.gif" alt="Loading..." style="display:none"/>
+ </div>
+ </div>
+
+
+ <div>Le message de l'invitation est:
+ <p><%=action.getMessage()%></p>
+ </div>
+
+ <div>
+ <sj:a id="acceptButton" href="/acceptInvitation/%{localNoteId}.action"
+ button="true" buttonIcon="ui-icon-gear">
+ <s:text name="vradi.showInvitation.accept"/>
+ </sj:a>
+
+ <sj:a id="rejectButton" href="/rejectInvitation/%{localNoteId}.action"
+ button="true" buttonIcon="ui-icon-gear">
+ <s:text name="vradi.showInvitation.accept"/>
+ </sj:a>
+
+ <sj:a id="noReceivedButton" href="/noReceivedInvitation/%{localSenderId}.action"
+ button="true" buttonIcon="ui-icon-gear">
+ <s:text name="vradi.showInvitation.accept"/>
+ </sj:a>
+
+ </div>
+ </body>
+</html>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userInfo.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -14,15 +14,14 @@
<%
RestoreUserAction action = RestoreUserAction.getAction();
VradiUser user = action.getUser();
+String email = "no email";
+String info = action.getInfoHtml();
if (user != null) {
- ActionContext.getContext().put("localUserEmail", user.getLogin());
- ActionContext.getContext().put("localUserInfo", action.getInfoHtml());
+ email = user.getLogin();
+ info = action.getInfoHtml();
}
%>
-<%--
- % on utilise s:property pour supprimer automatiquement les scripts et les tags html
- % ce qui pourrait etre dangereux si on a un utilisateur mal vayant
- %--%>
-<s:property value="localUserEmail" default="no email" escape="true"/>
-<s:property value="localUserInfo" default="no information" escape="true"/></pre>
\ No newline at end of file
+<a href="mailto:<%=email%>"><%=email%></a>
+
+<div><%=info%></div>
\ No newline at end of file
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userPreference.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userPreference.jsp 2011-06-29 14:45:18 UTC (rev 106)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/userPreference.jsp 2011-06-29 15:30:49 UTC (rev 107)
@@ -59,6 +59,7 @@
| Personnes a qui on n'envoie plus les demandes
+-->
<div>
+ <h2><s:text name="vradi.userPreference.nosend" /></h2>
<s:form id="noSendForm" action="/ajax/edit/%{localUserId}.action" method="POST">
<s:select size="5" name="userId" list="%{localUserNoSend}" listKey="wikittyId" listValue="login"/>
<sj:submit
@@ -89,6 +90,7 @@
| Personnes dont on ne recoit plus de demande
+-->
<div>
+ <h2><s:text name="vradi.userPreference.noreceived" /></h2>
<s:form id="noReceivedForm" action="/ajax/edit/%{localUserId}.action" method="POST">
<s:select size="5" name="userId" list="%{localUserNoReceived}" listKey="wikittyId" listValue="login"/>
<sj:submit
@@ -115,5 +117,53 @@
</div>
</div>
+ <!--
+ | Personnes avec qui on a des notes partagees
+ +-->
+ <div>
+ <h2><s:text name="vradi.userPreference.partners" /></h2>
+ <s:form id="partnersForm" action="/fragment/partners/%{localUserId}.action" method="POST">
+ <s:select size="5" name="userId" list="%{localPartners}" listKey="wikittyId" listValue="login"/>
+ <sj:submit
+ id="partnersFormShowSubmit"
+ href="/fragment/partnerInfo.action"
+ targets="partnersFormResult"
+ value="Show"
+ indicator="indicator-partnersForm"
+ button="true"
+ />
+ <sj:submit
+ id="partnersFormShowFormSubmit"
+ targets="partnersFormResult"
+ value="Form"
+ indicator="indicator-partnersForm"
+ button="true"
+ />
+
+ </s:form>
+
+ <div id="partnersFormResult">
+ <img id="indicator-partnersForm" src="/img/indicator.gif" alt="wait..." style="display:none"/>
+ </div>
+ </div>
+
+ <!--
+ | Les notes ouvertes
+ +-->
+ <div>
+ <h2><s:text name="vradi.userPreference.note.open" /></h2>
+
+ TODO
+ </div>
+
+ <!--
+ | Les notes closes
+ +-->
+ <div>
+ <h2><s:text name="vradi.userPreference.note.close" /></h2>
+
+ TODO
+ </div>
+
</body>
</html>
2
1
29 Jun '11
Author: sletellier
Date: 2011-06-29 16:45:18 +0200 (Wed, 29 Jun 2011)
New Revision: 106
Url: http://chorem.org/repositories/revision/vradi/106
Log:
Fix rst refresh
Modified:
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 14:30:46 UTC (rev 105)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 14:45:18 UTC (rev 106)
@@ -79,10 +79,11 @@
collapsible="true" useSelectedTabCookie="true">
<sj:tab id="tabHtmlSummary" target="htmlSummary" label="Summary"/>
<sj:tab id="tabHtmlSummaryEdit" target="htmlSummaryEdit" label="Edit"/>
- <div id="htmlSummary">
+ <sj:div id="htmlSummary"
+ href="/ajax/rst.action?id=%{localNoteId}&field=%{localFieldSummary}"
+ listenTopics="updateHtmlSummary">
<img id="indicator-htmlSummary" src="/img/indicator.gif" alt="Loading..." style="display:none"/>
- <%=action.getSummary()%>
- </div>
+ </sj:div>
<div id="htmlSummaryEdit">
<form id="htmlSummaryEditForm" action="/ajax/rst.action">
<s:hidden name="id" value="%{localNoteId}"/>
@@ -90,7 +91,9 @@
<s:textarea name="rst" value="%{localSummary}"/>
<sj:submit id="htmlSummaryEditSubmit"
value="Save"
- targets="htmlSummary" indicator="indicator-htmlSummary"
+ targets="result"
+ onCompleteTopics="updateHtmlSummary"
+ indicator="indicator-htmlSummary"
button="true" buttonIcon="ui-icon-gear"/>
</form>
</div>
1
0
r105 - in trunk/vradi-web/src/main: java/org/chorem/vradi/actions webapp/WEB-INF/jsp
by sletellier@users.chorem.org 29 Jun '11
by sletellier@users.chorem.org 29 Jun '11
29 Jun '11
Author: sletellier
Date: 2011-06-29 16:30:46 +0200 (Wed, 29 Jun 2011)
New Revision: 105
Url: http://chorem.org/repositories/revision/vradi/105
Log:
Revert formNote modifications
Modified:
trunk/vradi-web/src/main/java/org/chorem/vradi/actions/FormNoteAction.java
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/resultGrid.jsp
Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/FormNoteAction.java
===================================================================
--- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/FormNoteAction.java 2011-06-29 14:09:29 UTC (rev 104)
+++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/FormNoteAction.java 2011-06-29 14:30:46 UTC (rev 105)
@@ -6,15 +6,11 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.chorem.vradi.entities.Attachment;
import org.chorem.vradi.entities.FormNote;
import org.chorem.vradi.entities.FormNoteImpl;
import org.chorem.vradi.entities.VradiUser;
import org.nuiton.jrst.JRST;
import org.nuiton.wikitty.WikittyProxy;
-import org.nuiton.wikitty.search.Criteria;
-import org.nuiton.wikitty.search.PagedResult;
-import org.nuiton.wikitty.search.Search;
/**
*
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 14:09:29 UTC (rev 104)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formNote.jsp 2011-06-29 14:30:46 UTC (rev 105)
@@ -79,12 +79,10 @@
collapsible="true" useSelectedTabCookie="true">
<sj:tab id="tabHtmlSummary" target="htmlSummary" label="Summary"/>
<sj:tab id="tabHtmlSummaryEdit" target="htmlSummaryEdit" label="Edit"/>
- <sj:div id="htmlSummary"
- href="/ajax/rst.action?id=%{localNoteId}&field=%{localFieldSummary}"
- listenTopics="topicHtmlSummary">
+ <div id="htmlSummary">
<img id="indicator-htmlSummary" src="/img/indicator.gif" alt="Loading..." style="display:none"/>
<%=action.getSummary()%>
- </sj:div>
+ </div>
<div id="htmlSummaryEdit">
<form id="htmlSummaryEditForm" action="/ajax/rst.action">
<s:hidden name="id" value="%{localNoteId}"/>
@@ -92,8 +90,7 @@
<s:textarea name="rst" value="%{localSummary}"/>
<sj:submit id="htmlSummaryEditSubmit"
value="Save"
- targets="result"
- onClickTopics="topicHtmlSummary" indicator="indicator-htmlSummary"
+ targets="htmlSummary" indicator="indicator-htmlSummary"
button="true" buttonIcon="ui-icon-gear"/>
</form>
</div>
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/resultGrid.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/resultGrid.jsp 2011-06-29 14:09:29 UTC (rev 104)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/resultGrid.jsp 2011-06-29 14:30:46 UTC (rev 105)
@@ -11,7 +11,7 @@
* Format a Column as Link
*/
function formatLink(cellvalue, options, row) {
- return "<a href='/formNote/" + cellvalue + ".action'><%=_("vradi.form.editAction")%></a>";
+ return "<a href='/formNoteList/" + cellvalue + ".action'><%=_("vradi.form.editAction")%></a>";
}
</script>
1
0
r104 - in trunk/vradi-web/src/main: resources/i18n webapp/WEB-INF/jsp webapp/WEB-INF/jsp/inc
by sletellier@users.chorem.org 29 Jun '11
by sletellier@users.chorem.org 29 Jun '11
29 Jun '11
Author: sletellier
Date: 2011-06-29 16:09:29 +0200 (Wed, 29 Jun 2011)
New Revision: 104
Url: http://chorem.org/repositories/revision/vradi/104
Log:
Add navigation links
Modified:
trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formView.jsp
trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-29 14:02:20 UTC (rev 103)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_en_GB.properties 2011-06-29 14:09:29 UTC (rev 104)
@@ -23,6 +23,7 @@
vradi.register.mailHi=Hello
vradi.register.mailPwd=Your password
vradi.register.mailSubject=[Vradi] Your user informations
+vradi.search.link=Return to search page
vradi.register.submit=Login
vradi.register.title=Login
vradi.search.submit=Search
Modified: trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties
===================================================================
--- trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-29 14:02:20 UTC (rev 103)
+++ trunk/vradi-web/src/main/resources/i18n/vradi-web_fr_FR.properties 2011-06-29 14:09:29 UTC (rev 104)
@@ -19,6 +19,7 @@
vradi.form.creationDate=Date de création
vradi.form.editAction=Editer
vradi.form.object=Objet
+vradi.formView.title=Visualisation d'un formulaire
vradi.login.email=Email
vradi.login.password=Mot de passe
vradi.login.repeatPassword=Confiramtion
@@ -41,6 +42,7 @@
vradi.register.title=S'enregistrer
vradi.search.activateQuery=Activer
vradi.search.formNoteEdit=Edition des notes
+vradi.search.link=Retour à la page de recherche
vradi.search.queryName=Nom de la requête
vradi.search.saveQuery=Sauvegarder la requête
vradi.search.submit=Rechercher
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formView.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formView.jsp 2011-06-29 14:02:20 UTC (rev 103)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/formView.jsp 2011-06-29 14:09:29 UTC (rev 104)
@@ -2,6 +2,7 @@
<%@ page import="org.nuiton.wikitty.entities.Wikitty" %>
<%@ page import="org.nuiton.wikitty.entities.WikittyExtension" %>
<%@ page import="org.chorem.vradi.VradiSession" %>
+<%@ page import="org.chorem.vradi.VradiWebHelper" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
@@ -21,10 +22,10 @@
Wikitty wikitty = VradiSession.getVradiSession(session).getProxy().getWikitty(form);
WikittyExtension extension = wikitty.getExtension(extName);
for (String fieldName : extension.getFieldNames()) {
- %>
+ Object field = form.getField(extName, fieldName);%>
<tr>
<th><%=fieldName%></th>
- <td><%=form.getField(extName, fieldName)%></td>
+ <td><%=field == null ? "" : VradiWebHelper.escapeSciptBalises(field.toString())%></td>
</tr>
<%
}
Modified: trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp
===================================================================
--- trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp 2011-06-29 14:02:20 UTC (rev 103)
+++ trunk/vradi-web/src/main/webapp/WEB-INF/jsp/inc/header.jsp 2011-06-29 14:09:29 UTC (rev 104)
@@ -10,25 +10,37 @@
VradiSession vradiSession = VradiSession.getVradiSession(session);
VradiUser user = vradiSession.getUser();
ActionContext.getContext().put("logged", user != null);
+
+ String requestURI = request.getRequestURI();
+ boolean isSearchView = requestURI.contains("searchView");
+ ActionContext.getContext().put("isNotSearchViewPage", !isSearchView);
+
+ boolean isOption = requestURI.contains("option");
+ ActionContext.getContext().put("isNotOptionPage", !isOption);
%>
<div id="titlePanel">
<h1><s:text name="vradi.title" /></h1>
</div>
<s:if test="logged">
- <div id="logoutPanel">
+ <div id="linkPanel">
+ <s:if test="isNotOptionPage">
+ <s:a id="options"
+ action="options">
+ <s:text name="vradi.options"/>
+ </s:a>
+ </s:if>
+ <s:if test="isNotSearchViewPage">
+ <s:a id="searchLink"
+ action="searchView">
+ <s:text name="vradi.search.link"/>
+ </s:a>
+ </s:if>
<s:a id="logout"
action="logout">
<s:text name="vradi.logout.submit" />
</s:a>
</div>
- <div id="optionsPanel">
- <s:a id="options"
- action="options">
-
- <s:text name="vradi.options"/>
- </s:a>
- </div>
</s:if>
<div id="msg">
<span id="actionmessageHeader">
1
0
r103 - trunk/vradi-services/src/main/java/org/chorem/vradi/services/managers
by echatellier@users.chorem.org 29 Jun '11
by echatellier@users.chorem.org 29 Jun '11
29 Jun '11
Author: echatellier
Date: 2011-06-29 16:02:20 +0200 (Wed, 29 Jun 2011)
New Revision: 103
Url: http://chorem.org/repositories/revision/vradi/103
Log:
Doublon par rapport au findAllByCriteria(Class) qui ajoute la meme condition
Modified:
trunk/vradi-services/src/main/java/org/chorem/vradi/services/managers/FormManager.java
Modified: trunk/vradi-services/src/main/java/org/chorem/vradi/services/managers/FormManager.java
===================================================================
--- trunk/vradi-services/src/main/java/org/chorem/vradi/services/managers/FormManager.java 2011-06-29 10:21:37 UTC (rev 102)
+++ trunk/vradi-services/src/main/java/org/chorem/vradi/services/managers/FormManager.java 2011-06-29 14:02:20 UTC (rev 103)
@@ -219,7 +219,7 @@
log.error("Cant parse date");
}
}
- Search search = Search.query().eq(Element.ELT_EXTENSION, Session.EXT_SESSION);
+ Search search = Search.query();
if (formatedLastCloseDate != null) {
search.ge(Session.FQ_FIELD_SESSION_SESSIONDATE,
1
0