Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 558 → Rev 560

/trunk/src/org/tela_botanica/del/client/composants/metadonnees/metadonnees.css
1,27 → 1,93
.metadonnees {}
.labelNomRetenu {display:none}
.nomRetenu {font-size:15px;}
.zoneFamille {margin-top:1em}
.zoneFamille div {display:inline}
.zoneFamille div:first-child:after {content:" : " }
.metadonnees {
}
 
.zoneLocalite {}
.zoneLocalite div {display:inline}
.zoneLocalite div:first-child:after {content:" : " }
.labelNomRetenu {
display: none
}
 
.zoneLieuDit {}
.zoneLieuDit div:first-child {display:none}
.nomRetenu {
font-size: 15px;
cursor: pointer;
text-decoration: underline;
color: blue;
}
 
.zoneMilieu {}
.zoneMilieu div {display:inline}
.zoneMilieu div:first-child:after {content:" : " }
.zoneFamille {
margin-top: 1em;
cursor: pointer;
color: blue;
}
 
.zoneCommentaire {}
.zoneCommentaire div {display:inline}
.zoneCommentaire div:first-child:after {content:" : " }
.zoneFamille div {
display: inline
}
 
.zoneDateReleve {}
.zoneFamille div:first-child:after {
content: " : "
}
 
.zoneAuteur {}
.zoneAuteur div {display:inline}
.zoneAuteur div:first-child:after {content:" : " }
.zoneLocalite {
cursor: pointer;
color: blue;
}
 
.zoneLocalite div {
display: inline
}
 
.zoneLocalite div:first-child:after {
content: " : "
}
 
.zoneLieuDit {
}
 
.zoneLieuDit div:first-child {
display: none
}
 
.zoneMilieu {
cursor: pointer;
color: blue;
}
 
.zoneMilieu div {
display: inline
}
 
.zoneMilieu div:first-child:after {
content: " : "
}
 
.zoneCommentaire {
cursor: pointer;
color: blue;
}
 
.zoneCommentaire div {
display: inline
}
 
.zoneCommentaire div:first-child:after {
content: " : "
}
 
.zoneDateReleve {
cursor: pointer;
color: blue;
}
 
.zoneAuteur {
cursor: pointer;
color: blue;
}
 
.zoneAuteur div {
display: inline
}
 
.zoneAuteur div:first-child:after {
content: " : "
}
/trunk/src/org/tela_botanica/del/client/composants/metadonnees/MetadonneesVue.ui.xml
2,77 → 2,79
xmlns:g='urn:import:com.google.gwt.user.client.ui' ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
ui:generateLocales="default">
<ui:with field='res' type='org.tela_botanica.del.client.resources.Ressources' />
<ui:with field='res'
type='org.tela_botanica.del.client.resources.Ressources' />
<ui:with field="constants" type="org.tela_botanica.del.client.i18n.Vocabulary" />
 
<ui:style src="metadonnees.css" />
<g:HTMLPanel styleName="{style.metadonnees}">
<!-- Nom retenu -->
<g:HTMLPanel ui:field="zoneNomRetenu">
<g:Label styleName="petit gris {style.labelNomRetenu}" text="{constants.nomRetenu}"/>
<g:Label styleName="petit gris {style.labelNomRetenu}" text="{constants.nomRetenu}" />
<g:Hyperlink ui:field="nomRetenu" styleName="{style.nomRetenu}" />
</g:HTMLPanel>
 
<!-- Nom commun -->
<g:HTMLPanel ui:field="zoneNomCommun">
<g:Label styleName="petit gris" text="{constants.nomCommun}"/>
<g:Label styleName="petit gris" text="{constants.nomCommun}" />
<g:Hyperlink ui:field="nomCommun" />
</g:HTMLPanel>
 
<!-- Famille -->
<g:HTMLPanel ui:field="zoneFamille" styleName="{style.zoneFamille}">
<g:Label styleName="petit gris" text="{constants.famille}"/>
<g:Label styleName="petit gris" text="{constants.famille}" />
<g:Hyperlink ui:field="famille" />
</g:HTMLPanel>
 
<!-- Lieu -->
<g:HTMLPanel ui:field="zoneLocalite" styleName="{style.zoneLocalite}">
<g:Label styleName="petit gris" text="{constants.localite}"/>
<g:Label styleName="petit gris" text="{constants.localite}" />
<g:Hyperlink ui:field="localite" />
</g:HTMLPanel>
 
<!-- Lieu-dit -->
<g:HTMLPanel ui:field="zoneLieuDit" styleName="{style.zoneLieuDit}">
<g:Label styleName="petit gris" text="{constants.lieuDit}"/>
<g:Label styleName="petit gris" text="{constants.lieuDit}" />
<g:Hyperlink ui:field="lieuDit" />
</g:HTMLPanel>
 
