| 1 |
<%-- |
| 2 |
Copyright 2005-2006 The Portal Application Laboratory Team. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
Unless required by applicable law or agreed to in writing, software |
| 9 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
See the License for the specific language governing permissions and |
| 12 |
limitations under the License. |
| 13 |
--%> |
| 14 |
|
| 15 |
<%@ taglib uri='http://java.sun.com/portlet' prefix='portlet'%> |
| 16 |
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> |
| 17 |
<%@ page import="java.util.*"%> |
| 18 |
|
| 19 |
<jsp:useBean id="todayweather" class="jp.sf.pal.weather.Weather" scope="request" /> |
| 20 |
<jsp:useBean id="tomorrowweather" class="jp.sf.pal.weather.Weather" scope="request" /> |
| 21 |
<fmt:setBundle basename="jp.sf.pal.weather.resources.WeatherResources" /> |
| 22 |
<portlet:defineObjects/> |
| 23 |
|
| 24 |
<form action="<portlet:actionURL />" method="POST"> |
| 25 |
|
| 26 |
<table width="100%"> |
| 27 |
|
| 28 |
<!-- Display Pref. and City --> |
| 29 |
<tr> |
| 30 |
<td colspan="2" align="center" style="font-size: x-small"> |
| 31 |
<a href="<jsp:getProperty name="todayweather" property="link" />" style="font-size: x-small"> |
| 32 |
<jsp:getProperty name="todayweather" property="pref" /> |
| 33 |
<jsp:getProperty name="todayweather" property="city" /> |
| 34 |
<fmt:message key="weather.label.OfWeather" /> |
| 35 |
</a> |
| 36 |
</td> |
| 37 |
</tr> |
| 38 |
|
| 39 |
<!-- Display Forecast Day --> |
| 40 |
<tr> |
| 41 |
<td align="center" style="font-size: x-small"> |
| 42 |
<fmt:message key="weather.label.Today"/> |
| 43 |
</td> |
| 44 |
<td align="center" style="font-size: x-small"> |
| 45 |
<fmt:message key="weather.label.Tomorrow"/> |
| 46 |
</td> |
| 47 |
</tr> |
| 48 |
|
| 49 |
<!-- Display Forecast Image --> |
| 50 |
<tr> |
| 51 |
<!-- Today --> |
| 52 |
<td align="center"> |
| 53 |
<img src="<jsp:getProperty name="todayweather" property="imgUrl" />" |
| 54 |
alt="<jsp:getProperty name="todayweather" property="imgTitle" />" |
| 55 |
width="<jsp:getProperty name="todayweather" property="imgWidth" />" |
| 56 |
height="<jsp:getProperty name="todayweather" property="imgHeight" />" |
| 57 |
border="0" /> |
| 58 |
</td> |
| 59 |
<!-- Tomorrow --> |
| 60 |
<td align="center"> |
| 61 |
<img src="<jsp:getProperty name="tomorrowweather" property="imgUrl" />" |
| 62 |
alt="<jsp:getProperty name="tomorrowweather" property="imgTitle" />" |
| 63 |
width="<jsp:getProperty name="tomorrowweather" property="imgWidth" />" |
| 64 |
height="<jsp:getProperty name="tomorrowweather" property="imgHeight" />" |
| 65 |
border="0" /> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
|
| 69 |
<!-- Display Forecast --> |
| 70 |
<tr> |
| 71 |
<!-- Today --> |
| 72 |
<td align="center" style="font-size: x-small"> |
| 73 |
<jsp:getProperty name="todayweather" property="telop" /> |
| 74 |
</td> |
| 75 |
<!-- Tomorrow --> |
| 76 |
<td align="center" style="font-size: x-small"> |
| 77 |
<jsp:getProperty name="tomorrowweather" property="telop" /> |
| 78 |
</td> |
| 79 |
</tr> |
| 80 |
|
| 81 |
<!-- Temperature --> |
| 82 |
<tr> |
| 83 |
<td align="center" style="font-size: x-small;"> |
| 84 |
<span style="color: red;"> |
| 85 |
<fmt:message key="weather.label.High" />: |
| 86 |
<jsp:getProperty name="todayweather" property="tempMaxOutput"/> |
| 87 |
</span><br> |
| 88 |
<span style="color: blue;"> |
| 89 |
<fmt:message key="weather.label.Low" />: |
| 90 |
<jsp:getProperty name="todayweather" property="tempMinOutput"/> |
| 91 |
</span> |
| 92 |
</td> |
| 93 |
<td align="center" style="font-size: x-small;"> |
| 94 |
<span style="color: red;"> |
| 95 |
<fmt:message key="weather.label.High" />: |
| 96 |
<jsp:getProperty name="tomorrowweather" property="tempMaxOutput"/> |
| 97 |
</span><br> |
| 98 |
<span style="color: blue;"> |
| 99 |
<fmt:message key="weather.label.Low" />: |
| 100 |
<jsp:getProperty name="tomorrowweather" property="tempMinOutput"/> |
| 101 |
</span> |
| 102 |
</td> |
| 103 |
</tr> |
| 104 |
|
| 105 |
<!-- Copyright --> |
| 106 |
<tr> |
| 107 |
<td align="center" colspan="2"> |
| 108 |
<a href="<jsp:getProperty name="todayweather" property="copyrightLink" />" style="font-size:x-small"> |
| 109 |
<jsp:getProperty name="todayweather" property="copyrightTitle" /> |
| 110 |
</a> |
| 111 |
</td> |
| 112 |
</tr> |
| 113 |
|
| 114 |
<!-- Select Menu --> |
| 115 |
<tr> |
| 116 |
<td align="center" width="10%" style="font-size: x-small;" colspan="2"> |
| 117 |
<fmt:message key="weather.label.Area"/>: |
| 118 |
<select name="city"> |
| 119 |
<option value="default"><fmt:message key="weather.label.SelectArea"/> </option> |
| 120 |
<% |
| 121 |
Map cityMap = (Map)renderRequest.getAttribute("city") ; |
| 122 |
String reqId = (String)renderRequest.getAttribute("id") ; |
| 123 |
Iterator it = cityMap.keySet().iterator() ; |
| 124 |
while (it.hasNext()) { |
| 125 |
Integer id = (Integer)it.next() ; |
| 126 |
String cityId = id.toString() ; |
| 127 |
String cityName = (String)cityMap.get(id) ; |
| 128 |
String selected = "" ; |
| 129 |
if (reqId.equals(cityId)) { |
| 130 |
selected = "selected" ; |
| 131 |
} |
| 132 |
%> |
| 133 |
<option value="<%= cityId %>" <%= selected %>><%= cityName %></option> |
| 134 |
<% |
| 135 |
} |
| 136 |
%> |
| 137 |
</select> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
|
| 141 |
<!-- Submit --> |
| 142 |
<tr class="portlet-section-body"> |
| 143 |
<td colspan="2" align="center"> |
| 144 |
<input type="submit" value="<fmt:message key="weather.label.Submit"/>"> |
| 145 |
</td> |
| 146 |
</tr> |
| 147 |
</table> |
| 148 |
|
| 149 |
</form> |