Remove obsolete AXIS-related code. Remove files related to the mocked up temporary-login page.

This commit is contained in:
j2blake 2011-05-02 16:32:42 +00:00
parent 0e376ae2a9
commit 5c71b5984d
14 changed files with 0 additions and 3155 deletions

View file

@ -34,10 +34,6 @@ webapp/src/edu/cornell/mannlib/vitro/webapp/utils/JSONtoFmModel.java
webapp/web/js/tiny_mce/* webapp/web/js/tiny_mce/*
webapp/web/js/tiny_mce/**/* webapp/web/js/tiny_mce/**/*
# See /doc/3rd-party-licenses.txt for LICENSE file
webapp/web/admin/axis/SOAPMonitorApplet.java
services/additions/admin/axis/SOAPMonitorApplet.java
# See /doc/3rd-party-licenses.txt for LICENSE file # See /doc/3rd-party-licenses.txt for LICENSE file
webapp/web/js/jquery.js webapp/web/js/jquery.js
webapp/web/js/jquery-ui/* webapp/web/js/jquery-ui/*

File diff suppressed because it is too large Load diff

View file

@ -1,114 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<html>
<%@ page contentType="text/html; charset=utf-8" %>
<%
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
%>
<%@ include file="i18nLib.jsp" %>
<%
// initialize a private HttpServletRequest
setRequest(request);
// set a resouce base
setResouceBase("i18n");
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Apache-Axis</title>
</head>
<body bgcolor="#FFFFFF">
<h1 align="center">Apache-AXIS</h1>
<%= getLocaleChoice() %>
<%
out.print(getMessage("welcomeMessage")+"<p/>");
out.print(getMessage("operationType"));
%>
<ul>
<li>
<%
out.print("<a href=\""+ getMessage("validationURL") +"\">");
out.print(getMessage("validation") +"</a> - ");
out.print(getMessage("validationFootnote00") +"<br>");
out.print("<i>"+ getMessage("validationFootnote01") +"</i>");
%>
</li>
<li>
<%
out.print("<a href=\""+ getMessage("serviceListURL") +"\">");
out.print(getMessage("serviceList") +"</a> - ");
out.print(getMessage("serviceListFootnote"));
%>
</li>
<li>
<%
out.print("<a href=\""+ getMessage("callAnEndpointURL") +"\">");
out.print(getMessage("callAnEndpoint") +"</a> - ");
out.print(getMessage("callAnEndpointFootnote00") +" ");
out.print(getMessage("callAnEndpointFootnote01"));
%>
</li>
<li>
<%
out.print("<a href=\""+ getMessage("visitURL") +"\">");
out.print(getMessage("visit") +"</a> - ");
out.print(getMessage("visitFootnote"));
%>
</li>
<li>
<%
out.print("<a href=\""+ getMessage("adminURL") +"\">");
out.print(getMessage("admin") +"</a> - ");
out.print(getMessage("adminFootnote"));
%>
</li>
<li>
<%
out.print("<a href=\""+ getMessage("soapMonitorURL") +"\">");
out.print(getMessage("soapMonitor") +"</a> - ");
out.print(getMessage("soapMonitorFootnote"));
%>
</li>
</ul>
<%
out.print(getMessage("sideNote") +"<p/>");
%>
<%
out.print("<h3>"+ getMessage("validatingAxis") +"</h3>");
out.print(getMessage("validationNote00") +"<p/>");
out.print(getMessage("validationNote01"));
%>
</body>
</html>

View file

@ -1,274 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="java.io.File,
java.io.IOException,
java.util.Date"
session="false" %>
<html>
<head>
<title>System Fingerprint</title>
</head>
<body bgcolor=#ffffff>
<%!
/*
* Fingerprint the users system. This is mainly for use in
* diagnosing classpath problems. It is intended to dump out
* a copy of the environment this webapp is running in,
* and additionally attempt to identify versions of each jar
* in the classpath.
*
* @author Brian Ewins
*/
private java.util.Properties versionProps=new java.util.Properties();
/**
* Identify the version of a jar file. This uses a properties file
* containing known names and sizes in the format
* 'name(size)=version'. Version strings should be like 'xerces-1.4'
* ie they should include the name of the library.
*/
public String getFileVersion(File file) throws IOException {
String key="<td>"+file.getName()+"</td>";
key+= "<td>"+file.length()+"</td>";
Date timestamp=new Date(file.lastModified());
key+= "<td>"+timestamp.toString()+"</td>";
return key;
/* TODO: implement
String value=versionProps.getProperty(key);
if (value==null) {
// make it possible to have jars without version nos
value=versionProps.getProperty(file.getName());
}
if (value==null) {
// fall back on something obvious
value=key;
Date timestamp=new Date(file.lastModified());
value+=" / "+timestamp.toString();
}
return value;
*/
}
/**
* Split up a classpath-like variable. Returns a list of files.
* TODO: this can't cope with relative paths. I think theres code in BCEL that
* can be used for this?
*/
File[] splitClasspath(String path) throws IOException {
java.util.StringTokenizer st=
new java.util.StringTokenizer(path,
System.getProperty("path.separator"));
int toks=st.countTokens();
File[] files=new File[toks];
for(int i=0;i<toks;i++) {
files[i]=new File(st.nextToken());
}
return files;
}
/** given a list of files, return a list of jars which actually exist */
File[] scanFiles(File[] files) throws IOException {
File[] jars=new File[files.length];
int found=0;
for (int i=0; i<files.length; i++) {
if (files[i].getName().toLowerCase().endsWith(".jar")
&& files[i].exists()) {
jars[found]=files[i];
found++;
}
}
if (found<files.length) {
File[] temp=new File[found];
System.arraycopy(jars,0,temp,0,found);
jars=temp;
}
return jars;
}
private static final File[] NO_FILES=new File[0];
/** scan a directory for jars */
public File[] scanDir(String dir) throws IOException
{
if(dir==null) {
return NO_FILES;
}
return scanDir(new File(dir));
}
public File[] scanDir(File dir) throws IOException {
if (!dir.exists() || !dir.isDirectory()) {
return NO_FILES;
}
return scanFiles(dir.listFiles());
}
/** scan a classpath for jars */
public File[] scanClasspath(String path) throws IOException {
if (path==null) {
return NO_FILES;
}
return scanFiles(splitClasspath(path));
}
/**
* scan a 'dirpath' (like the java.ext.dirs system property) for jars
*/
public File[] scanDirpath(String path) throws IOException {
if (path==null) {
return NO_FILES;
}
File[] current=new File[0];
File[] dirs=splitClasspath(path);
for(int i=0; i<dirs.length; i++) {
File[] jars=scanDir(dirs[i]);
File[] temp=new File[current.length+jars.length];
System.arraycopy(current,0,temp,0,current.length);
System.arraycopy(jars,0,temp,current.length,jars.length);
current=temp;
}
return scanFiles(current);
}
/** print out the jar versions for a directory */
public void listDirectory(String title, JspWriter out,String dir, String comment) throws IOException {
listVersions(title, out,scanDir(dir), comment);
}
/** print out the jar versions for a directory-like system property */
public void listDirProperty(String title, JspWriter out,String key, String comment) throws IOException {
listVersions(title, out,scanDir(System.getProperty(key)), comment);
}
/** print out the jar versions for a classpath-like system property */
public void listClasspathProperty(String title, JspWriter out,String key, String comment) throws IOException {
listVersions(title, out,scanClasspath(System.getProperty(key)), comment);
}
/** print out the jar versions for a 'java.ext.dirs'-like system property */
public void listDirpathProperty(String title, JspWriter out,String key, String comment) throws IOException {
listVersions(title, out,scanDirpath(System.getProperty(key)), comment);
}
/** print out the jar versions for a context-relative directory */
public void listContextPath(String title, JspWriter out, String path, String comment) throws IOException {
listVersions(title, out,scanDir(getServletConfig().getServletContext().getRealPath(path)), comment);
}
/** print out the jar versions for a given list of files */
public void listVersions(String title, JspWriter out,File[] jars, String comment) throws IOException {
out.print("<h2>");
out.print(title);
out.println("</h2>");
out.println("<table>");
for (int i=0; i<jars.length; i++) {
out.println("<tr>"+getFileVersion(jars[i])+"</tr>");
}
out.println("</table>");
if(comment!=null && comment.length()>0) {
out.println("<p>");
out.println(comment);
out.println("<p>");
}
}
%>
<h1>System Fingerprint</h1>
<h2>JVM and Server Version</h2>
<table>
<tr>
<td>Servlet Engine</td>
<td><%= getServletConfig().getServletContext().getServerInfo() %></td>
<td><%= getServletConfig().getServletContext().getMajorVersion() %></td>
<td><%= getServletConfig().getServletContext().getMinorVersion() %></td>
</tr>
<tr>
<td>Java VM</td>
<td><%= System.getProperty("java.vm.vendor") %></td>
<td><%= System.getProperty("java.vm.name") %></td>
<td><%= System.getProperty("java.vm.version") %></td>
</tr>
<tr>
<td>Java RE</td>
<td><%= System.getProperty("java.vendor") %></td>
<td><%= System.getProperty("java.version") %></td>
<td> </td>
</tr>
<tr>
<td>Platform</td>
<td><%= System.getProperty("os.name") %></td>
<td><%= System.getProperty("os.arch") %></td>
<td><%= System.getProperty("os.version") %></td>
</tr>
</table>
<%
listClasspathProperty("Boot jars", out,"sun.boot.class.path", "Only valid on a sun jvm");
listClasspathProperty("System jars", out,"java.class.path", null);
listDirpathProperty("Extra system jars", out,"java.ext.dirs", null);
listContextPath("Webapp jars", out, "/WEB-INF/lib", null);
// identify the container...
String container=getServletConfig().getServletContext().getServerInfo();
if (container.startsWith("Tomcat Web Server/3.2")) {
String home=System.getProperty("tomcat.home");
if(home!=null) {
listDirectory("Tomcat 3.2 Common Jars", out,
home+File.separator
+"lib",
null);
}
} else if (container.startsWith("Tomcat Web Server/3.3")) {
String home=System.getProperty("tomcat.home");
if(home!=null) {
listDirectory("Tomcat 3.3 Container Jars", out,
home+File.separator
+"lib"+File.separator
+"container",
null);
listDirectory("Tomcat 3.3 Common Jars", out,
home+File.separator
+"lib"+File.separator
+"common",
null);
}
} else if (container.startsWith("Apache Tomcat/4.0")) {
//handle catalina common dir
String home=System.getProperty("catalina.home");
if(home!=null) {
listDirectory("Tomcat 4.0 Common Jars", out,
home+File.separator
+"common"+File.separator
+"lib",
null);
}
} else if (container.startsWith("Apache Tomcat/4.1")) {
//handle catalina common dir
String home=System.getProperty("catalina.home");
if(home!=null) {
listDirectory("Tomcat 4.1 Common Jars", out,
home+File.separator
+"shared"+File.separator
+"lib",
null);
}
} else if (System.getProperty("resin.home")!=null) {
String home=System.getProperty("resin.home");
if(home!=null) {
listDirectory("Resin Common Jars", out,
home+File.separator
+"lib",
null);
}
} else if (System.getProperty("weblogic.httpd.servlet.classpath")!=null) {
listClasspathProperty("Weblogic Servlet Jars", out,
"weblogic.httpd.servlet.classpath",
null);
} else {
//TODO: identify more servlet engine classpaths.
}
%>
</body>
</html>

