Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 1350 → Rev 1467

/trunk/src/org/tela_botanica/del/client/composants/partageurl/PartageUrlPresenteur.java
1,14 → 1,10
package org.tela_botanica.del.client.composants.partageurl;
 
import org.tela_botanica.del.client.cache.CacheClient;
import org.tela_botanica.del.client.config.Config;
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
import org.tela_botanica.del.client.modeles.InformationsRecherche;
 
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.IsWidget;
 
45,7 → 41,7
vue.getBoutonPartage().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String url = genererUrl();
String url = CacheClient.getInstance().genererUrlCourante();
vue.setUrl(url);
vue.afficherFormulaire();
}
52,39 → 48,6
});
}
 
public String genererUrl() {
String url = Window.Location.getHref();
CacheClient cache = CacheClient.getInstance();
String arguments = "";
if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
InformationsRecherche infoRecherche;
infoRecherche = cache.getInformationsRechercheImage();
arguments = infoRecherche.versChaineRequete() + "#" + ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
// Ajout du protocole
String protocole = "~";
if (CacheClient.getInstance().getProtocoleCourant() != null) {
protocole += String.valueOf(CacheClient.getInstance().getProtocoleCourant().getId());
}
url = new Config().getUrl("del") + "?" + arguments;
if (protocole != "~") {
url += protocole;
}
} else if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || cache.getPageCourante().equals("")) {
InformationsRecherche infoRecherche;
infoRecherche = cache.getInformationsRechercheObservation();
arguments = infoRecherche.versChaineRequete() + "#" + ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
url = new Config().getUrl("del") + "?" + arguments;
} else {
url = Window.Location.getHref();
}
// remplacement batard pour corriger l'url
// TODO: factoriser toute la fonction
url = url.replaceAll("\\?&", "?");
return url;
}
public void go(HasWidgets composite) {
vue.ajouterVue(composite);