New file |
0,0 → 1,91 |
package org.tela_botanica.client.modeles; |
|
import java.util.Iterator; |
import java.util.Set; |
|
import com.google.gwt.json.client.JSONObject; |
|
public class Publication extends aDonnee { |
|
/** |
* Constructeur vide |
* |
*/ |
public Publication() { |
|
} |
|
/** |
* Constructeur avec un objet JSON |
* |
* @param image |
*/ |
public Publication(JSONObject institution) { |
// l'objet JSON est une table de hachage |
Set<String> im = institution.keySet(); |
|
// Parcourt pour chaque clé |
for (Iterator<String> it = im.iterator(); it.hasNext();) { |
// Si elle est associée à une valeur, nous l'ajoutons |
String cle = it.next(); |
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet |
String cleObjet = cle.replaceFirst("^cpu_", ""); |
if (institution.get(cle).isString() != null) { |
String valeur = institution.get(cle).isString().stringValue(); |
this.set(cleObjet, valeur); |
} else { |
// Sinon, nous ajoutons la clé avec une valeur vide |
String valeur = " "; |
this.set(cleObjet, valeur); |
} |
} |
} |
|
public String getId() { |
return (String) renvoyerValeurCorrecte("id_publication"); |
} |
|
public String getProjet() { |
return (String) renvoyerValeurCorrecte("projet"); |
} |
|
public String getNomComplet() { |
return (String) renvoyerValeurCorrecte("fmt_nom_complet"); |
} |
|
public String getURI() { |
return (String) renvoyerValeurCorrecte("uri"); |
} |
|
public String getAuteur() { |
return (String) renvoyerValeurCorrecte("fmt_auteur"); |
} |
|
public String getCollection() { |
return (String) renvoyerValeurCorrecte("collection"); |
} |
|
public String getTitre() { |
return (String) renvoyerValeurCorrecte("titre"); |
} |
|
public String getEditeur() { |
return (String) renvoyerValeurCorrecte("ce_truk_editeur"); |
} |
|
public String getDateParution() { |
return (String) renvoyerValeurCorrecte("date_parution"); |
} |
|
public String getIndicationNvt() { |
return (String) renvoyerValeurCorrecte("indication_nvt"); |
} |
|
public String getFascicule() { |
return (String) renvoyerValeurCorrecte("fascicule"); |
} |
|
public String getPages() { |
return (String) renvoyerValeurCorrecte("truk_pages"); |
} |
} |