Subversion Repositories eFlore/Applications.del

Rev

Rev 1350 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1350 Rev 1467
Line 1... Line 1...
1
package org.tela_botanica.del.client.composants.partageurl;
1
package org.tela_botanica.del.client.composants.partageurl;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.del.client.cache.CacheClient;
-
 
4
import org.tela_botanica.del.client.config.Config;
-
 
5
import org.tela_botanica.del.client.gestionhistorique.ConstantesNavigation;
-
 
Line 6... Line 3...
6
import org.tela_botanica.del.client.modeles.InformationsRecherche;
3
import org.tela_botanica.del.client.cache.CacheClient;
7
 
4
 
8
import com.google.gwt.event.dom.client.ClickEvent;
5
import com.google.gwt.event.dom.client.ClickEvent;
9
import com.google.gwt.event.dom.client.ClickHandler;
-
 
10
import com.google.gwt.event.dom.client.HasClickHandlers;
6
import com.google.gwt.event.dom.client.ClickHandler;
11
import com.google.gwt.user.client.Window;
7
import com.google.gwt.event.dom.client.HasClickHandlers;
Line 12... Line 8...
12
import com.google.gwt.user.client.ui.HasWidgets;
8
import com.google.gwt.user.client.ui.HasWidgets;
Line 43... Line 39...
43
		});
39
		});
Line 44... Line 40...
44
		
40
		
45
		vue.getBoutonPartage().addClickHandler(new ClickHandler() {
41
		vue.getBoutonPartage().addClickHandler(new ClickHandler() {
46
			@Override
42
			@Override
47
			public void onClick(ClickEvent event) {
43
			public void onClick(ClickEvent event) {
48
				String url = genererUrl();
44
				String url = CacheClient.getInstance().genererUrlCourante();
49
				vue.setUrl(url);
45
				vue.setUrl(url);
50
				vue.afficherFormulaire();
46
				vue.afficherFormulaire();
51
			}
47
			}
Line 52... Line 48...
52
		});
48
		});
53
		
-
 
54
	}
-
 
55
 
-
 
56
	public String genererUrl() {
-
 
57
		String url = Window.Location.getHref();
-
 
58
		CacheClient cache = CacheClient.getInstance();
-
 
59
		
-
 
60
		String arguments = "";
-
 
61
		if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
-
 
62
			InformationsRecherche infoRecherche;
-
 
63
			infoRecherche = cache.getInformationsRechercheImage();
-
 
64
			arguments = infoRecherche.versChaineRequete() + "#" + ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
-
 
65
			// Ajout du protocole
-
 
66
			String protocole = "~";
-
 
67
			if (CacheClient.getInstance().getProtocoleCourant() != null) {
-
 
68
				protocole += String.valueOf(CacheClient.getInstance().getProtocoleCourant().getId());
-
 
69
			}
-
 
70
			url = new Config().getUrl("del") + "?" + arguments;
-
 
71
			if (protocole != "~") {
-
 
72
				url += protocole;
-
 
73
			}
-
 
74
		} else if (cache.getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || cache.getPageCourante().equals("")) {
-
 
75
			InformationsRecherche infoRecherche;
-
 
76
			infoRecherche = cache.getInformationsRechercheObservation();
-
 
77
			arguments = infoRecherche.versChaineRequete() + "#" + ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
-
 
78
			url = new Config().getUrl("del") + "?" + arguments;
-
 
79
		} else {
-
 
80
			url = Window.Location.getHref();
-
 
81
		}
-
 
82
		// remplacement batard pour corriger l'url
-
 
83
		// TODO: factoriser toute la fonction 
-
 
84
		url = url.replaceAll("\\?&", "?");
-
 
85
		
-
 
Line 86... Line 49...
86
		return url;
49
		
87
	}
50
	}
Line 88... Line 51...
88
	
51