<%@ include file="adminHeaders.jsp" %> <% /* $Id$ */ /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ boolean maintenanceUnderway = org.apache.manifoldcf.crawler.system.ManifoldCF.checkMaintenanceUnderway(); %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.ApacheManifoldCFStatusOfAllJobs")%>

<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.StatusOfJobs")%>

<% if (maintenanceUnderway == false) { %>
<% try { // Get the max count int maxCount = LockManagerFactory.getIntProperty(threadContext,"org.apache.manifoldcf.ui.maxstatuscount",500000); // Get the job manager handle IJobManager manager = JobManagerFactory.make(threadContext); JobStatus[] jobs = manager.getAllStatus(true,maxCount); %> <% int i = 0; while (i < jobs.length) { JobStatus js = jobs[i++]; String statusName; int status = js.getStatus(); switch (status) { case JobStatus.JOBSTATUS_NOTYETRUN: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Notyetrun"); break; case JobStatus.JOBSTATUS_RUNNING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Running"); break; case JobStatus.JOBSTATUS_RUNNING_UNINSTALLED: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Runningnoconnector"); break; case JobStatus.JOBSTATUS_ABORTING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Aborting"); break; case JobStatus.JOBSTATUS_RESTARTING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Restarting"); break; case JobStatus.JOBSTATUS_STOPPING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Stopping"); break; case JobStatus.JOBSTATUS_RESUMING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Resuming"); break; case JobStatus.JOBSTATUS_PAUSED: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Paused"); break; case JobStatus.JOBSTATUS_COMPLETED: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Done"); break; case JobStatus.JOBSTATUS_WINDOWWAIT: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Waiting"); break; case JobStatus.JOBSTATUS_STARTING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Startingup"); break; case JobStatus.JOBSTATUS_DESTRUCTING: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Cleaningup"); break; case JobStatus.JOBSTATUS_JOBENDCLEANUP: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Terminating"); break; case JobStatus.JOBSTATUS_JOBENDNOTIFICATION: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Endnotification"); break; case JobStatus.JOBSTATUS_ERROR: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.ErrorColon")+" "+js.getErrorText(); break; default: statusName = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Unknown"); break; } String startTime = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Notstarted"); if (js.getStartTime() != -1L) startTime = new Date(js.getStartTime()).toString(); String endTime = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Aborted"); if (js.getStartTime() == -1L) endTime = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Neverrun"); else { if (js.getEndTime() == -1L) { if (status == JobStatus.JOBSTATUS_COMPLETED) endTime = Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Aborted"); else endTime = ""; } else endTime = new Date(js.getEndTime()).toString(); } %> > <% } %>

<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Name")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Status")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.StartTime")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.EndTime")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Documents")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Active")%><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Processed")%>
<% if (status == JobStatus.JOBSTATUS_NOTYETRUN || status == JobStatus.JOBSTATUS_COMPLETED || status == JobStatus.JOBSTATUS_ERROR) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Start")%> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Startminimal")%> <% } if (status == JobStatus.JOBSTATUS_RUNNING || status == JobStatus.JOBSTATUS_RUNNING_UNINSTALLED || status == JobStatus.JOBSTATUS_WINDOWWAIT || status == JobStatus.JOBSTATUS_PAUSED || status == JobStatus.JOBSTATUS_STARTING) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Restart")%> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Restartminimal")%> <% } if (status == JobStatus.JOBSTATUS_RUNNING || status == JobStatus.JOBSTATUS_RUNNING_UNINSTALLED || status == JobStatus.JOBSTATUS_WINDOWWAIT) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Pause")%> <% } if (status == JobStatus.JOBSTATUS_RUNNING || status == JobStatus.JOBSTATUS_RUNNING_UNINSTALLED || status == JobStatus.JOBSTATUS_STOPPING || status == JobStatus.JOBSTATUS_RESUMING || status == JobStatus.JOBSTATUS_WINDOWWAIT || status == JobStatus.JOBSTATUS_PAUSED || status == JobStatus.JOBSTATUS_STARTING || status == JobStatus.JOBSTATUS_RESTARTING) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Abort")%> <% } if (status == JobStatus.JOBSTATUS_PAUSED) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Resume")%> <% } %> <%=""%><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(js.getDescription())%><%=statusName%><%=startTime%><%=endTime%> <%=(js.getQueueCountExact()?"":"> ")%><%=new Long(js.getDocumentsInQueue()).toString()%> <%=(js.getOutstandingCountExact()?"":"> ")%><%=new Long(js.getDocumentsOutstanding()).toString()%> <%=(js.getProcessedCountExact()?"":"> ")%><%=new Long(js.getDocumentsProcessed()).toString()%>

"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.Refresh")%>
<% } catch (ManifoldCFException e) { out.println("Error: "+e.getMessage()); e.printStackTrace(); } %>
<% } else { %>

<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"showjobstatus.PleaseTryAgainLater")%>
<% } %>