KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > weather > WeatherData


1 /**
2  * Jul 20, 2004, 2:52:59 PM
3  * @author: F. MORON
4  * @email: francois.moron@rd.francetelecom.com
5  *
6  * */

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 JavaDoc preferredStationCode_;
19     private String JavaDoc displayedStationCode_;
20     private String JavaDoc searchStationCode_;
21     private String JavaDoc 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 JavaDoc getDisplayedStationCode() {
33         return displayedStationCode_;
34     }
35
36     public PortletPreferences getPreferences() {
37         return preferences_;
38     }
39
40     public String JavaDoc getPreferredStationCode() {
41         return preferences_.getValue("code","LFRN");
42 // preferredStationCode_ = preferences_.getValue("code","LFRN");
43
// return preferredStationCode_;
44
}
45     
46     public String JavaDoc getSearchStationCode() {
47         return searchStationCode_;
48     }
49
50     public String JavaDoc 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 JavaDoc displayedStationCode) {
67         displayedStationCode_ = displayedStationCode;
68     }
69
70     public void setNbStations(int nbStations) {
71         nbStations_ = nbStations;
72     }
73
74     public void setPreferredStationCode(String JavaDoc preferredStationCode) {
75         preferredStationCode_ = preferredStationCode;
76     }
77
78     public void setSearchStationCode(String JavaDoc searchStationCode) {
79         searchStationCode_ = searchStationCode;
80     }
81
82     public void setStationFound(boolean stationFound) {
83         stationFound_ = stationFound;
84     }
85
86     public void setSearchStationName(String JavaDoc searchStationName) {
87         searchStationName_ = searchStationName;
88     }
89
90     public void setStationList(Station [] stationsList) {
91         stationsList_ = stationsList;
92     }
93 }
94
Popular Tags