New file |
0,0 → 1,224 |
package org.tela_botanica.client.modeles.objets; |
|
import com.google.gwt.core.client.GWT; |
import com.google.gwt.i18n.client.Dictionary; |
|
/** |
* Classe chargeant certains paramètres de configuration à partir d'un fichier |
* javascript (config.js) |
* |
* @author aurelien |
* |
*/ |
public class Configuration { |
|
/** |
* L'url de base du serveur jrest |
*/ |
private static String serviceBaseUrl; |
|
private static String imageBaseUrl; |
|
private static String suiviBugUrl ; |
|
private static String aideBaseUrl ; |
|
private static String emailContact; |
|
private static String referentielGeo ; |
|
private static String cleGoogleMaps ; |
|
private static String lienEfloreBaseUrl; |
|
private static String refTax; |
|
private static String refTaxVersion; |
|
private static String licence =""; |
|
private static String formatOriginal = ""; |
|
private static String formatZoom = ""; |
|
private static String formatGalerie = ""; |
|
private static String formatListe = ""; |
|
private static String utiliseRedirectionImage; |
|
private static String imageRedirectUrl; |
|
/** |
* Constructeur sans argument |
*/ |
public Configuration() { |
// on utilise le dictionnaire d'internationalisation pour lire les |
// variables du fichier javascript |
|
//if(GWT.isScript()) { |
serviceBaseUrl = Dictionary.getDictionary("configuration").get( |
"serviceBaseUrl"); |
|
emailContact = Dictionary.getDictionary("configuration").get( |
"emailContact"); |
|
suiviBugUrl = Dictionary.getDictionary("configuration").get( |
"suiviBugUrl"); |
|
imageBaseUrl = Dictionary.getDictionary("configuration").get( |
"imageBaseUrl"); |
|
aideBaseUrl = Dictionary.getDictionary("configuration").get( |
"aideBaseUrl"); |
|
referentielGeo = Dictionary.getDictionary("configuration").get( |
"referentielGeo"); |
|
cleGoogleMaps = Dictionary.getDictionary("configuration").get( |
"cleGoogleMaps"); |
|
lienEfloreBaseUrl = Dictionary.getDictionary("configuration").get( |
"lienEfloreBaseUrl"); |
|
refTax = Dictionary.getDictionary("configuration").get( |
"refTax"); |
|
refTaxVersion = Dictionary.getDictionary("configuration").get( |
"refTaxVersion"); |
|
formatOriginal = Dictionary.getDictionary("configuration").get( |
"formatOriginal"); |
|
formatZoom = Dictionary.getDictionary("configuration").get( |
"formatZoom"); |
|
formatGalerie = Dictionary.getDictionary("configuration").get( |
"formatGalerie"); |
|
formatListe = Dictionary.getDictionary("configuration").get( |
"formatListe"); |
|
utiliseRedirectionImage = Dictionary.getDictionary("configuration").get( |
"utiliseRedirectionImage"); |
|
imageRedirectUrl = Dictionary.getDictionary("configuration").get( |
"imageRedirectUrl"); |
|
//licence = Dictionary.getDictionary("configuration").get("licence"); |
} |
|
/** |
* Accesseur pour l'url de base du serveur jrest |
* |
* @return une url de la forme http://emplacement_serveur/jrest |
*/ |
public static String getServiceBaseUrl() { |
return serviceBaseUrl; |
} |
|
/** |
* Accesseur pour l'url de base du suivi de bug |
* |
* @return une url pointant vers le suivi des bugs |
*/ |
public static String getSuiviBugUrl() { |
return suiviBugUrl; |
} |
|
/** |
* Accesseur pour l'url de base des images |
* |
* @return une url pointant vers la racine du dossier contenant les images |
*/ |
public static String getImageBaseUrl() { |
return imageBaseUrl ; |
} |
|
/** |
* Accesseur pour l'url de base de l'aide |
* |
* @return une url pointant vers la racine de l'aide |
*/ |
public static String getAideBaseUrl() { |
return aideBaseUrl ; |
} |
|
/** |
* Accesseur pour l'email de contact du carnet en ligne |
* |
* @return une chaine contenant l'email de contact |
*/ |
public static String getEmailContact() { |
return emailContact; |
} |
|
/** |
* Accesseur pour le référentiel geo |
* |
* @return le référentiel geo |
*/ |
public static String getReferentielGeo() { |
return referentielGeo ; |
} |
|
/** |
* Accesseur pour la clé google maps |
* |
* @return la clé google maps |
*/ |
public static String getCleGoogleMaps() { |
return cleGoogleMaps ; |
} |
|
public static String getLienEfloreBaseUrl() { |
return lienEfloreBaseUrl; |
|
} |
|
public static String getRefTax() { |
return refTax; |
|
} |
|
public static String getRefTaxVersion() { |
return refTaxVersion; |
|
} |
|
public static String getLicence() { |
return licence; |
} |
|
public static String getFormatOriginal() { |
|
return formatOriginal; |
} |
|
public static String getFormatZoom() { |
|
return formatZoom; |
} |
|
public static String getFormatGalerie() { |
|
return formatGalerie; |
} |
|
public static String getFormatListe() { |
|
return formatListe; |
} |
|
public static boolean utiliseRedirectionImages() { |
|
return utiliseRedirectionImage.equals("1"); |
|
} |
|
public static String getImageRedirectUrl() { |
|
return imageRedirectUrl; |
|
} |
} |