editnewsgroupgateway.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 194 行
JSP
194 行
<%/** * $RCSfile: editNewsgroupGateway.jsp,v $ * $Revision: 1.1 $ * $Date: 2002/03/05 21:57:01 $ */%><%@ page import="java.util.*, java.text.*, com.jivesoftware.util.*, com.jivesoftware.forum.*, com.jivesoftware.forum.gateway.*, com.jivesoftware.forum.util.*"%><%@ include file="global.jsp" %><%! // Global variables, methods, etc. // Default values for most fields:%><% // get parameters long forumID = ParamUtils.getLongParameter(request,"forum",-1L); boolean add = ParamUtils.getBooleanParameter(request,"add"); boolean advanced = ParamUtils.getBooleanParameter(request,"advanced"); boolean save = ParamUtils.getBooleanParameter(request,"save"); boolean createNew = ParamUtils.getBooleanParameter(request,"createNew"); boolean edit = ParamUtils.getBooleanParameter(request,"edit"); int index = ParamUtils.getIntParameter(request,"index",-1); String host = ParamUtils.getParameter(request,"host",true); String newsgroup = ParamUtils.getParameter(request,"newsgroup",true); String fromAddress = ParamUtils.getParameter(request,"fromAddress",true); // Go back to the gateways page if "cancel" is clicked: String submitButton = ParamUtils.getParameter(request,"submitButton"); if ("Cancel".equals(submitButton)) { response.sendRedirect("gateways.jsp?forum="+forumID); return; } // Get the Forum Forum forum = forumFactory.getForum(forumID); // Get a GatewayManager from the forum GatewayManager gatewayManager = forum.getGatewayManager(); // Save properties of the gateway (or create a new gateway, and set its // properties if (save) { NewsgroupGateway newsgroupGateway = null; NewsgroupImporter importer = null; NewsgroupExporter exporter = null; // create a new gateway if (createNew) { newsgroupGateway = new NewsgroupGateway(forumFactory, forum); gatewayManager.addGateway(newsgroupGateway); } else { // else, load the gateway newsgroupGateway = (NewsgroupGateway) gatewayManager.getGateway(index); } importer = (NewsgroupImporter) newsgroupGateway.getGatewayImporter(); exporter = (NewsgroupExporter) newsgroupGateway.getGatewayExporter(); if (host != null) { importer.setHost(host); exporter.setHost(host); } if (newsgroup != null) { importer.setNewsgroup(newsgroup); exporter.setNewsgroup(newsgroup); } if (fromAddress != null) { exporter.setDefaultFromAddress(fromAddress); } if (createNew) { // save the gateway gatewayManager.saveGateways(); } else { gatewayManager.removeGateway(index); gatewayManager.addGateway(newsgroupGateway, index); } // go back to the gateways page response.sendRedirect("gateways.jsp?forum="+forumID); return; } // if edit, then get the exisiting properties of the gateway from the // installed gateway if (edit) { NewsgroupGateway newsgroupGateway = (NewsgroupGateway) gatewayManager.getGateway(index); NewsgroupExporter exporter = (NewsgroupExporter) newsgroupGateway.getGatewayExporter(); host = exporter.getHost(); newsgroup = exporter.getNewsgroup(); fromAddress = exporter.getDefaultFromAddress(); }%><%@ include file="header.jsp" %><p><% // Title of this page and breadcrumbs String title = null; if (add) { title = "Add a Newsgroup Gateway"; } else { title = "Edit Newsgroup Gateway Settings"; } String[][] breadcrumbs = { {"Main", "main.jsp"}, {"Forums", "forums.jsp"}, {"Gateways", "gateways.jsp?forum="+forumID}, {title, "editNewsgroupGateway.jsp?forum="+forumID+"&add="+add+"&edit="+edit+"&index="+index} };%><%@ include file="title.jsp" %><font size="-1"><% if (add) { %>Add a newsgroup gateway using the forms below.<% } else { %>Edit the newsgroup gateway settings using the forms below.<% } %></font><p><form action="editNewsgroupGateway.jsp"><input type="hidden" name="forum" value="<%= forumID %>"><input type="hidden" name="save" value="true"><input type="hidden" name="add" value="<%= add %>"><input type="hidden" name="edit" value="<%= edit %>"><input type="hidden" name="index" value="<%= index %>"><% if (add) { %><input type="hidden" name="createNew" value="true"><% } %><font size="-1"><b>Incoming Newsgroup Settings</b></font><ul> <table cellpadding="3" cellspacing="0" border="0"> <tr> <td><font size="-1">Host:</font></td> <td><input type="text" name="host" value="<%= (host!=null)?host:"" %>" size="30" maxlength="100"></td> </tr> <tr> <td><font size="-1">Newsgroup:</font></td> <td><input type="text" name="newsgroup" value="<%= (newsgroup!=null)?newsgroup:"" %>" size="15" maxlength="100"></td> </tr> </table></ul><font size="-1"><b>Outgoing Newsgroup Settings</b></font><ul> <table cellpadding="3" cellspacing="0" border="0"> <tr> <td><font size="-1">Default "From" address:</font></td> <td><input type="text" name="fromAddress" value="<%= (fromAddress!=null)?fromAddress:"" %>" size="30" maxlength="100"></td> </tr> </table></ul><%--<font size="-1"> <b>Advanced Settings</b></font>--%><p><center><% if (add) { %><input type="submit" name="submitButton" value="Add Gateway"><% } else { %><input type="submit" name="submitButton" value="Save Settings"><% } %><input type="submit" name="submitButton" value="Cancel"></center></form><p><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?