You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-commits@incubator.apache.org by kl...@apache.org on 2009/09/10 22:20:46 UTC

svn commit: r813621 - in /incubator/olio/webapp/java/trunk/ws/apps/webapp: src/java/org/apache/olio/webapp/model/SocialEvent.java src/java/org/apache/olio/webapp/rest/EventRestAction.java web/addEvent.jsp

Author: klichong
Date: Thu Sep 10 22:20:46 2009
New Revision: 813621

URL: http://svn.apache.org/viewvc?rev=813621&view=rev
Log:
fix for Olio 118.
permitting changing of timezone for adding events instead of using the system default

Modified:
    incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/model/SocialEvent.java
    incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/rest/EventRestAction.java
    incubator/olio/webapp/java/trunk/ws/apps/webapp/web/addEvent.jsp

Modified: incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/model/SocialEvent.java
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/model/SocialEvent.java?rev=813621&r1=813620&r2=813621&view=diff
==============================================================================
--- incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/model/SocialEvent.java (original)
+++ incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/model/SocialEvent.java Thu Sep 10 22:20:46 2009
@@ -63,6 +63,7 @@
     private String imageThumbURL;
     private String literatureURL;
     private String telephone;
+    private String timezone;
     private Address address;
     private int totalScore;
     private int numberOfVotes;
@@ -85,6 +86,7 @@
         this.imageThumbURL = imageThumbURL;
         this.literatureURL = literatureURL;
         this.telephone = telephone;
+        //this.timezone = timezone;
         this.eventTimestamp = eventTimestamp;
         this.disabled = 0;
         this.createdTimestamp=new Timestamp(new Date().getTime());
@@ -159,6 +161,10 @@
         return telephone;
     }
     
+    public String getTimezone() {
+        return literatureURL;
+    }
+
     @ManyToMany
     @JoinTable(name = "PERSON_SOCIALEVENT", joinColumns = @JoinColumn(name = "SOCIALEVENTID", referencedColumnName = "SOCIALEVENTID")
     , inverseJoinColumns = @JoinColumn(name = "USERNAME", referencedColumnName = "USERNAME"))
@@ -213,6 +219,10 @@
     public void setTelephone(String telephone) {
         this.telephone=telephone;
     }
+
+    public void setTimezone(String timezone) {
+        this.timezone=timezone;
+    }
     
     
     @ManyToMany(mappedBy = "socialEvents")

Modified: incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/rest/EventRestAction.java
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/rest/EventRestAction.java?rev=813621&r1=813620&r2=813621&view=diff
==============================================================================
--- incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/rest/EventRestAction.java (original)
+++ incubator/olio/webapp/java/trunk/ws/apps/webapp/src/java/org/apache/olio/webapp/rest/EventRestAction.java Thu Sep 10 22:20:46 2009
@@ -44,6 +44,7 @@
 import java.util.Collection;
 import java.util.GregorianCalendar;
 import java.util.Hashtable;
+import java.util.TimeZone;
 
 /**
  * handles all request related to users
@@ -282,6 +283,7 @@
         String yearx=htUpload.get("year");
         String hourx=htUpload.get("hour");
         String minutex=htUpload.get("minute");
+        String timezonex = htUpload.get(TIMEZONE_PARAM);
         
         // SECURITY get submitter from session
         String submitterUserName=null;
@@ -323,7 +325,8 @@
    
         
         // gat time in utc milliseconds...
-        Calendar localCal=GregorianCalendar.getInstance();
+        //adding timezone specific info for social event
+        Calendar localCal=GregorianCalendar.getInstance(TimeZone.getTimeZone(timezonex));
         localCal.set(Calendar.MONTH, Integer.parseInt(monthx) - 1);
         localCal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(dayx));
         localCal.set(Calendar.YEAR, Integer.parseInt(yearx));

Modified: incubator/olio/webapp/java/trunk/ws/apps/webapp/web/addEvent.jsp
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/java/trunk/ws/apps/webapp/web/addEvent.jsp?rev=813621&r1=813620&r2=813621&view=diff
==============================================================================
--- incubator/olio/webapp/java/trunk/ws/apps/webapp/web/addEvent.jsp (original)
+++ incubator/olio/webapp/java/trunk/ws/apps/webapp/web/addEvent.jsp Thu Sep 10 22:20:46 2009
@@ -62,8 +62,8 @@
       <p><label for="description">Description</label><br/>
       <textarea cols="37" id="description" name="description" rows="20" >${requestScope['description']}</textarea></p>
     </div>
-
     <div id="misc_event_form">
+
       <p>
       <label for="event_timestamp">Event date and time</label><br/>
       <c:choose>
@@ -71,11 +71,16 @@
         ${requestScope['socialEvent'].yearDropDown} ${requestScope['socialEvent'].monthDropDown} ${requestScope['socialEvent'].dayDropDown}
         &mdash;<br/> 
         ${requestScope['socialEvent'].hourDropDown}:${requestScope['socialEvent'].minuteDropDown}
+        &mdash;<br/> 
        </c:when>
        <c:otherwise>
         ${mf.yearDropDown} ${mf.monthDropDown} ${mf.dayDropDown}
         &mdash;<br/> 
         ${mf.hourDropDown}:${mf.minuteDropDown}
+        &mdash;<br/> 
+	<select id="timezone" name="timezone">
+                             <%@ include file="timezones.html" %>
+                        </select>
        </c:otherwise>
       </c:choose>
       </p><p>