📄 searchsettings.jsp
字号:
<%
/**
* $RCSfile: searchSettings.jsp,v $
* $Revision: 1.3 $
* $Date: 2000/12/18 02:06:21 $
*/
%>
<%@ page import="java.util.*,
java.text.*,
com.coolservlets.forum.*,
com.coolservlets.forum.util.*,
com.coolservlets.forum.util.admin.*"
errorPage="error.jsp"
%>
<jsp:useBean id="adminBean" scope="session"
class="com.coolservlets.forum.util.admin.AdminBean"/>
<%! /////////////////////
// global variables
// Date formatter
private final SimpleDateFormat dateFormatter
= new SimpleDateFormat( "yyyy.MM.dd h:mm a" );
%>
<% ////////////////////////////////
// Jive authorization check
// check the bean for the existence of an authorization token.
// Its existence proves the user is valid. If it's not found, redirect
// to the login page
Authorization authToken = adminBean.getAuthToken();
if( authToken == null ) {
response.sendRedirect( "/mainctrl/bbs/admin" );
return;
}
%>
<% ////////////////////
// Security check
// make sure the user is authorized to administer users:
ForumFactory forumFactory = ForumFactory.getInstance(authToken);
boolean isSystemAdmin = ((Boolean)session.getValue("jiveAdmin.systemAdmin")).booleanValue();
// redirect to error page if we're not a group admin or a system admin
if( !isSystemAdmin ) {
throw new UnauthorizedException("对不起,您没有权限修改查询设置!");
}
%>
<% ////////////////////
// get parameters
boolean doIndex = ParamUtils.getBooleanParameter(request,"doIndex");
boolean doUpdateIndex = ParamUtils.getBooleanParameter(request,"doUpdateIndex");
boolean doRebuildIndex = ParamUtils.getBooleanParameter(request,"doRebuildIndex");
boolean doIntervalUpdate = ParamUtils.getBooleanParameter(request,"doIntervalUpdate");
boolean makeAutoIndexEnabled = ParamUtils.getBooleanParameter(request,"isAutoIndexEnabled");
int hourInterval = ParamUtils.getIntParameter(request,"hourInterval",0);
int minInterval = ParamUtils.getIntParameter(request,"minInterval",0);
%>
<% ////////////////
// load up indexer
SearchIndexer indexer = forumFactory.getSearchIndexer();
boolean isAutoIndexEnabled = indexer.isAutoIndexEnabled();
%>
<% ///////////////
// rebuild or update index or intervals
if( doUpdateIndex ) {
indexer.updateIndex();
}
if( doRebuildIndex ) {
indexer.rebuildIndex();
}
if( doIntervalUpdate ) {
indexer.setUpdateInterval( minInterval, hourInterval );
}
if( doIndex ) {
indexer.setAutoIndexEnabled( makeAutoIndexEnabled );
}
// redirect if necessary
if( doUpdateIndex || doRebuildIndex || doIntervalUpdate || doIndex ) {
response.sendRedirect("searchSettings.jsp");
return;
}
%>
<% ////////////////////////////
// get properties of the indexer
int hoursUpdateInterval = indexer.getHoursUpdateInterval();
int minsUpdateInterval = indexer.getMinutesUpdateInterval();
Date lastIndexedDate = indexer.getLastIndexedDate();
%>
<html>
<head>
<title></title>
<link rel="stylesheet" href="style/global.css">
</head>
<body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<% ///////////////////////
// pageTitleInfo variable (used by include/pageTitle.jsp)
String[] pageTitleInfo = { "查询设置" };
%>
<% ///////////////////
// pageTitle include
%><%@ include file="include/pageTitle.jsp" %>
<p>
查询检索器可以阶段行的将新帖子增加到查询数据表中,你可以控制阶段的时间间隔,帖子
在未经检索之前,此帖子将不会出现在查询结果中,从方便查询角度分析,系统建议您将自动
检索的时间设置较小值。
<p>
您也可以将自动检索关闭,但是,在这种情况下,帖子只能靠您手工进行检索。
<p>
<form action="searchSettings.jsp">
<input type="hidden" name="doIndex" value="true">
<table bgcolor="#666666" cellpadding="0" cellspacing="0" border="0" width="80%" align="center">
<td>
<table bgcolor="#666666" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
<td>自动检索:</td>
<td align="center"<%= (isAutoIndexEnabled)?" bgcolor=\"#99cc99\"":"" %>>
<input type="radio" name="isAutoIndexEnabled" value="true" id="rb01"
<%= (isAutoIndexEnabled)?"checked":"" %>>
<label for="rb01"><%= (isAutoIndexEnabled)?"<b>开</b>":"开" %></label>
</td>
<td align="center"<%= (!isAutoIndexEnabled)?" bgcolor=\"#cc6666\"":"" %>>
<input type="radio" name="isAutoIndexEnabled" value="false" id="rb02"
<%= (!isAutoIndexEnabled)?"checked":"" %>>
<label for="rb02"><%= (!isAutoIndexEnabled)?"<b>关</b>":"关" %></label>
</td>
</tr>
</table>
</td>
</table>
<p>
<center>
<input type="submit" value="修改">
</center>
</form>
<p>
<form action="searchSettings.jsp">
<input type="hidden" name="doIntervalUpdate" value="true">
<table bgcolor="#666666" cellpadding="0" cellspacing="0" border="0" width="80%" align="center">
<td>
<table bgcolor="#666666" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
<td>最后索引时间</td>
<td><%= dateFormatter.format(lastIndexedDate) %></td>
</tr>
<tr bgcolor="#ffffff">
<td>设置时间间隔:</td>
<td>
每隔
<select size="1" name="hourInterval">
<% for( int i=0; i<24; i++ ) { %>
<% String selected = ""; %>
<% if( i==hoursUpdateInterval ) { selected = " selected"; } %>
<option value="<%= i %>"<%= selected %>><%= i %>
<% } %>
</select>
小时,
<select size="1" name="minInterval">
<% for( int i=0; i<60; ) { %>
<% String selected = ""; %>
<% if( i==minsUpdateInterval ) { selected = " selected"; } %>
<option value="<%= i %>"<%= selected %>><%= i %>
<% if( i>=10 ) { %>
<% i+=5; %>
<% } else { i++; } %>
<% } %>
</select>
分钟刷新一遍。
</td>
</tr>
</table>
</td>
</table>
<p>
<center>
<input type="submit" value="保存修改">
<input type="submit" value="完成"
onclick="location.href='main.jsp';return false;">
</center>
</form>
<p>
<b>强制更新新的索引</b>
<form action="searchSettings.jsp">
<input type="hidden" name="doUpdateIndex" value="true">
<ul>
这将更新所有从上次更新时间到现在的帖子。<br>
<input type="submit" value="开始更新索引">
</ul>
</form>
<p>
<b>强制更新所有的索引</b>
<form action="searchSettings.jsp">
<input type="hidden" name="doRebuildIndex" value="true">
<ul>
对所有的帖子进行索引更新,如果有很多帖子,这将花费非常多的时间,不建议用户使用此项功能。<br>
<input type="submit" value="开始更新索引">
</ul>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -