<%-- - $Revision$ - $Date$ - - Copyright (C) 2004-2005 Jive Software. All rights reserved. - - This software is published under the terms of the GNU Public License (GPL), - a copy of which is included in this distribution. --%> <%@ page import="java.util.*, org.jivesoftware.util.*, org.jivesoftware.util.ParamUtils, org.jivesoftware.util.JiveGlobals" errorPage="error.jsp" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%! /** * Make sure the String can wrap at 80 chars. * * @param str the string. * @return a wrappable string. */ String wrappableString(String str) { if (str.length() <= 60) { return str; } int count = 0; StringBuffer buf = new StringBuffer(); char [] strChars = str.toCharArray(); for (int i=0; i= 60) { buf.append(" "); count = 0; } } return buf.toString(); } %> <% String propName = ParamUtils.getParameter(request,"propName"); String propValue = ParamUtils.getParameter(request,"propValue",true); boolean edit = ParamUtils.getBooleanParameter(request,"edit"); boolean save = request.getParameter("save") != null; boolean delete = ParamUtils.getBooleanParameter(request,"del"); if (request.getParameter("cancel") != null) { response.sendRedirect("server-properties.jsp"); return; } if (delete) { if (propName != null) { JiveGlobals.deleteProperty(propName); response.sendRedirect("server-properties.jsp?deletesuccess=true"); return; } } Map errors = new HashMap(); if (save) { if (propName == null || "".equals(propName.trim())) { errors.put("propName",""); } if (propValue == null) { errors.put("propValue",""); } else if (propValue.length() > 4000) { errors.put("propValueLength",""); } if (errors.size() == 0) { JiveGlobals.setProperty(propName, propValue); response.sendRedirect("server-properties.jsp?success=true"); return; } } List properties = JiveGlobals.getPropertyNames(); Collections.sort(properties, new Comparator() { public int compare(Object o1, Object o2) { String s1 = (String)o1; String s2 = (String)o2; return s1.toLowerCase().compareTo(s2.toLowerCase()); } }); if (edit) { propValue = JiveGlobals.getProperty(propName); } %> <fmt:message key="server.properties.title"/>

<% if (errors.size() > 0) { %>

<% } else if ("true".equals(request.getParameter("success"))) { %>

<% } else if ("true".equals(request.getParameter("deletesuccess"))) { %>

<% } %> <% if (edit) { %>

<% } %> <% if (request.getParameter("delerror") != null) { %>

<% } %>
<% if (properties.size() == 0) { %> <% } %> <% for (int i=0; i"); %> "> <% } %>
<%= StringUtils.escapeHTMLTags(n) %>
<% if (n.indexOf("passwd") > -1 || n.indexOf("password") > -1 || n.indexOf("cookieKey") > -1) { %> hidden <% } else { %> "><%= ("".equals(v) ? " " : v) %> <% } %>
');" ><fmt:message key=" border="0"> ');" ><fmt:message key=" border="0">


<% if (edit) { %> <% } else { %> <% } %>
: <% if (edit) { %> <%= StringUtils.escapeHTMLTags(propName) %> <% } else { %> "> <% if (errors.containsKey("propName")) { %>
<% } %> <% } %>
: <% if (errors.containsKey("propValue")) { %>
<% } else if (errors.containsKey("propValueLength")) { %>
<% } %>
"> ">