1 7 8 package org.exoplatform.portlets.weather; 9 10 import javax.faces.context.FacesContext; 11 import javax.portlet.PortletPreferences; 12 import javax.portlet.PortletRequest; 13 14 import com.capeclear.www.GlobalWeather_xsd.Station; 15 16 public class WeatherData { 17 private PortletPreferences preferences_; 18 private String preferredStationCode_; 19 private String displayedStationCode_; 20 private String searchStationCode_; 21 private String searchStationName_; 22 private Station [] stationsList_; 23 private boolean stationFound_; 24 private int nbStations_; 25 26 public WeatherData() { 27 PortletRequest request = 28 (PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); 29 preferences_ = request.getPreferences(); 30 } 31 32 public String getDisplayedStationCode() { 33 return displayedStationCode_; 34 } 35 36 public PortletPreferences getPreferences() { 37 return preferences_; 38 } 39 40 public String getPreferredStationCode() { 41 return preferences_.getValue("code","LFRN"); 42 } 45 46 public String getSearchStationCode() { 47 return searchStationCode_; 48 } 49 50 public String getSearchStationName() { 51 return searchStationName_; 52 } 53 54 public int getNbStations() { 55 return nbStations_; 56 } 57 58 public Station[] getStationsList() { 59 return stationsList_; 60 } 61 62 public boolean isStationFound() { 63 return stationFound_; 64 } 65 66 public void setDisplayedStationCode(String displayedStationCode) { 67 displayedStationCode_ = displayedStationCode; 68 } 69 70 public void setNbStations(int nbStations) { 71 nbStations_ = nbStations; 72 } 73 74 public void setPreferredStationCode(String preferredStationCode) { 75 preferredStationCode_ = preferredStationCode; 76 } 77 78 public void setSearchStationCode(String searchStationCode) { 79 searchStationCode_ = searchStationCode; 80 } 81 82 public void setStationFound(boolean stationFound) { 83 stationFound_ = stationFound; 84 } 85 86 public void setSearchStationName(String searchStationName) { 87 searchStationName_ = searchStationName; 88 } 89 90 public void setStationList(Station [] stationsList) { 91 stationsList_ = stationsList; 92 } 93 } 94 | Popular Tags |