Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 25 → Rev 26

/trunk/src/org/tela_botanica/client/Mediator.java
12,9 → 12,10
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 {
public class Mediator implements AutoCompleteAsyncTextBoxListener {
private String serviceBaseUrl = getServiceBaseUrlFromDictionnary();
44,7 → 45,6
Mediator() {
}
/**
53,8 → 53,7
*/
public void initUser() {
getUserFromService();
getUserFromService(); // Appel distant recherche de l'utilisateur
}
74,7 → 73,48
}
 
/**
* Action lancee par la completion d'un nom dans l'assistant de saisie
* Recherche d'information compl�mentaires ....
*
* @return void
*/
public void onComplete(ResponseTextHandler sender, String str, String value) {
if (sender instanceof NameAssistant) {
onNameCompleted(value);
}
 
}
 
/**
* 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())
*
* @return void
*/
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
String str, String value) {
if (getEntryPanel().getOrdre()==null) {
onAddInventoryItem();
}
else {
onModifyInventoryItem(getEntryPanel().getOrdre());
getEntryPanel().setOrdre(null);
}
 
}
 
/**
* Action suite ajout, modification, suppression element inventaire
*/
104,6 → 144,19
 
/**
* Action sur deselection d'une observation : affichage du detail
*/
public void onInventoryItemUnselected(String ordre) {
entryPanel.setOrdre(null);
}
 
 
 
/**
* Action sur recherche : affichage de la liste des taxons correspondants
*/
127,20 → 180,19
public void onLocationSelected(String loc) {
inventoryItemList.setLocation(loc);
// inventoryItemList.setDate("all");
// inventoryItemList.setStation("all");
inventoryItemList.updateCount();
// nameAssistant.setValue(null);
inventoryItemList.displayFilter();
 
dateList.setLocation(loc);
// dateList.setDate("all");
dateList.updateCount();
stationList.setLocation(loc);
// stationList.setStation("all");
stationList.updateCount();
}
/**
* Action sur login
190,6 → 242,9
 
inventoryItemList.setStation(station);
inventoryItemList.updateCount();
inventoryItemList.displayFilter();
 
// nameAssistant.setValue(null);
 
 
206,6 → 261,9
 
inventoryItemList.setDate(date);
inventoryItemList.updateCount();
inventoryItemList.displayFilter();
 
// nameAssistant.setValue(null);
 
 
212,17 → 270,20
}
 
/**
* Action suivant la complétion d'un nom
* Action suivant la completion d'un nom
*
*/
 
public void onNameCompleted(String value) {
if (infoPopup==null) {
infoPopup = new InfoPopup(this);
}
infoPopup.setImageUrl(value);
}
/**
* Action prealable à l'ajout d'une observation : controle presence champs requis et lancement mise a jour
* Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour
*
*/
236,7 → 297,7
 
/**
* Action prealable à la modification d'une observation : controle presence champs requis et lancement mise a jour
* Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour
*
*/
 
429,7 → 490,7
 
/**
* Recherche distante et asynchrone de l'utilisateur connecté, en retour lancement methode initialisation
* Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
* de l'appellant Cel. (initAsync)
*
*/
444,8 → 505,8
JSONValue jsonValue = JSONParser.parse(str);
JSONArray jsonArray;
if ((jsonArray = jsonValue.isArray()) != null) {
user = ((JSONString) jsonArray.get(0)).stringValue();
connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();
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();
}
480,7 → 541,7
 
/**
* Accesseur Utilisateur
* @return utilisateur connecté ou identifiant de session
* @return utilisateur connecte ou identifiant de session
*/
public String getUser() {
530,6 → 591,9
}
 
public InfoPopup getInfoPopup() {
if (infoPopup==null) {
infoPopup = new InfoPopup(this);
}
return infoPopup;
}