7,6 → 7,7 |
|
import org.tela_botanica.client.Mediateur; |
import org.tela_botanica.client.modeles.aDonnee; |
import org.tela_botanica.client.modeles.collection.CollectionAPublication; |
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe; |
import org.tela_botanica.client.util.Debug; |
import org.tela_botanica.client.util.UtilString; |
21,6 → 22,7 |
private static final long serialVersionUID = -6974716696155349332L; |
|
public static final String PREFIXE = "cp"; |
private boolean removePrefix = true; |
public static final String TELEPHONE_FIXE = "FIX"; |
public static final String TELEPHONE_GSM = "GSM"; |
public static final String TELEPHONE_FAX = "FAX"; |
33,8 → 35,18 |
public Personne() { |
} |
|
public Personne(ModelData model) |
{ |
public Personne(ModelData model) { |
creerPersonne(model, false); |
} |
|
public Personne(ModelData model, boolean removePrefix) { |
creerPersonne(model, removePrefix); |
} |
|
private void creerPersonne(ModelData model, boolean removePrefix) { |
|
this.removePrefix = removePrefix; |
|
Map<String, Object> a = model.getProperties(); |
|
Set<String> cles = a.keySet(); |
42,11 → 54,17 |
while (it.hasNext()) { |
String cle = it.next(); |
if (a.get(cle) != null) { |
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", ""); |
String cleObjet = ""; |
if (removePrefix) { |
cleObjet = cleObjet.replaceFirst("^"+PREFIXE+"_", ""); |
} |
else { |
cleObjet = cle; |
} |
this.set(cleObjet, a.get(cle)); |
} |
} |
} |
} |
|
public Personne(JSONObject personne) { |
initialiserModele(personne); |