10,6 → 10,8 |
import org.tela_botanica.client.modeles.Information; |
import org.tela_botanica.client.modeles.ValeurListe; |
import org.tela_botanica.client.modeles.collection.Collection; |
import org.tela_botanica.client.modeles.collection.CollectionACommentaire; |
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe; |
import org.tela_botanica.client.modeles.collection.CollectionAPersonne; |
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe; |
import org.tela_botanica.client.modeles.collection.CollectionAPublication; |
17,6 → 19,7 |
import org.tela_botanica.client.modeles.collection.CollectionBotanique; |
import org.tela_botanica.client.modeles.collection.UniteBase; |
import org.tela_botanica.client.modeles.collection.UniteRangement; |
import org.tela_botanica.client.modeles.commentaire.Commentaire; |
import org.tela_botanica.client.modeles.personne.Personne; |
import org.tela_botanica.client.modeles.projet.ProjetListe; |
import org.tela_botanica.client.modeles.publication.Publication; |
42,6 → 45,7 |
private boolean collectionChargementOk = false; |
private boolean personnesLieesChargementOk = false; |
private boolean publicationsLieesChargementOk = false; |
private boolean commentairesLieesChargementOk = false; |
private Structure structure = null; |
|
private String enteteTpl = null; |
55,6 → 59,9 |
private String descriptionTpl = null; |
private String contenuTpl = null; |
private String inventaireTpl = null; |
private String commentaireTpl = null; |
private String tableauCommentairesLieesTpl = null; |
private String ligneCommentaireLieeTpl = null; |
|
private ContentPanel panneauPrincipal = null; |
private Html entete = null; |
65,6 → 72,7 |
private TabItem descriptionOnglet = null; |
private TabItem contenuOnglet = null; |
private TabItem inventaireOnglet = null; |
private TabItem commentaireOnglet = null; |
private String tableauUniteRangementTpl; |
private String ligneUniteRangementTpl; |
private String tableauUniteBaseTpl; |
119,6 → 127,11 |
inventaireOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(inventaireOnglet); |
|
commentaireOnglet = new TabItem(i18nC.collectionCommentaire()); |
commentaireOnglet.setLayout(new AnchorLayout()); |
commentaireOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(commentaireOnglet); |
|
panneauPrincipal.add(onglets); |
add(panneauPrincipal); |
} |
139,6 → 152,9 |
initialiserTableauUniteBaseTpl(); |
initialiserLigneUniteBaseTpl(); |
initialiserInventaireTpl(); |
initialiserCommentaireTpl(); |
initialiserTableauCommentairesLieesTpl(); |
initialiserLigneCommentaireLieeTpl(); |
} |
|
private void initialiserEnteteHtmlTpl() { |
442,6 → 458,44 |
"</div>"; |
} |
|
private void initialiserCommentaireTpl() { |
commentaireTpl = |
"<div class='{css_corps}'>"+ |
" <h2>{i18n_titre_commentaire}</h2>"+ |
" {tableau_commentaires_liees}"+ |
"</div>"; |
} |
|
private void initialiserTableauCommentairesLieesTpl() { |
tableauCommentairesLieesTpl = |
"<table>"+ |
" <thead>"+ |
" <tr>" + |
" <th>{i18n_type}</th>" + |
" <th>{i18n_titre}</th>" + |
" <th>{i18n_ponderation}</th>" + |
" <th>{i18n_public}</th>" + |
" </tr>"+ |
" </thead>"+ |
" <tbody>"+ |
" {lignes}"+ |
" </tbody>"+ |
"</table>"; |
} |
|
private void initialiserLigneCommentaireLieeTpl() { |
ligneCommentaireLieeTpl = |
"<tr>"+ |
" <td>{type}</td>"+ |
" <td>{titre}</td>"+ |
" <td>{ponderation}</td>"+ |
" <td>{public}</td>"+ |
"</tr>"+ |
"<tr>"+ |
" <td colspan='4'>{texte}</td>"+ |
"</tr>"; |
} |
|
private void chargerOntologie() { |
String[] listesCodes = {"typeCollectionBota", "typeCollectionNcd", "typeDepot", "groupementPrincipe", |
"realisationBut", "onpi", "ea", "typeClassement", "relationPersonneCollection", "ion", |
449,7 → 503,7 |
"methodeFixationSurSpecimen", "typeEcriture", "poisonTraitement", "insecteTraitement", "specimenDegradation", |
"niveauImportance", "supportDegradation", "niveauDetermination", "natureVegetale", "siecleNaturaliste", |
"dateDebut", "dateFin", "etat", "onep", "onp", "inventaireForme", "inventaireLogiciel", "inventaireEtat", |
"etatClassement"}; |
"etatClassement", "typeCommentaireCollection"}; |
lancerChargementListesValeurs(listesCodes); |
} |
|
469,6 → 523,8 |
lierCollectionAPersonne((CollectionAPersonneListe) info.getDonnee(0)); |
} else if (info.getType().equals("liste_collection_a_publication")) { |
lierCollectionAPublication((CollectionAPublicationListe) info.getDonnee(0)); |
} else if (info.getType().equals("liste_collection_a_commentaire")) { |
lierCollectionACommentaire((CollectionACommentaireListe) info.getDonnee(0)); |
} |
} else { |
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass())); |
489,10 → 545,15 |
publicationsLieesChargementOk = true; |
} |
|
protected void lierCollectionACommentaire(CollectionACommentaireListe commentaires) { |
collection.setCommentairesLiees(commentaires); |
commentairesLieesChargementOk = true; |
} |
|
private boolean avoirDonneesChargees() { |
boolean ok = false; |
//Debug.log("projetsChargementOk:"+projetsChargementOk+"-collectionChargementOk:"+collectionChargementOk+"-ontologieChargementOk:"+ontologieChargementOk+"-personnesLieesChargementOk:"+personnesLieesChargementOk+"-publicationsLieesChargementOk:"+publicationsLieesChargementOk); |
if (projetsChargementOk && collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk) { |
if (projetsChargementOk && collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk && commentairesLieesChargementOk) { |
ok = true; |
} |
return ok; |
507,6 → 568,7 |
afficherDescription(); |
afficherContenu(); |
afficherInventaire(); |
afficherCommentaire(); |
} |
layout(); |
} |
992,6 → 1054,56 |
afficherOnglet(inventaireTpl, inventaireParams, inventaireOnglet); |
} |
|
private void afficherCommentaire() { |
String tableauCommentaireHtml = ""; |
if (collection.getCommentairesLiees() != null && collection.getCommentairesLiees().size() > 0) { |
tableauCommentaireHtml = construireTableauCommentairesLiees(); |
} |
|
Params personneParams = new Params(); |
personneParams.set("i18n_titre_commentaire", i18nC.collectionCommentaireTitre()); |
personneParams.set("tableau_commentaires_liees", tableauCommentaireHtml); |
|
afficherOnglet(commentaireTpl, personneParams, commentaireOnglet); |
} |
|
private String construireTableauCommentairesLiees() { |
Params contenuParams = new Params(); |
contenuParams.set("i18n_type", i18nC.commentaireType()); |
contenuParams.set("i18n_titre", i18nC.commentaireTitre()); |
contenuParams.set("i18n_texte", i18nC.commentaireTexte()); |
contenuParams.set("i18n_ponderation", i18nC.commentairePonderation()); |
contenuParams.set("i18n_public", i18nC.commentairePublic()); |
|
String lignesCommentaire = ""; |
if (collection.getCommentairesLiees() != null) { |
Iterator<String> it = collection.getCommentairesLiees().keySet().iterator(); |
while (it.hasNext()) { |
CollectionACommentaire relationCollectionACommentaire = collection.getCommentairesLiees().get(it.next()); |
Commentaire commentaire = relationCollectionACommentaire.getCommentaire(); |
|
String type = construireTxtListeOntologie(relationCollectionACommentaire.getType()); |
String acces = (commentaire.etrePublic() ? i18nC.donneePublic() : i18nC.donneePrivee()); |
|
Params ligneParams = new Params(); |
ligneParams.set("type", type); |
ligneParams.set("titre", commentaire.getTitre()); |
ligneParams.set("texte", commentaire.getTexte()); |
ligneParams.set("ponderation", commentaire.getPonderation()+"/100"); |
ligneParams.set("public", acces); |
|
lignesCommentaire += Format.substitute(ligneCommentaireLieeTpl, ligneParams); |
} |
} |
|
String cHtml = i18nC.nonRenseigne(); |
if (!UtilString.isEmpty(lignesCommentaire)) { |
contenuParams.set("lignes", lignesCommentaire); |
cHtml = Format.substitute(tableauCommentairesLieesTpl, contenuParams); |
} |
return cHtml; |
} |
|
protected String getNomStructure() { |
String nomStructure = ""; |
if (structure != null) { |