📄 interceptors.jsp
字号:
}
}
</script>
<form action="interceptors.jsp">
<% if (!isGlobal) { %>
<input type="hidden" name="wgID" value="<%= workgroupID %>">
<% } %>
Configure interceptors of the realm:
<select name="managerType" onchange="this.form.submit();">
<option value="workgroup" <% if ("workgroup".equals(managerType)) out.write("selected");%>>Workgroup</option>
<option value="queue" <% if ("queue".equals(managerType)) out.write("selected");%>>Queue</option>
<option value="offer" <% if ("offer".equals(managerType)) out.write("selected");%>>Offer</option>
<option value="room" <% if ("room".equals(managerType)) out.write("selected");%>>Room</option>
<option value="chatbot" <% if ("chatbot".equals(managerType)) out.write("selected");%>>Chatbot</option>
<option value="agent" <% if ("agent".equals(managerType)) out.write("selected");%>>Agent</option>
</select>
</form>
<% // Print out a message if one exists
String oneTimeMessage = errorMessage;
if (oneTimeMessage != null) {
%>
<font size="-1" color="#ff0000">
<p><i><%= oneTimeMessage %></i></p>
<% }
%>
<% // Colors
String red = "#ffeeee";
String yellow = "#ffffee";
i=0;
if (interceptorCount > 0) {
%>
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<b>Current Interceptors</b>
</td>
<td>
<a href="#" onclick="helpwin('interceptors','current_interceptors');return false;"
title="Click for help"
><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8" alt="" /></a>
</td>
</tr>
</table><br>
<ul>
<table bgcolor="#aaaaaa" cellpadding="0" cellspacing="0" border="0">
<tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr bgcolor="#eeeeee">
<td align="center"><font size="-2" face="verdana"><b>ORDER</b></font></td>
<td align="center"><font size="-2" face="verdana"><b>NAME</b></font></td>
<td align="center"><font size="-2" face="verdana"><b>DESCRIPTION</b></font></td>
<% if (interceptorCount > 1) { %>
<td align="center"><font size="-2" face="verdana"><b>MOVE</b></font></td>
<% } %>
<td align="center"><font size="-2" face="verdana"><b>EDIT</b></font></td>
<td align="center"><font size="-2" face="verdana"><b>DELETE</b></font></td>
</tr>
<% // Loop through all interceptors
for (PacketInterceptor interceptor : activeInterceptors) {
try {
// Descriptor for this interceptor
BeanDescriptor descriptor = (Introspector.getBeanInfo(interceptor.getClass())).getBeanDescriptor();
// Properties for this interceptor
PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(interceptor.getClass());
// Version of this interceptor
String version = (String)descriptor.getValue("version");
// Description of this interceptor
String description = StringUtils.escapeHTMLTags(descriptor.getShortDescription());
%>
<tr bgcolor="#ffffff">
<td><%= (i+1) %></td>
<td nowrap alt="dd"><%= descriptor.getDisplayName() %></td>
<td><%= (description!=null)?description:" " %></td>
<% if (interceptorCount > 1) { %>
<td nowrap>
<% if ((i+1)<interceptorCount) { %>
<a href="interceptors.jsp?changePos=true&down=true&interceptorIndex=<%= i %>&managerType=<%=managerType%><%= isGlobal ? "" : "&wgID="+workgroupID %>"
><img src="images/arrow_down.gif" width="16" height="16" alt="Move this interceptor down." border="0"></a>
<% } else { %>
<img src="images/blank.gif" width="16" height="16" border="0" alt="" />
<% } %>
<% if (i != 0) { %>
<a href="interceptors.jsp?changePos=true&up=true&interceptorIndex=<%= i %>&managerType=<%=managerType%><%= isGlobal ? "" : "&wgID="+workgroupID %>"
><img src="images/arrow_up.gif" width="16" height="16" alt="Move this interceptor up." border="0"></a>
<% } else { %>
<img src="images/blank.gif" width="16" height="16" border="0" alt="" />
<% } %>
</td>
<% } %>
<td align="center">
<a href="interceptors.jsp?edit=true&pos=<%= i %>&managerType=<%=managerType%><%= isGlobal ? "" : "&wgID="+workgroupID %>"
><img src="images/edit-16x16.gif" width="16" height="16" alt="Edit the properties of this interceptor" border="0"
></a>
</td>
<td align="center">
<a href="interceptors.jsp?remove=true&pos=<%= i %>&managerType=<%=managerType%><%= isGlobal ? "" : "&wgID="+workgroupID %>"
><img src="images/delete-16x16.gif" width="16" height="16" alt="Delete this interceptor" border="0"
></a>
</td>
</tr>
<% if (position == i && edit) { %>
<form action="interceptors.jsp" method="post">
<% if (!isGlobal) { %>
<input type="hidden" name="wgID" value="<%= workgroupID %>">
<% } %>
<input type="hidden" name="managerType" value="<%= managerType %>">
<input type="hidden" name="saveProperties" value="true">
<input type="hidden" name="interceptorIndex" value="<%= i %>">
<tr bgcolor="#ffffff">
<td> </td>
<td colspan="<%= (interceptorCount > 1)?"5":"4" %>">
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<% int color = 1;
for (int j=0; j<descriptors.length; j++) {
color ++;
boolean isString = "java.lang.String".equals(descriptors[j].getPropertyType().getName());
if (isString) {
%>
<tr bgcolor=<%= (color%2==0)?"#f4f5f7":"#ffffff" %>>
<td colspan="3">
<%= descriptors[j].getDisplayName() %>
<br>
<font size="-2"><%= descriptors[j].getShortDescription() %></font>
</td>
</tr>
<tr bgcolor=<%= (color%2==0)?"#f4f5f7":"#ffffff" %>>
<td colspan="3">
<%= getHTML(interceptor, descriptors[j]) %>
</td>
</tr>
<% } else { %>
<tr bgcolor=<%= (color%2==0)?"#f4f5f7":"#ffffff" %>>
<td width="70%">
<%= descriptors[j].getDisplayName() %>
<br>
<font size="-2"><%= descriptors[j].getShortDescription() %></font>
</td>
<td width="10%"> </td>
<td width="10%" nowrap>
<%= getHTML(interceptor, descriptors[j]) %>
</td>
</tr>
<% }
}
%>
<tr>
<td colspan="4" align="right">
<input type="submit" value="Save Properties">
</td>
</tr>
</table>
</td>
</tr>
</form>
<% } %>
<% } catch (Exception e) { }
i++;
}
%>
</table>
</td></tr>
</table>
<br>
<% } %>
</ul>
<p>
<form action="interceptors.jsp" method="post">
<% if (!isGlobal) { %>
<input type="hidden" name="wgID" value="<%= workgroupID %>">
<% } %>
<input type="hidden" name="managerType" value="<%= managerType %>">
<input type="hidden" name="install" value="true">
<span class="jive-install-interceptor">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<b>Install Interceptor</b>
</td>
<td>
<a href="#" onclick="helpwin('interceptors','install_interceptor');return false;"
title="Click for help"
><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8" alt="" /></a>
</td>
</tr>
</table><br>
<ul>
<table bgcolor="#aaaaaa" cellpadding="0" cellspacing="0" border="0" width="1%">
<tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr bgcolor="#eeeeee">
<td align="center">
<font size="-2" face="verdana"><b>AVAILABLE INTERCEPTORS</b></font>
</td>
</tr>
<tr bgcolor="#ffffff">
<td>
<table cellpadding="1" cellspacing="0" border="0">
<tr>
<td width="48%" valign="top">
<select size="8" name="interceptors" onchange="properties(this.form);">
<% for(PacketInterceptor interceptor : interceptorManager.getAvailableInterceptors()) {
boolean isInstalled = isInstalledInterceptor(workgroup, interceptorManager, interceptor);
BeanDescriptor descriptor = (Introspector.getBeanInfo(interceptor.getClass())).getBeanDescriptor();
%>
<option value="<%= descriptor.getBeanClass().getName() %>"
><%= descriptor.getDisplayName() %>
<% if (isInstalled) { %>
*
<% } %>
<% } %>
</select>
<br>
(A * denotes the interceptor is already installed. You can install the
same interceptor more than once.)
</td>
<td width="2%"><img src="images/blank.gif" width="5" height="1" border="0" alt="" /></td>
<td width="48%" valign="top">
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td><font size="-2">VERSION</font></td>
<td><input type="text" size="20" name="version" style="width:100%"></td>
</tr>
<tr>
<td><font size="-2">AUTHOR</font></td>
<td><input type="text" size="20" name="author" style="width:100%"></td>
</tr>
<tr>
<td valign="top"><font size="-2">DESCRIPTION</font></td>
<td><textarea name="description" cols="20" rows="5" wrap="virtual"></textarea></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="Install">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
</ul>
</span>
</form>
<form action="interceptors.jsp">
<input type="hidden" name="addInterceptor" value="true">
<% if (!isGlobal) { %>
<input type="hidden" name="wgID" value="<%= workgroupID %>">
<% } %>
<input type="hidden" name="managerType" value="<%= managerType %>">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<b>Add Interceptor Class</b>
</td>
<td>
<a href="#" onclick="helpwin('interceptors','add_interceptor_class');return false;"
title="Click for help"
><img src="images/help-16x16.gif" width="16" height="16" border="0" hspace="8" alt="" /></a>
</td>
</tr>
</table><br>
<ul>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td>Class Name:</td>
<td><input type="text" name="newClassname" value="" size="30" maxlength="100"></td>
<td><input type="submit" value="Add Interceptor"></td>
</tr>
</table>
</ul>
</form>
<p>
</body>
</html>
<% } catch(Exception ex){ex.printStackTrace(); } %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -