Author: kwright
Date: Sun Dec 21 19:23:59 2014
New Revision: 1647194

URL: http://svn.apache.org/r1647194
Log:
Add notifications to job view page.

Modified:
    
manifoldcf/branches/CONNECTORS-1119/framework/crawler-ui/src/main/webapp/viewjob.jsp
    
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
    
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
    
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties

Modified: 
manifoldcf/branches/CONNECTORS-1119/framework/crawler-ui/src/main/webapp/viewjob.jsp
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/crawler-ui/src/main/webapp/viewjob.jsp?rev=1647194&r1=1647193&r2=1647194&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-1119/framework/crawler-ui/src/main/webapp/viewjob.jsp
 (original)
+++ 
manifoldcf/branches/CONNECTORS-1119/framework/crawler-ui/src/main/webapp/viewjob.jsp
 Sun Dec 21 19:23:59 2014
@@ -82,10 +82,12 @@
        IJobManager manager = JobManagerFactory.make(threadContext);
         IOutputConnectionManager outputManager = 
OutputConnectionManagerFactory.make(threadContext);
        IRepositoryConnectionManager connManager = 
RepositoryConnectionManagerFactory.make(threadContext);
+       INotificationConnectionManager notificationManager = 
NotificationConnectionManagerFactory.make(threadContext);
        ITransformationConnectionManager transformationManager = 
TransformationConnectionManagerFactory.make(threadContext);
 
        IOutputConnectorPool outputConnectorPool = 
OutputConnectorPoolFactory.make(threadContext);
        IRepositoryConnectorPool repositoryConnectorPool = 
RepositoryConnectorPoolFactory.make(threadContext);
+       INotificationConnectorPool notificationConnectorPool = 
NotificationConnectorPoolFactory.make(threadContext);
        ITransformationConnectorPool transformationConnectorPool = 
TransformationConnectorPoolFactory.make(threadContext);
 
        String jobID = variableContext.getParameter("jobid");
@@ -204,6 +206,37 @@
                                </td>
                        </tr>
                        <tr>
+                               <td class="description" 
colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.NotificationsColon")%></nobr></td>
+                               <td class="boxcell" colspan="3">
+                                       <table class="formtable">
+                                               <tr class="formheaderrow">
+                                                       <td 
class="formcolumnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.StageNumber")%></nobr></td>
+                                                       <td 
class="formcolumnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.NotificationDescription")%></nobr></td>
+                                                       <td 
class="formcolumnheader"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.NotificationConnectionName")%></nobr></td>
+                                               </tr>
+<%
+               for (int j = 0; j < job.countNotifications(); j++)
+               {
+%>
+                                               <tr class="<%=((rowCounter++ % 
2)==0)?"evenformrow":"oddformrow"%>">
+                                                       <td 
class="formcolumncell"><%=(j+job.countPipelineStages()+2)%>.</td>
+                                                       <td 
class="formcolumncell"><%=(job.getNotificationDescription(j)!=null)?org.apache.manifoldcf.ui.util.Encoder.bodyEscape(job.getNotificationDescription(j)):""%></td>
+                                                       <td 
class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(job.getNotificationConnectionName(j))%></td>
+                                               </tr>
+<%
+               }
+               if (job.countNotifications() == 0)
+               {
+%>
+                                               <tr class="formrow"><td 
class="formcolumnmessage" 
colspan="3"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.NoNotificationConnections")%></td></tr>
+<%
+               }
+%>
+                                       </table>
+                               </td>
+                       </tr>
+
+                       <tr>
                                <td class="separator" colspan="4"><hr/></td>
                        </tr>
                        <tr>
@@ -705,6 +738,39 @@
                        </tr>
 <%
                }
+               
+               for (int j = 0; j < job.countNotifications(); j++)
+               {
+%>
+                       <tr>
+                               <td class="separator" colspan="4"><hr/></td>
+                       </tr>
+                       <tr>
+                               <td class="message" 
colspan="4"><%=(j+job.countPipelineStages()+2)%>.</td>
+                       </tr>
+                       <tr>
+                               <td colspan="4">
+<%
+                       Specification os = job.getNotificationSpecification(j);
+                       INotificationConnection thisConnection = 
notificationManager.load(job.getNotificationConnectionName(j));
+                       INotificationConnector notificationConnector = 
notificationConnectorPool.grab(thisConnection);
+                       if (notificationConnector != null)
+                       {
+                               try
+                               {
+                                       
notificationConnector.viewSpecification(new 
org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),os,1+job.countPipelineStages()+j);
+                               }
+                               finally
+                               {
+                                       
notificationConnectorPool.release(thisConnection,notificationConnector);
+                               }
+                       }
+%>
+                               </td>
+                       </tr>
+<%
+               }
+
 %>
                        <tr>
                                <td class="separator" colspan="4"><hr/></td>

Modified: 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties?rev=1647194&r1=1647193&r2=1647194&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
 (original)
+++ 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
 Sun Dec 21 19:23:59 2014
@@ -1062,3 +1062,8 @@ editjob.NotificationConnectionName=Conne
 editjob.Deletenotification=Delete notification
 editjob.AddNotification=Add notification
 editjob.AddANotification=Add a notification
+
+viewjob.NotificationsColon=Notifications:
+viewjob.NotificationDescription=Description
+viewjob.NotificationConnectionName=Connection name
+viewjob.NoNotificationConnections=No notification connections
\ No newline at end of file

Modified: 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties?rev=1647194&r1=1647193&r2=1647194&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
 (original)
+++ 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
 Sun Dec 21 19:23:59 2014
@@ -1063,3 +1063,8 @@ editjob.NotificationConnectionName=Conne
 editjob.Deletenotification=Delete notification
 editjob.AddNotification=Add notification
 editjob.AddANotification=Add a notification
+
+viewjob.NotificationsColon=Notifications:
+viewjob.NotificationDescription=Description
+viewjob.NotificationConnectionName=Connection name
+viewjob.NoNotificationConnections=No notification connections

Modified: 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties?rev=1647194&r1=1647193&r2=1647194&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties
 (original)
+++ 
manifoldcf/branches/CONNECTORS-1119/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties
 Sun Dec 21 19:23:59 2014
@@ -1063,3 +1063,8 @@ editjob.NotificationConnectionName=Conne
 editjob.Deletenotification=Delete notification
 editjob.AddNotification=Add notification
 editjob.AddANotification=Add a notification
+
+viewjob.NotificationsColon=Notifications:
+viewjob.NotificationDescription=Description
+viewjob.NotificationConnectionName=Connection name
+viewjob.NoNotificationConnections=No notification connections


Reply via email to