Subversion Repositories eFlore/Applications.del

Compare Revisions

Regard whitespace Rev 1548 → Rev 1549

/trunk/src/org/tela_botanica/del/client/cache/CacheClient.java
21,7 → 21,6
 
private List<Protocole> listeProtocoles;
private String home = ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS;
private Observation observationCourante;
private Image imageCourante;
private String taxonPourRechercheEflore;
39,12 → 38,14
private InformationsRecherche informationsRechercheImage;
private InformationsRecherche informationsRechercheObservation;
private Utilisateur utilisateur;
private String pageCourante = home;
private String pageCourante = "";
private String statut;
private String[] statutsPossibles = {ConstantesNavigation.PARAM_TYPE_TOUS,
private String[] statutsPossibles = {
ConstantesNavigation.PARAM_TYPE_TOUS,
ConstantesNavigation.PARAM_TYPE_A_DETERMINER,
ConstantesNavigation.PARAM_TYPE_EN_DISCUSSION,
ConstantesNavigation.PARAM_TYPE_VALIDEES};
ConstantesNavigation.PARAM_TYPE_VALIDEES
};
public void supprimerFiltreStatut() {
this.statut = null;
73,20 → 74,18
}
 
public void initialiserAvecParametres() {
String urlCourante = Window.Location.getHref();
Config config = new Config();
String urlAppliImg = config.getUrl("pictoflora");
if(Location.getPath().contains("identiplante")) {
if(Location.getHash().contains(ConstantesNavigation.PAGE_VALIDATION)) {
setPageCourante(ConstantesNavigation.PAGE_VALIDATION+"~"+URLUtils.getURLSpecialParameterValue());
if (Location.getHash().contains(ConstantesNavigation.PAGE_DETAIL_OBS)) {
setPageCourante(ConstantesNavigation.PAGE_DETAIL_OBS+"~"+URLUtils.getURLSpecialParameterValue());
} else if (Location.getHash().contains(ConstantesNavigation.PAGE_DETAIL_IMG)) {
setPageCourante(ConstantesNavigation.PAGE_DETAIL_IMG+"~"+URLUtils.getURLSpecialParameterValue());
} else {
setPageCourante(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS);
setPageCourante("");
}
} 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);
}
}
GWT.log("initialiserAvecParametres:"+getPageCourante());
String rechercheLibre = Location.getParameter("masque");
String famille = Location.getParameter("masque.famille");
140,15 → 139,21
rechercheParArguments.setIdProtocoleSelectionne(URLUtils.getURLSpecialParameterValue());
}
if(pasInt != null) setPasPagination(pasInt);
if (pasInt != null) {
setPasPagination(pasInt);
}
if(pageCourante.equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
if (urlCourante.contains(urlAppliImg)) {
rechercheParArguments.setMotClefCel(tagCel);
rechercheParArguments.setMotClefDel(tagDel);
if(pageInt != null) setPageCouranteRechercheImages(pageInt);
if (pageInt != null) {
setPageCouranteRechercheImages(pageInt);
}
} else {
if(pageInt != null) setPageCouranteRechercheObservations(pageInt);
if (pageInt != null) {
setPageCouranteRechercheObservations(pageInt);
}
}
String tri = Location.getParameter("tri");
String ordre = Location.getParameter("ordre");
222,12 → 227,11
}
public void setHome(String home) {
this.home = home;
setPageCourante(home);
}
public String getHome() {
return home;
return "";
}
public Observation getObservationCourante() {
353,57 → 357,48
}
public String genererUrlCourante() {
String url = Window.Location.getHref();
String urlCourante = Window.Location.getHref();
Config config = new Config();
String urlAppliObs = config.getUrl("identiplante");
String urlAppliImg = config.getUrl("pictoflora");
String url = urlCourante;
String arguments = "";
String argumentsRecherche = "";
if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_IMAGES)) {
//GWT.log("URL courante:"+urlCourante);
//GWT.log("IdentiPlante:"+urlCourante.contains(urlAppliObs));
//GWT.log("PictoFlora:"+urlCourante.contains(urlAppliImg));
if (urlCourante.contains(urlAppliImg)) {
InformationsRecherche infoRecherche;
infoRecherche = getInformationsRechercheImage();
if (CacheClient.getInstance().getProtocoleCourant() != null) {
infoRecherche.setIdProtocoleSelectionne(""+CacheClient.getInstance().getProtocoleCourant().getId());
}
argumentsRecherche = infoRecherche.versChaineRequete();
if(!GWT.isScript()) {
argumentsRecherche += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
}
arguments = infoRecherche.versChaineRequete();
arguments += (arguments.isEmpty()) ? "" : "&";
arguments += "page="+getPageCouranteRechercheImage()+"&pas="+getPasPagination();
argumentsRecherche += (argumentsRecherche.isEmpty()) ? "" : "&";
argumentsRecherche += "page="+getPageCouranteRechercheImage()+"&pas="+getPasPagination();
argumentsRecherche = (argumentsRecherche.isEmpty()) ? argumentsRecherche : "?" + argumentsRecherche;
arguments = argumentsRecherche;
url = new Config().getUrl("pictoflora") + arguments;
url += "#"+ConstantesNavigation.PAGE_RECHERCHE_IMAGES;
} else if (getPageCourante().equals(ConstantesNavigation.PAGE_RECHERCHE_OBSERVATIONS) || getPageCourante().equals("")) {
url = config.getUrl("pictoflora");
} else if (urlCourante.contains(urlAppliObs)) {
InformationsRecherche infoRecherche;
infoRecherche = getInformationsRechercheObservation();
argumentsRecherche = "masque.type="+statut;
argumentsRecherche += "&page="+getPageCouranteRechercheObservations()+"&pas="+getPasPagination();
argumentsRecherche += "&"+infoRecherche.versChaineRequete();
if(!GWT.isScript()) {
argumentsRecherche += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
arguments = "masque.type="+statut;
arguments += "&page="+getPageCouranteRechercheObservations()+"&pas="+getPasPagination();
arguments += "&"+infoRecherche.versChaineRequete();
url = config.getUrl("identiplante");
}
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");
arguments += "&gwt.codesvr="+Location.getParameter("gwt.codesvr")+"";
}
url += "#"+getPageCourante();
}
arguments = (arguments.isEmpty()) ? "" : "?" + arguments;
String signet = getPageCourante().equals("") ? "" : "#" + getPageCourante();
url += arguments + signet;
// remplacements batards pour corriger l'url
// TODO: factoriser toute la fonction
url = url.replaceAll("&#", "#");
410,10 → 405,11
url = url.replaceAll("&&", "&");
url = url.replaceAll("\\?&", "?");
//GWT.log("URL de sortie:"+url);
return url;
}
public void mettreAjourUrlCourante() {
mettreAJourUrlCouranteSansRecharger(genererUrlCourante());
}