50,6 → 50,8 |
private String traitementConservationTpl = null; |
private String valorisationTpl = null; |
private String sautLigneTpl = null; |
private String typeTraitementConservationTpl = null; |
private String rechercheValorisationTpl = null; |
|
private Structure structure = null; |
private StructureAPersonneListe personnel = null; |
63,7 → 65,6 |
private TabItem personnelOnglet = null; |
private TabItem conservationOnglet = null; |
private TabItem valorisationOnglet = null; |
private String typeTraitementConservationTpl; |
|
public StructureDetailPanneauVue(Mediateur mediateurCourant) { |
mediateur = mediateurCourant; |
90,22 → 91,22 |
onglets.setHeight("100%"); |
onglets.setBodyBorder(false); |
|
identificationOnglet = new TabItem("Général"); |
identificationOnglet = new TabItem(i18nC.structureInfoGeneral()); |
identificationOnglet.setLayout(new AnchorLayout()); |
identificationOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(identificationOnglet); |
|
personnelOnglet = new TabItem("Personnel"); |
personnelOnglet = new TabItem(i18nC.structureInfoPersonnel()); |
personnelOnglet.setLayout(new AnchorLayout()); |
personnelOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(personnelOnglet); |
|
conservationOnglet = new TabItem("Conservation"); |
conservationOnglet = new TabItem(i18nC.structureInfoConservation()); |
conservationOnglet.setLayout(new AnchorLayout()); |
conservationOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(conservationOnglet); |
|
valorisationOnglet = new TabItem("Valorisation"); |
valorisationOnglet = new TabItem(i18nC.structureInfoValorisation()); |
valorisationOnglet.setLayout(new AnchorLayout()); |
valorisationOnglet.setScrollMode(Scroll.AUTO); |
onglets.add(valorisationOnglet); |
150,7 → 151,7 |
afficherConservation(); |
} |
if (valorisation != null) { |
//afficherValorisation(); |
afficherValorisation(); |
} |
} |
layout(); |
173,11 → 174,6 |
|
private void afficherIdentification() { |
Params identificationParams = new Params(); |
identificationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU); |
identificationParams.set("css_label", ComposantClass.LABEL); |
identificationParams.set("css_fieldset", ComposantClass.FIELDSET); |
identificationParams.set("css_clear", ComposantClass.CLEAR); |
|
identificationParams.set("i18n_titre_administratif", i18nC.titreAdministratif()); |
identificationParams.set("i18n_acronyme", i18nC.acronyme()); |
identificationParams.set("i18n_statut", i18nC.statut()); |
236,7 → 232,6 |
} |
|
Params personnelParams = new Params(); |
personnelParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU); |
personnelParams.set("i18n_titre_personnel", i18nC.titrePersonnel()); |
personnelParams.set("i18n_nbre_personnel_collection", i18nC.nbrePersonnelCollection()); |
personnelParams.set("nbre_personnel_collection", personnel.size()); |
289,11 → 284,6 |
|
private void afficherConservation() { |
Params conservationParams = new Params(); |
conservationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU); |
conservationParams.set("css_label", ComposantClass.LABEL); |
conservationParams.set("css_fieldset", ComposantClass.FIELDSET); |
conservationParams.set("css_clear", ComposantClass.CLEAR); |
|
conservationParams.set("i18n_titre_conservation_personnel", i18nC.titreConservationPersonnel()); |
conservationParams.set("i18n_formation", i18nC.formation()); |
conservationParams.set("i18n_formation_interet", i18nC.formationInteret()); |
368,7 → 358,6 |
|
if (echantillon.equals("1")) { |
Params traitementConservationParams = new Params(); |
traitementConservationParams.set("css_label", ComposantClass.LABEL); |
traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement()); |
|
traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement())); |
387,8 → 376,6 |
|
if (traitement.equals("1")) { |
Params typeTraitementParams = new Params(); |
typeTraitementParams.set("css_indentation", ComposantClass.INDENTATION); |
typeTraitementParams.set("css_label", ComposantClass.LABEL); |
typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte()); |
typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison()); |
|
403,78 → 390,76 |
return cHtml; |
} |
|
private void afficherOnglet(String template, Params parametres, TabItem onglet) { |
String cHtml = Format.substitute(template, parametres); |
HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml); |
onglet.removeAll(); |
onglet.add(corpsConteneurDuHtml); |
private void afficherValorisation() { |
Params valorisationParams = new Params(); |
valorisationParams.set("i18n_titre_action_valorisation", i18nC.titreActionValorisation()); |
valorisationParams.set("i18n_action", i18nC.action()); |
valorisationParams.set("i18n_action_publication", i18nC.actionPublication()); |
valorisationParams.set("i18n_collection_autre", i18nC.collectionAutre()); |
valorisationParams.set("i18n_action_future", i18nC.actionFuture()); |
|
valorisationParams.set("action", formaterOuiNon(valorisation.getAction())); |
String actionInfo = construireTxtListeOntologie(valorisation.getActionInfo()); |
valorisationParams.set("action_info", formaterParenthese(actionInfo)); |
valorisationParams.set("action_publication", valorisation.getPublication()); |
String collectionAutre = construireTxtListeOntologie(valorisation.getCollectionAutre()); |
valorisationParams.set("collection_autre", collectionAutre); |
valorisationParams.set("action_future", formaterOuiNon(valorisation.getActionFuture())); |
valorisationParams.set("action_future_info", formaterParenthese(valorisation.getActionFutureInfo())); |
|
valorisationParams.set("i18n_titre_recherche_scientifique", i18nC.titreRechercherScientifique()); |
valorisationParams.set("i18n_recherche", i18nC.recherche()); |
|
valorisationParams.set("recherche", formaterOuiNon(valorisation.getRecherche())); |
valorisationParams.set("recherche_info", construireRecherche()); |
|
valorisationParams.set("i18n_titre_acces_usage", i18nC.titreAccesUsage()); |
valorisationParams.set("i18n_acces", i18nC.acces()); |
valorisationParams.set("i18n_visite", i18nC.visite()); |
|
valorisationParams.set("acces", formaterOuiNon(valorisation.getAccesSansMotif())); |
valorisationParams.set("acces_info", formaterParenthese(valorisation.getAccesSansMotifInfo())); |
valorisationParams.set("visite", formaterOuiNon(valorisation.getVisiteAvecMotif())); |
valorisationParams.set("visite_info", formaterParenthese(valorisation.getVisiteAvecMotifInfo())); |
|
afficherOnglet(valorisationTpl, valorisationParams, valorisationOnglet); |
} |
|
private String formaterParenthese(String chaineAAfficher) { |
if (!chaineAAfficher.equals("")) { |
chaineAAfficher = "("+chaineAAfficher+")"; |
private String construireRecherche() { |
String cHtml = ""; |
String recherche = valorisation.getRecherche(); |
|
if (recherche.equals("1")) { |
Params rechercheParams = new Params(); |
rechercheParams.set("i18n_recherche_provenance", i18nC.rechercheProvenance()); |
rechercheParams.set("i18n_recherche_type", i18nC.rechercheType()); |
|
String rechercheProvenance = construireTxtListeOntologie(valorisation.getRechercheProvenance()); |
rechercheParams.set("recherche_provenance", rechercheProvenance); |
String rechercheType = construireTxtListeOntologie(valorisation.getRechercheType()); |
rechercheParams.set("recherche_type", rechercheType); |
|
cHtml = Format.substitute(rechercheValorisationTpl, rechercheParams); |
} |
return chaineAAfficher; |
|
return cHtml; |
} |
|
private String formaterAutre(String chaineAAfficher) { |
if (!chaineAAfficher.equals("")) { |
chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]"; |
} |
return chaineAAfficher; |
} |
|
private String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) { |
String chaineAAfficher = ""; |
int tailleDuTableau = tableauDeTxt.size(); |
if (tailleDuTableau > 0) { |
int indexAvtDernier = tailleDuTableau - 1; |
for (int i = 0; i < tailleDuTableau; i++) { |
String mot = tableauDeTxt.get(i); |
if (i != indexAvtDernier) { |
chaineAAfficher += mot+", "; |
} else { |
chaineAAfficher += nettoyerPointFinal(mot)+"."; |
} |
} |
} |
return chaineAAfficher; |
} |
|
private String formaterOuiNon(String chaineAFormater) { |
String txtARetourner = ""; |
if (chaineAFormater.equals("0")) { |
txtARetourner = i18nC.non(); |
} else if (chaineAFormater.equals("1")) { |
txtARetourner = i18nC.oui(); |
} |
return txtARetourner; |
} |
|
private String formaterSautDeLigne(String chaineAFormater) { |
String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl); |
return txtARetourner; |
} |
|
private String formaterValeurTruck(String valeur) { |
String chaineARetourner = ""; |
private void afficherOnglet(String template, Params parametres, TabItem onglet) { |
String cHtml = Format.substitute(template, parametres); |
|
if (valeur.matches("^[^#]+##[^$]+$")) { |
String[] cleValeur = valeur.split("##"); |
chaineARetourner = cleValeur[1]+" "+formaterParenthese(cleValeur[0]); |
} else if (!valeur.equals("")) { |
chaineARetourner = valeur; |
} else { |
GWT.log("Valeur truck posant problèlme :"+valeur, null); |
} |
Params cssParams = new Params(); |
cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU); |
cssParams.set("css_label", ComposantClass.LABEL); |
cssParams.set("css_indentation", ComposantClass.INDENTATION); |
cssParams.set("css_fieldset", ComposantClass.FIELDSET); |
cssParams.set("css_clear", ComposantClass.CLEAR); |
cHtml = Format.substitute(cHtml, cssParams); |
|
return chaineARetourner; |
} |
|
private String nettoyerPointFinal(String mot) { |
mot = mot.replaceAll("[.]$", ""); |
return mot; |
} |
HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml); |
onglet.removeAll(); |
onglet.add(corpsConteneurDuHtml); |
} |
|
private void initialiserTousLesTpl() { |
initialiserEnteteHtmlTpl(); |
486,6 → 471,7 |
initialiserTraitementConservationTpl(); |
initialiserTypeTraitementConservationTpl(); |
initialiserValorisationTpl(); |
initialiserRechercheValorisationTpl(); |
initialiserSautLigneTpl(); |
} |
|
616,8 → 602,10 |
|
private void initialiserTraitementConservationTpl() { |
traitementConservationTpl = |
"<span class='{css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+ |
" {acquisition_traitement_type_info}"; |
"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+ |
" <div class='{css_indentation}'>"+ |
" {acquisition_traitement_type_info}"+ |
" </div>"; |
} |
|
private void initialiserTypeTraitementConservationTpl() { |
631,17 → 619,31 |
"<div class='{css_corps}'>"+ |
" <div class='{css_fieldset}'>"+ |
" <h2>{i18n_titre_action_valorisation}</h2>"+ |
" <span class='{css_label}'>{i18n_action} :</span> {action} {action_info}<br />"+ |
" <span class='{css_label}'>{i18n_action_publication} :</span> {action_publication}<br />"+ |
" <span class='{css_label}'>{i18n_collection_autre} :</span> {collection_autre}<br />"+ |
" <span class='{css_label}'>{i18n_action_future} :</span> {action_future} {action_future_info}<br />"+ |
" </div>"+ |
" <div class='{css_fieldset}'>"+ |
" <h2>{i18n_titre_recherche_scientifique}</h2>"+ |
" <span class='{css_label}'>{i18n_recherche} :</span> {recherche}<br />"+ |
" {recherche_info}"+ |
" </div>"+ |
" <hr class='{css_clear}'/>"+ |
" <div class='{css_fieldset}'>"+ |
" <h2>{i18n_titre_acces_usage}</h2>"+ |
" <span class='{css_label}'>{i18n_visite} :</span> {visite} {visite_info}<br />"+ |
" <span class='{css_label}'>{i18n_acces} :</span> {acces} {acces_info}<br />"+ |
" </div>"+ |
"</div>"; |
} |
|
private void initialiserRechercheValorisationTpl() { |
rechercheValorisationTpl = |
"<span class='{css_indentation} {css_label}'>{i18n_recherche_provenance} :</span> {recherche_provenance}<br />"+ |
"<span class='{css_indentation} {css_label}'>{i18n_recherche_type} :</span> {recherche_type}<br />"; |
} |
|
private void initialiserSautLigneTpl() { |
sautLigneTpl = "<br />\n"; |
} |
677,6 → 679,10 |
} |
} |
|
protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) { |
structure.setPersonnel(personnel); |
} |
|
protected String construireTxtprojet(String idProjet) { |
String chaineARetourner = idProjet; |
|
744,8 → 750,70 |
return chaineARetourner; |
} |
|
protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) { |
structure.setPersonnel(personnel); |
private String formaterParenthese(String chaineAAfficher) { |
if (!chaineAAfficher.equals("")) { |
chaineAAfficher = "("+chaineAAfficher+")"; |
} |
return chaineAAfficher; |
} |
|
private String formaterAutre(String chaineAAfficher) { |
if (!chaineAAfficher.equals("")) { |
chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]"; |
} |
return chaineAAfficher; |
} |
|
private String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) { |
String chaineAAfficher = ""; |
int tailleDuTableau = tableauDeTxt.size(); |
if (tailleDuTableau > 0) { |
int indexAvtDernier = tailleDuTableau - 1; |
for (int i = 0; i < tailleDuTableau; i++) { |
String mot = tableauDeTxt.get(i); |
if (i != indexAvtDernier) { |
chaineAAfficher += mot+", "; |
} else { |
chaineAAfficher += nettoyerPointFinal(mot)+"."; |
} |
} |
} |
return chaineAAfficher; |
} |
|
private String formaterOuiNon(String chaineAFormater) { |
String txtARetourner = ""; |
if (chaineAFormater.equals("0")) { |
txtARetourner = i18nC.non(); |
} else if (chaineAFormater.equals("1")) { |
txtARetourner = i18nC.oui(); |
} |
return txtARetourner; |
} |
|
private String formaterSautDeLigne(String chaineAFormater) { |
String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl); |
return txtARetourner; |
} |
|
} |
private String formaterValeurTruck(String valeur) { |
String chaineARetourner = ""; |
|
if (valeur.matches("^[^#]+##[^$]+$")) { |
String[] cleValeur = valeur.split("##"); |
chaineARetourner = cleValeur[1]+" "+formaterParenthese(cleValeur[0]); |
} else if (!valeur.equals("")) { |
chaineARetourner = valeur; |
} else { |
GWT.log("Valeur truck posant problèlme :"+valeur, null); |
} |
|
return chaineARetourner; |
} |
|
private String nettoyerPointFinal(String mot) { |
mot = mot.replaceAll("[.]$", ""); |
return mot; |
} |
|
} |