Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 1524 → Rev 1525

/branches/v1.0-hydrogene/src/org/tela_botanica/del/client/utils/StringUtils.java
24,5 → 24,10
return mot;
}
 
public static native void logChaine(String s) /*-{
if(!!($wnd.console && $wnd.console.log)) {
$wnd.console.log(s);
}
}-*/;
}
/branches/v1.0-hydrogene/src/org/tela_botanica/del/client/cache/CacheClient.java
73,6 → 73,21
}
 
public void initialiserAvecParametres() {
if(Location.getPath().contains("identiplante")) {
if(Location.getHash().contains(ConstantesNavigation.PAGE_VALIDATION)) {
setPageCourante(ConstantesNavigation.PAGE_VALIDATION+"~"+URLUtils.getURLSpecialParameterValue());
} else {
setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
}
} else if(Location.getPath().contains("pictoflora")) {
if(Location.getHash().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
setPageCourante(ConstantesNavigation.PAGE_VALIDATION+URLUtils.getURLSpecialParameterValue());
} else {
setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_IMAGES);
}
}
String rechercheLibre = Location.getParameter("masque");
String famille = Location.getParameter("masque.famille");
String taxon = Location.getParameter("masque.ns");
135,7 → 150,6
if(pageInt != null) setPageCouranteRechercheObservations(pageInt);
}
String tri = Location.getParameter("tri");
String ordre = Location.getParameter("ordre");
184,6 → 198,8
informationsRechercheImage = rechercheParArguments;
informationsRechercheObservation = rechercheParArguments;
mettreAjourUrlCourante();
}
public void setIdProtocoleEnAttente(String idProtocole) {
338,14 → 354,13
public String genererUrlCourante() {
String url = Window.Location.getHref();
CacheClient cache = CacheClient.getInstance();
String arguments = "";
String argumentsRecherche = "";
if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
InformationsRecherche infoRecherche;
infoRecherche = cache.getInformationsRechercheImage();
infoRecherche = getInformationsRechercheImage();
if (CacheClient.getInstance().getProtocoleCourant() != null) {
infoRecherche.setIdProtocoleSelectionne(""+CacheClient.getInstance().getProtocoleCourant().getId());
}
359,13 → 374,13
argumentsRecherche += "page="+getPageCouranteRechercheImage()+"&pas="+getPasPagination();
argumentsRecherche = (argumentsRecherche.isEmpty()) ? argumentsRecherche : "?" + argumentsRecherche;
arguments = argumentsRecherche + "#" + ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
url = new Config().getUrl("del") + arguments;
 
} else if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || cache.getPageCourante().equals("")) {
arguments = argumentsRecherche;
url = new Config().getUrl("pictoflora") + arguments;
url += "#"+ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
} else if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || getPageCourante().equals("")) {
InformationsRecherche infoRecherche;
infoRecherche = cache.getInformationsRechercheObservation();
infoRecherche = getInformationsRechercheObservation();
argumentsRecherche = "masque.type="+statut;
argumentsRecherche += "&page="+getPageCouranteRechercheObservations()+"&pas="+getPasPagination();
argumentsRecherche += "&"+infoRecherche.versChaineRequete();
374,14 → 389,20
argumentsRecherche += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
}
arguments = "?"+argumentsRecherche + "#" + ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
url = new Config().getUrl("del") + arguments;
} else if (cache.getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION) || cache.getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
arguments = "?"+argumentsRecherche;
url = new Config().getUrl("identiplante") + arguments;
url += "#"+ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
} else if (getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION) || getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION_PICTOFLORA)) {
url = new Config().getUrl("del");
if(getPageCourante().contains(ConstantesNavigation.PAGE_VALIDATION)) {
url = new Config().getUrl("identiplante");
} else {
url = new Config().getUrl("pictoflora");
}
if(!GWT.isScript()) {
url += "?gwt.codesvr="+Location.getParameter("gwt.codesvr");
}
url += "#"+cache.getPageCourante();
url += "#"+getPageCourante();
}
// remplacements batards pour corriger l'url
// TODO: factoriser toute la fonction
403,6 → 424,5
if(!!($wnd.history && $wnd.history.pushState)) {
$wnd.history.pushState(nouvelleUrl, "", nouvelleUrl);
}
}-*/;
}-*/;
}
/branches/v1.0-hydrogene/src/org/tela_botanica/del/client/services/rest/async/PHPCallback.java
1,8 → 1,11
package org.tela_botanica.del.client.services.rest.async;
 
import org.tela_botanica.del.client.utils.StringUtils;
 
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONException;
import com.google.gwt.user.client.Window;
 
/**
51,7 → 54,12
}
 
if (statusCode == codeAttendu) {
surRetour(parserJSON(response.getText()));
try {
T reponseParsee = parserJSON(response.getText());
surRetour(reponseParsee);
} catch (JSONException e) {
StringUtils.logChaine("Une erreur est survenue, le serveur a répondu : "+response.getText());
}
} else {
surErreur("Erreur " + statusCode + ": " + response.getText());
}
/branches/v1.0-hydrogene/src/org/tela_botanica/del/client/Del.java
8,6 → 8,7
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
import com.google.gwt.event.shared.UmbrellaException;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
 
public class Del implements EntryPoint {
28,9 → 29,9
}
});*/
 
CacheClient.getInstance().initialiserAvecParametres();
History.addValueChangeHandler(new GestionnaireHistorique());
CacheClient.getInstance().initialiserAvecParametres();
History.addValueChangeHandler(new GestionnaireHistorique());
History.newItem(CacheClient.getInstance().getPageCourante());
History.fireCurrentHistoryState();
}
/branches/v1.0-hydrogene/src/org/tela_botanica/del/client/config/Config.java
34,6 → 34,8
Dictionary configuration = Dictionary.getDictionary("configuration");
urls.put("base", configuration.get("serviceBaseUrl"));
urls.put("del", configuration.get("delUrl"));
urls.put("identiplante", configuration.get("identiplanteUrl"));
urls.put("pictoflora", configuration.get("pictofloraUrl"));
urls.put("bogue", configuration.get("bogueUrl"));
urls.put("commentaire", configuration.get("commentaireUrl"));
urls.put("applisaisie", configuration.get("appliSaisieUrl"));