<!-- Milieu -->
<g:HTMLPanel ui:field="zoneMilieu" styleName="{style.zoneMilieu}">
<g:Label styleName="petit gris" text="{constants.milieu}"/>
<g:Label styleName="petit gris" text="{constants.milieu}" />
<g:Hyperlink ui:field="milieu" />
</g:HTMLPanel>
 
<!-- Commentaire -->
<g:HTMLPanel ui:field="zoneCommentaire" styleName="{style.zoneCommentaire}">
<g:Label styleName="petit gris" text="{constants.commentaire}"/>
<g:Label styleName="petit gris" text="{constants.commentaire}" />
<g:Hyperlink ui:field="commentaire" />
</g:HTMLPanel>
 
<!-- Date du relevé -->
<g:HTMLPanel ui:field="zoneDateReleve" styleName="{style.zoneDateReleve}">
<g:InlineLabel styleName="petit gris" text="{constants.dateReleve}"/>
<g:InlineLabel styleName="petit gris" text="{constants.dateReleve}" />
<g:InlineLabel ui:field="dateReleve" />
</g:HTMLPanel>
 
<!-- Publié par -->
<g:HTMLPanel ui:field="zoneAuteur" styleName="{style.zoneAuteur}">
<g:Label styleName="petit gris" text="{constants.auteur}"/>
<g:Label styleName="petit gris" text="{constants.auteur}" />
<g:Hyperlink ui:field="auteur" />
</g:HTMLPanel>
 
<!-- Date de transmission -->
<g:HTMLPanel ui:field="zoneDate">
<g:InlineLabel styleName="petit gris" text="{constants.dateTransmission}"/>
<g:InlineLabel styleName="petit gris" text="{constants.dateTransmission}" />
<g:InlineLabel ui:field="dateTransmission" />
</g:HTMLPanel>
 
<!-- Mots-clés/Tag -->
<g:HTMLPanel ui:field="zoneMotsClefs">
<g:Label styleName="petit gris" text="{constants.motsClefs}"/>
<g:Label styleName="petit gris" text="{constants.motsClefs}" />
<g:Hyperlink ui:field="motsClefs" />
</g:HTMLPanel>
 
<g:Hyperlink ui:field="numNomenclatural" />
</g:HTMLPanel>
</ui:UiBinder>
/trunk/src/org/tela_botanica/del/client/composants/metadonnees/MetadonneesPresenteur.java
145,16 → 145,6
}
});
 
vue.getLienLieuDit().addClickHandler(new ClickHandler() {
 
@Override
public void onClick(ClickEvent arg0) {
InformationsRecherche informationsRecherche = new InformationsRecherche();
informationsRecherche.setCommune(vue.getLieuDit().getText());
setInfosRechercheEnCacheEtLancerEvenement(informationsRecherche);
}
});
 