View file

@ -1,493 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<html>
<%@ page contentType="text/html; charset=utf-8"
import="java.io.InputStream,
java.io.IOException,
javax.xml.parsers.SAXParser,
java.lang.reflect.*,
javax.xml.parsers.SAXParserFactory"
session="false" %>
<%
/*
* Copyright 2002,2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
%>
<%!
/*
* Happiness tests for axis. These look at the classpath and warn if things
* are missing. Normally addng this much code in a JSP page is mad
* but here we want to validate JSP compilation too, and have a drop-in
* page for easy re-use
* @author Steve 'configuration problems' Loughran
* @author dims
* @author Brian Ewins
*/
/**
* test for a class existing
* @param classname
* @return class iff present
*/
Class classExists(String classname) {
try {
return Class.forName(classname);
} catch (ClassNotFoundException e) {
return null;
}
}
/**
* test for resource on the classpath
* @param resource
* @return true iff present
*/
boolean resourceExists(String resource) {
boolean found;
InputStream instream=this.getClass().getResourceAsStream(resource);
found=instream!=null;
if(instream!=null) {
try {
instream.close();
} catch (IOException e) {
}
}
return found;
}
/**
* probe for a class, print an error message is missing
* @param out stream to print stuff
* @param category text like "warning" or "error"
* @param classname class to look for
* @param jarFile where this class comes from
* @param errorText extra error text
* @param homePage where to d/l the library
* @return the number of missing classes
* @throws IOException
*/
int probeClass(JspWriter out,
String category,
String classname,
String jarFile,
String description,
String errorText,
String homePage) throws IOException {
try {
Class clazz = classExists(classname);
if(clazz == null) {
String url="";
if(homePage!=null) {
url=getMessage("seeHomepage",homePage,homePage);
}
out.write(getMessage("couldNotFound",category,classname,jarFile,errorText,url));
return 1;
} else {
String location = getLocation(out, clazz);
if(location == null) {
out.write("<li>"+getMessage("foundClass00",description,classname)+"</li><br>");
}
else {
out.write("<li>"+getMessage("foundClass01",description,classname,location)+"</li><br>");
}
return 0;
}
} catch(NoClassDefFoundError ncdfe) {
String url="";
if(homePage!=null) {
url=getMessage("seeHomepage",homePage,homePage);
}
out.write(getMessage("couldNotFoundDep",category, classname, errorText, url));
out.write(getMessage("theRootCause",ncdfe.getMessage(), classname));
return 1;
}
}
/**
* get the location of a class
* @param out
* @param clazz
* @return the jar file or path where a class was found
*/
String getLocation(JspWriter out,
Class clazz) {
try {
java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
String location = url.toString();
if(location.startsWith("jar")) {
url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL();
location = url.toString();
}
if(location.startsWith("file")) {
java.io.File file = new java.io.File(url.getFile());
return file.getAbsolutePath();
} else {
return url.toString();
}
} catch (Throwable t){
}
return getMessage("classFoundError");
}
/**
* a class we need if a class is missing
* @param out stream to print stuff
* @param classname class to look for
* @param jarFile where this class comes from
* @param errorText extra error text
* @param homePage where to d/l the library
* @throws IOException when needed
* @return the number of missing libraries (0 or 1)
*/
int needClass(JspWriter out,
String classname,
String jarFile,
String description,
String errorText,
String homePage) throws IOException {
return probeClass(out,
"<b>"+getMessage("error")+"</b>",
classname,
jarFile,
description,
errorText,
homePage);
}
/**
* print warning message if a class is missing
* @param out stream to print stuff
* @param classname class to look for
* @param jarFile where this class comes from
* @param errorText extra error text
* @param homePage where to d/l the library
* @throws IOException when needed
* @return the number of missing libraries (0 or 1)
*/
int wantClass(JspWriter out,
String classname,
String jarFile,
String description,
String errorText,
String homePage) throws IOException {
return probeClass(out,
"<b>"+getMessage("warning")+"</b>",
classname,
jarFile,
description,
errorText,
homePage);
}
/**
* get servlet version string
*
*/
public String getServletVersion() {
ServletContext context=getServletConfig().getServletContext();
int major = context.getMajorVersion();
int minor = context.getMinorVersion();
return Integer.toString(major) + '.' + Integer.toString(minor);
}
/**
* what parser are we using.
* @return the classname of the parser
*/
private String getParserName() {
SAXParser saxParser = getSAXParser();
if (saxParser == null) {
return getMessage("couldNotCreateParser");
}
// check to what is in the classname
String saxParserName = saxParser.getClass().getName();
return saxParserName;
}
/**
* Create a JAXP SAXParser
* @return parser or null for trouble
*/
private SAXParser getSAXParser() {
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
if (saxParserFactory == null) {
return null;
}
SAXParser saxParser = null;
try {
saxParser = saxParserFactory.newSAXParser();
} catch (Exception e) {
}
return saxParser;
}
/**
* get the location of the parser
* @return path or null for trouble in tracking it down
*/
private String getParserLocation(JspWriter out) {
SAXParser saxParser = getSAXParser();
if (saxParser == null) {
return null;
}
String location = getLocation(out,saxParser.getClass());
return location;
}
/**
* Check if class implements specified interface.
* @param Class clazz
* @param String interface name
* @return boolean
*/
private boolean implementsInterface(Class clazz, String interfaceName) {
if (clazz == null) {
return false;
}
Class[] interfaces = clazz.getInterfaces();
if (interfaces.length != 0) {
for (int i = 0; i < interfaces.length; i++) {
if (interfaces[i].getName().equals(interfaceName)) {
return true;
}
}
}
return false;
}
%>
<%@ include file="i18nLib.jsp" %>
<%
// initialize a private HttpServletRequest
setRequest(request);
// set a resouce base
setResouceBase("i18n");
%>
<head>
<title><%= getMessage("pageTitle") %></title>
</head>
<body bgcolor='#ffffff'>
<%
out.print("<h1>"+ getMessage("pageTitle") +"</h1>");
out.print("<h2>"+ getMessage("pageRole") +"</h2><p/>");
%>
<%= getLocaleChoice() %>
<%
out.print("<h3>"+ getMessage("neededComponents") +"</h3>");
%>
<UL>
<%
int needed=0,wanted=0;
/**
* the essentials, without these Axis is not going to work
*/
// need to check if the available version of SAAJ API meets requirements
String className = "javax.xml.soap.SOAPPart";
String interfaceName = "org.w3c.dom.Document";
Class clazz = classExists(className);
if (clazz == null || implementsInterface(clazz, interfaceName)) {
needed = needClass(out, "javax.xml.soap.SOAPMessage",
"saaj.jar",
"SAAJ API",
getMessage("criticalErrorMessage"),
"http://ws.apache.org/axis/");
} else {
String location = getLocation(out, clazz);
out.print(getMessage("invalidSAAJ",location));
out.print(getMessage("criticalErrorMessage"));
out.print(getMessage("seeHomepage","http://ws.apache.org/axis/java/install.html",getMessage("axisInstallation")));
out.print("<br>");
}
needed+=needClass(out, "javax.xml.rpc.Service",
"jaxrpc.jar",
"JAX-RPC API",
getMessage("criticalErrorMessage"),
"http://ws.apache.org/axis/");
needed+=needClass(out, "org.apache.axis.transport.http.AxisServlet",
"axis.jar",
"Apache-Axis",
getMessage("criticalErrorMessage"),
"http://ws.apache.org/axis/");
needed+=needClass(out, "org.apache.commons.discovery.Resource",
"commons-discovery.jar",
"Jakarta-Commons Discovery",
getMessage("criticalErrorMessage"),
"http://jakarta.apache.org/commons/discovery/");
needed+=needClass(out, "org.apache.commons.logging.Log",
"commons-logging.jar",
"Jakarta-Commons Logging",
getMessage("criticalErrorMessage"),
"http://jakarta.apache.org/commons/logging/");
needed+=needClass(out, "org.apache.log4j.Layout",
"log4j-1.2.8.jar",
"Log4j",
getMessage("uncertainErrorMessage"),
"http://jakarta.apache.org/log4j");
//should we search for a javax.wsdl file here, to hint that it needs
//to go into an approved directory? because we dont seem to need to do that.
needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl",
"wsdl4j.jar",
"IBM's WSDL4Java",
getMessage("criticalErrorMessage"),
null);
needed+=needClass(out, "javax.xml.parsers.SAXParserFactory",
"xerces.jar",
"JAXP implementation",
getMessage("criticalErrorMessage"),
"http://xml.apache.org/xerces-j/");
needed+=needClass(out,"javax.activation.DataHandler",
"activation.jar",
"Activation API",
getMessage("criticalErrorMessage"),
"http://java.sun.com/products/javabeans/glasgow/jaf.html");
%>
</UL>
<%
out.print("<h3>"+ getMessage("optionalComponents") +"</h3>");
%>
<UL>
<%
/*
* now the stuff we can live without
*/
wanted+=wantClass(out,"javax.mail.internet.MimeMessage",
"mail.jar",
"Mail API",
getMessage("attachmentsError"),
"http://java.sun.com/products/javamail/");
wanted+=wantClass(out,"org.apache.xml.security.Init",
"xmlsec.jar",
"XML Security API",
getMessage("xmlSecurityError"),
"http://xml.apache.org/security/");
wanted += wantClass(out, "javax.net.ssl.SSLSocketFactory",
"jsse.jar or java1.4+ runtime",
"Java Secure Socket Extension",
getMessage("httpsError"),
"http://java.sun.com/products/jsse/");
/*
* resources on the classpath path
*/
/* add more libraries here */
%>
</UL>
<%
out.write("<h3>");
//is everythng we need here
if(needed==0) {
//yes, be happy
out.write(getMessage("happyResult00"));
} else {
//no, be very unhappy
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
out.write(getMessage("unhappyResult00",Integer.toString(needed)));
}
//now look at wanted stuff
if(wanted>0) {
out.write(getMessage("unhappyResult01",Integer.toString(wanted)));
} else {
out.write(getMessage("happyResult01"));
}
out.write("</h3>");
%>
<UL>
<%
//hint if anything is missing
if(needed>0 || wanted>0 ) {
out.write(getMessage("hintString"));
}
out.write(getMessage("noteString"));
%>
</UL>
<h2><%= getMessage("apsExamining") %></h2>
<UL>
<%
String servletVersion=getServletVersion();
String xmlParser=getParserName();
String xmlParserLocation = getParserLocation(out);
%>
<table border="1" cellpadding="10">
<tr><td>Servlet version</td><td><%= servletVersion %></td></tr>
<tr><td>XML Parser</td><td><%= xmlParser %></td></tr>
<tr><td>XML ParserLocation</td><td><%= xmlParserLocation %></td></tr>
</table>
</UL>
<% if(xmlParser.indexOf("crimson")>=0) { %>
<p>
<%= getMessage("recommendedParser") %>
</p>
<% } %>
<h2><%= getMessage("sysExamining") %></h2>
<UL>
<%
/**
* Dump the system properties
*/
java.util.Enumeration e=null;
try {
e= System.getProperties().propertyNames();
} catch (SecurityException se) {
}
if(e!=null) {
out.write("<pre>");
for (;e.hasMoreElements();) {
String key = (String) e.nextElement();
out.write(key + "=" + System.getProperty(key)+"\n");
}
out.write("</pre><p>");
} else {
out.write(getMessage("sysPropError"));
}
%>
</UL>
<hr>
<%= getMessage("apsPlatform") %>:
<%= getServletConfig().getServletContext().getServerInfo() %>
</body>
</html>

