📄 _forumcontent__jsp.java
字号:
/*
* JSP generated by Resin 2.1.4 (built Fri Aug 2 14:16:52 PDT 2002)
*/
package _admin;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.SimpleDateFormat;
import com.coolservlets.forum.*;
import com.coolservlets.forum.util.*;
import com.coolservlets.forum.util.admin.*;
public class _forumcontent__jsp extends com.caucho.jsp.JavaPage{
private boolean _caucho_isDead;
//////////////////////////
// global vars
// date formatter for message dates
private final SimpleDateFormat dateFormatter
= new SimpleDateFormat( "EEE, MMM d 'at' hh:mm:ss z" );
private final static int RANGE = 15;
private final static int START = 0;
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, "/admin/error.jsp", true, 8192, true);
javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
javax.servlet.http.HttpSession session = pageContext.getSession();
javax.servlet.ServletContext application = pageContext.getServletContext();
response.setContentType("text/html;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
/**
* $RCSfile: forumContent.jsp,v $
* $Revision: 1.4 $
* $Date: 2000/12/18 02:06:21 $
*/
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
com.coolservlets.forum.util.admin.AdminBean adminBean;
synchronized (session) {
adminBean = (com.coolservlets.forum.util.admin.AdminBean) session.getValue("adminBean");
if (adminBean == null) {
adminBean = new com.coolservlets.forum.util.admin.AdminBean();
session.putValue("adminBean", adminBean);
}
}
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
////////////////////////////////
// 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( "login.jsp" );
return;
}
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
////////////////////
// Security check
// make sure the user is authorized to administer users:
ForumFactory forumFactory = ForumFactory.getInstance(authToken);
ForumPermissions permissions = forumFactory.getPermissions(authToken);
boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
boolean isUserAdmin = permissions.get(ForumPermissions.FORUM_ADMIN);
// redirect to error page if we're not a forum admin or a system admin
if( !isUserAdmin && !isSystemAdmin ) {
request.setAttribute("message","No permission to administer forums");
response.sendRedirect("error.jsp");
return;
}
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
////////////////////
// get parameters
int forumID = ParamUtils.getIntParameter(request,"forum",-1);
boolean deleteThread = ParamUtils.getBooleanParameter(request,"deleteThread");
int threadID = ParamUtils.getIntParameter(request,"thread",-1);
int start = ParamUtils.getIntParameter(request,"start",START);
int range = ParamUtils.getIntParameter(request,"range",RANGE);
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
//////////////////////////////////
// global error variables
String errorMessage = "";
boolean noForumSpecified = (forumID < 0);
boolean noThreadSpecified = (threadID < 0);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
////////////////////
// make a profile manager
ProfileManager manager = forumFactory.getProfileManager();
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
/////////////////////
// delete a thread
if( deleteThread ) {
Forum tempForum = forumFactory.getForum(forumID);
ForumThread tempThread = tempForum.getThread(threadID);
tempForum.deleteThread(tempThread);
response.sendRedirect("forumContent.jsp?forum="+forumID);
return;
}
pageContext.write(_jsp_string3, 0, _jsp_string3.length);
///////////////////////
// pageTitleInfo variable (used by include/pageTitle.jsp)
String[] pageTitleInfo = { "论坛:论坛内容管理" };
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
///////////////////
// pageTitle include
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
if( pageTitleInfo != null ) {
pageContext.write(_jsp_string4, 0, _jsp_string4.length);
for( int i=0; i<pageTitleInfo.length; i++ ){
pageContext.write(_jsp_string5, 0, _jsp_string5.length);
out.print(( pageTitleInfo[i] ));
pageContext.write(_jsp_string5, 0, _jsp_string5.length);
if( (i+1)<pageTitleInfo.length ) {
pageContext.write(_jsp_string6, 0, _jsp_string6.length);
}
pageContext.write(_jsp_string7, 0, _jsp_string7.length);
}
pageContext.write(_jsp_string8, 0, _jsp_string8.length);
}
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string9, 0, _jsp_string9.length);
//////////////////////
// show the name of the forum we're working with (if one was selected)
Forum currentForum = null;
if( !noForumSpecified ) {
try {
currentForum = forumFactory.getForum(forumID);
pageContext.write(_jsp_string10, 0, _jsp_string10.length);
out.print(( currentForum.getName() ));
pageContext.write(_jsp_string11, 0, _jsp_string11.length);
out.print(( currentForum.getThreadCount() ));
pageContext.write(_jsp_string12, 0, _jsp_string12.length);
out.print(( currentForum.getMessageCount() ));
pageContext.write(_jsp_string7, 0, _jsp_string7.length);
}
catch( ForumNotFoundException fnfe ) {
pageContext.write(_jsp_string13, 0, _jsp_string13.length);
}
catch( UnauthorizedException ue ) {
pageContext.write(_jsp_string14, 0, _jsp_string14.length);
}
}
pageContext.write(_jsp_string15, 0, _jsp_string15.length);
///////////////////////
// show a pulldown box of forums where this user can manage content:
Iterator forumIterator = forumFactory.forums();
if( !forumIterator.hasNext() ) {
pageContext.write(_jsp_string16, 0, _jsp_string16.length);
}
pageContext.write(_jsp_string17, 0, _jsp_string17.length);
while( forumIterator.hasNext() ) {
Forum forum = (Forum)forumIterator.next();
pageContext.write(_jsp_string18, 0, _jsp_string18.length);
out.print(( forum.getID() ));
pageContext.write(_jsp_string19, 0, _jsp_string19.length);
out.print(( forum.getName() ));
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
}
pageContext.write(_jsp_string20, 0, _jsp_string20.length);
if( noForumSpecified ) {
out.flush();
return;
}
pageContext.write(_jsp_string21, 0, _jsp_string21.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
int numThreads = currentForum.getThreadCount();
pageContext.write(_jsp_string22, 0, _jsp_string22.length);
pageContext.write(_jsp_string23, 0, _jsp_string23.length);
if( start > 0 ) {
pageContext.write(_jsp_string24, 0, _jsp_string24.length);
out.print((forumID));
pageContext.write(_jsp_string25, 0, _jsp_string25.length);
out.print(( (start-range) ));
pageContext.write(_jsp_string26, 0, _jsp_string26.length);
out.print(( range ));
pageContext.write(_jsp_string27, 0, _jsp_string27.length);
out.print(( range ));
pageContext.write(_jsp_string28, 0, _jsp_string28.length);
}
pageContext.write(_jsp_string29, 0, _jsp_string29.length);
if( numThreads > (start+range) ) {
pageContext.write(_jsp_string30, 0, _jsp_string30.length);
int numRemaining = (numThreads-(start+range));
pageContext.write(_jsp_string24, 0, _jsp_string24.length);
out.print((forumID));
pageContext.write(_jsp_string25, 0, _jsp_string25.length);
out.print(( (start+range) ));
pageContext.write(_jsp_string26, 0, _jsp_string26.length);
out.print(( range ));
pageContext.write(_jsp_string31, 0, _jsp_string31.length);
out.print(( (numRemaining>range)?range:numRemaining ));
pageContext.write(_jsp_string28, 0, _jsp_string28.length);
}
pageContext.write(_jsp_string32, 0, _jsp_string32.length);
pageContext.write(_jsp_string33, 0, _jsp_string33.length);
/////////////////////
// get an iterator of threads
Iterator threadIterator = currentForum.threads(start,range);
if( !threadIterator.hasNext() ) {
pageContext.write(_jsp_string34, 0, _jsp_string34.length);
}
while( threadIterator.hasNext() ) {
ForumThread currentThread = (ForumThread)threadIterator.next();
int currentThreadID = currentThread.getID();
ForumMessage rootMessage = currentThread.getRootMessage();
boolean rootMsgIsAnonymous = rootMessage.isAnonymous();
User rootMessageUser = rootMessage.getUser();
String username = rootMessageUser.getUsername();
String name = rootMessageUser.getName();
String email = rootMessageUser.getEmail();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -