manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1803717 - in /manifoldcf/trunk/framework/crawler-ui/src/main/webapp: editjob.jsp execute.jsp viewjob.jsp
Date Tue, 01 Aug 2017 23:05:21 GMT
Author: kwright
Date: Tue Aug  1 23:05:20 2017
New Revision: 1803717

URL: http://svn.apache.org/viewvc?rev=1803717&view=rev
Log:
Fix for editjob timezone display (CONNECTORS-1445)

Modified:
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp?rev=1803717&r1=1803716&r2=1803717&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp Tue Aug  1 23:05:20
2017
@@ -1383,6 +1383,10 @@ function isRegularExpression(value)
                 <input type="hidden" name="expirationinterval" value='<%=((expirationInterval==null)?"":expirationInterval.toString())%>'/>
 <%
     }
+    
+    String[] availableIDs = java.util.TimeZone.getAvailableIDs();
+    String localTimezone = java.util.TimeZone.getDefault().getID();
+
     if (scheduleRecords.size() == 0)
     {
 %>
@@ -1405,6 +1409,12 @@ function isRegularExpression(value)
         EnumeratedValues srHourOfDay = sr.getHourOfDay();
         EnumeratedValues srMinutesOfHour = sr.getMinutesOfHour();
         boolean srRequestMinimum = sr.getRequestMinimum();
+        String srTimezone = sr.getTimezone();
+        if (srTimezone == null)
+        {
+          srTimezone = java.util.TimeZone.getDefault().getID();
+        }
+        
         String postFix = Integer.toString(l);
         int k;
 
@@ -1412,6 +1422,28 @@ function isRegularExpression(value)
                 <tr>
                   <th><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.ScheduledTimeColon")%></nobr></th>
                   <td colspan="3" class="value">
+                    <select class="selectpicker" multiple="false" name='<%="timezone"+postFix%>'>
+<%
+        k = 0;
+        while (k < availableIDs.length)
+        {
+          String id = availableIDs[k];
+          if (id.equals(srTimezone))
+          {
+%>
+                      <option value='<%=id%>' selected=\"selected\"><%=id%></option>
+<%
+          }
+          else
+          {
+%>
+                      <option value='<%=id%>'><%=id%></option>
+<%
+          }
+          k++;
+        }
+%>
+                    </select>: 
                     <select class="selectpicker" multiple="true" name='<%="dayofweek"+postFix%>'>
                       <option value="none" <%=(srDayOfWeek==null)?"selected=\"selected\"":""%>><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.AnyDayOfWeek")%></option>
                       <option value="0" <%=(srDayOfWeek!=null&&srDayOfWeek.checkValue(0))?"selected=\"selected\"":""%>><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Sundays")%></option>
@@ -1532,6 +1564,28 @@ function isRegularExpression(value)
                   <th><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.ScheduledTimeColon")%></nobr></th>
                   <td colspan="3" class="value">
                     <div class="input-group">
+                      <select class="selectpicker" multiple="false" name="timezone">
+<%
+    int k = 0;
+    while (k < availableIDs.length)
+    {
+      String id = availableIDs[k];
+      if (id.equals(localTimezone))
+      {
+%>
+                        <option value='<%=id%>' selected=\"selected\"><%=id%></option>
+<%
+      }
+      else
+      {
+%>
+                        <option value='<%=id%>'><%=id%></option>
+<%
+      }
+      k++;
+    }
+%>
+                      </select>: 
                       <select class="selectpicker" multiple="true" name="dayofweek">
                         <option value="none" <%=(dayOfWeek==null)?"selected=\"selected\"":""%>><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.AnyDayOfWeek")%></option>
                         <option value="0" <%=(dayOfWeek!=null&&dayOfWeek.checkValue(0))?"selected=\"selected\"":""%>><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Sundays")%></option>
@@ -1546,7 +1600,7 @@ function isRegularExpression(value)
                       <select class="selectpicker" multiple="true" name="hourofday">
                         <option value="none" <%=(hourOfDay==null)?"selected=\"selected\"":""%>><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.MidnightAnyHourOfDay")%></option>
 <%
-    int k = 0;
+    k = 0;
     while (k < 24)
     {
       int q = k;
@@ -1674,8 +1728,12 @@ function isRegularExpression(value)
       EnumeratedValues srHourOfDay = sr.getHourOfDay();
       EnumeratedValues srMinutesOfHour = sr.getMinutesOfHour();
       boolean srRequestMinimum = sr.getRequestMinimum();
+      String srTimezone = sr.getTimezone();
       String postFix = Integer.toString(l);
 
+%>
+              <input type="hidden" name='<%="timezone"+postFix%>' value='<%=((srTimezone==null)?"":srTimezone)%>'/>
+<%
       if (srDayOfWeek == null)
       {
 %>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp?rev=1803717&r1=1803716&r2=1803717&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp Tue Aug  1 23:05:20
2017
@@ -1132,8 +1132,14 @@
               EnumeratedValues srHourOfDay = null;
               EnumeratedValues srMinutesOfHour = null;
               Long srDuration = null;
+              String srTimezone = null;
               boolean srRequestMinimum = false;
 
+              srTimezone = variableContext.getParameter("timezone"+indexValue);
+              if (srTimezone != null && srTimezone.length() == 0)
+              {
+                srTimezone = null;
+              }
               y = variableContext.getParameterValues("dayofweek"+indexValue);
               if (y != null)
               {
@@ -1200,7 +1206,7 @@
               if (x == null || !x.equals("Remove Schedule"))
               {
                 ScheduleRecord sr = new ScheduleRecord(srDayOfWeek,srMonthOfYear,srDayOfMonth,srYear,srHourOfDay,srMinutesOfHour,
-                  null,srDuration,srRequestMinimum);
+                  srTimezone,srDuration,srRequestMinimum);
                 job.addScheduleRecord(sr);
               }
               j++;
@@ -1217,9 +1223,15 @@
             EnumeratedValues srYear = null;
             EnumeratedValues srHourOfDay = null;
             EnumeratedValues srMinutesOfHour = null;
+            String srTimezone = null;
             Long srDuration = null;
             boolean srRequestMinimum = false;
 
+            x = variableContext.getParameter("timezone");
+            if (x != null)
+            {
+              srTimezone = x;
+            }
             y = variableContext.getParameterValues("dayofweek");
             if (y != null)
             {
@@ -1283,7 +1295,7 @@
             }
 
             ScheduleRecord sr = new ScheduleRecord(srDayOfWeek,srMonthOfYear,srDayOfMonth,srYear,srHourOfDay,srMinutesOfHour,
-              null,srDuration,srRequestMinimum);
+              srTimezone,srDuration,srRequestMinimum);
             job.addScheduleRecord(sr);
           }
 

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp?rev=1803717&r1=1803716&r2=1803717&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp Tue Aug  1 23:05:20
2017
@@ -277,6 +277,7 @@ try
         ScheduleRecord sr = job.getScheduleRecord(j);
         Long srDuration = sr.getDuration();
         boolean srRequestMinimum = sr.getRequestMinimum();
+        String srTimezone = sr.getTimezone();
         EnumeratedValues srDayOfWeek = sr.getDayOfWeek();
         EnumeratedValues srMonthOfYear = sr.getMonthOfYear();
         EnumeratedValues srDayOfMonth = sr.getDayOfMonth();
@@ -289,6 +290,10 @@ try
               <th><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.ScheduledTimeColon")%></nobr></th>
               <td colspan="3">
 <%
+          if (srTimezone != null)
+          {
+            out.println(id + ": ");
+          }
           if (srDayOfWeek == null)
             out.println(Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Anydayoftheweek"));
           else



Mime
View raw message