View file

@ -1,223 +0,0 @@
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
<%@ page import="java.util.*" %>
<%
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
%>
<%!
/*
* A library file to produce i18n web applications. This can be easily
* reused from your jsp(s) - just include and call any methods.
* @author toshi
*/
// private variable
HttpServletRequest _req = null;
// private variable
String _strResourceName = null;
/**
* Set a HttpServletRequest to a private variable.
* @param request HttpServletRequest
*/
void setRequest(HttpServletRequest request) {
_req = request;
}
/**
* Get the private variable of the HttpServletRequest.
* @return HttpServletRequest
*/
HttpServletRequest getRequest() {
return _req;
}
/**
* Set a resouce base name to a private variable.
* @param resouce The resouce base name
*/
void setResouceBase(String resource) {
_strResourceName = resource;
}
/**
* Get the private variable of the resouce base name.
* @return resouce The resouce base name
*/
String getResouceBase() {
return _strResourceName;
}
/**
* Get a ResourceBundle object.
* @return a ResourceBundle object
*/
ResourceBundle getRB() {
String strLocale = getRequest().getParameter("locale");
ResourceBundle objRb = null;
Locale objLcl = null;
if (strLocale!=null) {
objLcl=new Locale(strLocale,"");
} else {
objLcl=getRequest().getLocale();
}
Locale.setDefault(objLcl);
objRb = ResourceBundle.getBundle(getResouceBase(),objLcl);
return objRb;
}
/**
* Get a list of locale choice
* @return a list of supported locales
*/
String getLocaleChoice() {
String choice = getMessage("locales");
StringBuffer buf = new StringBuffer();
buf.append("<div align=\"right\">\n");
buf.append(getMessage("language"));
buf.append(": ");
StringTokenizer st = new StringTokenizer(choice);
String locale = null;
while (st.hasMoreTokens()) {
locale = st.nextToken();
buf.append("[<a href=\"?locale="+ locale +"\">"+ locale +"</a>] ");
}
buf.append("\n</div>\n");
return buf.toString();
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @return The formatted message
*/
String getMessage(String key) {
return getMessage(key, null, null, null, null, null);
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @return The formatted message
*/
String getMessage(String key, String arg0) {
return getMessage(key, arg0, null, null, null, null);
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @return The formatted message
*/
String getMessage(String key, String arg0, String arg1) {
return getMessage(key, arg0, arg1, null, null, null);
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @return The formatted message
*/
String getMessage(String key, String arg0, String arg1, String arg2) {
return getMessage(key, arg0, arg1, arg2, null, null);
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @param arg3 The argument to place in variable {3}
* @return The formatted message
*/
String getMessage(String key, String arg0, String arg1,
String arg2, String arg3) {
return getMessage(key, arg0, arg1, arg2, arg3, null);
}
/**
* Get a message from i18n.properties with several arguments.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @param arg3 The argument to place in variable {3}
* @param arg4 The argument to place in variable {4}
* @return The formatted message
*/
String getMessage(String key, String arg0, String arg1,
String arg2, String arg3, String arg4) {
String strPattern = getRB().getString(key);
String [] params = { arg0, arg1, arg2, arg3, arg4 };
for (int i=0; i<5; i++) {
if (params[i]!=null) params[i]=replaceAll(params[i],"%20"," ");
}
if (arg0!=null) strPattern = replaceAll(strPattern,"{0}",params[0]);
if (arg1!=null) strPattern = replaceAll(strPattern,"{1}",params[1]);
if (arg2!=null) strPattern = replaceAll(strPattern,"{2}",params[2]);
if (arg3!=null) strPattern = replaceAll(strPattern,"{3}",params[3]);
if (arg4!=null) strPattern = replaceAll(strPattern,"{4}",params[4]);
return strPattern;
}
/**
* Get a replaced string by the specified message.
* @param source The original message
* @param pattern The key message for replacing
* @param replace The message to place in the key variable - 'pattern'
* @return The replaced message
*/
String replaceAll(String source, String pattern, String replace)
{
int i=0;
boolean ret = false;
StringBuffer buf = new StringBuffer();
int lenSource = source.length();
int lenPattern = pattern.length();
for (i=0; i<lenSource; i++) {
ret = source.regionMatches(i, pattern, 0, lenPattern);
if (ret) {
buf.append(source.substring(0,i));
buf.append(replace);
buf.append(source.substring(i+lenPattern));
source = replaceAll(buf.toString(), pattern, replace);
break;
}
}
return source;
}
%>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

View file

@ -1,84 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
img {
padding: 0;
margin: 0;
}
#chpassbox {
width:450px;
}
#guestloginbox {
width: 300px;
}
#webloginbox {
width: 325px;
}
td#infocell {
padding-left: 30px;
height: 100%;
vertical-align: middle;
}
td#loginboxcell {
vertical-align: middle;
}
td #loginboxtitle {
font-size: x-large;
line-height: 1.1em;
}
.loginbox {
border-collapse: collapse;
border: 1px solid #bbb;
}
.loginbox td {
background: #dfdfdf;
}
#toprow img {
margin-bottom: 5px;
}
#toprow td {
padding-top: 6px;
vertical-align: top;
text-align: center;
line-height: 1.3em;
}
#entrybox {
margin: 6px;
padding: 2px;
}
#entrybox td {
width: 100%;
text-align: right;
}
#entrybox input {
width: 240px;
}
#entrybox2 {
margin: 6px;
padding: 2px;
}
#entrybox2 td {
width: 100%;
text-align: right;
}
#entrybox2 input {
width: 45px;
height: 1.7em;
}
#buttoncell {
padding: 0 6px 6px 0;
width: 100%;
text-align: right;
}
#buttoncell input {
width: 5.5em;
}
#reasonbox{
background: #dfdfdf;
border-collapse: collapse;
border: 1px solid #bbb;
color: #AB1A2A;
}

