Subversion Repositories eFlore/Applications.cel

Rev

Rev 729 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 729 Rev 965
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
2
 
2
 
3
import java.util.HashMap;
3
import java.util.HashMap;
4
import java.util.Iterator;
4
import java.util.Iterator;
5
import java.util.Set;
5
import java.util.Set;
-
 
6
 
6
 
7
import com.google.gwt.core.client.GWT;
-
 
8
import com.google.gwt.json.client.JSONObject;
-
 
9
import com.google.gwt.xml.client.Document;
-
 
10
import com.google.gwt.xml.client.NodeList;
-
 
11
import com.google.gwt.xml.client.XMLParser;
7
import com.google.gwt.json.client.JSONObject;
12
import com.google.gwt.xml.client.impl.DOMParseException;
8
 
13
 
9
/**
14
/**
10
 * 
15
 * 
11
 * Classe representant une image du carnet, elle ne contient pas d'image à
16
 * Classe representant une image du carnet, elle ne contient pas d'image à
12
 * proprement parler mais plutôt les informations associées ainsi que l'url
17
 * proprement parler mais plutôt les informations associées ainsi que l'url
13
 * distante. C'est une table de hachage qui contient des paires propriété/valeur
18
 * distante. C'est une table de hachage qui contient des paires propriété/valeur
14
 * 
19
 * 
15
 */
20
 */