vue.getLienLocalite().addClickHandler(new ClickHandler() {
 
@Override
218,13 → 208,16
}
 
public void setInfosRechercheEnCacheEtLancerEvenement(InformationsRecherche informationsRecherche) {
 
switch (modeRecherche) {
case MODE_IMAGE:
CacheClient.getInstance().setPageCouranteRechercheImages(1);
CacheClient.getInstance().setInformationsRechercheImage(informationsRecherche);
BusEvenementiel.getInstance().fireEvent(new EvenementRechercheImage());
break;
 
case MODE_OBSERVATION:
CacheClient.getInstance().setPageCouranteRechercheObservations(1);
CacheClient.getInstance().setInformationsRechercheObservation(informationsRecherche);
BusEvenementiel.getInstance().fireEvent(new EvenementRechercheObservation());
 
/trunk/src/org/tela_botanica/del/client/composants/metadonnees/MetadonneesVue.java
8,7 → 8,6
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
 
public class MetadonneesVue extends Composite implements MetadonneesPresenteur.Vue {
/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRecherchePresenteur.java
24,31 → 24,57
 
public abstract interface Vue extends IsWidget {
public void ajouterVue(HasWidgets composite);
 
public HasClickHandlers getLienRechercheAvancee();
 
public void basculerAffichageZoneCache();
 
public HasClickHandlers getBoutonRechercheSimple();
 
public HasClickHandlers getBoutonFermer();
 
public HasClickHandlers getBoutonVider();
 
public HasClickHandlers getBoutonRechercheAvancee();
 
public HasKeyPressHandlers getChampSaisie();
 
public HasClickHandlers getChampSaisieCliquable();
 
public String getValeurRechercheSimple();
 
public String getLabelRecherche();
 
public String getContientMots();
 
public String getDepartement();
 
public HasWidgets getCommune();
 
public HasWidgets getTaxon();
 
public String getFamille();
 
public String getGenre();
 
public String getTag();
 
public String getMotCle();
 
public String getAuteur();
 
public String getDate();
 
public void setValeurRechercheSimple(String valeurRecherche);
 
public void setContientMots(String mots);
 
public void setValeurDepartement(String dpt);
 
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
 
public void focusSaisie();
 
public void nettoyer();
}
 
55,45 → 81,49
private Vue vue;
private Config config;
private ModeRecherche modeRecherche;
public enum TypeMoteur {SIMPLE, AVANCEE};
 
public enum TypeMoteur {
SIMPLE, AVANCEE
};
 
private TypeMoteur typeMoteur = TypeMoteur.SIMPLE;
 
private AutoCompletionComboBoxPresenteur completionTaxonsPresenteur = null;
private AutoCompletionComboBoxPresenteur completionCommunesPresenteur = null;
 
public MoteurRecherchePresenteur(Vue vue, ModeRecherche mode) {
initialiser(vue, mode);
}
public MoteurRecherchePresenteur(AutoCompletionComboBoxPresenteur presenteurAutoCompletionTaxon,
AutoCompletionComboBoxPresenteur presenteurAutoCompletionCommunes,
Vue vue, ModeRecherche mode) {
 
public MoteurRecherchePresenteur(AutoCompletionComboBoxPresenteur presenteurAutoCompletionTaxon, AutoCompletionComboBoxPresenteur presenteurAutoCompletionCommunes, Vue vue, ModeRecherche mode) {
completionTaxonsPresenteur = presenteurAutoCompletionTaxon;
completionCommunesPresenteur = presenteurAutoCompletionCommunes;
initialiser(vue, mode);
}
 
private void initialiser(Vue vue, ModeRecherche mode) {
this.vue = vue;
setMode(mode);
this.config = new Config();
if (completionTaxonsPresenteur == null) this.creerCompletionTaxons();
if (completionCommunesPresenteur == null) this.creerCompletionCommunes();
if (completionTaxonsPresenteur == null)
this.creerCompletionTaxons();
if (completionCommunesPresenteur == null)
this.creerCompletionCommunes();
gererEvenements();
}
 
private Vue getVue() {
return vue;
}
 
public ModeRecherche getMode() {
return modeRecherche;
}
 
private void setMode(ModeRecherche mode) {
modeRecherche = mode;
}
 
public void setTypeMoteur(TypeMoteur typeMoteur) {
this.typeMoteur = typeMoteur;
}
104,7 → 134,7
 
public boolean estPourRechercheObservations() {
return (modeRecherche == ModeRecherche.MODE_OBSERVATION);
}
}
 
private void creerCompletionTaxons() {
String url = this.config.getUrl("nomSciCompletionService");
124,7 → 154,7
}
};
}
 
private void creerCompletionCommunes() {
String url = this.config.getUrl("communeCompletionService");
completionCommunesPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), url) {
131,9 → 161,10
protected String effectuerPreTraitementChaineRequete(String requete) {
return requete;
}
 
@Override
protected void surSelectionSuggestion(String suggestion) {
setValeur(suggestion);
collecterInfosRecherche();
setValeur(getInformationsRechercheEnCache().getCommune());
vue.setValeurDepartement(getInformationsRechercheEnCache().getDepartement());
145,7 → 176,7
}
};
}
 
@Override
public void go(HasWidgets composite) {
afficherRequeteEtLancerRecherche();
159,6 → 190,7
protected void gererEvenements() {
vue.getLienRechercheAvancee().addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
setTypeMoteur(TypeMoteur.AVANCEE);
vue.setContientMots(vue.getValeurRechercheSimple());
vue.basculerAffichageZoneCache();
}
218,7 → 250,7
}
});
}
 
private void nettoyerChamps() {
completionCommunesPresenteur.nettoyer();
completionTaxonsPresenteur.nettoyer();
240,6 → 272,7
informationRecherche.setDate(vue.getDate());
}
 
 
if (estPourRechercheImages()) {
CacheClient.getInstance().setPageCouranteRechercheImages(1);
CacheClient.getInstance().setInformationsRechercheImage(informationRecherche);
248,19 → 281,20
CacheClient.getInstance().setInformationsRechercheObservation(informationRecherche);
}
}
 
private String getRechercheLibre() {
String rechercheLibre = "";
switch (this.typeMoteur) {
case SIMPLE :
rechercheLibre = vue.getValeurRechercheSimple();
break;
case AVANCEE :
rechercheLibre = vue.getContientMots();
break;
default:
// TODO : voir comment gérer les exceptions proprement
//throw new Exception("Le type de moteur de recherche indiqué n'est pas disponilbe");
case SIMPLE:
rechercheLibre = vue.getValeurRechercheSimple();
break;
case AVANCEE:
rechercheLibre = vue.getContientMots();
break;
default:
// TODO : voir comment gérer les exceptions proprement
// throw new
// Exception("Le type de moteur de recherche indiqué n'est pas disponilbe");
}
return rechercheLibre;
}