Subversion Repositories eFlore/Archives.cel-v2

Compare Revisions

Ignore whitespace Rev 12 → Rev 11

/trunk/src/org/tela_botanica/client/modeles/ImageUploaderAsynchroneDAO.java
File deleted
/trunk/src/org/tela_botanica/client/modeles/ImageCarnet.java
1,169 → 1,29
package org.tela_botanica.client.modeles;
 
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
 
import com.google.gwt.json.client.JSONObject;
 
/**
*
* Classe representant une image du carnet,
* elle ne contient pas d'image à proprement parler mais
* plutôt les informations associées ainsi que l'url distante
*
*/
public class ImageCarnet extends HashMap {
public class ImageCarnet {
/*
// infos sur l'image
private String url = " " ;
private String ordre = " " ;
private String utilisateur = " " ;
private boolean publiable = false ;
private String height = "0" ;
private String width = "0" ;
private String make = " " ;
private String model = " " ;
private String xResolution = "0" ;
private String yResolution = "0" ;
private String date = " " ;
private String GPS = " " ;
private String comment = " " ;
private String url = null ;
private int numero = 0 ;
private String nom = null ;
// metadonnees exif
private String exifExposureTime = " " ;
private String exifFNumber = " " ;
private String exifVersion = " " ;
private String exifCompressedBitsPerPixel = " " ;
private String exifShutterSpeedValue = " " ;
private String exifApertureValue = " " ;
private String exifExposureBiasValue = " " ;
private String exifMaxApertureValue = " " ;
private String exifMeteringMode = " " ;
private String exifLightSource = " " ;
private String exifFlash = " " ;
private String exifFocalLength = " " ;
private String exifFlashPixVersion = " " ;
private String exifColorSpace = " " ;
private String exifInteroperabilityOffset = " " ;
private String exifFocalPlaneXResolution = " " ;
private String exifFocalPlaneYResolution = " " ;
private String exifFocalPlaneResolutionUnit = " " ;
private String exifSensingMethod = " " ;
private String exifFileSource = " " ;
private String exifCustomRendered = " " ;
private String exifExposureMode = " " ;
private String exifWhiteBalance = " " ;
private String exifDigitalZoomRatio = " " ;
private String exifSceneCaptureType = " " ;
private String exifGainControl = " " ;
private String exifContrast = " " ;
private String exifSaturation = " " ;
private String exifSharpness = " " ;
private String exifSubjectDistanceRange = " " ;
private String exifAutres = " " ;
// metadonnes iptc
private String iptcMotsCles = " " ;
private String iptcByLine = " " ;
private String iptcByLineTitle = " " ;
private String iptcCity = " " ;
private String iptcSubLocation = " " ;
private String iptcProvinceState = " " ;
private String iptcCountryPrimaryLocationCode = " " ;
private String iptcHeadline = " " ;
private String iptcCredit = " " ;
private String iptcCopyrightNotice = " " ;
private String iptcContact = " " ;
private String iptcAutres = " " ;
*/
 
public ImageCarnet(JSONObject image)
{
Set im = image.keySet() ;
for (Iterator iterator = im.iterator(); iterator.hasNext();) {
String key = (String) iterator.next();
if(image.get(key).isString() != null)
{
String valeur = image.get(key).isString().stringValue() ;
this.put(key, valeur) ;
}
}
 
}
public String renvoyerValeurCorrecte(String cle)
public ImageCarnet(String url,int numero,String nom)
{
if(this.containsKey((cle)))
{
String valeur = (String)this.get(cle) ;
if(valeur.equals("null"))
{
return " " ;
}
else
{
return valeur ;
}
}
else
{
return " " ;
}
this.url = url ;
this.numero = numero ;
this.nom = nom ;
}
 
public String getOrdre() {
return renvoyerValeurCorrecte("ci_ordre") ;
}
public String getBaseUrl()
{
return "http://localhost/Documents/images_serveur/" ;
}
 
public String getUrl() {
return getBaseUrl()+(String)this.get("ci_id_image")+".jpg" ;
return url;
}
public String getSUrl() {
return getBaseUrl()+(String)this.get("ci_id_image")+"_S.jpg" ;
}
public String getMUrl() {
return getBaseUrl()+(String)this.get("ci_id_image")+"_M.jpg" ;
}
 
 
public String getDate() {
return renvoyerValeurCorrecte("ci_meta_date_time") ;
public int getNumero() {
return numero;
}
 
 
public Object getIptcCity() {
return renvoyerValeurCorrecte("ci_meta_iptc_city") ;
public String getNom() {
return nom;
}
 
 
public String getMake() {
return renvoyerValeurCorrecte("ci_meta_make") ;
}
 
 
public String getModel() {
return renvoyerValeurCorrecte("ci_meta_model") ;
}
}
/trunk/src/org/tela_botanica/client/modeles/ListeImageAsynchroneDAO.java
3,7 → 3,6
import org.tela_botanica.client.interfaces.Rafraichissable;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
16,49 → 15,32
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StringFieldDef;
 
/**
* Data Object Access communiquant avec le serveur jrest fournissant la liste des images
* répondant à des critères donné
* @author aurelien
*
*/
public class ListeImageAsynchroneDAO {
public void ObtenirListeImages(final Rafraichissable r)
{
HTTPRequest.asyncGet("jrest/inventoryImageList/1/ci_publiable_eflore=0", new ResponseTextHandler() {
HTTPRequest.asyncGet("getphotos.php", new ResponseTextHandler() {
public void onCompletion(String responseText) {
final ListeImage photoData ;
final Object[][] photoData ;
 
final JSONValue responseValue = JSONParser.parse(responseText);
if (responseValue.isArray() != null) {
final JSONArray reponse = responseValue.isArray();
final JSONArray liste_noms = responseValue.isArray();
 
final int taillemax = reponse.size();
photoData = new ListeImage(taillemax);
for (int j = 0; j < taillemax ; j++) {
JSONObject image = (JSONObject)reponse.get(j) ;
photoData.add(new ImageCarnet(image)) ;
final int taillemax = liste_noms.size();
photoData = new Object[taillemax][2];
for (int j = 0; j < liste_noms.size(); j++) {
final JSONString debuturl = (JSONString) liste_noms
.get(j);
photoData[j] = new Object[]{"photo" + j,
"images/" + debuturl.stringValue()};
}
}
else
{
if(responseValue.isObject() != null)
{
photoData = new ListeImage(1);
photoData.add(new ImageCarnet(responseValue.isObject())) ;
}
else
{
photoData = null ;
}
photoData = null ;
}
r.rafraichir(photoData);
/trunk/src/org/tela_botanica/client/modeles/ListeImage.java
2,12 → 2,6
 
import java.util.Vector;
 
/**
* vecteur composé d'ImageCarnet, renvoyé par les objets de type DAO
* pour les images
* @author aurelien
*
*/
public class ListeImage extends Vector {
public ListeImage()
15,17 → 9,12
super();
}
public ListeImage(int taille)
{
super(taille);
}
public ListeImage(ImageCarnet[] ic)
{
super() ;
for (int i = 0; i < ic.length; i++)
{
if(ic[i] != null && ic[i] instanceof ImageCarnet)
if(ic[i] != null)
{
this.add(ic[i]);
}
/trunk/src/org/tela_botanica/client/modeles/ObservationAsynchroneDAO.java
5,6 → 5,7
*
*/
 
 
import org.tela_botanica.client.Util;
import org.tela_botanica.client.interfaces.iRetourObservation;