Chorem-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
- March
August 2012
- 4 participants
- 53 discussions
Author: tchemit
Date: 2012-08-25 10:53:18 +0200 (Sat, 25 Aug 2012)
New Revision: 262
Url: http://chorem.org/repositories/revision/chorem/262
Log:
fixes #793: Configure pom to add application at release time
fixes #792: Configure pom to auto-deploy to demo
ignore idea files
Modified:
trunk/
trunk/chorem-webmotion/pom.xml
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- target
*.iml
*.iws
*.ipr
+ target
*.iml
*.iws
*.ipr
.idea
Modified: trunk/chorem-webmotion/pom.xml
===================================================================
--- trunk/chorem-webmotion/pom.xml 2012-08-24 15:20:19 UTC (rev 261)
+++ trunk/chorem-webmotion/pom.xml 2012-08-25 08:53:18 UTC (rev 262)
@@ -26,7 +26,15 @@
<i18n.bundleOutputDir>${basedir}/target/generated-sources/resources
</i18n.bundleOutputDir>
<i18n.addBundleOuputDirParent>false</i18n.addBundleOuputDirParent>
+
+ <!-- pour attacher lors d'un deployement sur demo (ou autre) -->
<deployFiles>target/${project.build.finalName}.war</deployFiles>
+
+ <!-- pour deployer vers redmine lors d'une release -->
+ <redmine.releaseFiles>
+ target/${project.build.finalName}.war,
+ </redmine.releaseFiles>
+
</properties>
<dependencies>
1
0
24 Aug '12
Author: maven-release
Date: 2012-08-24 17:20:19 +0200 (Fri, 24 Aug 2012)
New Revision: 261
Url: http://chorem.org/repositories/revision/chorem/261
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/chorem-entities/pom.xml
trunk/chorem-webmotion/pom.xml
trunk/pom.xml
Modified: trunk/chorem-entities/pom.xml
===================================================================
--- trunk/chorem-entities/pom.xml 2012-08-24 15:20:17 UTC (rev 260)
+++ trunk/chorem-entities/pom.xml 2012-08-24 15:20:19 UTC (rev 261)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.chorem</groupId>
Modified: trunk/chorem-webmotion/pom.xml
===================================================================
--- trunk/chorem-webmotion/pom.xml 2012-08-24 15:20:17 UTC (rev 260)
+++ trunk/chorem-webmotion/pom.xml 2012-08-24 15:20:19 UTC (rev 261)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>org.chorem.chorem</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-08-24 15:20:17 UTC (rev 260)
+++ trunk/pom.xml 2012-08-24 15:20:19 UTC (rev 261)
@@ -15,7 +15,7 @@
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
<modules>
<module>chorem-entities</module>
@@ -74,11 +74,11 @@
</developers>
<scm>
- <connection>scm:svn:http://svn.chorem.org/svn/chorem/tags/chorem-0.2</connection>
+ <connection>scm:svn:http://svn.chorem.org/svn/chorem/trunk</connection>
<developerConnection>
- scm:svn:http://svn.chorem.org/svn/chorem/tags/chorem-0.2
+ scm:svn:http://svn.chorem.org/svn/chorem/trunk
</developerConnection>
- <url>http://www.chorem.org/repositories/browse/chorem/tags/chorem-0.2</url>
+ <url>http://www.chorem.org/repositories/browse/chorem/trunk</url>
</scm>
<distributionManagement>
1
0
Author: maven-release
Date: 2012-08-24 17:20:17 +0200 (Fri, 24 Aug 2012)
New Revision: 260
Url: http://chorem.org/repositories/revision/chorem/260
Log:
[maven-release-plugin] copy for tag chorem-0.2
Added:
tags/chorem-0.2/
1
0
24 Aug '12
Author: maven-release
Date: 2012-08-24 17:20:06 +0200 (Fri, 24 Aug 2012)
New Revision: 259
Url: http://chorem.org/repositories/revision/chorem/259
Log:
[maven-release-plugin] prepare release chorem-0.2
Modified:
trunk/chorem-entities/pom.xml
trunk/chorem-webmotion/pom.xml
trunk/pom.xml
Modified: trunk/chorem-entities/pom.xml
===================================================================
--- trunk/chorem-entities/pom.xml 2012-08-24 14:50:51 UTC (rev 258)
+++ trunk/chorem-entities/pom.xml 2012-08-24 15:20:06 UTC (rev 259)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>org.chorem.chorem</groupId>
Modified: trunk/chorem-webmotion/pom.xml
===================================================================
--- trunk/chorem-webmotion/pom.xml 2012-08-24 14:50:51 UTC (rev 258)
+++ trunk/chorem-webmotion/pom.xml 2012-08-24 15:20:06 UTC (rev 259)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>org.chorem.chorem</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-08-24 14:50:51 UTC (rev 258)
+++ trunk/pom.xml 2012-08-24 15:20:06 UTC (rev 259)
@@ -15,7 +15,7 @@
<groupId>org.chorem</groupId>
<artifactId>chorem</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
<modules>
<module>chorem-entities</module>
@@ -74,11 +74,11 @@
</developers>
<scm>
- <connection>scm:svn:http://svn.chorem.org/svn/chorem/trunk</connection>
+ <connection>scm:svn:http://svn.chorem.org/svn/chorem/tags/chorem-0.2</connection>
<developerConnection>
- scm:svn:http://svn.chorem.org/svn/chorem/trunk
+ scm:svn:http://svn.chorem.org/svn/chorem/tags/chorem-0.2
</developerConnection>
- <url>http://www.chorem.org/repositories/browse/chorem/trunk</url>
+ <url>http://www.chorem.org/repositories/browse/chorem/tags/chorem-0.2</url>
</scm>
<distributionManagement>
1
0
r258 - trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions
by bpoussin@users.chorem.org 24 Aug '12
by bpoussin@users.chorem.org 24 Aug '12
24 Aug '12
Author: bpoussin
Date: 2012-08-24 16:50:51 +0200 (Fri, 24 Aug 2012)
New Revision: 258
Url: http://chorem.org/repositories/revision/chorem/258
Log:
Evolution #738: Order the linked objects
Added:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/MapWithDefault.java
Modified:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2012-08-24 13:33:48 UTC (rev 257)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/DashboardAction.java 2012-08-24 14:50:51 UTC (rev 258)
@@ -23,8 +23,16 @@
package org.chorem.webmotion.actions;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
@@ -34,17 +42,20 @@
import org.chorem.entities.Category;
import org.chorem.entities.Configuration;
import org.chorem.entities.Employee;
+import org.chorem.entities.Interval;
import org.chorem.entities.Invoice;
import org.chorem.entities.Quotation;
import org.chorem.entities.QuotationStatus;
import org.chorem.entities.Task;
import org.chorem.entities.TaskStatus;
import org.chorem.entities.Time;
+import org.chorem.entities.Touch;
import org.chorem.entities.Vacation;
import org.chorem.entities.VacationStatus;
import org.debux.webmotion.server.WebMotionController;
import org.debux.webmotion.server.render.Render;
-import org.nuiton.util.ObjectUtil;
+import org.nuiton.util.DateUtil;
+import org.nuiton.wikitty.entities.Element;
import org.nuiton.wikitty.entities.ElementField;
import org.nuiton.wikitty.query.WikittyQuery;
import org.nuiton.wikitty.query.WikittyQueryMaker;
@@ -52,22 +63,6 @@
import org.nuiton.wikitty.query.WikittyQueryResultTreeNode;
import org.nuiton.wikitty.query.conditions.Aggregate;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.lang3.StringUtils;
-import org.chorem.entities.Interval;
-import org.chorem.entities.Touch;
-import org.nuiton.util.DateUtil;
-import org.nuiton.wikitty.entities.Element;
-
/**
*
* @author poussin
@@ -84,134 +79,6 @@
static final public String budgetDateFormat = "MM/yyyy";
static final public String summaryDateFormat = "dd/MM/yyyy hh:mm";
- /**
- * Permet de decore une map dont toutes les valeurs manquant lorsqu'on les
- * demandent sont initialise avec l'objet passe dans le constructeur.
- * L'objet initialise est pousse dans la map avant d'etre retourne.
- *
- * TODO poussin 20120526 move this class to nuiton-utils
- *
- * @param <K>
- * @param <V>
- */
- static public class MapWithDefault<K, V> implements Map<K, V>, Cloneable {
- protected Map<K, V> map;
- protected Object defaultValue;
- protected Collection args;
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- MapWithDefault result = (MapWithDefault)super.clone();
- // class cast exception if map is not cloneable
- result.map = (Map)ObjectUtil.clone((Cloneable)map);
- return result;
- }
-
- /**
- * L'objet par default utilise est l'objet passe en parametre s'il n'est
- * pas clonable ou un clone de l'objet s'il est clonable.
- * @param map la map a decore
- * @param defaultValue la valeur par default
- */
- public MapWithDefault(Map<K, V> map, V defaultValue) {
- this.map = map;
- this.defaultValue = defaultValue;
- }
-
- /**
- * L'objet par defaut est construit via le constructeur de la classe
- * passe en parametre prenant les arguments args.
- * @param map la map a decore
- * @param defaultValue la class de la valeur par defaut
- * @param args les arguments du construteur pour la classe
- */
- public MapWithDefault(Map<K, V> map, Class<V> defaultValue, Object... args) {
- this.map = map;
- this.defaultValue = defaultValue;
- if (ArrayUtils.isNotEmpty(args)) {
- this.args = Arrays.asList(args);
- }
- }
-
- /**
- * Get new instance of defaultValue if defaultValue is clonable or
- * return directly defaultValue otherwize.
- * @return
- */
- protected V getDefaultValue() {
- try {
- Object result = defaultValue;
- if (defaultValue instanceof Class) {
- if (args == null) {
- result = ((Class)defaultValue).newInstance();
- } else {
- result = ObjectUtil.newInstance(((Class)defaultValue), args, true);
- }
- } else if (defaultValue instanceof Cloneable) {
- result = ObjectUtil.clone(((Cloneable)defaultValue));
- }
- return (V)result;
- } catch (Exception eee) {
- throw new RuntimeException(eee);
- }
- }
-
- // on surcharge le get pour creer automatiquement les objets
- @Override
- public V get(Object key) {
- V result = map.get(key);
- if (result == null) {
- result = getDefaultValue();
- put((K)key, result);
- }
- return result;
- }
-
- public int size() {
- return map.size();
- }
-
- public boolean isEmpty() {
- return map.isEmpty();
- }
-
- public boolean containsKey(Object key) {
- return map.containsKey(key);
- }
-
- public boolean containsValue(Object value) {
- return map.containsValue(value);
- }
-
- public V put(K key, V value) {
- return map.put(key, value);
- }
-
- public V remove(Object key) {
- return map.remove(key);
- }
-
- public void putAll(Map<? extends K, ? extends V> m) {
- map.putAll(m);
- }
-
- public void clear() {
- map.clear();
- }
-
- public Set<K> keySet() {
- return map.keySet();
- }
-
- public Collection<V> values() {
- return map.values();
- }
-
- public Set<Entry<K, V>> entrySet() {
- return map.entrySet();
- }
- }
-
protected <E> Map<String, List<Attachment>> prepareAttachment(ChoremClient client, Collection<E> ids) {
// recherche des attachments de chaque quotation trouvee
WikittyQuery attachmentQuery = new WikittyQueryMaker().and()
@@ -271,7 +138,7 @@
////////////////////////////////////////////////////////////////////////////
//
- // C O N T A C T
+ // A C C U E I L
//
////////////////////////////////////////////////////////////////////////////
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-24 13:33:48 UTC (rev 257)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-24 14:50:51 UTC (rev 258)
@@ -23,6 +23,7 @@
package org.chorem.webmotion.actions;
import com.google.common.collect.LinkedHashMultimap;
+import com.google.common.collect.Multimaps;
import java.io.ByteArrayInputStream;
import java.net.MalformedURLException;
import java.util.ArrayList;
@@ -35,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.ArrayUtils;
@@ -148,7 +150,7 @@
*/
// depth est un Integer car si c'est un int et qu'il n'existe pas dans les parametres
// l'appel plante au lieu de passer 0 comme valeur par defaut
- public LinkedHashMultimap<String, Wikitty> searchAsMap(ChoremClient client, String[] extension, String query, Integer depth) {
+ public Map<String, List<Wikitty>> searchAsMap(ChoremClient client, String[] extension, String query, Integer depth) {
if (depth == null) {
depth = 0;
}
@@ -179,11 +181,13 @@
client.findAllByQuery(Wikitty.class, q);
// on classe par extension demande les resultats
- LinkedHashMultimap<String, Wikitty> map = LinkedHashMultimap.create();
+ Map<String, List<Wikitty>> map =
+ new MapWithDefault<String, List<Wikitty>>(
+ new TreeMap<String, List<Wikitty>>(), new LinkedList<Wikitty>());
for (Wikitty w : results) {
for (WikittyExtension ext : w.getExtensions()) {
if (exts.contains(ext)) {
- map.put(ext.getName(), w);
+ map.get(ext.getName()).add(w);
}
}
}
@@ -191,16 +195,14 @@
List<String> extExcluded = client.getConfig().getOptionAsList(
ChoremConfigOption.CHOREM_EXTENSION_SEARCH_EXCLUSION.key).getOption();
for (String ext : extExcluded) {
- map.removeAll(ext);
+ map.remove(ext);
}
if (extension != null) {
for (String ext : extension) {
// The wanted extensions should be present, even without wikitties...
- Set<Wikitty> wikitties = map.get(ext);
- if (wikitties == null || wikitties.isEmpty() ) {
- map.put(ext, null);
- }
+ // just get, create entry
+ map.get(ext);
}
}
return map;
@@ -208,7 +210,7 @@
}
public Render search(ChoremClient client, String[] extension, String query) {
- LinkedHashMultimap<String, Wikitty> map = searchAsMap(client, extension, query, 1);
+ Map<String, List<Wikitty>> map = searchAsMap(client, extension, query, 1);
return renderView("search.jsp", "result", map);
}
@@ -245,22 +247,23 @@
// query += " AND ("+extensionRestriction+")";
// }
- LinkedHashMultimap<String, Wikitty> map = searchAsMap(client, extension, query, 1);
+ Map<String, List<Wikitty>> map = searchAsMap(client, extension, query, 1);
List<Map<String, String>> result = new ArrayList<Map<String, String>>(map.size());
- for (Map.Entry<String, Wikitty> e : map.entries()) {
+ for (Map.Entry<String, List<Wikitty>> e : map.entrySet()) {
String extName = e.getKey();
- Wikitty value = e.getValue();
- // Avoid potential null value
- if (value != null) {
- String id = value.getWikittyId();
- String label = value.toString(extName);
- Map<String, String> item = new LinkedHashMap<String, String>();
- item.put("extension", extName);
- item.put("label", label);
- item.put("value", label);
- item.put("name", label);
- item.put("id", id);
- result.add(item);
+ for (Wikitty value : e.getValue()) {
+ // Avoid potential null value
+ if (value != null) {
+ String id = value.getWikittyId();
+ String label = value.toString(extName);
+ Map<String, String> item = new LinkedHashMap<String, String>();
+ item.put("extension", extName);
+ item.put("label", label);
+ item.put("value", label);
+ item.put("name", label);
+ item.put("id", id);
+ result.add(item);
+ }
}
}
return renderJSON(result);
@@ -561,7 +564,7 @@
*/
public Render searchRelated(ChoremClient client, String id) {
String query = id + " AND id != " + id;
- LinkedHashMultimap<String, Wikitty> map = searchAsMap(client, null, query, 0);
+ Map<String, List<Wikitty>> map = searchAsMap(client, null, query, 0);
return renderView("search.jsp", "result", map);
}
Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/MapWithDefault.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/MapWithDefault.java (rev 0)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/MapWithDefault.java 2012-08-24 14:50:51 UTC (rev 258)
@@ -0,0 +1,148 @@
+package org.chorem.webmotion.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import org.apache.commons.lang3.ArrayUtils;
+import org.nuiton.util.ObjectUtil;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+/**
+ * Permet de decore une map dont toutes les valeurs manquant lorsqu'on les
+ * demandent sont initialise avec l'objet passe dans le constructeur.
+ * L'objet initialise est pousse dans la map avant d'etre retourne.
+ *
+ * TODO poussin 20120526 move this class to nuiton-utils
+ *
+ * @param <K>
+ * @param <V>
+ */
+public class MapWithDefault<K, V> implements Map<K, V>, Cloneable {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ protected Map<K, V> map;
+ protected Object defaultValue;
+ protected Collection args;
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ MapWithDefault result = (MapWithDefault) super.clone();
+ // class cast exception if map is not cloneable
+ result.map = (Map) ObjectUtil.clone((Cloneable) map);
+ return result;
+ }
+
+ /**
+ * L'objet par default utilise est l'objet passe en parametre s'il n'est
+ * pas clonable ou un clone de l'objet s'il est clonable.
+ * @param map la map a decore
+ * @param defaultValue la valeur par default
+ */
+ public MapWithDefault(Map<K, V> map, V defaultValue) {
+ this.map = map;
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * L'objet par defaut est construit via le constructeur de la classe
+ * passe en parametre prenant les arguments args.
+ * @param map la map a decore
+ * @param defaultValue la class de la valeur par defaut
+ * @param args les arguments du construteur pour la classe
+ */
+ public MapWithDefault(Map<K, V> map, Class<V> defaultValue, Object... args) {
+ this.map = map;
+ this.defaultValue = defaultValue;
+ if (ArrayUtils.isNotEmpty(args)) {
+ this.args = Arrays.asList(args);
+ }
+ }
+
+ /**
+ * Get new instance of defaultValue if defaultValue is clonable or
+ * return directly defaultValue otherwize.
+ * @return
+ */
+ protected V getDefaultValue() {
+ try {
+ Object result = defaultValue;
+ if (defaultValue instanceof Class) {
+ if (args == null) {
+ result = ((Class) defaultValue).newInstance();
+ } else {
+ result = ObjectUtil.newInstance((Class) defaultValue, args, true);
+ }
+ } else if (defaultValue instanceof Cloneable) {
+ result = ObjectUtil.clone((Cloneable) defaultValue);
+ }
+ return (V) result;
+ } catch (Exception eee) {
+ throw new RuntimeException(eee);
+ }
+ }
+
+ // on surcharge le get pour creer automatiquement les objets
+ @Override
+ public V get(Object key) {
+ V result = map.get(key);
+ if (result == null) {
+ result = getDefaultValue();
+ put((K) key, result);
+ }
+ return result;
+ }
+
+ public int size() {
+ return map.size();
+ }
+
+ public boolean isEmpty() {
+ return map.isEmpty();
+ }
+
+ public boolean containsKey(Object key) {
+ return map.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ return map.containsValue(value);
+ }
+
+ public V put(K key, V value) {
+ return map.put(key, value);
+ }
+
+ public V remove(Object key) {
+ return map.remove(key);
+ }
+
+ public void putAll(Map<? extends K, ? extends V> m) {
+ map.putAll(m);
+ }
+
+ public void clear() {
+ map.clear();
+ }
+
+ public Set<K> keySet() {
+ return map.keySet();
+ }
+
+ public Collection<V> values() {
+ return map.values();
+ }
+
+ public Set<Entry<K, V>> entrySet() {
+ return map.entrySet();
+ }
+
+}
1
0
r257 - in trunk: . chorem-entities/src/main/java/org/chorem chorem-webmotion chorem-webmotion/src/main/java/org/chorem/webmotion src/site/rst
by maven-release@users.chorem.org 24 Aug '12
by maven-release@users.chorem.org 24 Aug '12
24 Aug '12
Author: maven-release
Date: 2012-08-24 15:33:48 +0200 (Fri, 24 Aug 2012)
New Revision: 257
Url: http://chorem.org/repositories/revision/chorem/257
Log:
updates to mavenpom 3.3.6
optimize dependencies
make rst site ok
add missing license headers
Modified:
trunk/chorem-entities/src/main/java/org/chorem/Saint.java
trunk/chorem-webmotion/pom.xml
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
trunk/pom.xml
trunk/src/site/rst/chorem-cdc.rst
trunk/src/site/rst/doc-devel.rst
trunk/src/site/rst/index.rst
trunk/src/site/rst/requisite.rst
Modified: trunk/chorem-entities/src/main/java/org/chorem/Saint.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/Saint.java 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/chorem-entities/src/main/java/org/chorem/Saint.java 2012-08-24 13:33:48 UTC (rev 257)
@@ -10,12 +10,12 @@
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -67,4 +67,4 @@
return result;
}
-}
\ No newline at end of file
+}
Modified: trunk/chorem-webmotion/pom.xml
===================================================================
--- trunk/chorem-webmotion/pom.xml 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/chorem-webmotion/pom.xml 2012-08-24 13:33:48 UTC (rev 257)
@@ -74,6 +74,11 @@
<artifactId>commons-collections</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+
<!-- provided dependencies -->
<dependency>
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java 2012-08-24 13:33:48 UTC (rev 257)
@@ -1,4 +1,26 @@
package org.chorem.webmotion;
+/*
+ * #%L
+ * Chorem webmotion
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2011 - 2012 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
import javax.servlet.http.HttpServletRequest;
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/pom.xml 2012-08-24 13:33:48 UTC (rev 257)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.3.4</version>
+ <version>3.3.6</version>
</parent>
<groupId>org.chorem</groupId>
@@ -44,7 +44,7 @@
<email>martel at codelutin.com</email>
<organization>CodeLutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -55,7 +55,7 @@
<email>chemit at codelutin.com</email>
<organization>Code Lutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -66,7 +66,7 @@
<email>poussin at codelutin.com</email>
<organization>CodeLutin</organization>
<organizationUrl>http://www.codelutin.com/</organizationUrl>
- <timezone>+1</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>developer</role>
</roles>
@@ -98,7 +98,7 @@
<nuitonUtilsVersion>2.4.8</nuitonUtilsVersion>
<nuitonWebVersion>1.7</nuitonWebVersion>
<nuitonI18nVersion>2.3.1</nuitonI18nVersion>
- <wikittyVersion>3.8-SNAPSHOT</wikittyVersion>
+ <wikittyVersion>3.8</wikittyVersion>
<slf4jVersion>1.6.1</slf4jVersion>
<struts2Version>2.2.3</struts2Version>
<struts2jqueryVersion>3.2.0</struts2jqueryVersion>
Modified: trunk/src/site/rst/chorem-cdc.rst
===================================================================
--- trunk/src/site/rst/chorem-cdc.rst 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/src/site/rst/chorem-cdc.rst 2012-08-24 13:33:48 UTC (rev 257)
@@ -20,6 +20,7 @@
.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
.. * #L%
.. -
+
====== Chorem ======
Chorem est composé de plusieurs modules
Modified: trunk/src/site/rst/doc-devel.rst
===================================================================
--- trunk/src/site/rst/doc-devel.rst 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/src/site/rst/doc-devel.rst 2012-08-24 13:33:48 UTC (rev 257)
@@ -1,3 +1,26 @@
+.. -
+.. * #%L
+.. * chorem
+.. * $Id:$
+.. * $HeadURL:$
+.. * %%
+.. * Copyright (C) 2011 - 2012 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Affero General Public License as published by
+.. * the Free Software Foundation, either version 3 of the License, or
+.. * (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Public License for more details.
+.. *
+.. * You should have received a copy of the GNU Affero General Public License
+.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
+.. * #L%
+.. -
+
=========================
Documentation développeur
=========================
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/src/site/rst/index.rst 2012-08-24 13:33:48 UTC (rev 257)
@@ -20,6 +20,7 @@
.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
.. * #L%
.. -
+
====== Chorem ======
TODO en exercice
\ No newline at end of file
Modified: trunk/src/site/rst/requisite.rst
===================================================================
--- trunk/src/site/rst/requisite.rst 2012-08-24 09:42:09 UTC (rev 256)
+++ trunk/src/site/rst/requisite.rst 2012-08-24 13:33:48 UTC (rev 257)
@@ -20,6 +20,7 @@
.. * along with this program. If not, see <http://www.gnu.org/licenses/>.
.. * #L%
.. -
+
Contact
=======
Avoir un champs langue sur le contact, qui permet d'indiquer la langue
1
0
Author: jcouteau
Date: 2012-08-24 11:42:09 +0200 (Fri, 24 Aug 2012)
New Revision: 256
Url: http://chorem.org/repositories/revision/chorem/256
Log:
Change Invoice toString to "ref - description - amount"
Modified:
trunk/chorem-entities/src/main/xmi/chorem-model.properties
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties
===================================================================
--- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-23 23:36:55 UTC (rev 255)
+++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-24 09:42:09 UTC (rev 256)
@@ -97,7 +97,7 @@
#
org.chorem.entities.Invoice.class.tagvalue.version=14.0
org.chorem.entities.Invoice.class.tagvalue.preload=Invoice.customer;Invoice.supplier
-org.chorem.entities.Invoice.class.tagvalue.toString=%Invoice.reference|noref$s %Invoice.amount|noamount$s %Invoice.postedDate$tF %Invoice.expectedDate$tF %Invoice.paymentDate$tF
+org.chorem.entities.Invoice.class.tagvalue.toString=%Invoice.reference|noref$s - %Invoice.description|nodescription$s - %Invoice.amount|noamount$s
org.chorem.entities.Invoice.class.tagvalue.sortOrder=Invoice.postedDate desc,Invoice.expectedDate,Invoice.paymentDate,Invoice.reference,Invoice.amount
org.chorem.entities.Invoice.attribute.reference.tagvalue.help=La r\u00e9f\u00e9rence de la facture
org.chorem.entities.Invoice.attribute.description.tagvalue.help=la description de la facture (ce sur quoi elle porte)
1
0
23 Aug '12
Author: bpoussin
Date: 2012-08-24 01:36:55 +0200 (Fri, 24 Aug 2012)
New Revision: 255
Url: http://chorem.org/repositories/revision/chorem/255
Log:
- grosse refonte pour supporter plusieurs domaines sur une instance (1 base par domaine)
- ajout de l'authentification
Modified:
trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java
trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java
trunk/chorem-entities/src/main/xmi/chorem-model.properties
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/ChoremClientFilter.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/DecoratorFilter.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
trunk/chorem-webmotion/src/main/resources/mapping
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -39,18 +39,23 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(ChoremAction.class);
+ ApplicationConfig config;
+
+ public ChoremAction(ApplicationConfig config) {
+ this.config = config;
+ }
+
/**
* Remove all data in database, used with caution
*/
- static public void clean() {
+ public void clean() {
System.out.println("Cleaning database ...");
- ChoremClient proxy = ChoremClient.getClient();
+ ChoremClient proxy = ChoremClient.getClient(config);
proxy.clear();
System.out.println("... clean done");
}
- static public void configInfo() {
- ApplicationConfig config = ChoremConfig.getConfig();
+ public void configInfo() {
config.printConfig();
}
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -25,14 +25,15 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
-
import org.chorem.entities.Attachment;
+import org.chorem.entities.ChoremUser;
+import org.chorem.entities.Company;
+import org.chorem.entities.CompanyImpl;
import org.chorem.entities.Configuration;
import org.chorem.entities.ConfigurationImpl;
import org.chorem.entities.ContactDetails;
-
+import org.chorem.entities.Employee;
import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.VersionUtil;
import org.nuiton.wikitty.WikittyClient;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.WikittyServiceFactory;
@@ -53,55 +54,81 @@
protected ChoremClient(ApplicationConfig config, WikittyService ws) {
super(config, ws);
}
-
+
/**
- * Returns new ChoremClient instance with specified security token
+ * Returns new ChoremClient instance for the specified domain
*
- * @param token can be null, if no authorisation token already exist (no login done)
+ * @param domain le domain qui permet de trouve la base de donnees
* @return
*/
- static public ChoremClient getClient(String token) {
- ApplicationConfig config = ChoremConfig.getConfig();
- WikittyService ws = getWikittyService(config);
- ChoremClient result = new ChoremClient(config, ws);
- result.setSecurityToken(token);
-
+ static public ChoremClient getClient(String domain) {
+ ApplicationConfig config = ChoremConfig.getConfig(domain);
+ ChoremClient result = getClient(config);
+
return result;
}
/**
- * Return new ChoremClient instance with authentication done with login and
- * password found in application configuration. If no login found
- * ChoremClient returned doesn't have authentication.
+ * Returns new ChoremClient instance for the specified domain
*
+ * @param config la configuration a utiliser
* @return
*/
- static public ChoremClient getClient() {
- ApplicationConfig config = ChoremConfig.getConfig();
- String login = config.getOption(ChoremConfigOption.CHOREM_LOGIN.key);
- String password = config.getOption(ChoremConfigOption.CHOREM_PASSWORD.key);
+ static public ChoremClient getClient(ApplicationConfig config) {
+ WikittyService ws = getWikittyService(config);
+ ChoremClient result = new ChoremClient(config, ws);
- ChoremClient result = getClient(login, password);
-
return result;
}
- /**
- * return new ChoremClient instance with authentication done with
- * login and password in argument, only if login is not null and not blank
- *
- * @param login login used for authentication
- * @param password password used for authentication
- */
- static public ChoremClient getClient(String login, String password) {
- ChoremClient result = getClient(null);
+// /**
+// * Returns new ChoremClient instance with specified security token
+// *
+// * @param token can be null, if no authorisation token already exist (no login done)
+// * @return
+// */
+// static public ChoremClient getClient(String token) {
+// ApplicationConfig config = ChoremConfig.getConfig();
+// WikittyService ws = getWikittyService(config);
+// ChoremClient result = new ChoremClient(config, ws);
+// result.setSecurityToken(token);
+//
+// return result;
+// }
+//
+// /**
+// * Return new ChoremClient instance with authentication done with login and
+// * password found in application configuration. If no login found
+// * ChoremClient returned doesn't have authentication.
+// *
+// * @return
+// */
+// static public ChoremClient getClient() {
+// ApplicationConfig config = ChoremConfig.getConfig();
+// String login = config.getOption(ChoremConfigOption.CHOREM_LOGIN.key);
+// String password = config.getOption(ChoremConfigOption.CHOREM_PASSWORD.key);
+//
+// ChoremClient result = getClient(login, password);
+//
+// return result;
+// }
+//
+// /**
+// * return new ChoremClient instance with authentication done with
+// * login and password in argument, only if login is not null and not blank
+// *
+// * @param login login used for authentication
+// * @param password password used for authentication
+// */
+// static public ChoremClient getClient(String login, String password) {
+// ChoremClient result = getClient(null);
+//
+// if (StringUtils.isNotBlank(login)) {
+// result.login(login, password);
+// }
+// return result;
+// }
- if (StringUtils.isNotBlank(login)) {
- result.login(login, password);
- }
- return result;
- }
-
/**
* Returns WikittyService to use. This WikittyService is singleton.
*
@@ -175,11 +202,11 @@
* @param wikittyId
* @return the list of attachments
*/
- static public List<Attachment> getAttachments(String wikittyId) {
+ public List<Attachment> getAttachments(String wikittyId) {
WikittyQuery criteria = new WikittyQueryMaker()
.eq(Attachment.FQ_FIELD_ATTACHMENT_TARGET, wikittyId).end();
- WikittyQueryResult<Attachment> result = getClient(null)
- .findAllByQuery(Attachment.class, criteria);
+ WikittyQueryResult<Attachment> result =
+ findAllByQuery(Attachment.class, criteria);
List<Attachment> attachments = result.getAll();
return attachments;
}
@@ -190,16 +217,20 @@
* @param wikittyId
* @return the list of contact details
*/
- static public List<ContactDetails> getContactDetails(String wikittyId) {
+ public List<ContactDetails> getContactDetails(String wikittyId) {
WikittyQuery criteria = new WikittyQueryMaker()
.eq(ContactDetails.FQ_FIELD_CONTACTDETAILS_TARGET, wikittyId).end();
- WikittyQueryResult<ContactDetails> result = getClient(null)
- .findAllByQuery(ContactDetails.class, criteria);
+ WikittyQueryResult<ContactDetails> result =
+ findAllByQuery(ContactDetails.class, criteria);
List<ContactDetails> contactDetails = result.getAll();
return contactDetails;
}
protected String configId;
+ /**
+ * Retourne la configuration générale pour l'application
+ * @return
+ */
public Configuration getConfiguration() {
if (configId == null) {
configId = findByQuery(new WikittyQueryMaker().exteq(Configuration.EXT_CONFIGURATION).end());
@@ -221,4 +252,60 @@
return config;
}
+ /**
+ * Retourne la comparny par defaut pour l'utilisateur loggue, si par d'utilisateur
+ * alors on prend la company defini dans la configuration general. S'il n'y
+ * a aucune company, on en cree une nouvelle (non stocke) pour que tout
+ * fonctionne bien. Cette company n'existant pas reellement les recherches
+ * l'utilisant ne renvoie pas de resultat
+ * @return on retourne la company par defaut, ou company factice si aucun
+ * defaut n'existe
+ */
+ public Company getDefaultCompany() {
+ String companyId = null;
+ ChoremUser user = getUser(ChoremUser.class);
+
+ // on regarde si l'utilisateur a configurer sa societe par defaut
+ if (user != null) {
+ companyId = user.getDefaultCompany();
+ }
+
+ // on regarde si l'utilateur a une societe (au moins, on la prend au hasard :))
+ WikittyQuery q = new WikittyQueryMaker()
+ .select(Employee.FQ_FIELD_EMPLOYEE_COMPANY)
+ .eq(Employee.FQ_FIELD_EMPLOYEE_PERSON, user)
+ .end();
+ companyId = findByQuery(q);
+
+ // on a toujours pas de societe, on utilise celle de la config de l'application
+ if (companyId == null) {
+ companyId = getConfiguration().getDefaultCompany();
+ }
+
+ Company result = null;
+ if (companyId == null) {
+ // on a trouve aucun societe on fini par en cree une victive qui ne doit pas etre persiste
+ result = new CompanyImpl();
+ result.setName("No Company");
+ } else {
+ // on restore la societe trouvee
+ result = restore(Company.class, companyId);
+ }
+ return result;
+ }
+
+ /**
+ * Retourne toutes les companies possible pour l'utilisateur loggue
+ * @return
+ */
+ public List<Company> getUserCompanies() {
+ String userId = getUser().getWikittyId();
+ // on recupere toutes les companies pour lequel le user est salarie
+ WikittyQuery q = new WikittyQueryMaker()
+ .select(Employee.FQ_FIELD_EMPLOYEE_COMPANY)
+ .eq(Employee.FQ_FIELD_EMPLOYEE_PERSON, userId)
+ .end();
+ WikittyQueryResult<Company> result = findAllByQuery(Company.class, q);
+ return result.getAll();
+ }
}
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -23,6 +23,7 @@
package org.chorem;
import org.apache.commons.lang.UnhandledException;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
@@ -46,22 +47,37 @@
public ChoremConfig() {
}
- public static ApplicationConfig getConfig(String... args) {
+ /**
+ * Get config for specified domain, if domain is null, configuration domain
+ * is used
+ * @param domain
+ * @param args
+ * @return
+ */
+ public static ApplicationConfig getConfig(String domain, String... args) {
if (config == null) {
synchronized (ChoremConfig.class) {
if (config == null) {
try {
- config = new ApplicationConfig(ChoremConfigOption.CONFIG_FILE.getDefaultValue());
+ config = new ApplicationConfig(
+ ChoremConfigOption.CONFIG_FILE.getDefaultValue());
// Load wikitty options
- config.loadDefaultOptions(WikittyConfigOption.class);
+ config.loadDefaultOptions(WikittyConfigOption.values());
// Load chorem options
- config.loadDefaultOptions(ChoremConfigOption.class);
+ config.loadDefaultOptions(ChoremConfigOption.values());
// Load chorem action
- config.loadActions(ChoremConfigAction.class);
+ config.loadActions(ChoremConfigAction.values());
+ // set domain before parse command line but after load default
+ if (StringUtils.isNotBlank(domain)) {
+ config.setOption(
+ ChoremConfigOption.CHOREM_DOMAIN.getKey(),
+ domain);
+ }
+
// Parse args
config.parse(args);
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -22,9 +22,10 @@
*/
package org.chorem;
-import static org.nuiton.i18n.I18n._;
import org.nuiton.util.ApplicationConfig;
+import static org.nuiton.i18n.I18n._;
+
/**
* Chorem option definition.
*
@@ -37,13 +38,18 @@
CHOREM_EXTENSION_SEARCH_EXCLUSION(
"chorem.extension.search.exclusion",
_("Liste des extensions qui ne doivent pas apparaitre dans les resultats"),
- "Configuration,Interval,WikittyTreeNode",
+ "Configuration,Interval,WikittyTreeNode,WikittyToken,WikittyUser",
String.class, false, false),
CHOREM_AUTHENTICATION(
"chorem.authentication",
_("If true authentication is used to acces page (default: false)"),
"false",
Boolean.class, false, false),
+ CHOREM_DOMAIN(
+ "chorem.domain",
+ _("Domain qui permet de trouver la base de donnees a utiliser"),
+ "default",
+ String.class, false, false),
CHOREM_LOGIN(
"chorem.admin.login",
_("Login as default login for action on command line"),
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -44,7 +44,7 @@
System.out.println(String.format("Launching ChoremMain ... (args: %s)", Arrays.toString(args)));
// getConfig do all: parse and doAllAction
// String[] forceArgs = "--clean -ic /tmp/chorem-company.csv -ip /tmp/chorem-person.csv -ie /tmp/chorem-employee.csv --import-contract-type /tmp/chorem-contracttype.csv --import-contract /tmp/chorem-contract.csv --commit".split(" ");
- ApplicationConfig config = ChoremConfig.getConfig(args);
+ ApplicationConfig config = ChoremConfig.getConfig(null, args);
System.exit(0);
}
Modified: trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -38,6 +38,7 @@
import org.chorem.entities.EmployeeImpl;
import org.chorem.entities.InvoiceImpl;
import org.chorem.entities.PersonImpl;
+import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ApplicationConfig.Action.Step;
import org.nuiton.wikitty.entities.BusinessEntityImpl;
@@ -107,7 +108,10 @@
// a ne pas stocker dans wikitty
protected Map<String, String> contractType = new HashMap<String, String>();
- public ImportChoremTopia() {
+ protected ApplicationConfig config;
+
+ public ImportChoremTopia(ApplicationConfig config) {
+ this.config = config;
}
/**
@@ -138,7 +142,9 @@
}
/**
- * Commit all imported data. Step number must be the last
+ * Commit all imported data. Step number must be the last.
+ * @param domain le domain permettant de trouver la base de donnees dans
+ * lequel le commit doit etre fait
*/
@Step(99)
public void commit() {
@@ -149,7 +155,7 @@
data.addAll(employees.values());
data.addAll(contacts);
- ChoremClient proxy = ChoremClient.getClient();
+ ChoremClient proxy = ChoremClient.getClient(config);
data = proxy.store(data);
System.out.println(String.format("%s Commited data", data.size()));
}
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties
===================================================================
--- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-23 23:36:55 UTC (rev 255)
@@ -37,9 +37,9 @@
#
# ChoremUser
#
-org.chorem.entities.Attachment.class.tagvalue.version=1.0
-org.chorem.entities.Attachment.class.tagvalue.toString=%WikittyUser.login|nologin$s
-org.chorem.entities.Attachment.class.tagvalue.sortOrder=WikittyUser.login
+org.chorem.entities.ChoremUser.class.tagvalue.version=1.0
+org.chorem.entities.ChoremUser.class.tagvalue.toString=%WikittyUser.login|nologin$s
+org.chorem.entities.ChoremUser.class.tagvalue.sortOrder=WikittyUser.login
#
# Configuration
#
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -4,6 +4,7 @@
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.chorem.ChoremClient;
import org.chorem.ChoremConfig;
import org.debux.webmotion.server.call.Call;
import org.debux.webmotion.server.call.HttpContext;
@@ -22,8 +23,6 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(ChoremWebMotionUtil.class);
- static final private String SECURITY_TOKEN = "SecurityTocken";
-
static public String getDomain(Call call) {
String result = getDomain(call.getContext().getRequest());
return result;
@@ -39,33 +38,40 @@
return result;
}
- static public String getSecurityToken(Call call) {
- String result = getSecurityToken(call.getContext().getRequest());
+ static public ApplicationConfig getConfig(HttpContext context) {
+ String domain = getDomain(context);
+ ApplicationConfig result = ChoremConfig.getConfig(domain);
return result;
}
- static public String getSecurityToken(HttpContext context) {
- String result = getSecurityToken(context.getRequest());
+ static public ChoremClient getClient(Call call) {
+ ChoremClient result = getClient(call.getContext().getRequest());
return result;
}
- static public String getSecurityToken(HttpServletRequest request) {
- String domain = getDomain(request);
- String result = (String)request.getSession().getAttribute(domain + "." + SECURITY_TOKEN);
+ static public ChoremClient getClient(HttpContext context) {
+ ChoremClient result = getClient(context.getRequest());
return result;
}
- static public void setSecurityToken(HttpContext context, String token) {
- setSecurityToken(context.getRequest(), token);
- }
-
- static public void setSecurityToken(HttpServletRequest request, String token) {
+ /**
+ * Recupere le ChoremClient pour cette utilisateur dans sa session. S'il n'a
+ * pas encore de ChoremClient l'objet est cree et pousser dans la session.
+ * Ce ChoremClient n'est pas encore authentifier (pas de token de securite)
+ * @param request
+ * @return
+ */
+ static public ChoremClient getClient(HttpServletRequest request) {
String domain = getDomain(request);
- request.getSession().setAttribute(domain + "." + SECURITY_TOKEN, token);
- }
+ ChoremClient result = (ChoremClient)request.getSession().getAttribute(
+ domain + "." + ChoremClient.class.getName());
+ if (result == null) {
+ result = ChoremClient.getClient(domain);
+ request.getSession().setAttribute(domain + "." + ChoremClient.class.getName(), result);
+ }
- static public ApplicationConfig getConfig(HttpContext context) {
- ApplicationConfig result = ChoremConfig.getConfig();
return result;
}
+
+
}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/GenericAction.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -23,6 +23,20 @@
package org.chorem.webmotion.actions;
import com.google.common.collect.LinkedHashMultimap;
+import java.io.ByteArrayInputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
@@ -33,6 +47,7 @@
import org.debux.webmotion.server.WebMotionController;
import org.debux.webmotion.server.call.Call;
import org.debux.webmotion.server.call.UploadFile;
+import org.debux.webmotion.server.mapping.Config;
import org.debux.webmotion.server.render.Render;
import org.nuiton.wikitty.entities.Element;
import org.nuiton.wikitty.entities.ElementField;
@@ -45,23 +60,6 @@
import org.nuiton.wikitty.query.WikittyQueryParser;
import org.nuiton.wikitty.query.WikittyQueryResult;
-import java.io.ByteArrayInputStream;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.servlet.ServletContext;
-import org.debux.webmotion.server.mapping.Config;
-
/**
*
* @author poussin
@@ -75,6 +73,11 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(GenericAction.class);
+ public Render logout(HttpSession session) {
+ session.invalidate();
+ return renderURL("/");
+ }
+
// FIXME poussin 20120418 cette methode est-elle vraiment utilise ?
// si oui searchJson ne peut-elle pas la remplacer ?
public Render searchFieldJson(ChoremClient client, String query) {
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -23,14 +23,13 @@
package org.chorem.webmotion.filters;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.ChoremClient;
-import org.debux.webmotion.server.WebMotionFilter;
-import javax.servlet.http.HttpSession;
-import org.apache.commons.lang3.StringUtils;
import org.chorem.ChoremConfigOption;
import org.chorem.webmotion.ChoremWebMotionUtil;
+import org.debux.webmotion.server.WebMotionFilter;
import org.debux.webmotion.server.call.HttpContext;
import org.debux.webmotion.server.render.Render;
import org.nuiton.util.ApplicationConfig;
@@ -54,10 +53,19 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(AuthenticationFilter.class);
- public Render check(ChoremClient client, HttpContext context,
+ public Render check(HttpContext context,
String choremLogin, String choremPassword) {
- String token = ChoremWebMotionUtil.getSecurityToken(context);
- log.debug("SecurityTocken: " + StringUtils.isNotBlank(token));
+ Render result = null;
+
+ // injection de ChoremWebMotionUtil dans la session
+ ChoremClient client = ChoremWebMotionUtil.getClient(context);
+
+ String token = client.getSecurityToken();
+ if (log.isDebugEnabled()) {
+ // on affiche pas le token, car ca creerait un trou de securite
+ // on indique donc juste s'il y en a un
+ log.debug("SecurityTocken: " + StringUtils.isNotBlank(token));
+ }
if (token == null) {
if (StringUtils.isBlank(choremLogin)) {
// avant de mettre la page de login, on verifie s'il le faut vraiment
@@ -72,21 +80,33 @@
.exteq(WikittyUser.EXT_WIKITTYUSER).end();
String userId = client.findByQuery(q);
if (userId != null) {
- return renderView("login.jsp");
+ result = renderView("login.jsp");
}
}
} else {
// phase d'authentification, l'utilisateur a soumis le formulaire de login
try {
client.login(choremLogin, choremPassword);
- ChoremWebMotionUtil.setSecurityToken(context, client.getSecurityToken());
+ String url = context.getUrl();
+ String query = context.getRequest().getQueryString();
+ if (StringUtils.isNotBlank(query)) {
+ url = StringUtils.join(url, "?", query);
+ }
+
+
+ result = renderURL(url);
} catch (SecurityException eee) {
context.addErrorMessage("message", "bad login or password");
- return renderView("login.jsp");
+ result = renderView("login.jsp");
}
}
}
- doProcess();
- return null;
+
+ if (result == null) {
+ doProcess();
+ return null;
+ } else {
+ return result;
+ }
}
}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/ChoremClientFilter.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/ChoremClientFilter.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/ChoremClientFilter.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -26,52 +26,32 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.chorem.ChoremClient;
+import org.chorem.webmotion.ChoremWebMotionUtil;
import org.debux.webmotion.server.WebMotionFilter;
-import org.debux.webmotion.server.WebMotionUtils;
-import org.debux.webmotion.server.call.Executor;
-import org.debux.webmotion.server.mapping.Mapping;
+import org.debux.webmotion.server.call.HttpContext;
-import java.lang.reflect.Method;
-import java.util.Map;
-
/**
- * Inject dans les parametres des actions le client wikitty a utiliser pour les
- * actions (ChoremClient)
+ * Inject le ChoremClient dans la request pour permettre au JSP de facilement
+ * l'utiliser. Cela est necessaire car celui en session
+ * est enregistrer avec le domain, ce qui empeche la recuperation dans
+ * les jsp pour l'utiliser.
*
* @author poussin
* @version $Revision$
*
* Last update: $Date$
* by : $Author$
- *
- * @deprecated filter has been replaced by {@link org.chorem.webmotion.injector.InjectorListener}
*/
public class ChoremClientFilter extends WebMotionFilter {
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(ChoremClientFilter.class);
- public void inject(Mapping mapping, String token) {
- ChoremClient client = ChoremClient.getClient(token);
-
- Executor executor = contextable.getCall().getExecutor();
- if (executor != null) {
- Method executorMethod = executor.getMethod();
- String[] parameterNames = WebMotionUtils.getParameterNames(mapping, executorMethod);
- Class<?>[] parameterTypes = executorMethod.getParameterTypes();
- Map<String, Object> parameters = executor.getParameters();
-
- for (int i=0; i<parameterNames.length; i++) {
- Class<?> clazz = parameterTypes[i];
- if (ChoremClient.class.isAssignableFrom(clazz)) {
- String name = parameterNames[i];
- if (parameters.get(name) == null) {
- parameters.put(name, client);
- }
- }
- }
- }
-
+ public void inject(HttpContext context) {
+ // recuperation du client courant
+ ChoremClient client = ChoremWebMotionUtil.getClient(context);
+ // ajout dans la request
+ context.getRequest().setAttribute("client", client);
doProcess();
}
}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/DecoratorFilter.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/DecoratorFilter.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/DecoratorFilter.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -33,10 +33,10 @@
* le fichier view par defaut ou le nom du slot principale
* <p>
* parametre possible
- * <li> view: le nom du fichier jsp a utiliser comme decorateur (defaut: decorator.jsp)
- * <li> main: le nom du slot utilise pour mettre le contenu principal (defaut: slotContent)
+ * <li> wmDecoratorView: le nom du fichier jsp a utiliser comme decorateur (defaut: decorator.jsp)
+ * <li> wmDecoratorMain: le nom du slot utilise pour mettre le contenu principal (defaut: slotContent)
*
- * Si dans la requete on trouve un attribut "__nodecorator__" qui vaut true alors
+ * Si dans la requete on trouve un attribut "wmDecoratorNo" qui vaut true alors
* on ne fait pas la decoration.
*
* @author poussin
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2012-08-23 23:36:55 UTC (rev 255)
@@ -52,9 +52,8 @@
@Override
public Object getValue(Mapping mapping, Call call, Class<?> type, Type generic) {
if (ChoremClient.class.isAssignableFrom(type)) {
- String token = ChoremWebMotionUtil.getSecurityToken(call);
// Get Client
- ChoremClient client = ChoremClient.getClient(token);
+ ChoremClient client = ChoremWebMotionUtil.getClient(call);
return client;
}
return null;
Modified: trunk/chorem-webmotion/src/main/resources/mapping
===================================================================
--- trunk/chorem-webmotion/src/main/resources/mapping 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/resources/mapping 2012-08-23 23:36:55 UTC (rev 255)
@@ -5,14 +5,21 @@
server.listener.class=org.chorem.webmotion.injector.InjectorListener
[filters]
-#* /* ChoremClientFilter.inject
-#GET /wikitty/{extension}/view/{id} DecoratorFilter.decorate slotEntityFooter={extension}Footer.jsp
+* /* ChoremClientFilter.inject
+#GET /wikitty/{extension}/view/* DecoratorFilter.decorate slotEntityFooter={extension}Footer.jsp
* /wikitty-json/* DecoratorFilter.decorate wmDecoratorNo=true
* /fragment/* DecoratorFilter.decorate wmDecoratorNo=true
-GET /* DecoratorFilter.decorate
-GET /* AuthenticationFilter.check
+GET /* DecoratorFilter.decorate
+* /* AuthenticationFilter.check
+#####
+#/!\#
+##### il y a un bug si on met le DecoratorFilter en POST avec les formulaires
+##### enctype="multipart/form-data", il faut donc que tous les form post
+##### fasse un redirect en GET apres leur action, sinon on a pas de decorateur
+##### le symptome de l'erreur est qu'il n'y a aucun parametre qui nous arrive :(
[actions]
+* /logout action:GenericAction.logout
* / view:index.jsp
* /wikitty/{extension}/search action:GenericAction.search
* /wikitty/{extension}/view/{id} action:GenericAction.view
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/decorator.jsp 2012-08-23 23:36:55 UTC (rev 255)
@@ -22,6 +22,7 @@
--%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/WEB-INF/wikitty.tld" prefix="w"%>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
@@ -190,8 +191,13 @@
<input type="text" class="search-query" placeholder="Search" name="query" value="${param.query}"/>
</form>
</div>
-
+ <c:if test="${client.user != null}">
+ <w:display wikitty="${client.user}"/>
+ <w:display wikitty="${client.defaultCompany}"/>
+ <a href="<c:url value='/logout'/>">Logout</a>
+ </c:if>
+
</div>
</div>
</div>
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp 2012-08-23 11:06:17 UTC (rev 254)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp 2012-08-23 23:36:55 UTC (rev 255)
@@ -26,7 +26,8 @@
Bienvenue sur Chorem, l'outil de gestion d'entreprise.
-<form>
+<%-- En post pour eviter d'avoir le mot de passe dans l'url --%>
+<form method="POST">
<input type="text" name="choremLogin" placeholder="login"/>
<input type="password" name="choremPassword" placeholder="password"/>
<input type="submit"/>
1
0
r254 - in trunk: chorem-entities/src/main/java/org/chorem chorem-entities/src/main/xmi chorem-webmotion/src/main/java/org/chorem/webmotion chorem-webmotion/src/main/java/org/chorem/webmotion/filters chorem-webmotion/src/main/java/org/chorem/webmotion/injector chorem-webmotion/src/main/resources chorem-webmotion/src/main/webapp/WEB-INF/jsp
by bpoussin@users.chorem.org 23 Aug '12
by bpoussin@users.chorem.org 23 Aug '12
23 Aug '12
Author: bpoussin
Date: 2012-08-23 13:06:17 +0200 (Thu, 23 Aug 2012)
New Revision: 254
Url: http://chorem.org/repositories/revision/chorem/254
Log:
modif extension WikittyTreeNode pour une meilleur presentation
debut d'implantation d'une authentification (si la config le demande)
Added:
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp
Modified:
trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java
trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java
trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java
trunk/chorem-entities/src/main/xmi/chorem-model.properties
trunk/chorem-entities/src/main/xmi/chorem-model.zargo
trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
trunk/chorem-webmotion/src/main/resources/mapping
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -32,9 +32,11 @@
import org.chorem.entities.ContactDetails;
import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.VersionUtil;
import org.nuiton.wikitty.WikittyClient;
import org.nuiton.wikitty.WikittyService;
import org.nuiton.wikitty.WikittyServiceFactory;
+import org.nuiton.wikitty.WikittyUtil;
import org.nuiton.wikitty.entities.WikittyExtension;
import org.nuiton.wikitty.query.WikittyQuery;
import org.nuiton.wikitty.query.WikittyQueryMaker;
@@ -115,11 +117,11 @@
// register last entity versions in database
List<WikittyExtension> exts = new ArrayList<WikittyExtension>();
- exts.addAll(org.chorem.entities.ConfigurationAbstract.extensions);
+ exts.addAll(org.chorem.entities.AttachmentAbstract.extensions);
exts.addAll(org.chorem.entities.CategoryAbstract.extensions);
- exts.addAll(org.chorem.entities.AttachmentAbstract.extensions);
- exts.addAll(org.chorem.entities.NoteAbstract.extensions);
+ exts.addAll(org.chorem.entities.ChoremUserAbstract.extensions);
exts.addAll(org.chorem.entities.CompanyAbstract.extensions);
+ exts.addAll(org.chorem.entities.ConfigurationAbstract.extensions);
exts.addAll(org.chorem.entities.ContactDetailsAbstract.extensions);
exts.addAll(org.chorem.entities.EmployeeAbstract.extensions);
exts.addAll(org.chorem.entities.EvaluationAbstract.extensions);
@@ -129,6 +131,7 @@
exts.addAll(org.chorem.entities.InvoiceableAbstract.extensions);
exts.addAll(org.chorem.entities.InvoiceAbstract.extensions);
exts.addAll(org.chorem.entities.MissionAbstract.extensions);
+ exts.addAll(org.chorem.entities.NoteAbstract.extensions);
exts.addAll(org.chorem.entities.PersonAbstract.extensions);
exts.addAll(org.chorem.entities.PersonSkillAbstract.extensions);
exts.addAll(org.chorem.entities.ProjectAbstract.extensions);
@@ -140,13 +143,25 @@
exts.addAll(org.chorem.entities.VacationAbstract.extensions);
exts.addAll(org.chorem.entities.WorkerAbstract.extensions);
+ exts.addAll(org.nuiton.wikitty.entities.WikittyAuthorisationAbstract.extensions);
exts.addAll(org.nuiton.wikitty.entities.WikittyGroupAbstract.extensions);
- exts.addAll(org.nuiton.wikitty.entities.WikittyUserAbstract.extensions);
- exts.addAll(org.nuiton.wikitty.entities.WikittyTreeNodeAbstract.extensions);
exts.addAll(org.nuiton.wikitty.entities.WikittyHookAbstract.extensions);
- exts.addAll(org.nuiton.wikitty.entities.WikittyAuthorisationAbstract.extensions);
exts.addAll(org.nuiton.wikitty.entities.WikittyLabelAbstract.extensions);
+ exts.addAll(org.nuiton.wikitty.entities.WikittyTreeNodeAbstract.extensions);
+ exts.addAll(org.nuiton.wikitty.entities.WikittyUserAbstract.extensions);
+ // Ajout de TAG value specifique au objet deja genere dans Wikitty
+//org.chorem.entities.WikittyTreeNode.attribute.name.tagvalue.help=Le nom pour cette catégorie (ex: dépense, Salaire, ...)
+//org.chorem.entities.WikittyTreeNode.attribute.attachment.tagvalue.visible=false
+//org.chorem.entities.WikittyTreeNode.attribute.parent.tagvalue.help=La catégorie Parente de celle-ci (ex: dépense pour Loyer)
+//org.chorem.entities.WikittyTreeNode.attribute.parent.tagvalue.allowed=Category
+ WikittyExtension e = org.nuiton.wikitty.entities.WikittyTreeNodeAbstract.extensionWikittyTreeNode;
+ e.setVersion(WikittyUtil.incrementMajorRevision(e.getVersion())); // toujours faire attention d'etre a +1 par rapport a l'objet genere
+ e.getFieldType("name").addTagValue("help", "Le nom pour cette catégorie (ex: dépense, Salaire, ...)");
+ e.getFieldType("attachment").addTagValue("visible", "false");
+ e.getFieldType("parent").addTagValue("help", "La catégorie Parente de celle-ci (ex: dépense pour Loyer)");
+ e.getFieldType("parent").addTagValue("allowed", "Category");
+
ws.storeExtension(null, exts);
}
}
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfig.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -38,7 +38,7 @@
static protected ApplicationConfig config = null;
- /**
+ /**
* constructeur public seulement pour pouvoir mettre une variable de ce
* type dans BowBaseAction et acceder facilement au donnees dans les jsp
* en ognl
Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -20,22 +20,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-/*
- * Copyright (c) 2011 poussin. All rights reserved.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
package org.chorem;
import static org.nuiton.i18n.I18n._;
@@ -53,8 +37,13 @@
CHOREM_EXTENSION_SEARCH_EXCLUSION(
"chorem.extension.search.exclusion",
_("Liste des extensions qui ne doivent pas apparaitre dans les resultats"),
- "Configuration,Interval",
+ "Configuration,Interval,WikittyTreeNode",
String.class, false, false),
+ CHOREM_AUTHENTICATION(
+ "chorem.authentication",
+ _("If true authentication is used to acces page (default: false)"),
+ "false",
+ Boolean.class, false, false),
CHOREM_LOGIN(
"chorem.admin.login",
_("Login as default login for action on command line"),
Modified: trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -36,6 +36,7 @@
import org.chorem.entities.CompanyImpl;
import org.chorem.entities.ContactDetailsImpl;
import org.chorem.entities.EmployeeImpl;
+import org.chorem.entities.InvoiceImpl;
import org.chorem.entities.PersonImpl;
import org.nuiton.util.ApplicationConfig.Action.Step;
import org.nuiton.wikitty.entities.BusinessEntityImpl;
@@ -49,6 +50,8 @@
* \copy contracttype to '/tmp/chorem-contracttype.csv' delimiter ';' CSV HEADER
* \copy contract to '/tmp/chorem-contract.csv' delimiter ';' CSV HEADER
*
+ * pour bill
+ * \copy (SELECT subcategory.name AS category, number, issuedate, hopedate, realdate, value, company.name AS company from bill LEFT OUTER JOIN subcategory ON bill.subcategory=subcategory.topiaid LEFT OUTER JOIN task ON bill.task=task.topiaid LEFT OUTER JOIN contact ON bill.contact=contact.topiaid LEFT OUTER JOIN company ON contact.company=company.topiaid order by company.name) TO '/tmp/bill.csv' delimiter ';' CSV HEADER
* </pre>
*
* @author poussin
@@ -91,10 +94,15 @@
monthduration, basepay, othercost, employee, contracttype
}
+ enum BILL_HEADER {
+ category,number,issuedate,hopedate,realdate,value,company
+ }
+
protected List<ContactDetailsImpl> contacts = new LinkedList<ContactDetailsImpl>();
protected Map<String, CompanyImpl> companies = new HashMap<String, CompanyImpl>();
protected Map<String, PersonImpl> persons = new HashMap<String, PersonImpl>();
protected Map<String, EmployeeImpl> employees = new HashMap<String, EmployeeImpl>();
+ protected Map<String, InvoiceImpl> invoices = new HashMap<String, InvoiceImpl>();
// a ne pas stocker dans wikitty
protected Map<String, String> contractType = new HashMap<String, String>();
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties
===================================================================
--- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-23 11:06:17 UTC (rev 254)
@@ -35,6 +35,12 @@
org.chorem.entities.Attachment.attribute.content.tagvalue.help=Le fichier \u00e0 importer
org.chorem.entities.Attachment.attribute.contentUrl.tagvalue.help=Si on ne souhaite pas importer le fichier, on peut indiquer ici sont URL (ex: http://commun.codelutin.home/Clients/...)
#
+# ChoremUser
+#
+org.chorem.entities.Attachment.class.tagvalue.version=1.0
+org.chorem.entities.Attachment.class.tagvalue.toString=%WikittyUser.login|nologin$s
+org.chorem.entities.Attachment.class.tagvalue.sortOrder=WikittyUser.login
+#
# Configuration
#
org.chorem.entities.Configuration.class.tagvalue.version=3.0
Modified: trunk/chorem-entities/src/main/xmi/chorem-model.zargo
===================================================================
(Binary files differ)
Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java (rev 0)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/ChoremWebMotionUtil.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -0,0 +1,71 @@
+package org.chorem.webmotion;
+
+
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.ChoremConfig;
+import org.debux.webmotion.server.call.Call;
+import org.debux.webmotion.server.call.HttpContext;
+import org.nuiton.util.ApplicationConfig;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ChoremWebMotionUtil {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ChoremWebMotionUtil.class);
+
+ static final private String SECURITY_TOKEN = "SecurityTocken";
+
+ static public String getDomain(Call call) {
+ String result = getDomain(call.getContext().getRequest());
+ return result;
+ }
+
+ static public String getDomain(HttpContext context) {
+ String result = getDomain(context.getRequest());
+ return result;
+ }
+
+ static public String getDomain(HttpServletRequest request) {
+ String result = request.getServerName();
+ return result;
+ }
+
+ static public String getSecurityToken(Call call) {
+ String result = getSecurityToken(call.getContext().getRequest());
+ return result;
+ }
+
+ static public String getSecurityToken(HttpContext context) {
+ String result = getSecurityToken(context.getRequest());
+ return result;
+ }
+
+ static public String getSecurityToken(HttpServletRequest request) {
+ String domain = getDomain(request);
+ String result = (String)request.getSession().getAttribute(domain + "." + SECURITY_TOKEN);
+ return result;
+ }
+
+ static public void setSecurityToken(HttpContext context, String token) {
+ setSecurityToken(context.getRequest(), token);
+ }
+
+ static public void setSecurityToken(HttpServletRequest request, String token) {
+ String domain = getDomain(request);
+ request.getSession().setAttribute(domain + "." + SECURITY_TOKEN, token);
+ }
+
+ static public ApplicationConfig getConfig(HttpContext context) {
+ ApplicationConfig result = ChoremConfig.getConfig();
+ return result;
+ }
+}
Added: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java (rev 0)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/filters/AuthenticationFilter.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -0,0 +1,92 @@
+/*
+ * #%L
+ * Chorem webmotion
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2011 - 2012 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package org.chorem.webmotion.filters;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.chorem.ChoremClient;
+import org.debux.webmotion.server.WebMotionFilter;
+import javax.servlet.http.HttpSession;
+import org.apache.commons.lang3.StringUtils;
+import org.chorem.ChoremConfigOption;
+import org.chorem.webmotion.ChoremWebMotionUtil;
+import org.debux.webmotion.server.call.HttpContext;
+import org.debux.webmotion.server.render.Render;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.wikitty.entities.WikittyUser;
+import org.nuiton.wikitty.query.WikittyQuery;
+import org.nuiton.wikitty.query.WikittyQueryMaker;
+
+/**
+ * Inject dans les parametres des actions le client wikitty a utiliser pour les
+ * actions (ChoremClient)
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ *
+ */
+public class AuthenticationFilter extends WebMotionFilter {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(AuthenticationFilter.class);
+
+ public Render check(ChoremClient client, HttpContext context,
+ String choremLogin, String choremPassword) {
+ String token = ChoremWebMotionUtil.getSecurityToken(context);
+ log.debug("SecurityTocken: " + StringUtils.isNotBlank(token));
+ if (token == null) {
+ if (StringUtils.isBlank(choremLogin)) {
+ // avant de mettre la page de login, on verifie s'il le faut vraiment
+ ApplicationConfig config = ChoremWebMotionUtil.getConfig(context);
+ boolean authActivate =
+ config.getOptionAsBoolean(ChoremConfigOption.CHOREM_AUTHENTICATION.getKey());
+ if (authActivate) {
+ // la configuration demande une authentification, mais s'il
+ // n'y a aucun WikittyUser, on ne le fait pas pour permettre
+ // la creation du 1er user
+ WikittyQuery q = new WikittyQueryMaker()
+ .exteq(WikittyUser.EXT_WIKITTYUSER).end();
+ String userId = client.findByQuery(q);
+ if (userId != null) {
+ return renderView("login.jsp");
+ }
+ }
+ } else {
+ // phase d'authentification, l'utilisateur a soumis le formulaire de login
+ try {
+ client.login(choremLogin, choremPassword);
+ ChoremWebMotionUtil.setSecurityToken(context, client.getSecurityToken());
+ } catch (SecurityException eee) {
+ context.addErrorMessage("message", "bad login or password");
+ return renderView("login.jsp");
+ }
+ }
+ }
+ doProcess();
+ return null;
+ }
+}
Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java
===================================================================
--- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/injector/InjectorListener.java 2012-08-23 11:06:17 UTC (rev 254)
@@ -36,6 +36,7 @@
import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.lang3.StringUtils;
+import org.chorem.webmotion.ChoremWebMotionUtil;
import org.nuiton.wikitty.WikittyUtil;
/**
@@ -45,20 +46,15 @@
@Override
public void onStart(ServerContext context) {
-
- // FIXME poussin 20120815 il y a un probleme avec l'injection du ChoremClient.
- // a terme, il doit y avoir un ChoremClient instancier pour chaque requete,
- // car chaque requete est faite par un utilisateur different (token different)
-
- // Get Client
- String token = "";
- final ChoremClient client = ChoremClient.getClient(null);
-
+
// Declare injector
context.addInjector(new Injector() {
@Override
public Object getValue(Mapping mapping, Call call, Class<?> type, Type generic) {
if (ChoremClient.class.isAssignableFrom(type)) {
+ String token = ChoremWebMotionUtil.getSecurityToken(call);
+ // Get Client
+ ChoremClient client = ChoremClient.getClient(token);
return client;
}
return null;
Modified: trunk/chorem-webmotion/src/main/resources/mapping
===================================================================
--- trunk/chorem-webmotion/src/main/resources/mapping 2012-08-22 14:11:15 UTC (rev 253)
+++ trunk/chorem-webmotion/src/main/resources/mapping 2012-08-23 11:06:17 UTC (rev 254)
@@ -10,6 +10,7 @@
* /wikitty-json/* DecoratorFilter.decorate wmDecoratorNo=true
* /fragment/* DecoratorFilter.decorate wmDecoratorNo=true
GET /* DecoratorFilter.decorate
+GET /* AuthenticationFilter.check
[actions]
* / view:index.jsp
Added: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp (rev 0)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/login.jsp 2012-08-23 11:06:17 UTC (rev 254)
@@ -0,0 +1,33 @@
+<%--
+ #%L
+ Chorem webmotion
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2011 - 2012 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+<h1>Chorem</h1>
+
+Bienvenue sur Chorem, l'outil de gestion d'entreprise.
+
+<form>
+ <input type="text" name="choremLogin" placeholder="login"/>
+ <input type="password" name="choremPassword" placeholder="password"/>
+ <input type="submit"/>
+</form>
\ No newline at end of file
1
0
r253 - in trunk: chorem-entities/src/main/java/org/chorem chorem-webmotion/src/main/webapp/WEB-INF/jsp chorem-webmotion/src/main/webapp/css
by bpoussin@users.chorem.org 22 Aug '12
by bpoussin@users.chorem.org 22 Aug '12
22 Aug '12
Author: bpoussin
Date: 2012-08-22 16:11:15 +0200 (Wed, 22 Aug 2012)
New Revision: 253
Url: http://chorem.org/repositories/revision/chorem/253
Log:
ajout des fetes :), completement inutile donc indispensable (recuperation d'un travail de 2002 :))
Added:
trunk/chorem-entities/src/main/java/org/chorem/Saint.java
Modified:
trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp
trunk/chorem-webmotion/src/main/webapp/css/chorem.less
Added: trunk/chorem-entities/src/main/java/org/chorem/Saint.java
===================================================================
--- trunk/chorem-entities/src/main/java/org/chorem/Saint.java (rev 0)
+++ trunk/chorem-entities/src/main/java/org/chorem/Saint.java 2012-08-22 14:11:15 UTC (rev 253)
@@ -0,0 +1,70 @@
+/*
+ * #%L
+ * Chorem entities
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2011 - 2012 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+package org.chorem;
+
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * Contient toutes les fetes du calendrier.
+ * data[month - 1][day of month -1]
+ * @author poussin
+ */
+public class Saint{
+ static final public String[][] data = new String[][]{
+ {"MARIE", "BASILE, VASSILI", "GENEVIEVE, GINETTE", "EDDY, ODILON", "EDOUARD, EMILIENNE, TED, TEDDY", "MELAINE, TIPHAINE", "CEDRIC, RAYMOND, RAYMONDE, VIRGINIE", "LUCIEN, LUCIENNE, PEGGY", "ALEXIA, ALIX", "BILL, BILLY, GUILLAUME, GUILLEMETTE, WILLIAM, WILLY", "PAULIN", "AILRED, CESARINE, EILRED, TANIA, TANIS, TATIANA", "HILAIRE, YVETTE", "NINA", "AMAURY, MAUR, RACHEL, REMI, REMY", "HONORAT, MARCEAU, MARCEL", "ANTHONY, ANTOINE, ROSELINE", "GWENDAL, PRISCA", "BREVELAER, MARIO, MARIUS", "BASTIEN, FABIEN, FABIENNE, SEBASTIEN", "AGNES, INES", "VINCE, VINCENT", "BARNARD", "FRANCOIS DE SALES, PACO, TIM", "APOLLOS, MORGANE", "MELANIE, PAOL, PAOLA, PAULA, PAULE, PAULINE, TIMOTHEE", "ANGELE, ANGELINE, ANGELIQUE", "THOMAS D'AQUIN", "GILDAS", "BATHILDE, BATHYLLE, BOB, JACINTHE, MARTINE", "MARCELLE, NIKITA"},
+ {"ELLA, ELLE, ELLENITA, VIRIDIANA", "GUTUAL, THEOPHANE", "ANATOLE, BLAISE, OSCAR", "BERENICE, GIL, GILBERT, VANESSA, VERONIQUE", "AGATHE, AVIT", "AMAND, AMANDA, DOROTHEE, GASTON", "EUGENIE", "ELISENDA, JACKIE, JACQUELINE", "APPOLLINE", "ARNAUD", "N.-D. DE LOURDES, N.D. DE LOURDES", "FELIX", "BEA, BEATRICE, JORDAN, JORDANNE", "TINO, VALENTIN", "CLAUDE, CLAUDIE, CLAUDINE, CLAUDIUS, FAUSTIN", "ELIAZ, JULIENNE, LUCILLE, PAMELA, PAMPHILE", "ALEXIS, LOGAN", "BERNADETTE, FLAVIEN, NADETTE, NADINE, SIMEON", "GABIN", "AIMEE", "DAMIEN, DINAN", "ISA, ISABELLE, TERRY", "LAZARE, POLYCARPE", "MODESTE", "ROMEO", "NESTOR", "HONORINE", "ANTOINETTE, ROMAIN", "AUGUSTE"},
+ {"ALBIN, ALBINA, AUBIN, DENIEL, JONATHAN", "CARL, CHARLES LE B., JAOUEN, JOEVIN", "GUENOLE", "CASIMIR", "GERAN, OLIVE, OLIVETTE, OLIVIA", "COLETTE, NICOLE", "FELICIE, FELICITE, PERPETUE", "JEAN DE D.", "FRANCE, FRANCETTE, FRANCINE, FRANCOISE, PAQUITA", "ANASTASIE, VIVIEN", "ROSINE", "ELPHEGE, JUSTINE", "RODRIGUE", "MATHILDE, MAUD", "LOUISE", "BENEDICTE", "PATRICE, PATRICIA, PATRICK, PATSY, PATTY", "CYRIL, CYRILLE, SALVATORE", "JOSE, JOSEPH, JOSEPHINE, JOSETTE, JOSIANE", "HERBET, SVETLANA, WULFRAN", "CLEMENCE", "LEA, LEILA, LIA, LILA", "VICTORIEN", "CATHERINE DE SUEDE, KARINE, KETTY", "ANNONCIATION", "LARA, LARISSA", "HABIB", "GONTRAN", "GLADYS", "AMEDEE", "AMOS, BABINE, BALBINE, BEN, BENJAMIN, BENJAMINE"},
+ {"HUGUES, HUGUETTE, VALERY", "SANDIE, SANDRA, SANDRINE, SANDY", "DICK, RICHARD", "ALETHE, ALETTE, ISIDORE, MAYA", "IRENE", "MARCELLIN", "J.B. DE LA SALLE", "CONSTANCE, JULIE", "GAUTHIER, GAUTIER, WALTER", "FULBERT", "STAN, STANISLAS", "JULES", "IDA", "LIDWINE, MAXIME", "PATERNE", "BENOIT-JOSEPH", "ETIENNE", "GRETA, PARFAIT", "EMMA", "GIRAUD, ODETTE", "ALSELME, SELMA", "ALEX, ALEXANDRA, ALEXANDRE", "FORTUNAT, GEORGES, GEORGETTE, GEORGINA, YOURI", "FIDELE, MARJORIE", "MARC", "ALIDA", "ZITA", "VALERIE", "CATHERINE, CATHERINE DE SIENNE", "MARIEN, ROBERT, ROSEMONDE"},
+ {"BRIEG, JEREMIE, JEREMY, MUGUET, MUGUETTE, TAMARA", "ANTONIN, ATHANASE, BORICE, BORIS, ZOE", "GURVAN, JACQUES, PHILIPPE", "FLORIAN, SYLVAIN, SYLVAINE", "ANGE, JUDITH", "CALINE, PRUDENCE", "DOMITILLE, FLAVIE, GISELE", "DESIRE, DUNVEL, JEANNE, JOHANNA", "ISAIE, PACOME", "SOLANGE", "ESTELLE, ETOILE, MAYEUL, STELLA", "ACHILLE, ANAIS", "MAELA, ROLANDE", "MATHIAS", "DENISE, PRIMAEL, VICTORIN", "ENORA, HONORE", "PASCAL, PASCALE", "CORALIE, CORINNE, ERIC, ERICK, ERIKA, JULIETTE", "CELESTIN, ERWAN, ERWIN, YVAN, YVES, YVON, YVONNE", "BERNARDIN, ROXANE", "CHARLES, CHARLY, CONSTANTIN", "EMILE, MILOUD, RITA", "DIDIER", "AMAEL, DONATIEN, MAEL, MAËLE, ROGATIEN", "SOPHIE", "BERENGER, BERENGERE", "AUGUSTIN DE C.", "GERMAIN, JORAN", "AYMAR", "FERDINAND, JEANNE D'ARC, JEANNINE, JOHANNA, JOHANNE, JUANITA, LORAINE", "PERINNE, PERNELLE, PERRETTE, PERRINE, PETRONILLE, PIERRETTE"},
+ {"JUSTIN, ROMAN, RONAN", "BLANDINE, VITAL", "KEVIN", "CLOTHIDE, CLOTILDE", "BONIFACE, IGOR", "CLAUDE, CLAUDIE, CLAUDINE, CLAUDIUS, GOAL, GURVAL, NORBERT", "GIL, GILBERT, MAITE, MARIE-THÉRÈSE, MERIADEC", "ARMAND, MEDARD, PRUNE", "DIANA, DIANE, FELICIEN", "GLORIA, LANDRY", "BARNABE, YOLANDE", "GUY, GUYONNE", "ANTHONY, ANTOINE, ANTONIO, TONY", "CANDICE, ELISEE, VALÈRE", "GERMAINE", "ARGAN, AURELIEN, FERREOL, REGIS", "HERVE, RAINIER", "LEONCE", "GERVAIS, GERVAISE, MICHELINE, ROMUALD", "SILVERE", "ALOYSE, GINA, GONZAGUE, LOIS, RALPH, RAOUL, RODOLPHE, RUDY", "ALBAN, ALBANE, ALBANNIE, ALBE, THOMAS", "AUDREY", "BAPTISTE, GIAN-LUCA, JEAN, JEAN PHILIPPE, JEAN-BAPTISTE, JOANNY, YANN, YOANN", "ELEONORE, LORE, NORA, PROSPER, SALOMON", "ANTHELME, OLYMPE", "FERNAND, FERNANDE", "IRENEE, MIRKO, PIERRICK", "PABLO, PAUL, PETER, PIERRE", "ADOLPHE, ANDREIA, MARTIAL"},
+ {"DIRCK, DIRK, ESTHER, SERVAN, SERVANE, THIERRY", "MARTINIEN", "THOMAS, TOM", "BERTHE, ELIANE, FLORENT", "ANTOINE, TONIO, TONY", "MARIETTA, MARIETTE, NOLWENN", "ELIANE", "EDGAR, KILLIAN, THIBAULT, THIBAUT, THIEBAUD", "AMANDINE, HERMINE, IRMA, MARIANNE", "ULRICH", "BENOIT, OLGA", "JASON, OLIVIER, OLLIE", "CLELIA, ENRIQUE, EUGENE, HARRY, HENRI, JOEL, JOELLE", "CAMILLE, ELISENDA", "BONAVENTURE, DON, DONALD, WLADIMIR", "CARMEN, ELVIRE", "ARLETTE, CAROLE, CAROLINE, CHARLINE, CHARLOTTE, MARCELLINE", "ARNOULD, FREDDY, FREDERIC, FREDERIQUE", "ARSENE, MADEL", "ELIE, ELIETTE, HELYETTE, MARGUERITE, MARINA, MARINE, MARJORIE", "VICTOR", "MADDY, MADELEINE, MAGALI, MAGGY, MAIALEN, MARIE-MADELEINE", "BRIGITTE", "CHRISTEL, CHRISTELLE, CHRISTINE, CRISTELLE, IVAN, JOHN, JOHNNY, KRISTELL, SEGOLENE", "CHRISTOPHE, JAMES, JIM, SANTIAGO, VALENTINE", "ANAELLE, ANNA, ANNABELLE, ANNE, ANNE LAURE, ANNICK, ANNIE, ANNY, ANOUK, NANCY", "LILIAN, LILIANE, LILIOSE, LILY, NATHALIE", "SAMSON", "MARTHE", "JULIETTE", "IGNACE"},
+ {"ALPHONSE, ARCADIUS, ELEAZAR, ESPERANCE", "EUSEBE, JULIEN", "LYDIE", "JEAN-MARIE, VIANNEY", "ABEL, OSWALD", "MARLÈNE, OCTAVIEN", "GAETAN", "DOMINIQUE", "AMOUR", "ANNE LAURE, DIEUDONNE, LARRY, LAURA, LAURE, LAURENCE, LAURENE, LAURENT", "CLAIRE, GERIN, GILBERTE, SUZANNE, SUZETTE, SUZY", "CLARISSE", "HIPPOLYTE, ROSY", "ARNOLD, EVRARD", "ALFRED, ANNE-MARIE, MANON, MARIA, MARIE, MARIE-FRANCE, MARIE-LAURE, MARIELLE, MARILYNE, MARION, MARYLINE, MARYLISE, MARYSE, MARYVONNE, MIREILLE, MURIEL, MURIELLE, MYRIAM", "ARMEL, ARMELLE, ARZHEL, ARZHELA, ROCH", "HYACINTHE", "ELEN, HELENE, LAETITIA, LENA, MILENE, NELLEY", "JEAN EUDES, MYLÈNE", "BERNARD, PHILIBERT, SAM, SAMANTHA, SAMUEL, SAMY", "AHMED, CHRISTOFFE, CHRISTOPHE, GRACE, OMBELINE", "FABRICE, SIEGFRIED, SYMPHORIEN", "ROSA, ROSE, ROZEN, ROZENN", "BARTHELEMY", "CLOVIS, LOIC, LOUIS, LUDIVINE, LUDOVIC, MARCIEN", "CESAIRE, CESAR, NATACHA, NATASHA", "MONICA, MONIQUE", "AUGUSTIN, ELOUAN, LINDA, LOAN", "SABINE, SABRINA", "FIACRE, SABRINA, SACHA", "ARISTIDE"},
+ {"GILLES, JOSUE", "INGRID", "GRAIG, GREGOIRE, GREGORY", "IRIS, IRMA, MOISE, MOSHE, ROSALIE", "RAISSA, RAÏSSA", "BERTRAND, EVA, EVELYNE", "REGINE, REINE, REJANE", "ADRIEN, ADRIENNE", "ALAIN", "AUBERT, INES", "ADELPHE, DAPHNÉE, GLEN, VINCIANE", "APOLLINAIRE, KIM", "AIME", "MATERNE", "DOLORES, LOLA, ROLAND", "CYPRIEN, EDITH, LUDMILLA, REGNAULT", "LAMBERT, REGINALD, RENALD, RENAUD, ROBERT, RONALD", "ARIANE, NADEGE, NADIA, NADINE, SONIA, VERA", "AMELIE, EMILIE, GABY", "DAVY", "DEBORAH, MATEO, MATHEO, MATHIEU, MATTEO, MATTHIEU", "MAURICE, MAURICETTE, MORVAN", "CONSTANT", "THECLE", "HERMANN", "COME, DAMIEN", "VINCENT DE PAUL", "VENCESLAS", "GABRIEL, MICHEL, MICHELE, MICHELLE, MICKAEL, MIKAEL, MIKAELA, RAPHAEL, RAPHAELE, RAPHAELLE", "GERONIMA, JEROME, NADIYE"},
+ {"ARIELLE, EURIELLE, SULIAN, THERESE E.-J., URIELLE", "LEGER", "BLANCHE, CANDIDE, GERARD", "AURE, FRANCIS, FRANCK, FRANCOIS, ORIANNE, SOIZIC", "CAPUCINE, FLEUR, JASMINE, PLACIDE, VIOLAINE, VIOLETTE", "BRUNO", "GUSTAVE, SERGE", "EDUIN, MORGAN, PELAGIE, SAMARA", "DENIS, SARA, SARAH, SIBILLE", "GHISLAIN, GHISLAINE", "FIRMIN, SOLEDAD", "FRED, SERAPHINE, WILFRIED", "GERAUD", "CALLISTE, CELESTE, GWENDOLINE, JUSTE", "AURELIA, AURELIE, TERESA, THERESE D'AV.", "BERTRAND, EDWIGE, GAELA, GALL, PERLETTE", "BAUDOUIN, GAEL, GAELLE, SOLENE, SOLENNE", "AIMABLE, GENN, LUC, LUCA, LUCAS", "LAURYNE, RENE, RENEE", "ADELINE, ALINE, LINE", "CELINE, URSULA, URSULE", "ELODIE, SALOME", "JEAN DE CAPISTRAN", "FLORENTIN", "DARIA, DORIA, ENGUERRAN, ENGUERRAND, GOUENOU", "DIMITRI", "EMELINE", "JUDE, MONA, SIMON, SIMONE, THADDEE", "JORIS, NARCISSE", "BIENVENUE, HEIDI", "QUENTIN, WOLFGANG"},
+ {"DREL, HAROLD, MATHURIN, TOUSSAIN", "DEFUNTS", "GWENAEL, GWENAELLE, HUBERT", "AYMERIC, CAROLINE, CHARLES, CHARLES BOR., CHARLY, JESSE, JESSICA, JESSIE, JESSY", "SYLVETTE, SYLVIANE, SYLVIE, ZAC, ZACHARIE", "BERTILLE, LEO, LEONARD, LEONARDO, WINNOC", "CAREN, CARINE, ERNEST, ERNIE, KARELLE, KAREN, KARINE", "CLAIR, GEOFFREY, GEOFFROY, GODEFROI, GODEFROY", "DORA, DORIAN, DORINE, THEO, THEODORE", "LEON, LEONTINE, LIONEL, NOE", "MARTIN", "CHRISTIAN, CHRISTIANE, EMILIEN", "BRICE, DIEGO, KILLIAN", "SIDOINE, SIDONIE", "ALBERT, ARTHUR, LEOPOLD, VICTOIRE, VICTORIA", "DAISY, GERTRUDE, MARGAUX, MARGOT, MARGUERITE, OMAR, OTMAR, PEGGY", "BABETTE, ELISABETH, ELISE, ELIZABETH, ELSA, HILDA, LESLIE, LISA, LISBETH, LISE", "AUDE", "TANGI, TANGUY", "EDMA, EDMEE, EDMOND, OCTAVE, OCTAVIE", "PERINNE, PERNELLE, PERRETTE, PERRINE, PETRONILLE, PIERRETTE", "CECILE, CELIA, SHEILA", "CLEMENT, CLEMENTINE, RACHILDE", "AUGUSTA, FLORA, FLORE", "CATHEL, CATHERINE, CATHY, KATEL, KATELL, KATIA, KATY", "CONRAD, DELPHINE, KURT", "ASTRID, SEVERIN, SEVERINE", "JACQUES DE LA M., ZDZISLAW, ZDZISLAWA", "SATURNIN", "ANDRE, ANDREA, ANDREE, ANDREV, TUGDUAL"},
+ {"ALAN, ALAR, ALENA, ELOI, FLORENCE, NAHUM", "VIVIANE", "FRANCOIS-XAVIER, XAVIER", "ADA, ADNETTE, BARBAN, BARBARA, BARBE, BARBIE", "COLIN, GERALD, GERALDINE, NICOLETTA", "EVE, NICK, NICOLAS", "AMBROISE", "BUDOG, ELFRIED, FRIDA", "PIERRE FOURIER", "ROMA, ROMARIC", "DANIEL, DANIELE, DANIELLE, DANITZA, DANNY, DANY", "CHANTAL, CORENTIN, JEANNINE, JENNY, JUANITA, KRISTEN", "AURORE, JOCELYN, JOCELYNE, JOSSE, JOSSELIN, JOSSELINE, LUCETTE, LUCIE", "MELODIE, NOEMIE, ODILE", "CHRISTIANNE, NINON", "ADELAIDE, ALICE", "JUDICAEL, TESA, TESSA", "GATIEN, GRATIENNE, ROBIN", "URBAIN", "ABRAHAM, ISAAC, JACOB, JOY, THEOPHILE", "PIERRE C.", "FRANCOISE-XAVIERE, XAVIERE", "ARMAND, HARTMANN", "ADELE, DELPHIN, EUGENIE", "EMMANUEL, EMMANUELLE, LOLITA, MANUEL, NELLY, NOEL, NOELA, NOELLE", "ESTEBAN, ETIENNE, FANNY, STEFAN, STEPHANE, STEPHANIE, STEVE", "FABIOLA, HANS, YANNICK", "GASPARD", "DAVE, DAVID", "ROGER", "COLOMBE, SYLVESTRE"}};
+
+ static public String get(Calendar c) {
+ String result = data[c.get(Calendar.MONTH)][c.get(Calendar.DAY_OF_MONTH) - 1];
+ return result;
+ }
+
+ /**
+ * get Saint for current day
+ * @return
+ */
+ static public String get() {
+ String result = get(Calendar.getInstance());
+ return result;
+ }
+
+ static public String get(Date d) {
+ Calendar c = Calendar.getInstance();
+ c.setTime(d);
+ String result = get(c);
+ return result;
+ }
+
+}
\ No newline at end of file
Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2012-08-22 14:09:43 UTC (rev 252)
+++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardSummary.jsp 2012-08-22 14:11:15 UTC (rev 253)
@@ -29,6 +29,7 @@
<div class="span1">
<p class="calendar">
<f:formatDate value="${date}" pattern="dd"/>
+ <span class="saint"><%=org.chorem.Saint.get(new java.util.Date())%></span>
<span class="week">semaine <f:formatDate value="${date}" pattern="w"/></span>
<em><f:formatDate value="${date}" pattern="MMM"/></em>
</p>
Modified: trunk/chorem-webmotion/src/main/webapp/css/chorem.less
===================================================================
--- trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2012-08-22 14:09:43 UTC (rev 252)
+++ trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2012-08-22 14:11:15 UTC (rev 253)
@@ -48,7 +48,7 @@
background:#ededef;
background: -webkit-gradient(linear, left top, left bottom, from(#ededef), to(#ccc));
background: -moz-linear-gradient(top, #ededef, #ccc);
- font:bold 30px/60px Arial Black, Arial, Helvetica, sans-serif;
+ font:bold 40px/60px Arial Black, Arial, Helvetica, sans-serif;
text-align:center;
color:#000;
text-shadow:#fff 0 1px 0;
@@ -66,6 +66,12 @@
font: 10px/20px Arial Black, Arial, Helvetica, sans-serif;
}
+.calendar span.saint {
+ display:block;
+ font:normal bold 11px/11px Arial, Helvetica, sans-serif;
+ text-shadow:#00365a 0 -1px 0;
+}
+
.calendar:before, .calendar:after{
content:'';
float:left;
1
0