View file

@ -1,44 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
body {background: #fff;}
h2
{
margin: 0;
font-size: 14pt;
line-height: 20px;
padding: 12px 0 22px 0px;
font-weight: normal;
}
.confirm
{
margin: 0;
font-size: 14pt;
line-height: 20px;
padding: 12px 0 12px 0px;
font-weight: normal;
color: #AB1A2A;
}
td
{
font-family: verdana, arial, helvetica, geneva, sans-serif;
font-size: 11px;
line-height: 20px;
}
.rowBkgrd { background: #F4F4F4; } /* was #eee; */
.tableHeading
{
font-weight: bold;
white-space: nowrap;
}
.label
{
font-weight: bold;
text-align: right;
white-space: nowrap;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,437 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
/***********************
* General formatting
***********************/
.hidden { display: none;}
body {
margin: 0;
padding: 0;
font-family: verdana, arial, helvetica, geneva, sans-serif;
font-size: 11px;
color: #484848; /*666;*/
background: #fff;
}
.wrapper {
width: 100%;
text-align: center;
}
.inner {
width: 720px;
margin: 0 auto;
text-align: left;
}
/****************************************************************/
//#hm a, #hm a:link, #hm a:visited {
// color: #85A3C2;
// text-decoration: none;
// font-weight: bold;
//}
//#hm a:hover {
// color: #596C80;
// text-decoration: underline;
// font-weight: bold;
//}
//#hm a:active {
// color: #85A3C2;
//}
h2 {
margin: 0;
font-size: 14pt;
line-height: 20px;
padding: 20px 0px 20px 0px;
font-weight: normal;
}
#confirm {
margin: 0;
font-size: 14pt;
line-height: 20px;
padding: 12px 0px 12px 0px;
font-weight: normal;
color: black;
}
#confirmdata {
color: black;
font-size: 111%;
margin-left: 4em;
line-height: 1em;
padding: 0em;
}
#confirmdata td {
padding-left: 1em;
// font-size: 90%;
line-height: 120%;
}
#error {
margin: 0;
font-size: 111%;
line-height: 1.2em;
padding-bottom: 0.5em;
font-weight: normal;
color: #AB1A2A;
}
#errordata {
margin: 0em;
// font-size: 90%;
line-height: 1em;
padding-bottom: 2em;
font-weight: normal;
color: #AB1A2A;
}
td
{
font-family: verdana, arial, helvetica, geneva, sans-serif;
font-size: 11px;
line-height: 20px;
}
.rowBkgrd { background: #F4F4F4; } /* was #eee; */
.tableHeading {
font-weight: bold;
white-space: nowrap;
}
.label {
font-weight: bold;
text-align: right;
white-space: nowrap;
}
/****************************************************************/
/***********************
* Header layout
***********************/
/* HEADER 1 */
#header1wrap {
border-bottom: 4px solid #bbb; /*#DCE2E5;*/
height: 23px;
background: #AB1A2A;
}
#logo {
float: left;
width: 211px;
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
/* ie5 box model hack */
width: 213px;
voice-family: "\"}\"";
voice-family:inherit;
/* unhack */
width: 211px;
}
/* be nice to Opera */
html>#logo {
width: 211px;
}
#status {
float: left;
padding-left: 10px;
width: 497px;
height: 23px;
color: #ddd;
font-size: .9em;
line-height: 23px;
}
/* HEADER 2 */
#header2wrap {
position: relative;
}
#header2left {
position: absolute;
top: 0;
left: 0;
width: 50%;
background: #fff;
}
#header2right {
position: absolute;
top: 0;
left: 50%;
width: 50%;
margin-top: 36px;
padding: 10px 0;
height: 17px;
line-height: 17px;
background: #dfdfdf; /*#f4f4f4;*/
border-top: 1px solid #bbb; /*#ddd;*/
}
#header2 {
position: absolute;
top: 0;
left: 50%;
margin-left: -360px;
margin-right: 0;
width: 720px;
/* SSK IE 6 Hack */
* html{
width:700px;
}
background: #fff;
}
/*SSK be nice to Opera */
html>#manage { width: 487px; }
#title {
float: left;
width: 211px;
height: 74px;
border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
}
#manage {
float: left;
margin-top: 36px;
border-top: 1px solid #bbb; /*#ddd;*/
padding: 10px;
width: 485px;
height: 17px;
background: #dfdfdf; /*#f4f4f4;*/
line-height: 17px;
/* ie5 box model hack */
width: 507px;
voice-family: "\"}\"";
voice-family:inherit;
/* unhack */
width: 485px;
}
/* be nice to Opera */
html>#manage { width: 487px; }
#manage a, #manage a:link, #manage a:visited {
color: #85A3C2;
text-decoration: none;
font-weight: bold;
}
#manage a:hover {
color: #596C80;
text-decoration: underline;
font-weight: bold;
}
#manage a:active {color: #85A3C2;}
/* HEADER 3 */
#header3wrap {
margin-top: 74px;
background: #dfdfdf; /*#f4f4f4;*/
border-top: 1px solid #bbb; /*#ddd;*/
border-bottom: 1px solid #bbb /*#ddd;*/
}
#header3 {
padding: 8px 0 8px 10px;
width: 750px;
/* ie5 box model hack */
width: 760px;
voice-family: "\"}\"";
voice-family:inherit;
/* unhack */
width: 750px;
}
/* be nice to Opera */
html>#header3 {
width: 750px;
}
/***********************
* Contents
***********************/
#content {
margin-top: 20px;
padding-left: 10px;
width: 750px;
/* ie5 box model hack */
width: 760px;
voice-family: "\"}\"";
voice-family:inherit;
/* unhack */
width: 760px;
}
/* be nice to Opera */
html>#content {
width: 750px;
}
#footer {
margin: 20px 0;
padding: 15px 0;
border-top: 1px solid #ddd;
}
#footer .inner {
padding-left: 10px;
width: 750px;
/* ie5 box model hack */
width: 760px;
voice-family: "\"}\"";
voice-family:inherit;
/* unhack */
width: 750px;
}
/* be nice to Opera */
html>#footer .inner {
width: 750px;
}
/***********************
* Text
***********************/
h1 {
margin-top: 12px;
margin-left: 10px;
margin-bottom: 0;
padding: 0;
font-size: 24px;
font-weight: normal;
color: #a0a0a0;
}
ul {
margin-top: 0px;
}
.sep {
font-size: 10px;
font-weight: bold;
line-height: 12px;
color: #ccc;
padding: 0 2px;
}
.headerlabel {
padding-right: 2px;
}
/* LINKS */
a, a:link, a:visited {
text-decoration: none;
font-weight: normal;
color: #85A3C2;
}
a:hover {
color: #596C80;
text-decoration: underline;
}
a:active {
color: #85A3C2;
}
/***********************
* Forms
***********************/
form {
margin: 0;
padding: 0;
}
form#existingguest {
display: inline;
}
.selectnull {
font-style: italic;
color: grey;
}
.textinput, .dropdown {
border: 1px solid #999;
color: #333;
background: #fff;
font-size: 11px;
}
#guestid {
width: 150px;
}
#guesttask {
margin: 0 5px;
width: 150px;
}
.inputsubmit
{
color: #666;
font-size: 12px;
background: #fc0;
font-weight: bold;
}
/* HEADER FORM */
#existingguest .textinput, #existingguest .dropdown {
background: #DFE7EB;
border: 1px solid #85A3C2;
height: 15px;
}
#existingguest a, #existingguest a:link, #existingguest a:visited {
color: #85A3C2;
text-decoration: none;
font-weight: bold;
}
#existingguest a:active {color: #85A3C2;}
#existingguest a:hover {
color: #596C80;
text-decoration: underline;
font-weight: bold;
}
.inputsubmitHead {
padding: 0 5px;
color: #666;
font-size: 11px;
background: #DFE7EB;
border: 1px solid #85A3C2;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB