Subversion Repositories eFlore/Applications.cel

Rev

Rev 965 | Rev 990 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 965 Rev 989
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles.objets;
Line 2... Line 2...
2
 
2
 
3
import java.util.HashMap;
3
import java.util.HashMap;
4
import java.util.Iterator;
4
import java.util.Iterator;
Line -... Line 5...
-
 
5
import java.util.Set;
5
import java.util.Set;
6
 
6
 
7
import com.google.appengine.api.memcache.MemcacheServicePb.MemcacheDeleteRequest.Item;
7
import com.google.gwt.core.client.GWT;
8
import com.google.gwt.core.client.GWT;
-
 
9
import com.google.gwt.json.client.JSONObject;
8
import com.google.gwt.json.client.JSONObject;
10
import com.google.gwt.xml.client.Document;
-
 
11
import com.google.gwt.xml.client.Node;
9
import com.google.gwt.xml.client.Document;
12
import com.google.gwt.xml.client.NodeList;
10
import com.google.gwt.xml.client.NodeList;
13
import com.google.gwt.xml.client.Text;
Line 11... Line 14...
11
import com.google.gwt.xml.client.XMLParser;
14
import com.google.gwt.xml.client.XMLParser;
12
import com.google.gwt.xml.client.impl.DOMParseException;
15
import com.google.gwt.xml.client.impl.DOMParseException;
Line 175... Line 178...
175
	 * Renvoie le nom de base du fichier image et ses sous dossier
178
	 * Renvoie le nom de base du fichier image et ses sous dossier
176
	 * 
179
	 * 
177
	 * @return le nom de base du fichier de type (XXX_XXX_XXX), et ses sous
180
	 * @return le nom de base du fichier de type (XXX_XXX_XXX), et ses sous
178
	 *         dossier
181
	 *         dossier
179
	 */
182
	 */
180
	public String[] getRealBaseFileName() {
183
	public String[] getVraiCheminBaseFichier() {
Line 181... Line 184...
181
		
184
		
Line 182... Line 185...
182
		String id = getIdAvecPadding();
185
		String id = getIdAvecPadding();
183
 
186
 
Line 192... Line 195...
192
		return infosFichier;
195
		return infosFichier;
193
	}
196
	}
Line 194... Line 197...
194
	
197
	
Line 195... Line 198...
195
	private String getVraieUrlFormat(String format) {
198
	private String getVraieUrlFormat(String format) {
Line 196... Line 199...
196
		
199
		
197
		String[] infosFichier = getRealBaseFileName();
200
		String[] infosFichier = getVraiCheminBaseFichier();
198
 
201
 
Line 283... Line 286...
283
	/**
286
	/**
284
	 * Renvoie le fabricant de l'appareil
287
	 * Renvoie le fabricant de l'appareil
285
	 * 
288
	 * 
286
	 * @return le fabricant
289
	 * @return le fabricant
287
	 */
290
	 */
288
	public String getMake() {
291
	public String getFabriquantAppareil() {
Line 289... Line 292...
289
 
292
 
290
		return renvoyerValeurCorrecte("appareil_fabricant");
293
		return renvoyerValeurCorrecte("appareil_fabricant");
Line 291... Line 294...
291
	}
294
	}
292
 
295
 
293
	/**
296
	/**
294
	 * Renvoie le modele de l'appareil
297
	 * Renvoie le modele de l'appareil
295
	 * 
298
	 * 
296
	 * @return le modele
299
	 * @return le modele
Line 297... Line 300...
297
	 */
300
	 */
298
	public String getModel() {
301
	public String getModeleAppareil() {
Line 299... Line 302...
299
 
302
 
Line 318... Line 321...
318
            + "\\u10000-\\u10FFFF"
321
            + "\\u10000-\\u10FFFF"
319
            + "]+";
322
            + "]+";
320
		xml = xml.replaceAll(invalidXmlPattern, " ");
323
		xml = xml.replaceAll(invalidXmlPattern, " ");
321
		try {
324
		try {
322
			Document d = XMLParser.parse(xml);
325
			Document d = XMLParser.parse(xml);
-
 
326
			if(d.hasChildNodes()) {
323
			NodeList attributs = d.getFirstChild().getChildNodes();
327
				NodeList attributs = d.getFirstChild().getChildNodes();
324
 
-
 
325
			
328
				
326
			int taille = attributs.getLength();
329
				int taille = attributs.getLength();
327
			metaIptc = new String[taille][2];
330
				metaIptc = new String[taille][2];
-
 
331
				
328
			for(int i = 0; i < taille; i++)  {
332
				for(int i = 0; i < taille; i++)  {
-
 
333
					if(attributs.item(i) != null) {
329
				XMLParser.removeWhitespace(attributs.item(i));
334
						XMLParser.removeWhitespace(attributs.item(i));
330
				attributs.item(i).normalize();
335
						attributs.item(i).normalize();
331
				metaIptc[i][0] = attributs.item(i).getNodeName();
336
						metaIptc[i][0] = attributs.item(i).getNodeName();
-
 
337
						if(attributs.item(i).hasChildNodes()) {
332
				metaIptc[i][1] = attributs.item(i).getNodeValue();
338
							Node valeur = attributs.item(i).getFirstChild();
-
 
339
							if(valeur.getNodeType() == Node.TEXT_NODE) {
-
 
340
								metaIptc[i][1] = ((Text)valeur).getData();
-
 
341
							} else {
-
 
342
								metaIptc[i][1] = "";
-
 
343
							}
-
 
344
						}
-
 
345
					}
-
 
346
				}
333
			}
347
			}
Line 334... Line 348...
334
			
348
			
335
			return metaIptc;
349
			return metaIptc;
Line 359... Line 373...
359
		                             + "]+";
373
		                             + "]+";
360
		xml = xml.replaceAll(invalidXmlPattern, " ");
374
		xml = xml.replaceAll(invalidXmlPattern, " ");
Line 361... Line 375...
361
 
375
 
362
		try {
376
		try {
-
 
377
			Document d = XMLParser.parse(xml);
363
			Document d = XMLParser.parse(xml);
378
			if(d.hasChildNodes()) {
364
			NodeList attributs = d.getFirstChild().getChildNodes();
379
				NodeList attributs = d.getFirstChild().getChildNodes();
365
			
380
				
366
			int taille = attributs.getLength();
381
				int taille = attributs.getLength();
-
 
382
				metaExif = new String[taille][2];
367
			metaExif = new String[taille][2];
383
				
-
 
384
				for(int i = 0; i < taille; i++)  {
368
			for(int i = 0; i < taille; i++)  {
385
					if(attributs.item(i) != null) {
369
				XMLParser.removeWhitespace(attributs.item(i));
386
						XMLParser.removeWhitespace(attributs.item(i));
370
				attributs.item(i).normalize();
387
						attributs.item(i).normalize();
-
 
388
						metaExif[i][0] = attributs.item(i).getNodeName();
371
				metaExif[i][0] = attributs.item(i).getNodeName();
389
						if(attributs.item(i).hasChildNodes()) {
-
 
390
							Node valeur = attributs.item(i).getFirstChild();
-
 
391
							if(valeur.getNodeType() == Node.TEXT_NODE) {
-
 
392
								metaExif[i][1] = ((Text)valeur).getData();
-
 
393
							} else {
-
 
394
								metaExif[i][1] = "";
-
 
395
							}
-
 
396
						}
-
 
397
					}
372
				metaExif[i][1] = attributs.item(i).getNodeValue();
398
				}
-
 
399
			}
-
 
400
			
373
			}
401
			return metaExif;
Line 374... Line 402...
374
		} catch(DOMParseException e) {
402
		} catch(DOMParseException e) {
Line 375... Line 403...
375
			
403