16
public class ImageCarnet extends HashMap<String, String> {
21
public class ImageCarnet extends HashMap<String, String> {
17
 
22
 
18
	/**
23
	/**
19
	 * 
24
	 * 
20
	 */
25
	 */
21
	private static final long serialVersionUID = -6220175386957259859L;
26
	private static final long serialVersionUID = -6220175386957259859L;
22
 
27
 
23
	/**
28
	/**
24
	 * Constructeur avec un objet JSON
29
	 * Constructeur avec un objet JSON
25
	 * 
30
	 * 
26
	 * @param image
31
	 * @param image
27
	 */
32
	 */
28
	public ImageCarnet(JSONObject image) {
33
	public ImageCarnet(JSONObject image) {
29
		// l'objet JSON est une table de hachage
34
		// l'objet JSON est une table de hachage
30
		Set<String> im = image.keySet();
35
		Set<String> im = image.keySet();
31
 
36
 
32
		// on la parcourt pour chaque clé
37
		// on la parcourt pour chaque clé
33
		for (Iterator<String> iterator = im.iterator(); iterator.hasNext();) {
38
		for (Iterator<String> iterator = im.iterator(); iterator.hasNext();) {
34
 
39
 
35
			// si elle est associée à une valeur, on l'ajoute
40
			// si elle est associée à une valeur, on l'ajoute
36
			String key = iterator.next();
41
			String key = iterator.next();
37
			if (image.get(key).isString() != null) {
42
			if (image.get(key).isString() != null) {
38
				String valeur = image.get(key).isString().stringValue();
43
				String valeur = image.get(key).isString().stringValue();
39
				this.put(key, valeur);
44
				this.put(key, valeur);
40
			} else {
45
			} else {
41
				// sinon on ajoute la clé avec une valeur vide
46
				// sinon on ajoute la clé avec une valeur vide
42
				String valeur = " ";
47
				String valeur = " ";
43
				this.put(key, valeur);
48
				this.put(key, valeur);
44
			}
49
			}
45
 
50
 
46
		}
51
		}
47
 
52
 
48
	}
53
	}
49
	
54
	
50
	public ImageCarnet(String[][] image) {
55
	public ImageCarnet(String[][] image) {
51
 
56
 
52
		for (int i = 0; i < image.length; i++) {
57
		for (int i = 0; i < image.length; i++) {
53
			if (image[i][0] != null && image[i][1] != null) {
58
			if (image[i][0] != null && image[i][1] != null) {
54
				this.put(image[i][0], image[i][1]);
59
				this.put(image[i][0], image[i][1]);
55
			}
60
			}
56
		}
61
		}
57
	}
62
	}
58
 
63
 
59
	/**
64
	/**
60
	 * Surcharge de toString qui affiche toutes les propriétés de l'image
65
	 * Surcharge de toString qui affiche toutes les propriétés de l'image
61
	 */
66
	 */
62
 
67
 
63
	public String toString() {
68
	public String toString() {
64
		String valeur = " ";
69
		String valeur = " ";
65
 
70
 
66
		for (Iterator<String> iterator = this.keySet().iterator(); iterator
71
		for (Iterator<String> iterator = this.keySet().iterator(); iterator
67
				.hasNext();) {
72
				.hasNext();) {
68
 
73
 
69
			String key = iterator.next();
74
			String key = iterator.next();
70
			if (this.get(key) != null) {
75
			if (this.get(key) != null) {
71
				valeur += "cle : " + key + " valeur :" + this.get(key) + "\n";
76
				valeur += "cle : " + key + " valeur :" + this.get(key) + "\n";
72
			}
77
			}
73
 
78
 
74
		}
79
		}
75
 
80
 
76
		return valeur;
81
		return valeur;
77
	}
82
	}
78
 
83
 
79
	/**
84
	/**
80
	 * Pour éviter que l'on traite des valeurs nulles à l'affichage on passe par
85
	 * Pour éviter que l'on traite des valeurs nulles à l'affichage on passe par
81
	 * cette fonction qui retire les charactères nuls qui font planter
86
	 * cette fonction qui retire les charactères nuls qui font planter
82
	 * l'affichage, il ne faut pas utiliser get directement
87
	 * l'affichage, il ne faut pas utiliser get directement
83
	 * 
88
	 * 
84
	 * @param cle
89
	 * @param cle
85
	 * @return la valeur associée à la clé
90
	 * @return la valeur associée à la clé
86
	 */
91
	 */
87
	public String renvoyerValeurCorrecte(String cle) {
92
	public String renvoyerValeurCorrecte(String cle) {
88
		if (this.containsKey((cle))) {
93
		if (this.containsKey((cle))) {
89
			String valeur = this.get(cle);
94
			String valeur = this.get(cle);
90
			if (valeur.equals("null") || valeur == null) {
95
			if (valeur.equals("null") || valeur == null) {
91
				return " ";
96
				return " ";
92
			} else {
97
			} else {
93
				char nullChar = '\u0000';
98
				char nullChar = '\u0000';
94
				String sNull = "" + nullChar;
99
				String sNull = "" + nullChar;
95
				valeur = valeur.replaceAll(sNull, "");
100
				valeur = valeur.replaceAll(sNull, "");
96
				return valeur;
101
				return valeur;
97
			}
102
			}
98
		} else {
103
		} else {
99
			return " ";
104
			return " ";
100
		}
105
		}
101
	}
106
	}
102
 
107
 
103
	/**
108
	/**
104
	 * Acesseur pour l'id de l'image
109
	 * Acesseur pour l'id de l'image
105
	 * 
110
	 * 
106
	 * @return l'id de l'image
111
	 * @return l'id de l'image
107
	 */
112
	 */
108
	public String getId() {
113
	public String getId() {
109
 
114
 
110
		return renvoyerValeurCorrecte("ci_id_image");
115
		return renvoyerValeurCorrecte("id_image");
111
	}
116
	}
112
 
117
 
113
	/**
118
	/**
114
	 * Acesseur pour le numero d'ordre de l'image
119
	 * Acesseur pour le numero d'ordre de l'image
115
	 * 
120
	 * 
116
	 * @return l'ordre de l'image
121
	 * @return l'ordre de l'image
117
	 */
122
	 */
118
	public String getOrdre() {
123
	public String getOrdre() {
119
 
124
 
120
		return renvoyerValeurCorrecte("ci_ordre");
125
		return renvoyerValeurCorrecte("ordre");
121
	}
126
	}
122
 
127
 
123
	/**
128
	/**
124
	 * Base de l'url serveur pour les images
129
	 * Base de l'url serveur pour les images
125
	 * 
130
	 * 
126
	 * @return url racine pour les images
131
	 * @return url racine pour les images
127
	 */
132
	 */
128
	public String getVraieBaseUrl() {
133
	public String getVraieBaseUrl() {
129
		return Configuration.getImageBaseUrl() ;
134
		return Configuration.getImageBaseUrl() ;
130
	}
135
	}
131
	
136
	
132
	/**
137
	/**
133
	 * Base de l'url serveur pour les images
138
	 * Base de l'url serveur pour les images
134
	 * 
139
	 * 
135
	 * @return url racine pour les images
140
	 * @return url racine pour les images
136
	 */
141
	 */
137
	public String getBaseUrlRedirect() {
142
	public String getBaseUrlRedirect() {
138
		return Configuration.getImageRedirectUrl() ;
143
		return Configuration.getImageRedirectUrl() ;
139
	}
144
	}
140
	
145
	
141
	public String getIdAvecPadding() {
146
	public String getIdAvecPadding() {
142
		
147
		
143
		String id = getId();
148
		String id = getId();
144
 
149
 
145
		int maxZeros = 9 - id.length();
150
		int maxZeros = 9 - id.length();
146
 
151
 
147
		for (int i = 0; i < maxZeros; i++) {
152
		for (int i = 0; i < maxZeros; i++) {
148
			id = "0" + id;
153
			id = "0" + id;
149
		}
154
		}
150
		
155
		
151
		return id;
156
		return id;
152
	}
157
	}
153
	
158
	
154
	private String getUrlFormat(String format) {
159
	private String getUrlFormat(String format) {
155
		
160
		
156
		String urlImage = "";
161
		String urlImage = "";
157
		
162
		
158
		if(Configuration.utiliseRedirectionImages()) {
163
		if(Configuration.utiliseRedirectionImages()) {
159
		
164
		
160
			String identifiantRedirect = getIdAvecPadding()+format;
165
			String identifiantRedirect = getIdAvecPadding()+format;
161
			urlImage = getBaseUrlRedirect()+identifiantRedirect;
166
			urlImage = getBaseUrlRedirect()+identifiantRedirect;
162
		} else {
167
		} else {
163
			urlImage = getVraieUrlFormat(format);
168
			urlImage = getVraieUrlFormat(format);
164
		}
169
		}
165
 
170
 
166
		return urlImage;
171
		return urlImage;
167
	}
172
	}
168
 
173
 
169
	/**
174
	/**
170
	 * Renvoie le nom de base du fichier image et ses sous dossier
175
	 * Renvoie le nom de base du fichier image et ses sous dossier
171
	 * 
176
	 * 
172
	 * @return le nom de base du fichier de type (XXX_XXX_XXX), et ses sous
177
	 * @return le nom de base du fichier de type (XXX_XXX_XXX), et ses sous
173
	 *         dossier
178
	 *         dossier
174
	 */
179
	 */
175
	public String[] getRealBaseFileName() {
180
	public String[] getRealBaseFileName() {
176
		
181
		
177
		String id = getIdAvecPadding();
182
		String id = getIdAvecPadding();
178
 
183
 
179
		String dossierNv1 = id.substring(0, 3);
184
		String dossierNv1 = id.substring(0, 3);
180
		String dossierNv2 = id.substring(3, 6);
185
		String dossierNv2 = id.substring(3, 6);
181
		String fichierNv = id.substring(6, 9);
186
		String fichierNv = id.substring(6, 9);
182
 
187
 
183
		String nomFichier = dossierNv1 + "_" + dossierNv2 + "_" + fichierNv;
188
		String nomFichier = dossierNv1 + "_" + dossierNv2 + "_" + fichierNv;
184
 
189
 
185
		String[] infosFichier = { nomFichier, dossierNv1, dossierNv2 };
190
		String[] infosFichier = { nomFichier, dossierNv1, dossierNv2 };
186
		
191
		
187
		return infosFichier;
192
		return infosFichier;
188
	}
193
	}
189
	
194
	
190
	private String getVraieUrlFormat(String format) {
195
	private String getVraieUrlFormat(String format) {
191
		
196
		
192
		String[] infosFichier = getRealBaseFileName();
197
		String[] infosFichier = getRealBaseFileName();
193
 
198
 
194
		return getVraieBaseUrl() + infosFichier[1] + "/" + infosFichier[2] + "/"+format+"/"
199
		return getVraieBaseUrl() + infosFichier[1] + "/" + infosFichier[2] + "/"+format+"/"
195
				+ infosFichier[0] + "_"+format+".jpg";
200
				+ infosFichier[0] + "_"+format+".jpg";
196
	}
201
	}
197
	
202
	
198
	/**
203
	/**
199
	 * Renvoie le chemin et nom du fichier format original
204
	 * Renvoie le chemin et nom du fichier format original
200
	 * 
205
	 * 
201
	 * @return le chemin du fichier grand original
206
	 * @return le chemin du fichier grand original
202
	 */
207
	 */
203
	public String getUrlFormatOriginal() {
208
	public String getUrlFormatOriginal() {
204
 
209
 
205
		return getUrlFormat(Configuration.getFormatOriginal());
210
		return getUrlFormat(Configuration.getFormatOriginal());
206
	}
211
	}
207
 
212
 
208
	/**
213
	/**
209
	 * Renvoie le chemin et nom du fichier grand format
214
	 * Renvoie le chemin et nom du fichier grand format
210
	 * 
215
	 * 
211
	 * @return le chemin du fichier grand format
216
	 * @return le chemin du fichier grand format
212
	 */
217
	 */
213
	public String getUrlFormatZoom() {
218
	public String getUrlFormatZoom() {
214
 
219
 
215
		return getUrlFormat(Configuration.getFormatZoom());
220
		return getUrlFormat(Configuration.getFormatZoom());
216
	}
221
	}
217
 
222
 
218
	/**
223
	/**
219
	 * Renvoie le chemin et nom du fichier petit format
224
	 * Renvoie le chemin et nom du fichier petit format
220
	 * 
225
	 * 
221
	 * @return le chemin du fichier petit format
226
	 * @return le chemin du fichier petit format
222
	 */
227
	 */
223
	public String getUrlFormatGalerie() {
228
	public String getUrlFormatGalerie() {
224
 
229
 
225
		return getUrlFormat(Configuration.getFormatGalerie());
230
		return getUrlFormat(Configuration.getFormatGalerie());
226
	}
231
	}
227
 
232
 
228
	/**
233
	/**
229
	 * Renvoie le chemin et nom du fichier moyen format
234
	 * Renvoie le chemin et nom du fichier moyen format
230
	 * 
235
	 * 
231
	 * @return le chemin du fichier moyen format
236
	 * @return le chemin du fichier moyen format
232
	 */
237
	 */
233
	public String getUrlFormatListe() {
238
	public String getUrlFormatListe() {
234
 
239
 
235
		return getUrlFormat(Configuration.getFormatListe());
240
		return getUrlFormat(Configuration.getFormatListe());
236
	}
241
	}
237
 
242
 
238
	/**
243
	/**
239
	 * Renvoie la taille de l'image
244
	 * Renvoie la taille de l'image
240
	 * 
245
	 * 
241
	 * @return un tableau de deux string contenant la hauteur puis la largeur
246
	 * @return un tableau de deux string contenant la hauteur puis la largeur
242
	 */
247
	 */
243
	public String[] getTailleImage() {
248
	public String[] getTailleImage() {
244
		String[] XY = { renvoyerValeurCorrecte("ci_meta_height"),
249
		String[] XY = { renvoyerValeurCorrecte("hauteur"),
245
				renvoyerValeurCorrecte("ci_meta_width") };
250
				renvoyerValeurCorrecte("largeur") };
246
		return XY;
251
		return XY;
247
	}
252
	}
248
 
253
 
249
	public String[] getNote() {
254
	public String[] getNote() {
250
		String[] note = { renvoyerValeurCorrecte("ci_note_image") };
255
		String[] note = { renvoyerValeurCorrecte("note_qualite") };
251
		return note;
256
		return note;
252
	}
257
	}
253
 
258
 
254
	/**
259
	/**
255
	 * Renvoie la date exif associée à l'image
260
	 * Renvoie la date exif associée à l'image
256
	 * 
261
	 * 
257
	 * @return la date associée à l'image
262
	 * @return la date associée à l'image
258
	 */
263
	 */
259
	public String getDate() {
264
	public String getDate() {
260
 
265
 
261
		if(renvoyerValeurCorrecte("ci_meta_date").equals("00/00/0000"))
266
		if(renvoyerValeurCorrecte("date_prise_de_vue").equals("00/00/0000"))
262
		{
267
		{
263
			return "" ;
268
			return "" ;
264
		}
269
		}
265
		return renvoyerValeurCorrecte("ci_meta_date");
270
		return renvoyerValeurCorrecte("date_prise_de_vue");
266
	}
271
	}
267
 
272
 
268
	/**
273
	/**
269
	 * Renvoie la ville associée à l'image
274
	 * Renvoie la ville associée à l'image
270
	 * 
275
	 * 
271
	 * @return la ville iptc
276
	 * @return la ville iptc
272
	 */
277
	 */
273
	public Object getIptcCity() {
278
	public Object getIptcCity() {
274
 
279
 
275
		return renvoyerValeurCorrecte("ci_meta_iptc_city");
280
		return renvoyerValeurCorrecte("");
276
	}
281
	}
277
 
282
 
278
	/**
283
	/**
279
	 * Renvoie le fabricant de l'appareil
284
	 * Renvoie le fabricant de l'appareil
280
	 * 
285
	 * 
281
	 * @return le fabricant
286
	 * @return le fabricant
282
	 */
287
	 */
283
	public String getMake() {
288
	public String getMake() {
284
 
289
 
285
		return renvoyerValeurCorrecte("ci_meta_make");
290
		return renvoyerValeurCorrecte("appareil_fabricant");
286
	}
291
	}
287
 
292
 
288
	/**
293
	/**
289
	 * Renvoie le modele de l'appareil
294
	 * Renvoie le modele de l'appareil
290
	 * 
295
	 * 
291
	 * @return le modele
296
	 * @return le modele
292
	 */
297
	 */
293
	public String getModel() {
298
	public String getModel() {
294
 
299
 
295
		return renvoyerValeurCorrecte("ci_meta_model");
300
		return renvoyerValeurCorrecte("appareil_modele");
296
	}
301
	}
297
 
302
 
298
	/**
303
	/**
299
	 * Renvoie un tableau nom / valeur de toutes les metadonnées Iptc
304
	 * Renvoie un tableau nom / valeur de toutes les metadonnées Iptc
300
	 * 
305
	 * 
301
	 * @return les métadonnées iptc
306
	 * @return les métadonnées iptc
302
	 */
307
	 */
303
	public String[][] getMetadonnesIptc() {
308
	public String[][] getMetadonnesIptc() {
304
 
309
		
305
		String[][] metaIptc = new String[14][2];
310
		String[][] metaIptc = {{},{}};
306
		int elem = 0;
-
 
307
 
311
		
308
		for (Iterator<String> it = this.keySet().iterator(); it.hasNext();) {
312
		String xml = renvoyerValeurCorrecte("meta_iptc");
309
 
313
		
310
			String key = it.next();
314
		String invalidXmlPattern = "[^"
-
 
315
            + "\\u0009\\u000A\\u000D"
-
 
316
            + "\\u0020-\\uD7FF"
-
 
317
            + "\\uE000-\\uFFFD"
-
 
318
            + "\\u10000-\\u10FFFF"
-
 
319
            + "]+";
-
 
320
		xml = xml.replaceAll(invalidXmlPattern, " ");
311
 
321
		try {
312
			// on filtre le "ci"
322
			Document d = XMLParser.parse(xml);
313
			String type[] = key.split("_", 3);
323
			NodeList attributs = d.getFirstChild().getChildNodes();
-
 
324
 
314
 
325
			
315
			// si c'est une metadonnee exif ou iptc
326
			int taille = attributs.getLength();
316
			if (type[1].equals("meta")) {
327
			metaIptc = new String[taille][2];
317
				String[] genre = type[2].split("_", 2);
328
			for(int i = 0; i < taille; i++)  {
318
				if (genre[0].equals("iptc")) {
329
				XMLParser.removeWhitespace(attributs.item(i));
319
					String nom = genre[1];
330
				attributs.item(i).normalize();
320
					metaIptc[elem][0] = nom;
331
				metaIptc[i][0] = attributs.item(i).getNodeName();
321
					metaIptc[elem][1] = renvoyerValeurCorrecte(key);
332
				metaIptc[i][1] = attributs.item(i).getNodeValue();
322
					elem++;
-
 
323
				}
-
 
324
 
-
 
325
			}
333
			}
326
 
334
			
-
 
335
			return metaIptc;
-
 
336
		} catch(DOMParseException e) {
-
 
337
			
327
		}
338
		}	
328
 
339
		
329
		return metaIptc;
340
		return metaIptc;
330
	}
341
	}
331
 
342
 
332
	/**
343
	/**
333
	 * Renvoie un tableau nom / valeur de toutes les metadonnées Exif
344
	 * Renvoie un tableau nom / valeur de toutes les metadonnées Exif
334
	 * 
345
	 * 
335
	 * @return les métadonnées Exif
346
	 * @return les métadonnées Exif
336
	 */
347
	 */
337
	public String[][] getMetadonnesExif() {
348
	public String[][] getMetadonnesExif() {
338
 
349
		
339
		String[][] metaExif = new String[31][2];
350
		String[][] metaExif = {{},{}};
340
		int elem = 0;
-
 
341
 
351
		
342
		for (Iterator<String> it = this.keySet().iterator(); it.hasNext();) {
352
		String xml = renvoyerValeurCorrecte("meta_exif");
343
 
353
		
344
			String key = it.next();
354
		String invalidXmlPattern = "[^"
-
 
355
		                             + "\\u0009\\u000A\\u000D"
-
 
356
		                             + "\\u0020-\\uD7FF"
-
 
357
		                             + "\\uE000-\\uFFFD"
-
 
358
		                             + "\\u10000-\\u10FFFF"
-
 
359
		                             + "]+";
-
 
360
		xml = xml.replaceAll(invalidXmlPattern, " ");
345
 
361
 
-
 
362
		try {
346
			// on filtre le "ci"
363
			Document d = XMLParser.parse(xml);
347
			String type[] = key.split("_", 3);
364
			NodeList attributs = d.getFirstChild().getChildNodes();
348
 
365
			
349
			// si c'est une metadonnee exif ou iptc
366
			int taille = attributs.getLength();
350
			if (type[1].equals("meta")) {
367
			metaExif = new String[taille][2];
351
				String[] genre = type[2].split("_", 2);
368
			for(int i = 0; i < taille; i++)  {
352
				if (genre[0].equals("exif")) {
369
				XMLParser.removeWhitespace(attributs.item(i));
353
					String nom = genre[1];
370
				attributs.item(i).normalize();
354
					metaExif[elem][0] = nom;
371
				metaExif[i][0] = attributs.item(i).getNodeName();
355
					metaExif[elem][1] = renvoyerValeurCorrecte(key);
372
				metaExif[i][1] = attributs.item(i).getNodeValue();
356
					elem++;
-
 
357
				}
-
 
358
 
-
 
359
			}
373
			}
-
 
374
		} catch(DOMParseException e) {
360
 
375
			
361
		}
376
		}	
362
 
377
		
363
		return metaExif;
378
		return metaExif;
364
 
379
 
365
	}
380
	}
366
 
381
 
367
	/**
382
	/**
368
	 * Renvoie un tableau nom / valeur contenant les infos générales
383
	 * Renvoie un tableau nom / valeur contenant les infos générales
369
	 * 
384
	 * 
370
	 * @return les infos générales
385
	 * @return les infos générales
371
	 */
386
	 */
372
	public String[][] getInfoGenerales() {
387
	public String[][] getInfoGenerales() {
373
 
388
 
374
		String[][] metaGen = new String[2][2];
389
		String[][] metaGen = new String[2][2];
375
 
390
 
376
		metaGen[0][0] = "ci_meta_comment";
391
		metaGen[0][0] = "commentaire";
377
		metaGen[0][1] = this.renvoyerValeurCorrecte("ci_meta_comment");
392
		metaGen[0][1] = this.renvoyerValeurCorrecte("commentaire");
378
 
393
 
379
		metaGen[1][0] = "ci_meta_date";
394
		metaGen[1][0] = "date_prise_de_vue";
380
		metaGen[1][1] = this.renvoyerValeurCorrecte("ci_meta_date");
395
		metaGen[1][1] = this.renvoyerValeurCorrecte("date_prise_de_vue");
381
 
396
 
382
		return metaGen;
397
		return metaGen;
383
	}
398
	}
384
 
399
 
385
	/**
400
	/**
386
	 * Renvoie une string contenant les mots clés séparés par des ','
401
	 * Renvoie une string contenant les mots clés séparés par des ','
387
	 * 
402
	 * 
388
	 * @return les mots clés
403
	 * @return les mots clés
389
	 */
404
	 */
390
	public String getMotsCles() {
405
	public String getMotsCles() {
391
 
406
 
392
		return renvoyerValeurCorrecte("ci_meta_mots_cles");
407
		return renvoyerValeurCorrecte("mots_cles");
393
	}
408
	}
394
 
409
 
395
	/**
410
	/**
396
	 * Met à jour le commenentaire et la date
411
	 * Met à jour le commenentaire et la date
397
	 * 
412
	 * 
398
	 * @param commentaires
413
	 * @param commentaires
399
	 *            le nouveau commentaire
414
	 *            le nouveau commentaire
400
	 * @param date
415
	 * @param date
401
	 *            la nouvelle date
416
	 *            la nouvelle date
402
	 */
417
	 */
403
	public void miseAJourInfoGenerales(String commentaires, String date,
418
	public void miseAJourInfoGenerales(String commentaires, String date,
404
			String note) {
419
			String note) {
405
		put("ci_meta_comment", commentaires);
420
		put("commentaire", commentaires);
406
		put("ci_note_image", note);
421
		put("note_qualite", note);
407
		put("ci_meta_date", date);
422
		put("date_prise_de_vue", date);
408
	}
423
	}
409
 
424
 
410
	/**
425
	/**
411
	 * Met à jour les mots clés
426
	 * Met à jour les mots clés
412
	 * 
427
	 * 
413
	 * @param motsClesEnCours
428
	 * @param motsClesEnCours
414
	 *            la liste de mots clés séparés par des ','
429
	 *            la liste de mots clés séparés par des ','
415
	 */
430
	 */
416
	public void mettreAjourMotsCles(String motsClesEnCours) {
431
	public void mettreAjourMotsCles(String motsClesEnCours) {
417
 
432
 
418
		put("ci_meta_mots_cles", motsClesEnCours);
433
		put("mots_cles", motsClesEnCours);
419
 
434
 
420
	}
435
	}
421
	
436
	
422
	public void mettreAjourObsAssociees(String idsObsAssociees) {
437
	public void mettreAjourObsAssociees(String idsObsAssociees) {
423
		put("ci_ce_observation", idsObsAssociees);
438
		put("id_observation", idsObsAssociees);
424
	}
439
	}
425
	
440
	
426
	/**
441
	/**
427
	 * Accesseur pour le nom original
442
	 * Accesseur pour le nom original
428
	 * 
443
	 * 
429
	 * @return le nom orginal de l'image
444
	 * @return le nom orginal de l'image
430
	 */
445
	 */
431
	public String getNomOriginal() {
446
	public String getNomOriginal() {
432
		return renvoyerValeurCorrecte("ci_nom_original");
447
		return renvoyerValeurCorrecte("nom_original");
433
	}
448
	}
434
	
449
	
435
	public String getIdsObsAssociees() {
450
	public String getIdsObsAssociees() {
436
		
451
		
437
		String observationsAssociees = renvoyerValeurCorrecte("ci_ce_observation");
452
		String observationsAssociees = renvoyerValeurCorrecte("id_observation");
438
		observationsAssociees = observationsAssociees.replaceAll("null", "");
453
		observationsAssociees = observationsAssociees.replaceAll("null", "");
439
		
454
		
440
		return observationsAssociees;
455
		return observationsAssociees;
441
	}
456
	}
442
 
457
 
443
}
458
}