/trunk/src/org/tela_botanica/client/Mediator.java |
---|
12,34 → 12,50 |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.TextBox; |
public class Mediator implements AutoCompleteAsyncTextBoxListener { |
private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); |
private String user = null; |
private InventoryItemList inventoryItemList = null; |
private LocationList locationList = null; |
private DateList dateList = null; |
private StationList stationList = null; |
private NameAssistant nameAssistant=null; |
private LocationAssistant locationAssistant=null; |
private InventoryItem inventoryItem=null; |
private EntryPanel entryPanel=null; |
private ActionPanel actionPanel=null; |
private TopPanel topPanel=null; |
private LeftPanel leftPanel=null; |
private InfoPopup infoPopup=null; |
private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); // Recherche url de base des services distants |
private TextBox date = null; |
private TextBox complementLocation = null; |
private TextBox comment = null; |
// Utilisateur |
private TopPanel topPanel=null; // Information de connexion |
private String user = null; // Utilisateur connecte ou bien identifiant de session |
private boolean connected=false; |
boolean connected=false; |
// Filtres |
private LeftPanel leftPanel=null; // Containeur filtre date, lieu, lieu-dit ... |
private LocationList locationList = null; // Filtre sur lieu de releve |
private DateList dateList = null; // Filtre sur date d'observation |
private StationList stationList = null; // Filtre sur station d'observation |
// Saisie d'une observation |
private EntryPanel entryPanel=null; // Formulaire de saisie observation |
private NameAssistant nameAssistant=null; // Assistant de saisie nom scientifique |
private LocationAssistant locationAssistant=null; // Assistant de saisie nom de commune |
private TextBox date = null; // date observation |
private TextBox milieu = null; // milieu observation |
private TextBox lieudit = null; // lieu dit observation |
private TextBox comment = null; // commentaire observation |
private InventoryItem inventoryItem=null; // Une observation saisie |
// Liste des observations |
private InventoryItemList inventoryItemList = null; // Liste de releves saisis |
private ActionPanel actionPanel=null; // Action sur les observations |
// Informations |
private InfoPopup infoPopup=null; // Information complementaire sur un taxon (photo, repartition) |
// Point d'entree (pour fin d'initialisation) |
private Cel cel = null; |
47,7 → 63,62 |
} |
// Methodes Private |
/** |
* Recuperation du prefixe d'appel des services |
* @return prefix appel des service |
*/ |
private String getServiceBaseUrlFromDictionnary() { |
Dictionary theme = Dictionary.getDictionary("Parameters"); |
return theme.get("serviceBaseUrl"); |
} |
// Appel aux services : |
/** |
* Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation |
* de l'appellant Cel. (initAsync) |
* |
*/ |
private void getUserFromService() { |
HTTPRequest.asyncGet(serviceBaseUrl + "/User/", |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte |
connected = ((JSONBoolean) jsonArray.get(1)).booleanValue(); // Drapeau leve si utilisateur identifie |
} |
cel.initAsync(); |
} |
}); |
} |
// Methodes Public |
// Information sur Etat du systeme |
/** |
* Recuperation information utilisateur |
* |
*/ |
57,11 → 128,12 |
} |
// Actions declanchee par le systeme |
/** |
* Action initialisation |
* Action initialisation premier affichage |
*/ |
public void onInit() { |
73,10 → 145,12 |
} |
// Actions sur formulaire de saisie |
/** |
* Action lancee par la completion d'un nom dans l'assistant de saisie |
* Recherche d'information compl�mentaires .... |
* Action lancee par la completion d'un nom dans un assistant de saisie |
* Recherche d'information complementaires .... |
* |
* @return void |
*/ |
90,112 → 164,143 |
} |
/** |
* Action lancee par la selection d'un nom dans l'assistant de saisie. Lance |
* la recherche d'informations compl�mentaires (famille, numero |
* nomenclaturaux etc) et met a jour l'inventaire (addelement()) |
* Action suivant la completion d'un nom |
* |
* @return void |
*/ |
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, |
String str, String value) { |
if (getEntryPanel().getOrdre()==null) { |
onAddInventoryItem(); |
public void onNameCompleted(String value) { |
if (infoPopup==null) { |
infoPopup = new InfoPopup(this); |
} |
else { |
onModifyInventoryItem(getEntryPanel().getOrdre()); |
getEntryPanel().setOrdre(null); |
infoPopup.setImageUrl(value); |
} |
/** |
* Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour |
* |
*/ |
public void onAddInventoryItem() { |
// Lazy instantiation |
if (inventoryItem==null) { |
registerInventoryItem(new InventoryItem()); |
} |
inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),"null"); |
inventoryItemList.addelement(); |
} |
/** |
* Action suite ajout, modification, suppression element inventaire |
* Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour |
* |
*/ |
public void onModifyInventoryItem(String ordre) { |
public void onInventoryUpdated(String location) { |
// Lazy instantiation |
if (inventoryItem==null) { |
registerInventoryItem(new InventoryItem()); |
} |
inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),ordre); |
inventoryItemList.updateElement(); |
locationList.setLocation(location); |
locationList.updateCount(); |
} |
this.onLocationSelected(location); |
public boolean inventoryItemIsValid() { |
// TODO : controle date |
if (inventoryItem.getName().compareTo("")==0) { |
return false; |
} |
else { |
return true; |
} |
} |
/** |
* Action sur selection d'une observation : affichage du detail |
* Action lancee par la selection d'un nom dans un assistant de saisie. Lance |
* la recherche d'informations complementaires (famille, numero |
* nomenclaturaux etc) et met a jour l'inventaire (addelement()) |
* |
* @return void |
*/ |
public void onInventoryItemSelected(String ordre) { |
entryPanel.setOrdre(ordre); |
entryPanel.update(); |
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, |
String str, String value) { |
if (getEntryPanel().getOrdre()==null) { // Nouvelle observation |
onAddInventoryItem(); |
} |
else { |
onModifyInventoryItem(getEntryPanel().getOrdre()); // Modification d'une observation |
getEntryPanel().setOrdre(null); |
} |
} |
// Action portant sur la liste des observations |
/** |
* Action sur deselection d'une observation : affichage du detail |
* Action suite ajout, modification, suppression d'un element inventaire |
*/ |
public void onInventoryItemUnselected(String ordre) { |
entryPanel.setOrdre(null); |
public void onInventoryUpdated(String location) { |
} |
locationList.setLocation(location); // Mise a jour filtre localite |
locationList.updateCount(); |
this.onLocationSelected(location); // Selection localite |
} |
/** |
* Action sur recherche : affichage de la liste des taxons correspondants |
* Action sur selection d'une observation : affichage du detail |
*/ |
public void onSearch(String search) { |
public void onInventoryItemSelected(String ordre) { |
if (search.trim().compareTo("")==0) { |
search="all"; |
} |
inventoryItemList.setSearch(search); |
inventoryItemList.updateCount(); |
entryPanel.setOrdre(ordre); // Mise a jour du formulaire de saisie avec l'element selectionne |
entryPanel.update(); |
} |
/** |
* Action sur selection d'un lieu : affichage de la liste des taxons correspondants |
* TODO : gerer asynchronicite ? |
* Action sur deselection d'une observation : remise a zero |
*/ |
public void onLocationSelected(String loc) { |
public void onInventoryItemUnselected(String ordre) { |
inventoryItemList.setLocation(loc); |
inventoryItemList.updateCount(); |
entryPanel.setOrdre(null); // Mise a jour du formulaire de saisie avec l'element selectionne |
inventoryItemList.displayFilter(); |
} |
dateList.setLocation(loc); |
dateList.updateCount(); |
stationList.setLocation(loc); |
stationList.updateCount(); |
} |
// Action sur Filtrage |
// Filtre identification |
/** |
* Action sur login |
* Action sur login : initialisation filtres pour cette utilisateur |
* @param user |
*/ |
231,99 → 336,90 |
entryPanel.setUser(user); |
locationList.setUser(user); |
this.onInit(); |
} |
// Filtre recherche contenu |
/** |
* Action sur selection d'une station : affichage de la liste des taxons correspondants |
* Action sur recherche : affichage de la liste des taxons correspondants |
*/ |
public void onStationSelected(String station) { |
public void onSearch(String search) { |
inventoryItemList.setStation(station); |
if (search.trim().compareTo("")==0) { |
search="all"; |
} |
inventoryItemList.setSearch(search); |
inventoryItemList.updateCount(); |
inventoryItemList.displayFilter(); |
// nameAssistant.setValue(null); |
} |
// Filtre selection lieu |
/** |
* Action sur selection d'une date : affichage de la liste des taxons correspondants |
* Action sur selection d'un lieu : affichage de la liste des taxons correspondants |
* TODO : gerer asynchronicite ? |
*/ |
public void onDateSelected(String date) { |
public void onLocationSelected(String loc) { |
inventoryItemList.setDate(date); |
inventoryItemList.setLocation(loc); |
inventoryItemList.updateCount(); |
inventoryItemList.displayFilter(); |
// nameAssistant.setValue(null); |
dateList.setLocation(loc); |
dateList.updateCount(); |
stationList.setLocation(loc); |
stationList.updateCount(); |
} |
// Filtre station |
/** |
* Action suivant la completion d'un nom |
* |
* Action sur selection d'une station : affichage de la liste des taxons correspondants |
*/ |
public void onNameCompleted(String value) { |
if (infoPopup==null) { |
infoPopup = new InfoPopup(this); |
} |
infoPopup.setImageUrl(value); |
} |
public void onStationSelected(String station) { |
inventoryItemList.setStation(station); |
inventoryItemList.updateCount(); |
/** |
* Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour |
* |
*/ |
inventoryItemList.displayFilter(); |
public void onAddInventoryItem() { |
// TODO : singleton ? |
registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),"null")); |
inventoryItemList.addelement(); |
} |
// Filtre date d'observation |
/** |
* Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour |
* |
* Action sur selection d'une date : affichage de la liste des taxons correspondants |
*/ |
public void onModifyInventoryItem(String ordre) { |
public void onDateSelected(String date) { |
// TODO : singleton ? |
registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),ordre)); |
inventoryItemList.updateElement(); |
inventoryItemList.setDate(date); |
inventoryItemList.updateCount(); |
} |
inventoryItemList.displayFilter(); |
public boolean inventoryItemIsValid() { |
// TODO : controle date |
if (inventoryItem.getName().compareTo("")==0) { |
return false; |
} |
else { |
return true; |
} |
} |
// Declaration, enregistrement |
/** |
* Declaration InventoryItem |
* Declaration InventoryItem : une observation |
* @param cel |
*/ |
334,9 → 430,8 |
/** |
* Declaration InventoryItemList |
* Declaration InventoryItemList : liste d'observation |
* @param inventoryItemList |
*/ |
347,7 → 442,7 |
} |
/** |
* Declaration LocationList |
* Declaration LocationList : filtre lieu observation |
* @param locationList |
*/ |
359,7 → 454,7 |
/** |
* Declaration DateList |
* Declaration DateList : filtre date observation |
* @param locationList |
*/ |
370,7 → 465,7 |
/** |
* Declaration InfoPopup |
* Declaration InfoPopup : information complementaire taxon en cours |
* @param infoPopup |
*/ |
382,7 → 477,7 |
/** |
* Declaration StationList |
* Declaration StationList : filtre par station |
* @param locationList |
*/ |
394,7 → 489,7 |
/** |
* Declaration Cel |
* Declaration Cel : point d'entree |
* @param cel |
*/ |
405,7 → 500,7 |
/** |
* Declaration NameAssistant |
* Declaration NameAssistant : completion nom scientifique |
* @param nameassistant |
*/ |
415,7 → 510,7 |
} |
/** |
* Declaration LocationAssistant |
* Declaration LocationAssistant : completion commune |
* @param locationassistant |
*/ |
427,7 → 522,7 |
/** |
* Declaration date |
* Declaration date : date observation |
* @param date |
*/ |
439,27 → 534,54 |
/** |
* Declaration complementLocation |
* @param complementLocation |
* Declaration lieu dit : lieu dit d'observation |
* |
* @param milieu |
*/ |
public void registerComplementLocation(TextBox complementLocation) { |
this.complementLocation=complementLocation; |
public void registerLieudit(TextBox lieudit) { |
this.lieudit=lieudit; |
} |
/** |
* Declaration milieu : milieu d'observation |
* |
* @param milieu |
*/ |
public void registerMilieu(TextBox milieu) { |
this.milieu=milieu; |
} |
/** |
* Declaration Entry Panel : formulaire de saisie observation |
*/ |
public void registerEntryPanel(EntryPanel entryPanel) { |
this.entryPanel=entryPanel; |
} |
/** |
* Declaration Action Panel : actions sur liste des observations |
*/ |
public void registerActionPanel(ActionPanel actionPanel) { |
this.actionPanel=actionPanel; |
} |
/** |
* Declaration TopPanel : panneau de connexion |
*/ |
public void registerTopPanel(TopPanel topPanel) { |
this.topPanel=topPanel; |
} |
477,7 → 599,8 |
} |
/* Panneau gauche |
/* |
* Declaration LeftPanel Panneau gauche filtre sur liste d'observation |
* |
*/ |
487,34 → 610,10 |
} |
// Accesseurs et setteurs |
/** |
* Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation |
* de l'appellant Cel. (initAsync) |
* |
*/ |
private void getUserFromService() { |
HTTPRequest.asyncGet(serviceBaseUrl + "/User/", |
new ResponseTextHandler() { |
public void onCompletion(String str) { |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte |
connected = ((JSONBoolean) jsonArray.get(1)).booleanValue(); // Drapeau leve si utilisateur identifie |
} |
cel.initAsync(); |
} |
}); |
} |
/** |
* Accesseur Url de base |
* @return Url de base |
*/ |
527,19 → 626,6 |
/** |
* Recuperation du prefixe d'appel des services |
* @return prefix appel des service |
*/ |
private String getServiceBaseUrlFromDictionnary() { |
Dictionary theme = Dictionary.getDictionary("Parameters"); |
return theme.get("serviceBaseUrl"); |
} |
/** |
* Accesseur Utilisateur |
* @return utilisateur connecte ou identifiant de session |
*/ |
548,14 → 634,11 |
return user; |
} |
public void setUser(String user) { |
this.user=user; |
} |
public InventoryItemList getInventoryItemList() { |
return inventoryItemList; |
} |
/trunk/src/org/tela_botanica/client/LocationList.java |
---|
149,7 → 149,7 |
private int count = 0; |
// Tous selectionné |
// Tous selectionn� |
private int selectedRow = -1; |
private Mediator mediator = null; |
179,7 → 179,7 |
// Mise en forme de l'entree "Toutes localités" |
// Mise en forme de l'entree "Toutes localit�s" |
selector.setCellSpacing(0); |
selector.setCellPadding(0); |
218,7 → 218,7 |
navBar.setWidth("100%"); |
outer.add(header); |
inner.add(selector); // Toutes localités |
inner.add(selector); // Toutes localit�s |
inner.add(table); |
inner.setStyleName("location-List"); |
inner.setWidth("100%"); |
310,9 → 310,9 |
/** |
* |
* Mise a jour de l'affichage, à partir des données d'inventaire deja |
* Mise a jour de l'affichage, � partir des donn�es d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
* données seront affichées |
* donn�es seront affich�es |
* |
*/ |
348,7 → 348,7 |
} |
// Lieu |
String loc=((JSONString)jsonArrayNested.get(0)).stringValue(); |
String loc=Util.toCelString(((JSONString)jsonArrayNested.get(0)).toString()); |
if (loc.compareTo("000null")!=0) { |
table.setText(row, 0,loc); |
398,7 → 398,7 |
/* |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* dernière page |
* derni�re page |
* |
* @param |
* @return void |
416,7 → 416,7 |
/** |
* Affichage message d'attente et désactivation navigation |
* Affichage message d'attente et d�sactivation navigation |
* |
* @param |
* @return void |
/trunk/src/org/tela_botanica/client/InventoryItemList.java |
---|
291,15 → 291,15 |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Nom retenu, Num Nomen nom retenu, Num Taxon, Famille |
updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(), |
((JSONString) jsonArray.get(0)) |
.stringValue(), |
Util.toCelString(((JSONString) jsonArray.get(0)) |
.toString()), |
((JSONString) jsonArray.get(1)) |
.stringValue(), |
((JSONString) jsonArray.get(2)) |
.stringValue(), |
((JSONString) jsonArray.get(3)) |
.stringValue(), |
inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment()); |
Util.toCelString(((JSONString) jsonArray.get(3)) |
.toString()), |
inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment()); |
} |
} |
307,7 → 307,7 |
} |
// Modification d'un nom ne faisant pas parti du referentiel (saisie libre) |
else { |
updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment()); |
updateElement(inventoryItem.getOrdre(),inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment()); |
} |
} |
349,15 → 349,15 |
// Nom retenu, Num Nomen nom retenu, Num Taxon, |
// Famille |
addElement(inventoryItem.getName(), inventoryItem.getNomenclaturalNumber(), |
((JSONString) jsonArray.get(0)) |
.stringValue(), |
Util.toCelString(((JSONString) jsonArray.get(0)) |
.toString()), |
((JSONString) jsonArray.get(1)) |
.stringValue(), |
((JSONString) jsonArray.get(2)) |
.stringValue(), |
((JSONString) jsonArray.get(3)) |
.stringValue(), |
inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment()); |
Util.toCelString(((JSONString) jsonArray.get(3)) |
.toString()), |
inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment()); |
} |
} |
365,7 → 365,7 |
} |
// Saisie libre |
else { |
addElement(inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getComplementlocation(),inventoryItem.getComment()); |
addElement(inventoryItem.getName(), " ", " ", " ", " ", " ",inventoryItem.getLocation(),inventoryItem.getLocation_id(),inventoryItem.getDate(),inventoryItem.getMilieu(),inventoryItem.getComment()); |
} |
} |
395,15 → 395,15 |
*/ |
private void addElement(String nom_sel, String num_nom_sel, String nom_ret, |
String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) { |
String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) { |
count++; |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/", "identifiant=" |
+ user + "&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel |
+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret |
+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat |
+ "&station="+ complementLocation + "&commentaire="+ comment, |
+ user + "&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel |
+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret |
+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat |
+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment), |
new ResponseTextHandler() { |
438,14 → 438,14 |
*/ |
private void updateElement(String ordre, String nom_sel, String num_nom_sel, String nom_ret, |
String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String complementLocation, String comment) { |
String num_nom_ret, String num_taxon, String famille,final String loc, String id_location,String dat, String milieu, String comment) { |
HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user + "/" +ordre + "/", |
"&nom_sel=" + nom_sel + "&num_nom_sel=" + num_nom_sel |
+ "&nom_ret=" + nom_ret + "&num_nom_ret=" + num_nom_ret |
+ "&num_taxon=" + num_taxon + "&famille=" + famille + "&location=" + loc + "&id_location=" + id_location + "&date_observation=" + dat |
+ "&station="+ complementLocation + "&commentaire="+ comment, |
"&nom_sel=" + URL.encodeComponent(nom_sel) + "&num_nom_sel=" + num_nom_sel |
+ "&nom_ret=" + URL.encodeComponent(nom_ret) + "&num_nom_ret=" + num_nom_ret |
+ "&num_taxon=" + num_taxon + "&famille=" + URL.encodeComponent(famille) + "&location=" + URL.encodeComponent(loc) + "&id_location=" + id_location + "&date_observation=" + dat |
+ "&station="+ URL.encodeComponent(milieu) + "&commentaire="+ URL.encodeComponent(comment), |
new ResponseTextHandler() { |
631,7 → 631,7 |
adate=date.substring(6,10)+"-"+date.substring(3,5)+"-"+date.substring(0,2)+" 00:00:00"; |
} |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + search + "/" + URL.encodeComponent(station) + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + URL.encodeComponent(location) +"/" + adate + "/" + URL.encodeComponent(search) + "/" + URL.encodeComponent(station) + "/" |
+ startIndex + "/" + VISIBLE_TAXON_COUNT, |
new ResponseTextHandler() { |
655,6 → 655,7 |
for (i = 0; i < arraySize; ++i) { |
if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) { |
// Optimisation |
if (i>=table.getRowCount()) { |
row = table.insertRow(table.getRowCount()); |
} |
670,7 → 671,7 |
table.setWidget(row, 0, new CheckBox()); |
// Observation transmise |
// Statut Observation transmise ? |
String atransmit=((JSONString) jsonArrayNested .get(11)).stringValue(); |
682,10 → 683,12 |
table.setWidget(row,1,new HTML(" ")); |
} |
left.append("<b>"+((JSONString) jsonArrayNested .get(0)).stringValue()+"</b>"); |
// Nom saisi |
left.append("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>"); |
// Nom retenu |
String aname=((JSONString) jsonArrayNested .get(2)).stringValue(); |
String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString()); |
if (aname.compareTo("null")==0) { |
} |
716,7 → 719,7 |
} |
// Famille |
String afamily=((JSONString) jsonArrayNested .get(5)).stringValue(); |
String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString()); |
if (afamily.compareTo("null")==0) { |
// |
726,7 → 729,7 |
} |
String aloc=((JSONString) jsonArrayNested .get(6)).stringValue(); |
String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString()); |
// Localisation - Lieu |
if (aloc.compareTo("000null")==0) { |
748,7 → 751,7 |
} |
String alieudit=((JSONString) jsonArrayNested .get(9)).stringValue(); |
String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString()); |
// Localisation - Lieu dit |
756,7 → 759,7 |
center.append(", "+alieudit); |
} |
String acomment=((JSONString) jsonArrayNested .get(10)).stringValue(); |
String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString()); |
// Commentaire |
if (acomment.compareTo("null")!=0) { |
1058,4 → 1061,7 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.7 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
*/ |
/trunk/src/org/tela_botanica/client/DateList.java |
---|
1,20 → 1,21 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* DateList.java : filtrage des releves par date d'observation |
* Copyright 2006 Google Inc. |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* 1: Le programme initialise les filtres communes, lieu-dit et dates) |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.http.client.URL; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONNumber; |
26,6 → 27,7 |
import com.google.gwt.user.client.ui.Button; |
import com.google.gwt.user.client.ui.ClickListener; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.DockPanel; |
import com.google.gwt.user.client.ui.FlexTable; |
import com.google.gwt.user.client.ui.Grid; |
import com.google.gwt.user.client.ui.HTML; |
43,42 → 45,58 |
public class DateList extends Composite { |
// Debut Barre de navigation |
// Barre de navigation |
private class NavBar extends Composite implements ClickListener { |
public final DockPanel bar = new DockPanel(); |
public final Button gotoFirst = new Button("<<", this); |
public final Button gotoNext = new Button(">", this); |
public final Button gotoPrev = new Button("<", this); |
public final Button gotoEnd = new Button(">>", this); |
public final HTML status = new HTML(); |
public NavBar() { |
initWidget(bar); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
status.setWordWrap(false); |
HorizontalPanel buttons = new HorizontalPanel(); |
HorizontalPanel bar = new HorizontalPanel(); |
buttons.add(status); |
buttons.setCellHorizontalAlignment(status, |
HasHorizontalAlignment.ALIGN_RIGHT); |
buttons.setCellVerticalAlignment(status, |
HasVerticalAlignment.ALIGN_MIDDLE); |
buttons.setCellWidth(status, "100%"); |
bar.setStyleName("navbar"); |
status.setStyleName("status"); |
buttons.add(gotoFirst); |
buttons.add(gotoPrev); |
buttons.add(gotoNext); |
buttons.add(gotoEnd); |
bar.add(buttons, DockPanel.EAST); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT); |
bar.add(status); |
bar.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT); |
bar.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE); |
bar.setCellWidth(status, "100%"); |
bar.add(gotoFirst); |
bar.add(gotoPrev); |
bar.add(gotoNext); |
bar.add(gotoEnd); |
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT); |
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); |
initWidget(bar); |
} |
public void onClick(Widget sender) { |
if (sender == gotoNext) { |
// Move forward a page. |
106,7 → 124,6 |
} |
// Fin Barre de navigation |
private static final int VISIBLE_DATE_COUNT = 10; |
134,9 → 151,9 |
private NavBar navBar=null; |
private int count = 0; |
private int count = 65000; |
// Tous selectionne |
// Tous selectionné |
private int selectedRow = -1; |
private Mediator mediator = null; |
171,7 → 188,7 |
// header.getCellFormatter().setWidth(0, 0, "100%"); |
// Mise en forme de l'entree "Toutes localites" |
// Mise en forme de l'entree "Toutes localités" |
selector.setCellSpacing(0); |
selector.setCellPadding(0); |
208,7 → 225,7 |
outer.add(header); |
inner.add(selector); // Toutes localit�s |
inner.add(selector); // Toutes localités |
inner.add(table); |
inner.setStyleName("date-List"); |
inner.setWidth("100%"); |
239,6 → 256,9 |
selector.getRowFormatter().addStyleName(0, "date-SelectedRow"); |
//updateCount(); |
// update() |
initWidget(outer); |
254,7 → 274,6 |
setStatusDisabled(); |
// HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location + "/"+ station, |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + URL.encodeComponent(location) , |
new ResponseTextHandler() { |
296,9 → 315,9 |
/** |
* |
* Mise a jour de l'affichage, a partir des donnees d'inventaire deja |
* Mise a jour de l'affichage, à partir des données d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
* donnees seront affichees |
* données seront affichées |
* |
*/ |
307,7 → 326,6 |
setStatusDisabled(); |
// HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + location + "/" + station + "/" |
HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryDateList/" + user + "/" + URL.encodeComponent(location) + "/" |
+ startIndex + "/" + VISIBLE_DATE_COUNT, |
386,7 → 404,7 |
/* |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* derni�re page |
* dernière page |
* |
* @param |
* @return void |
404,7 → 422,7 |
/** |
* Affichage message d'attente et d�sactivation navigation |
* Affichage message d'attente et désactivation navigation |
* |
* @param |
* @return void |
417,7 → 435,7 |
navBar.gotoNext.setEnabled(false); |
navBar.gotoEnd.setEnabled(false); |
navBar.status.setText("Patientez ..."); |
setStatusText("Patientez ..."); |
} |
/** |
440,31 → 458,35 |
// page |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
navBar.status.setText((startIndex + 1) + " - " |
setStatusText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_DATE_COUNT) + " sur " + count ); |
} else { // Derniere page |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count ); |
setStatusText((startIndex + 1) + " - " + count + " sur " + count ); |
} |
} else { // Premiere page |
if (count > VISIBLE_DATE_COUNT) { // Des pages derrieres |
navBar.gotoNext.setEnabled(true); |
navBar.gotoEnd.setEnabled(true); |
navBar.status.setText((startIndex + 1) + " - " |
setStatusText((startIndex + 1) + " - " |
+ (startIndex + VISIBLE_DATE_COUNT) + " sur " + count); |
} else { |
navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count); |
setStatusText((startIndex + 1) + " - " + count + " sur " + count); |
} |
} |
} |
else { // Pas d'inventaire, pas de navigation |
navBar.status.setText("0 - 0 sur 0"); |
setStatusText("0 - 0 sur 0"); |
} |
} |
private void setStatusText(String text) { |
navBar.status.setText(text); |
} |
public void setUser(String user) { |
this.user = user; |
} |
477,8 → 499,3 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* |
*/ |
/trunk/src/org/tela_botanica/client/NameAssistant.java |
---|
17,7 → 17,7 |
import org.tela_botanica.client.AutoCompleteAsyncTextBox; |
/** |
* Affiche une liste de nom pour selection. Son retournés le nom selectionné (gettext()) et un code associé (getvalue()). |
* Affiche une liste de nom pour selection. Son retourn�s le nom selectionn� (gettext()) et un code associ� (getvalue()). |
*/ |
public class NameAssistant extends Composite implements EventListener, ResponseTextHandler { |
54,7 → 54,7 |
if ((jsonArray = jsonValue.isArray()) != null) { |
for (int i = 0; i < jsonArray.size(); ++i) { |
if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) { |
autoCompletebox.addItem(((JSONString) jsonArrayNested.get(0)).stringValue(),((JSONString) jsonArrayNested.get(1)).stringValue()); |
autoCompletebox.addItem(Util.toCelString(((JSONString) jsonArrayNested.get(0)).toString()),Util.toCelString(((JSONString) jsonArrayNested.get(1)).toString())); |
} |
} |
} |
/trunk/src/org/tela_botanica/client/InventoryItem.java |
---|
2,6 → 2,7 |
public class InventoryItem { |
// TODO : Singleton ? |
private String name=null; |
private String nomenclaturalNumber=null; |
8,14 → 9,27 |
private String location=null; |
private String location_id=null; |
private String date=null; |
private String complementlocation=null; |
private String milieu=null; |
private String comment=null; |
private String ordre=null; |
public InventoryItem(String name,String nomenclaturalNumber, String location, String location_id, String date, String complementlocation, String comment,String ordre) { |
// Constructeur |
// Constructeur sur saisie |
public InventoryItem() { |
} |
// Alimentation contenu depuis saisie |
public void setContent(String name,String nomenclaturalNumber, String location, String location_id, String date, String milieu, String comment,String ordre) { |
this.name=name; |
this.nomenclaturalNumber=nomenclaturalNumber; |
30,7 → 44,7 |
this.location_id=location_id; |
this.date=date; |
this.complementlocation=complementlocation; |
this.milieu=milieu; |
this.comment=comment; |
this.ordre=ordre; |
37,6 → 51,7 |
} |
public String getLocation() { |
return location; |
} |
62,8 → 77,8 |
} |
public String getComplementlocation() { |
return complementlocation; |
public String getMilieu() { |
return milieu; |
} |
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBox.java |
---|
20,10 → 20,9 |
package org.tela_botanica.client; |
// TODO : traiter latence (augmenter en fonction rapidité saisie + texte vide) |
// TODO : traiter latence (augmenter en fonction rapidit� saisie + texte vide) |
// TODO : traitement espace apres l'espece (%20) |
import com.google.gwt.http.client.URL; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.ui.KeyboardListener; |
/trunk/src/org/tela_botanica/client/StationList.java |
---|
136,7 → 136,7 |
private int count = 65000; |
// Tous selectionné |
// Tous selectionn� |
private int selectedRow = -1; |
private Mediator mediator = null; |
287,9 → 287,9 |
/** |
* |
* Mise a jour de l'affichage, à partir des données d'inventaire deja |
* Mise a jour de l'affichage, � partir des donn�es d'inventaire deja |
* saisies. La valeur de this.startIndex permet de determiner quelles |
* données seront affichées |
* donn�es seront affich�es |
* |
*/ |
325,7 → 325,7 |
row = i; |
} |
String astation=((JSONString)jsonArrayNested.get(0)).stringValue(); |
String astation=Util.toCelString(((JSONString)jsonArrayNested.get(0)).toString()); |
if (astation.compareTo("000null")!=0) { |
table.setText(row, 0,astation); |
376,7 → 376,7 |
/* |
* Positionnement index de parcours (this.startIndex) pour affichage de la |
* dernière page |
* derni�re page |
* |
* @param |
* @return void |
394,7 → 394,7 |
/** |
* Affichage message d'attente et désactivation navigation |
* Affichage message d'attente et d�sactivation navigation |
* |
* @param |
* @return void |
/trunk/src/org/tela_botanica/client/Util.java |
---|
New file |
0,0 → 1,12 |
package org.tela_botanica.client; |
public class Util { |
public Util() { |
} |
static String toCelString(String str) { |
return str.substring(1,str.length()-1); |
// |
} |
} |
/trunk/src/org/tela_botanica/client/InfoPopup.java |
---|
22,8 → 22,6 |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HorizontalPanel; |
import com.google.gwt.user.client.ui.Image; |
import com.google.gwt.user.client.ui.PopupPanel; |
import com.google.gwt.user.client.ui.VerticalPanel; |
99,7 → 97,7 |
if (url.compareTo("null")!=0) { |
// setPopupPosition(3*(Window.getClientWidth()/4), mediator.getInventoryItemList().getAbsoluteTop()+50); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)+50); |
show(); |
imageTop.setUrl(url); |
} |
113,7 → 111,7 |
public void setImageBottom(String url) { |
if (url.compareTo("null")!=0) { |
// setPopupPosition(3*(Window.getClientWidth()/4), mediator.getInventoryItemList().getAbsoluteTop()+50); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2) + 50); |
show(); |
imageBottom.setUrl(url); |
} |
/trunk/src/org/tela_botanica/client/EntryPanel.java |
---|
55,9 → 55,12 |
private NameAssistant nameAssistant = null; |
private LocationAssistant locationAssistant = null; |
private TextBox date = new TextBox(); |
private TextBox complementLocation = new TextBox(); |
private TextBox lieudit = new TextBox(); |
private TextBox milieu = new TextBox(); |
private TextBox comment = new TextBox(); |
private Button dateSelector = new Button("..."); |
private Button validButton = new Button("Ajouter"); |
boolean visible=false; |
private Mediator mediator=null; |
72,58 → 75,109 |
public EntryPanel(final Mediator med) { |
Grid inner = new Grid(3,4); |
Grid observation = new Grid(4,4); |
// Formatage affichage |
for (int i=0; i<4;i++) { |
observation.getCellFormatter().setWidth(i, 0, "3%"); |
observation.getCellFormatter().setWidth(i, 1, "47%"); |
observation.getCellFormatter().setWidth(i, 2, "3%"); |
observation.getCellFormatter().setWidth(i, 3, "47%"); |
} |
mediator=med; |
user=mediator.getUser(); |
// Declaration des elements du dialogue de saisie aupres du mediator |
mediator.registerEntryPanel(this); |
mediator.registerDate(date); |
mediator.registerComment(comment); |
mediator.registerComplementLocation(complementLocation); |
mediator.registerMilieu(milieu); |
mediator.registerLieudit(lieudit); |
VerticalPanel outer = new VerticalPanel(); |
// Name assistant et location assistant : widget auto-completion sur nom scientifique ou commune |
outer.add(new HTML("<b>Saisir un relevé :</b>")); |
nameAssistant = new NameAssistant(mediator); |
locationAssistant = new LocationAssistant(mediator); |
for (int i=0; i<3;i++) { |
inner.getCellFormatter().setWidth(i, 0, "3%"); |
inner.getCellFormatter().setWidth(i, 1, "47%"); |
inner.getCellFormatter().setWidth(i, 2, "3%"); |
inner.getCellFormatter().setWidth(i, 3, "47%"); |
// Saisie Commune |
observation.setHTML(2,0,"Commune: "); |
observation.setWidget(2,1,locationAssistant); |
locationAssistant.setWidth("100%"); |
// Saisie lieu-dit |
observation.setHTML(2,2,"Lieu-dit: "); |
observation.setWidget(2,3,lieudit); |
lieudit.setWidth("100%"); |
lieudit.addKeyboardListener( new KeyboardListener() { |
public void onKeyDown(Widget arg0, char arg1, int arg2) { |
if(arg1 == KEY_ENTER) |
{ |
onValidateTextBox(lieudit); |
} |
} |
public void onKeyUp(Widget arg0, char arg1, int arg2) { } |
public void onKeyPress(Widget arg0, char arg1, int arg2) { } |
nameAssistant = new NameAssistant(mediator); |
locationAssistant = new LocationAssistant(mediator); |
} |
); |
// Saisie Nom |
inner.setHTML(0,0,"Espèce: "); |
inner.setWidget(0,1,nameAssistant); |
// Saisie (milieu) |
nameAssistant.setWidth("100%"); |
observation.setHTML(3,0,"Milieu: "); |
observation.setWidget(3,1,milieu); |
// Saisie lieu |
milieu.setWidth("100%"); |
inner.setHTML(1,0,"Commune: "); |
inner.setWidget(1,1,locationAssistant); |
locationAssistant.setWidth("100%"); |
// Validation par entree sur cette zone de texte |
// Saisie Date |
milieu.addKeyboardListener( new KeyboardListener() { |
public void onKeyDown(Widget arg0, char arg1, int arg2) { |
if(arg1 == KEY_ENTER) |
{ |
onValidateTextBox(milieu); |
} |
} |
public void onKeyUp(Widget arg0, char arg1, int arg2) { } |
public void onKeyPress(Widget arg0, char arg1, int arg2) { } |
} |
); |
// Selecteur de Date |
// Releve |
dateSelector.addClickListener(new ClickListener () { |
public void onClick(Widget w) { |
161,30 → 215,32 |
}); |
inner.setHTML(2,0,"Date: "); |
// Saisie Espece |
observation.setHTML(0,0,"Espèce: "); |
observation.setWidget(0,1,nameAssistant); |
nameAssistant.setWidth("100%"); |
observation.setHTML(0,2,"Date: "); |
HorizontalPanel datePanel = new HorizontalPanel(); |
datePanel.add(date); |
datePanel.add(dateSelector); |
inner.setWidget(2,1,datePanel); |
observation.setWidget(0,3,datePanel); |
// Saisie date |
// Validation par entree sur cette zone de texte |
date.addKeyboardListener( new KeyboardListener() { |
public void onKeyDown(Widget arg0, char arg1, int arg2) { |
if(arg1 == KEY_ENTER) |
{ |
if (ordre==null) { |
mediator.onAddInventoryItem(); |
date.setText(""); |
onValidateTextBox(date); |
} |
else { |
mediator.onModifyInventoryItem(ordre); |
ordre=null; |
} |
} |
} |
public void onKeyUp(Widget arg0, char arg1, int arg2) { } |
public void onKeyPress(Widget arg0, char arg1, int arg2) { } |
194,61 → 250,24 |
// Saisie Complement de lieu (station) |
inner.setHTML(1,2,"Station: "); |
inner.setWidget(1,3,complementLocation); |
complementLocation.setWidth("100%"); |
complementLocation.addKeyboardListener( new KeyboardListener() { |
public void onKeyDown(Widget arg0, char arg1, int arg2) { |
if(arg1 == KEY_ENTER) |
{ |
if (ordre==null) { |
mediator.onAddInventoryItem(); |
complementLocation.setText(""); |
} |
else { |
mediator.onModifyInventoryItem(ordre); |
ordre=null; |
} |
} |
} |
public void onKeyUp(Widget arg0, char arg1, int arg2) { } |
public void onKeyPress(Widget arg0, char arg1, int arg2) { } |
} |
); |
// Saisie Commentaire |
inner.setHTML(2,2,"Notes: "); |
inner.setWidget(2,3,comment); |
observation.setHTML(1,0,"Notes: "); |
observation.setWidget(1,1,comment); |
comment.setWidth("100%"); |
// Validation par entree sur cette zone de texte |
comment.addKeyboardListener( new KeyboardListener() { |
public void onKeyDown(Widget arg0, char arg1, int arg2) { |
if(arg1 == KEY_ENTER) |
{ |
if (ordre==null) { |
mediator.onAddInventoryItem(); |
comment.setText(""); |
onValidateTextBox(comment); |
} |
else { |
mediator.onModifyInventoryItem(ordre); |
ordre=null; |
} |
} |
} |
259,7 → 278,7 |
); |
Button validButton = new Button("Valider"); |
// Validation par click sur bouton valider |
validButton.addClickListener( |
267,6 → 286,7 |
new ClickListener() { |
public void onClick(Widget w) { |
// Numero ordre vide : ajout d'une observation |
if (ordre==null) { |
mediator.onAddInventoryItem(); |
} |
285,10 → 305,10 |
actionPanel.add(validButton); |
inner.setWidth("100%"); |
observation.setWidth("100%"); |
outer.add(inner); |
outer.setCellWidth(inner, "100%"); |
outer.add(observation); |
outer.setCellWidth(observation, "100%"); |
outer.setSpacing(10); |
outer.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER); |
311,17 → 331,13 |
if ((jsonArray = jsonValue.isArray()) != null) { |
String aname = ((JSONString) jsonArray.get(0)).stringValue(); |
String aname = Util.toCelString(((JSONString) jsonArray.get(0)).toString()); |
// Nom |
if (aname.compareTo("null")!=0) { |
nameAssistant.setText(((JSONString) jsonArray.get(0)).stringValue()); |
nameAssistant.setText(aname); |
// Numero nomenclatural |
nameAssistant.setValue(anum); |
} |
} |
339,17 → 355,23 |
} |
/* |
* Numero d'ordre du relev� affich� |
* Numero d'ordre du releve affiche + mise à jour bouton |
* |
*/ |
public void setOrdre(String ordre) { |
this.ordre = ordre; |
if (ordre==null) { |
this.validButton.setText("Ajouter"); |
} |
else { |
this.validButton.setText("Modifier"); |
} |
} |
/* |
* Numero d'ordre du relev� affich� |
* Numero d'ordre du releve affiche |
* |
*/ |
358,9 → 380,26 |
} |
// Validation par entree sur cette zone de texte |
private void onValidateTextBox(TextBox textbox) { |
if (ordre==null) { |
// Numero ordre vide : ajout d'une observation |
mediator.onAddInventoryItem(); |
textbox.setText(""); |
} |
else { |
mediator.onModifyInventoryItem(ordre); |
ordre=null; |
} |
} |
/** |
* Mise a jour de l'affichage a partir de donn�es deja saisie |
* Mise a jour de l'affichage a partir de donnees deja saisie |
* |
*/ |
377,9 → 416,11 |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Nom saisi |
nameAssistant.setText(((JSONString) jsonArray.get(0)).stringValue()); |
nameAssistant.setText(Util.toCelString(((JSONString) jsonArray.get(0)).toString())); |
// Numero nomenclatural |
String ann=((JSONString) jsonArray .get(3)).stringValue(); |
393,7 → 434,7 |
} |
// Commune |
String aloc=((JSONString) jsonArray .get(6)).stringValue(); |
String aloc=Util.toCelString(((JSONString) jsonArray .get(6)).toString()); |
if (aloc.compareTo("000null")!=0) { |
locationAssistant.setText(aloc); |
413,18 → 454,18 |
} |
String astation=((JSONString) jsonArray .get(9)).stringValue(); |
String astation=Util.toCelString(((JSONString) jsonArray .get(9)).toString()); |
// Station |
if (astation.compareTo("000null")!=0) { |
complementLocation.setText(astation); |
milieu.setText(astation); |
} |
else { |
complementLocation.setText(""); |
milieu.setText(""); |
} |
String acomment=((JSONString) jsonArray .get(10)).stringValue(); |
String acomment=Util.toCelString(((JSONString) jsonArray .get(10)).toString()); |
// Notes |
if (acomment.compareTo("null")!=0) { |
comment.setText(acomment); |
450,6 → 491,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.7 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
* Revision 1.6 2007-06-06 13:29:30 ddelon |
* v0.09 |
* |
/trunk/src/org/tela_botanica/client/TopPanel.java |
---|
100,7 → 100,7 |
JSONValue jsonValue = JSONParser.parse(str); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur : identifant de session |
user = Util.toCelString(((JSONString) jsonArray.get(0)).toString()); // Identifiant utilisateur : identifant de session |
mediator.setConnected(((JSONBoolean) jsonArray.get(1)).booleanValue()); |
} |
133,5 → 133,8 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.5 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
* |
*/ |
/trunk/src/org/tela_botanica/client/SearchPanel.java |
---|
1,18 → 1,16 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* SearchPanel.java : recherche parmi les releves |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1: Le programme affiche une zone de saisie pour recherche |
* 2: Le programme arme l'action liee a l'envoi d'une recherche |
*/ |
package org.tela_botanica.client; |
95,3 → 93,11 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.5 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
* |
*/ |
/trunk/src/org/tela_botanica/client/ActionPanel.java |
---|
1,18 → 1,21 |
/** |
David Delon david.delon@clapas.net 2007 |
*/ |
/* |
* Copyright 2006 Google Inc. |
* ActionPanel.java : affichage actions sur releves saisie ou affiches (suppression, export etc...) |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* TODO : appel de fonction du mediator, au lieu de passer par les methode de la classe de gestion d'affichage des releves (voir les TODO dans le |
* corps de ce programme) |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
* 1: Le programme affiche les boutons commandant les actions sur les releves et arme les actions correspondantes |
* - Transmission d'elements (vers tela botanica) |
* - Suppression d'elements selectionnes |
* - Export vers tableur |
* - Selection / Deselection des releves affiches |
*/ |
package org.tela_botanica.client; |
23,11 → 26,6 |
import com.google.gwt.user.client.ui.HorizontalPanel; |
import com.google.gwt.user.client.ui.Label; |
import com.google.gwt.user.client.ui.Widget; |
/** |
* Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget() |
*/ |
public class ActionPanel extends Composite { |
private Mediator mediator=null; |
80,11 → 78,9 |
buttons.add(delButton); |
// Export de la totalité |
// Export (renseigne lors de l'affichage des releves ) |
exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ mediator.getUser() + |
"\">"+"Export tableur</a>"); |
exportButton=new HTML(); |
buttons.add(exportButton); |
exportButton.setStyleName("html_button"); |
141,4 → 137,14 |
public HTML getExportButton() { |
return exportButton; |
} |
} |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.5 2007-09-17 19:25:34 ddelon |
* Documentation |
* |
* |
*/ |
/trunk/src/org/tela_botanica/public/Cel.html |
---|
1,15 → 1,14 |
<html> |
<?xml version="1.0" encoding="utf-8"?> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
<head> |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
<meta http-equiv="Content-Style-Type" content="text/css" /> |
<!-- --> |
<!-- Any title is fine --> |
<!-- --> |
<title>Carnet en ligne</title> |
<!-- --> |
<!-- Use normal html, such as style --> |
<!-- --> |
<style> |
<style type="text/css" > |
body,td,a,div,.p{font-family:arial,sans-serif} |
div,td{color:#000000} |
a:link,.w,.w a:link{color:#0000cc} |
19,38 → 18,17 |
<script type="text/javascript"> |
var Parameters = { |
serviceBaseUrl: "http://192.168.0.32/david/jrest" |
serviceBaseUrl: "http://localhost/david/jrest" |
}; |
</script> |
<script type="text/javascript" language='javascript' src='org.tela_botanica.Cel.nocache.js'> |
</script> |
<!-- --> |
<!-- The module reference below is the link --> |
<!-- between html and your Web Toolkit module --> |
<!-- --> |
<meta name='gwt:module' content='org.tela_botanica.Cel'> |
</head> |
<!-- --> |
<!-- The body can have arbitrary html, or --> |
<!-- you can leave the body empty if you want --> |
<!-- to create a completely dynamic ui --> |
<!-- --> |
<body> |
<!-- --> |
<!-- This script is required bootstrap stuff. --> |
<!-- You can put it in the HEAD, but startup --> |
<!-- is slightly faster if you include it here. --> |
<!-- --> |
<script language="javascript" src="gwt.js"></script> |
<!-- OPTIONAL: include this if you want history support --> |
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe> |
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe> |
</body> |
</html> |
/trunk/src/org/tela_botanica/public/tela.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/src/org/tela_botanica/public/tela.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/src/org/tela_botanica/public/Cel.css |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |