alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<td width="100%" nowrap> <a class="nav" href="<%=indexUrl%>"> »  <a class="nav" href="index">Admin CP »  <a class="nav" href="configindex">Config mvnForum »  Config mvnForum - Step 3 </td> </tr> </table> <br/> <form action="configstepthreeprocess" method="post" name="submitform"> <table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center"> <tr class="theader"> <td colspan="2">Configuration Step 3 - Database Configuration </tr> <tr class="trow1"> <td>use_datasource * <td> <select name="use_datasource" onChange="javascript:OnChangeUseDatasource();"> <% String use_datasource = conf.getString("dboptions.use_datasource", ""); String[] arr = {"true", "false"}; for (int i = 0; i < arr.length; i++) { if (arr[i].equals(use_datasource)) { %> <option value=<%=arr[i]%> selected><%=arr[i]%> <%} else { %> <option value=<%=arr[i]%>><%=arr[i]%> <%} } %> </select> </td> </tr> <tr class="trow2" id="id_database_type" style="display: none;"> <td>database_type * <td> <select name="database_type"> <% String database_type = conf.getString("dboptions.database_type", "");%> <option value=0 <%= (database_type.equals("0")) ? "selected" : "" %>>Default (Auto detect) <option value=2 <%= (database_type.equals("2")) ? "selected" : "" %>>Database/Driver doesn't support scrollable Resultset </select> </td> </tr> <tr class="trow1" id="id_driver_class_name" style="display: none;"> <td>driver_class_name * <td>"> </tr> <tr class="trow2" id="id_database_url" style="display: none;"> <td>database_url * <td>"> </tr> <tr class="trow1" id="id_database_user" style="display: none;"> <td>database_user * <td>"> </tr> <tr class="trow2" id="id_database_password" style="display: none;"> <td>database_password <td>"> </tr> <tr class="trow1" id="id_max_connection" style="display: none;"> <td>max_connection * <td>"> </tr> <tr class="trow2" id="id_max_time_to_wait" style="display: none;"> <td>max_time_to_wait * <td>"> </tr> <tr class="trow1" id="id_minutes_between_refresh" style="display: none;"> <td>minutes_between_refresh * <td>"> </tr> <tr class="trow2" id="id_datasource_name" style="display: none;"> <td>datasource_name <td>"> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - Mail Options </tr> <tr class="trow1"> <td>mail_server * <td>"> </tr> <tr class="trow2"> <td>default_mail_from * <td>"> </tr> <tr class="trow1"> <td>username <td>"> </tr> <tr class="trow2"> <td>password <td>"> </tr> <tr class="trow1"> <td>port * <td>"> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - Parameter Options </tr> <tr class="trow1"> <td>context_path <td> <input type="text" size="60" name="context_path" value="<%=conf.getString("paramoptions.context_path", "")%>">
Auto detect: <b><%= request.getContextPath() %> </td> </tr> <tr class="trow2"> <td>server_path * <td> <input type="text" size="60" name="server_path" value="<%=conf.getString("paramoptions.server_path", "")%>">
Auto detect (method 1): <b><%= ParamUtil.getServer(request) %>
Auto detect (method 2): <b><%= ParamUtil.getServer2(request) %> </td> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - Date options </tr> <tr class="trow1"> <td>server_hour_offset * <td> <input type="text" size="60" name="server_hour_offset" value="<%=conf.getString("dateoptions.server_hour_offset", "0")%>"> <br/>Auto detect: <%= java.util.TimeZone.getDefault().getRawOffset() / DateUtil.HOUR %> </td> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - User Agent Options </tr> <tr class="trow1"> <td>blocked_user_agent <td> <input type="text" size="60" name="blocked_user_agent" value="<%=conf.getString("useragentoptions.blocked_user_agent", "")%>"> </td> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - IP Options </tr> <tr class="trow1"> <td>blocked_ip <td> <input type="text" size="60" name="blocked_ip" value="<%=conf.getString("ipoptions.blocked_ip", "")%>"> </td> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - Core Options </tr> <tr class="trow1"> <td>enable_link_nofollow * <td> <select name="enable_link_nofollow"> <% String enable_link_nofollow = conf.getString("mvncoreconfig.enable_link_nofollow", "");%> <option value="true" <%if ( "true".equals(enable_link_nofollow) ) { %> selected <% } %> >true <option value="false" <%if ( "false".equals(enable_link_nofollow) ) { %> selected <% } %>>false </select> </td> </tr> <tr class="theader"> <td colspan="2">Configuration Step 3 - Interceptor Options </tr> <tr class="trow1"> <td>mailinterceptor_implementation <td> <input type="text" size="60" name="mailinterceptor_implementation" value="<%=conf.getString("interceptor.mailinterceptor_implementation", "")%>"> </td> </tr> <tr class="trow2"> <td>contentinterceptor_implementation <td> <input type="text" size="60" name="contentinterceptor_implementation" value="<%=conf.getString("interceptor.contentinterceptor_implementation", "")%>"> </td> </tr> <tr class="trow1"> <td>loginidinterceptor_implementation <td> <input type="text" size="60" name="loginidinterceptor_implementation" value="<%=conf.getString("interceptor.loginidinterceptor_implementation", "")%>"> </td> </tr> <tr class="trowfinal"> <td colspan="2" align="center"> <input type="button" name="submitbutton" value="Update Configuration" onclick="javascript:SubmitForm();" class="mainoption"> <input type="button" value="Cancel" class="liteoption" onclick="javascript:gotoPage('configindex');"> </td> </tr> </table> </form> <br/> <script language="JavaScript" type="text/javascript"> <!-- OnChangeUseDatasource(); //--> </script> </fmt:bundle> <%@ include file="footer.jsp"%> </body> </html>

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/admin/configstepthree.jsp,v 1.6 2005/02/15 19:30:22 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.6 $
 - $Date: 2005/02/15 19:30:22 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.io.File" %>
<%@ page import="java.util.Locale" %>
<%@ page import="net.myvietnam.mvncore.util.*" %>
<%@ page import="net.myvietnam.mvncore.configuration.DOM4JConfiguration" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html>
<head>
  <title> - Config mvnForum - Step 3
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="inc_js_checkvalid_myvietnamlib.jsp"%>

<script type="text/javascript">
function SubmitForm() {
  if (ValidateForm() == true ) {
    document.submitform.submitbutton.disabled = true;
    document.submitform.submit();
  }
}

function ValidateForm() {
  if (document.submitform.use_datasource.options[document.submitform.use_datasource.selectedIndex].value == "false") {
    if (isBlank(document.submitform.database_type, "database_type")) return false;
    if (isBlank(document.submitform.driver_class_name, "driver_class_name")) return false;
    if (isBlank(document.submitform.database_url, "database_url")) return false;
    if (isBlank(document.submitform.database_user, "database_user")) return false;
    if (!isUnsignedInteger(document.submitform.max_connection, "max_connection")) return false;
    if (!isUnsignedInteger(document.submitform.max_time_to_wait, "max_time_to_wait")) return false;
    if (!isUnsignedInteger(document.submitform.minutes_between_refresh, "minutes_between_refresh")) return false;
  } else {
    if (isBlank(document.submitform.datasource_name, "datasource_name")) return false;
  }

  if (isBlank(document.submitform.mail_server, "mail_server")) return false;
  if (isBlank(document.submitform.default_mail_from, "default_mail_from")) return false;
  if (!isEmail(document.submitform.default_mail_from, "default_mail_from")) return false;
  if (!isUnsignedInteger(document.submitform.port, "port")) return false;

  if (isBlank(document.submitform.server_path, "server_path")) return false;
  if (isBlank(document.submitform.server_hour_offset, "server_hour_offset")) return false;
  //if (!isUnsignedInteger(document.submitform.server_hour_offset, "server_hour_offset")) return false;
  return true;
}
function OnChangeUseDatasource() {
  if (document.submitform.use_datasource.options[document.submitform.use_datasource.selectedIndex].value == "false") {
    document.getElementById("id_database_type").style.display = '';
    document.getElementById("id_driver_class_name").style.display = '';
    document.getElementById("id_database_url").style.display = '';
    document.getElementById("id_database_user").style.display = '';
    document.getElementById("id_database_password").style.display = '';
    document.getElementById("id_max_connection").style.display = '';
    document.getElementById("id_max_time_to_wait").style.display = '';
    document.getElementById("id_minutes_between_refresh").style.display = '';
    document.getElementById("id_datasource_name").style.display = 'none';
  } else {
    document.getElementById("id_database_type").style.display = 'none';
    document.getElementById("id_driver_class_name").style.display = 'none';
    document.getElementById("id_database_url").style.display = 'none';
    document.getElementById("id_database_user").style.display = 'none';
    document.getElementById("id_database_password").style.display = 'none';
    document.getElementById("id_max_connection").style.display = 'none';
    document.getElementById("id_max_time_to_wait").style.display = 'none';
    document.getElementById("id_minutes_between_refresh").style.display = 'none';
    document.getElementById("id_datasource_name").style.display = '';
  }
}
</script>

<%@ include file="header.jsp"%>
<br/>
<%
  String strPathName = FileUtil.getServletClassesPath();
  String configFilename = strPathName + "mvncore.xml";
  DOM4JConfiguration conf = new DOM4JConfiguration(new File(configFilename));
%>

<table width="95%" align="center">
  <tr class="nav">
    <td>
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.