commit 4f2e303079dd3e59f62cc079b3ee9019b62f2820 Author: jeb228 Date: Fri Jan 29 22:13:57 2010 +0000 Improve output: distinguish between failed assertions (failures) and unexpected exceptions (errors), and print a filtered stack trace for any exception. diff --git a/config/ant/importedBuild.xml b/config/ant/importedBuild.xml new file mode 100644 index 000000000..7984cd6f0 --- /dev/null +++ b/config/ant/importedBuild.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/config/ant/lib/ant-contrib-1.0b2.jar b/config/ant/lib/ant-contrib-1.0b2.jar new file mode 100644 index 000000000..ea817cd43 Binary files /dev/null and b/config/ant/lib/ant-contrib-1.0b2.jar differ diff --git a/config/example.globalbuild.properties b/config/example.globalbuild.properties new file mode 100644 index 000000000..d3ca3158c --- /dev/null +++ b/config/example.globalbuild.properties @@ -0,0 +1,49 @@ +# these are ant build properties that all of the vitro and build.xml files might need. +# +# All of these paths must be absolute or relative to the vitro directory. Relative +# is preferred. + +# Notice that the use of relative paths is facilitated by the basedir attribute of the +# ant project elements. All projects should use the same base directory so that the +# relative paths will point to the correct files. +# See the ant documentation for project element basedir attribute. + +############## basic configuration ############### +java_api=/usr/local/java/java_home + +############ tomcat stuff #################### +tomcat.home=/usr/local/tomcat + +############# source directory ######################################### +##### This parameter is used for referencing a "permanent" home ####### +##### in the source directory of the project for uploaded files ####### +##### so that if the Tomcat webapp context is wiped out, any ####### +##### uploaded files (usually images) are not lost. ####### +######################################################################## +source.home=/usr/local/src/Vitro + +######################################################################## +##### Everything under this is used by the Vitro build.xml files ####### +##### You should not need to customize it for you local install ####### +######################################################################## + +########### ant contrib tasks ############### +ant.lib=./config/ant/lib +ant.contrib.jar=${ant.lib}/ant-contrib-1.0b2.jar + +#### locations of files in the build ##### +webapp.dir=./webapp +webapp.lib=${webapp.dir}/lib +webapp.build=${webapp.dir}/.build +webapp.dir.jar=${webapp.build}/vitro-webapp.jar +webapp.name=vitro +webapp.deploy.home=${tomcat.home}/webapps/${webapp.name} + +ingest.dir=./ingestTool +ingest.lib=${ingest.dir}/lib +ingest.build=${ingest.dir}/build + +ws.dir=./services +ws.lib=${ws.dir}/lib +ws.build=${webapp.dir}/build +ws.wsdd.dir=${ws.dir}/wsdd diff --git a/config/test b/config/test new file mode 100644 index 000000000..a6b65f3ad --- /dev/null +++ b/config/test @@ -0,0 +1,4 @@ + +osk +sk +dklsjf diff --git a/doc/license.txt b/doc/license.txt new file mode 100644 index 000000000..dc0434a55 --- /dev/null +++ b/doc/license.txt @@ -0,0 +1,25 @@ +Copyright (c) ${year}, Cornell University +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Cornell University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/services/additions/WEB-INF/classes/README.txt b/services/additions/WEB-INF/classes/README.txt new file mode 100644 index 000000000..e783a08f9 --- /dev/null +++ b/services/additions/WEB-INF/classes/README.txt @@ -0,0 +1,12 @@ +bdc34: +This directory is here so that we can stick properties files +and other resources into a directory that will end up on +the java CLASSPATH. + +Files for apache axis: + -rw-r--r-- 1 bdc34 bdc34 9355 Aug 14 12:13 i18n_ja.properties + -rw-r--r-- 1 bdc34 bdc34 4799 Aug 14 12:13 i18n.properties + -rw-rw-r-- 1 bdc34 bdc34 921 Aug 14 12:32 log4j.properties + +It seems like the log4j.properties file may cause problems if +we start using log4j in other parts of the system. diff --git a/services/additions/WEB-INF/classes/i18n.properties b/services/additions/WEB-INF/classes/i18n.properties new file mode 100644 index 000000000..8b1deba2e --- /dev/null +++ b/services/additions/WEB-INF/classes/i18n.properties @@ -0,0 +1,132 @@ +############################################################ +# i18n settings for the Axis Web-Application +# + +#################### [i18n global setting] ################# +# +locales=en ja + +#################### [index.jsp] ########################### +# + +### Header ### +# +language=Language +welcomeMessage=Hello! Welcome to Apache-Axis. + +### Operation list ### +# +operationType=What do you want to do today? + +# Validation +validation=Validation +validationURL=happyaxis.jsp +validationFootnote00=Validate the local installation's configuration +validationFootnote01=see below if this does not work. + +# List +serviceList=List +serviceListURL=servlet/AxisServlet +serviceListFootnote=View the list of deployed Web services + +# Call +callAnEndpoint=Call +callAnEndpointURL=EchoHeaders.jws?method=list +callAnEndpointFootnote00=Call a local endpoint that list's the caller's http headers +callAnEndpointFootnote01=(or see its WSDL). + +# Visit +visit=Visit +visitURL=http://ws.apache.org/axis/ +visitFootnote=Visit the Apache-Axis Home Page + +# Admin +admin=Administer Axis +adminURL=servlet/AdminServlet +adminFootnote=[disabled by default for security reasons] + +# SOAPMonitor +soapMonitor=SOAPMonitor +soapMonitorURL=SOAPMonitor +soapMonitorFootnote=[disabled by default for security reasons] + +# Sidenote +sideNote=To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it. + +### Validating Axis ### +# + +# Title +validatingAxis=Validating Axis + +# Note 0 +validationNote00=If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers. + +# Note 1 +validationNote01=If you have problems getting Axis to work, consult the Axis Wiki and then try the Axis user mailing list. + +# +#################### [index.jsp] ########################### + +#################### [happyaxis.jsp] ####################### +# + +pageTitle=Axis Happiness Page +pageRole=Examining webapp configuration + +### Needed Components ### +# +neededComponents=Needed Components +error=Error +warning=Warning +criticalErrorMessage=Axis will not work. +uncertainErrorMessage=Axis may not work. +# parameters = url, name +seeHomepage=
See {0} +# parameters = category, classname, jarFile, errorText, url +couldNotFound=

{0}: could not find class {1} from file {2}
{3} {4}

+# parameters = description, classname +foundClass00=Found {0} ( {1} ) +# parameters = description, classname +foundClass01=Found {0} ( {1} ) at {2} +# parameters = category, classname, errorText, url +couldNotFoundDep=

{0}: could not find a dependency of class {1} from file {2}
{3} {4} +# parameters = ncdfe.getMessage(), classname +theRootCause=
The root cause was: {0}
This can happen e.g. if {1} is in the 'common' classpath, but a dependency like activation.jar is only in the webapp classpath.

+# parameters = location +invalidSAAJ=Error: Invalid version of SAAJ API found in {0}. Make sure that Axis' saaj.jar precedes {0} in CLASSPATH.
+axisInstallation=Axis installation instructions + +### Optional Components ### +# + +optionalComponents=Optional Components +attachmentsError=Attachments will not work. +xmlSecurityError=XML Security is not supported. +httpsError=https is not supported. + +happyResult00=The core axis libraries are present. +happyResult01=The optional components are present. +# parameters = needed(num of missing libraries) +unhappyResult00={0} core axis library(ies) are missing +# parameters = wanted(num of missing libraries) +unhappyResult01={0} wanted optional axis librar(ies) are missing + +hintString=Note: On Tomcat 4.x and Java1.4, you may need to put libraries that contain java.* or javax.* packages into CATALINA_HOME/common/lib
jaxrpc.jar and saaj.jar are two such libraries.

+noteString=Note: Even if everything this page probes for is present, there is no guarantee your web service will work, because there are many configuration options that we do not check for. These tests are necessary but not sufficient


+ +### Examining Application Server ### +# +apsExamining=Examining Application Server +recommendedParser=We recommend Xerces 2 over Crimson as the XML parser for Axis +couldNotCreateParser=Could not create an XML Parser + +### Examining System Properties ### +# +sysExamining=Examining System Properties +sysPropError=System properties are not accessible.

+classFoundError=an unknown location +apsPlatform=Platform + +# +#################### [happyaxis.jsp] ####################### \ No newline at end of file diff --git a/services/additions/WEB-INF/classes/i18n_ja.properties b/services/additions/WEB-INF/classes/i18n_ja.properties new file mode 100644 index 000000000..91fb3cf14 --- /dev/null +++ b/services/additions/WEB-INF/classes/i18n_ja.properties @@ -0,0 +1,127 @@ +############################################################ +# Japanese settings for the Axis Web-Application +# + +#################### [index.jsp] ########################### +# + +### Header ### +# +language=\u8a00\u8a9e +welcomeMessage=\u3053\u3093\u306b\u3061\u306f\uff01 Apache-Axis\u3078\u3088\u3046\u3053\u305d + +### Operation list ### +# +operationType=\u4eca\u65e5\u306f\u4f55\u3092\u3057\u305f\u3044\u3067\u3059\u304b\uff1f + +# Validation +validation=\u691c\u8a3c +validationURL=happyaxis.jsp +validationFootnote00=\u30ed\u30fc\u30ab\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u72b6\u6cc1\u3092\u691c\u8a3c\u3059\u308b +validationFootnote01=\u3046\u307e\u304f\u6a5f\u80fd\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u4e0b\u8a18\u300cAxis\u306e\u691c\u8a3c\u300d\u3092\u53c2\u7167 + +# List +serviceList=\u30ea\u30b9\u30c8 +serviceListURL=servlet/AxisServlet +serviceListFootnote=\u30c7\u30d7\u30ed\u30a4\u6e08\u307f\u306eWeb\u30b5\u30fc\u30d3\u30b9\u30ea\u30b9\u30c8\u3092\u898b\u308b + +# Call +callAnEndpoint=\u547c\u51fa\u3057 +callAnEndpointURL=EchoHeaders.jws?method=list +callAnEndpointFootnote00=HTTP\u30d8\u30c3\u30c0\u306e\u4e00\u89a7\u8868\u793a\u3092\u884c\u3046\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u8d77\u52d5\u3059\u308b +callAnEndpointFootnote01=(\u3082\u3057\u304f\u306fWSDL\u306e\u53c2\u7167) + +# Visit +visit=\u8a2a\u554f +visitURL=http://ws.apache.org/axis/ja/index.html +visitFootnote=Apache Axis\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u8a2a\u554f\u3059\u308b + +# Admin +admin=Axis\u306e\u7ba1\u7406 +adminURL=servlet/AdminServlet +adminFootnote=[\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5229\u7528\u4e0d\u53ef] + +# SOAPMonitor +soapMonitor=SOAP\u30e2\u30cb\u30bf +soapMonitorURL=SOAPMonitor +soapMonitorFootnote=[\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5229\u7528\u4e0d\u53ef] + +# Sidenote +sideNote=\u4e0a\u8a18\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5229\u7528\u3067\u304d\u306a\u3044\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u306eWEB-INF/web.xml\u30d5\u30a1\u30a4\u30eb\u306e\u8a72\u5f53\u3059\u308b\u5ba3\u8a00\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002 + +### Validating Axis ### +# + +# Title +validatingAxis=Axis\u306e\u691c\u8a3c + +# Note 0 +validationNote00="happyaxis"\u691c\u8a3c\u30da\u30fc\u30b8\u304c\u72b6\u614b\u8868\u793a\u3067\u306f\u306a\u304f\u4f8b\u5916\u3092\u8868\u793a\u3059\u308b\u5834\u5408\u3001\u539f\u56e0\u3068\u3057\u3066\u306f\u30af\u30e9\u30b9\u30d1\u30b9\u5185\u306b\u8907\u6570\u306eXML\u30d1\u30fc\u30b5\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002\u95a2\u4fc2\u306a\u3044\u30d1\u30fc\u30b5\u3092\u30af\u30e9\u30b9\u30d1\u30b9\u304b\u3089\u53d6\u308a\u9664\u3044\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002 + +# Note 1 +validationNote01=Axis\u3092\u52d5\u4f5c\u3055\u305b\u308b\u4e0a\u3067\u554f\u984c\u3092\u62b1\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u307e\u305aAxis Wiki\u3092\u53c2\u8003\u306b\u3057\u3001\u305d\u306e\u5f8c\u3067Axis\u30e6\u30fc\u30b6\u30e1\u30fc\u30ea\u30f3\u30b0\u30ea\u30b9\u30c8\u306b\u6295\u7a3f\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002 + +# +#################### [index.jsp] ########################### + +#################### [happyaxis.jsp] ####################### +# +pageTitle=Axis Happiness Page +pageRole=webapp\u306e\u69cb\u6210\u306b\u95a2\u3059\u308b\u8abf\u67fb + +### Needed Components ### +# +neededComponents=\u5fc5\u9808\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 +error=\u30a8\u30e9\u30fc +warning=\u8b66\u544a +criticalErrorMessage=\u304a\u305d\u3089\u304fAxis\u306f\u52d5\u304d\u307e\u305b\u3093\u3002 +uncertainErrorMessage=Axis\u306f\u52d5\u304b\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +# parameters = url, name +seeHomepage=
{0}\u3092\u898b\u3066\u4e0b\u3055\u3044\u3002 +# parameters = category, classname, jarFile, errorText, url +couldNotFound=

{0}: {2}\u30d5\u30a1\u30a4\u30eb\u304c\u63d0\u4f9b\u3059\u308b{1}\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
{3} {4}

+# parameters = description, classname +foundClass00={0} ( {1} ) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 +# parameters = description, classname, location +foundClass01={0} ( {1} ) \u304c{2}\u3067\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 +# parameters = category, classname, errorText, url +couldNotFoundDep=

{0}: {2}\u30d5\u30a1\u30a4\u30eb\u304c\u63d0\u4f9b\u3059\u308b{1}\u30af\u30e9\u30b9\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u89e3\u6c7a\u3067\u304d\u307e\u305b\u3093\u3002
{3} {4} +# parameters = ncdfe.getMessage(), classname +theRootCause=
\u6839\u672c\u539f\u56e0: {0}
\u3053\u306e\u30a8\u30e9\u30fc\u306f\u6b21\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u5171\u901a\u306e\u300d\u30af\u30e9\u30b9\u30d1\u30b9\u306b{1}\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001activation.jar \u306e\u3088\u3046\u306a\u4f9d\u5b58\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u304cwebapp\u306e\u30af\u30e9\u30b9\u30d1\u30b9\u3060\u3051\u306b\u3057\u304b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u5834\u5408\u3067\u3059\u3002

+# parameters = location +invalidSAAJ=\u30a8\u30e9\u30fc: {0}\u306b\u9069\u5207\u3067\u306a\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eSAAJ API\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002Axis\u306esaaj.jar\u3092\u3001CLASSPATH\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b{0} \u3088\u308a\u3082\u524d\u65b9\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+axisInstallation=Axis\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806 + +### Optional Components ### +# +optionalComponents=\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 +attachmentsError=\u304a\u305d\u3089\u304fAttachments\u306f\u6a5f\u80fd\u3057\u307e\u305b\u3093\u3002 +xmlSecurityError=XML Security\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002 +httpsError=https\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002 + +happyResult00=axis\u306e\u30b3\u30a2\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u5168\u3066\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002 +happyResult01=\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002 +# parameters = needed(num of missing libraries) +unhappyResult00=axis\u306e\u30b3\u30a2\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u304c{0}\u3064\u6b20\u3051\u3066\u3044\u307e\u3059\u3002 +# parameters = wanted(num of missing libraries) +unhappyResult01=axis\u306e\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u304c{0}\u3064\u6b20\u3051\u3066\u3044\u307e\u3059\u3002 + +hintString=\u6ce8\u610f: Tomcat 4.x \u3068 Java1.4 \u4e0a\u3067\u306f\u3001CATALINA_HOME/common/lib \u306b\u3001java.* \u3082\u3057\u304f\u306f javax.* \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u542b\u3080\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u914d\u7f6e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002
\u4f8b\u3048\u3070 jaxrpc.jar \u3068 saaj.jar \u306f\u3001\u305d\u306e\u3088\u3046\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002

+noteString=\u6ce8\u610f: \u30da\u30fc\u30b8\u306b\u5168\u3066\u306e\u8abf\u67fb\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u30c1\u30a7\u30c3\u30af\u3067\u304d\u306a\u3044\u69cb\u6210\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u591a\u3044\u305f\u3081\u3001\u3042\u306a\u305f\u306eWeb\u30b5\u30fc\u30d3\u30b9\u304c\u6b63\u5e38\u306b\u6a5f\u80fd\u3059\u308b\u4fdd\u969c\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u3089\u306e\u30c6\u30b9\u30c8\u306f\u5fc5\u8981\u306a\u3082\u306e\u3067\u3059\u304c\u3001\u5341\u5206\u306a\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 + +### Examining Application Server ### +# +apsExamining=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff65\u30b5\u30fc\u30d0\u30fc\u306b\u95a2\u3059\u308b\u8abf\u67fb +recommendedParser=Axis\u3067\u4f7f\u7528\u3059\u308bXML\u30d1\u30fc\u30b5\u30fc\u306b\u306f Crimson \u3067\u306f\u306a\u304f\u3001Xerces 2 \u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 +couldNotCreateParser=XML Parser\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002 + +### Examining System Properties ### +# +sysExamining=\u30b7\u30b9\u30c6\u30e0\uff65\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u95a2\u3059\u308b\u8abf\u67fb +sysPropError=\u30b7\u30b9\u30c6\u30e0\uff65\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002

+ +classFoundError=\u4e0d\u660e\u306a\u5834\u6240 +apsPlatform=\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0 + +# +#################### [happyaxis.jsp] ####################### diff --git a/services/additions/WEB-INF/classes/log4j.properties b/services/additions/WEB-INF/classes/log4j.properties new file mode 100644 index 000000000..3ca86f404 --- /dev/null +++ b/services/additions/WEB-INF/classes/log4j.properties @@ -0,0 +1,20 @@ +# Set root category priority to INFO and its only appender to CONSOLE. +log4j.rootCategory=INFO, CONSOLE +#log4j.rootCategory=INFO, CONSOLE, LOGFILE + +# Set the enterprise logger category to FATAL and its only appender to CONSOLE. +log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE + +# CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.Threshold=INFO +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n + +# LOGFILE is set to be a File appender using a PatternLayout. +log4j.appender.LOGFILE=org.apache.log4j.FileAppender +log4j.appender.LOGFILE.File=axis.log +log4j.appender.LOGFILE.Append=true +log4j.appender.LOGFILE.Threshold=INFO +log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout +log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n diff --git a/services/additions/admin/axis/SOAPMonitorApplet.java b/services/additions/admin/axis/SOAPMonitorApplet.java new file mode 100644 index 000000000..08b0ce1cd --- /dev/null +++ b/services/additions/admin/axis/SOAPMonitorApplet.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2001,2004 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. + */ + +import java.awt.*; +import java.awt.event.*; +import java.io.*; +import java.net.*; +import java.text.*; +import java.util.*; +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.event.*; +import javax.swing.table.*; + +import org.apache.axis.monitor.SOAPMonitorConstants; + +/** + * This is a SOAP Mointor Applet class. This class provides + * the user interface for displaying data from the SOAP + * monitor service. + * + * @author Brian Price (pricebe@us.ibm.com) + * + */ +public class SOAPMonitorApplet extends JApplet { + + /** + * Private data + */ + private JPanel main_panel = null; + private JTabbedPane tabbed_pane = null; + private int port = 0; + private Vector pages = null; + + /** + * Constructor + */ + public SOAPMonitorApplet() { + } + + /** + * Applet initialization + */ + public void init() { + // Get the port to be used + String port_str = getParameter("port"); + if (port_str != null) { + port = Integer.parseInt(port_str); + } + // Try to use the system look and feel + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e){ + } + // Create main panel to hold notebook + main_panel = new JPanel(); + main_panel.setBackground(Color.white); + main_panel.setLayout(new BorderLayout()); + setContentPane(main_panel); + // Create the notebook + tabbed_pane = new JTabbedPane(JTabbedPane.TOP); + main_panel.add(tabbed_pane,BorderLayout.CENTER); + // Add notebook page for default host connection + pages = new Vector(); + addPage(new SOAPMonitorPage(getCodeBase().getHost())); + } + + /** + * Add a page to the notebook + */ + private void addPage(SOAPMonitorPage pg) { + tabbed_pane.addTab(" "+pg.getHost()+" ", pg); + pages.addElement(pg); + } + + /** + * Applet is being displayed + */ + public void start() { + // Tell all pages to start talking to the server + Enumeration e = pages.elements(); + while (e.hasMoreElements()) { + SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement(); + if (pg != null) { + pg.start(); + } + } + } + + /* + * Applet is no longer displayed + */ + public void stop() { + // Tell all pages to stop talking to the server + Enumeration e = pages.elements(); + while (e.hasMoreElements()) { + SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement(); + if (pg != null) { + pg.stop(); + } + } + } + + /** + * Applet cleanup + */ + public void destroy() { + tabbed_pane = null; + main_panel = null; + } + + /** + * This class provides the contents of a notebook page + * representing a server connection. + */ + class SOAPMonitorPage extends JPanel + implements Runnable, + ListSelectionListener, + ActionListener { + + /** + * Status Strings + */ + private final String STATUS_ACTIVE = "The SOAP Monitor is started."; + private final String STATUS_STOPPED = "The SOAP Monitor is stopped."; + private final String STATUS_CLOSED = "The server communication has been terminated."; + private final String STATUS_NOCONNECT = "The SOAP Monitor is unable to communcate with the server."; + + /** + * Private data + */ + private String host = null; + private Socket socket = null; + private ObjectInputStream in = null; + private ObjectOutputStream out = null; + private SOAPMonitorTableModel model = null; + private JTable table = null; + private JScrollPane scroll = null; + private JPanel list_panel = null; + private JPanel list_buttons = null; + private JButton remove_button = null; + private JButton remove_all_button = null; + private JButton filter_button = null; + private JPanel details_panel = null; + private JPanel details_header = null; + private JSplitPane details_soap = null; + private JPanel details_buttons = null; + private JLabel details_time = null; + private JLabel details_target = null; + private JLabel details_status = null; + private JLabel details_time_value = null; + private JLabel details_target_value = null; + private JLabel details_status_value = null; + private EmptyBorder empty_border = null; + private EtchedBorder etched_border = null; + private JPanel request_panel = null; + private JPanel response_panel = null; + private JLabel request_label = null; + private JLabel response_label = null; + private SOAPMonitorTextArea request_text = null; + private SOAPMonitorTextArea response_text = null; + private JScrollPane request_scroll = null; + private JScrollPane response_scroll = null; + private JButton layout_button = null; + private JSplitPane split = null; + private JPanel status_area = null; + private JPanel status_buttons = null; + private JButton start_button = null; + private JButton stop_button = null; + private JLabel status_text = null; + private JPanel status_text_panel = null; + private SOAPMonitorFilter filter = null; + private GridBagLayout details_header_layout = null; + private GridBagConstraints details_header_constraints = null; + private JCheckBox reflow_xml = null; + + /** + * Constructor (create and layout page) + */ + public SOAPMonitorPage(String host_name) { + host = host_name; + // Set up default filter (show all messages) + filter = new SOAPMonitorFilter(); + // Use borders to help improve appearance + etched_border = new EtchedBorder(); + // Build top portion of split (list panel) + model = new SOAPMonitorTableModel(); + table = new JTable(model); + table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + table.setRowSelectionInterval(0,0); + table.setPreferredScrollableViewportSize(new Dimension(600, 96)); + table.getSelectionModel().addListSelectionListener(this); + scroll = new JScrollPane(table); + remove_button = new JButton("Remove"); + remove_button.addActionListener(this); + remove_button.setEnabled(false); + remove_all_button = new JButton("Remove All"); + remove_all_button.addActionListener(this); + filter_button = new JButton("Filter ..."); + filter_button.addActionListener(this); + list_buttons = new JPanel(); + list_buttons.setLayout(new FlowLayout()); + list_buttons.add(remove_button); + list_buttons.add(remove_all_button); + list_buttons.add(filter_button); + list_panel = new JPanel(); + list_panel.setLayout(new BorderLayout()); + list_panel.add(scroll,BorderLayout.CENTER); + list_panel.add(list_buttons, BorderLayout.SOUTH); + list_panel.setBorder(empty_border); + // Build bottom portion of split (message details) + details_time = new JLabel("Time: ", SwingConstants.RIGHT); + details_target = new JLabel("Target Service: ", SwingConstants.RIGHT); + details_status = new JLabel("Status: ", SwingConstants.RIGHT); + details_time_value = new JLabel(); + details_target_value = new JLabel(); + details_status_value = new JLabel(); + Dimension preferred_size = details_time.getPreferredSize(); + preferred_size.width = 1; + details_time.setPreferredSize(preferred_size); + details_target.setPreferredSize(preferred_size); + details_status.setPreferredSize(preferred_size); + details_time_value.setPreferredSize(preferred_size); + details_target_value.setPreferredSize(preferred_size); + details_status_value.setPreferredSize(preferred_size); + details_header = new JPanel(); + details_header_layout = new GridBagLayout(); + details_header.setLayout(details_header_layout); + details_header_constraints = new GridBagConstraints(); + details_header_constraints.fill=GridBagConstraints.BOTH; + details_header_constraints.weightx=0.5; + details_header_layout.setConstraints(details_time,details_header_constraints); + details_header.add(details_time); + details_header_layout.setConstraints(details_time_value,details_header_constraints); + details_header.add(details_time_value); + details_header_layout.setConstraints(details_target,details_header_constraints); + details_header.add(details_target); + details_header_constraints.weightx=1.0; + details_header_layout.setConstraints(details_target_value,details_header_constraints); + details_header.add(details_target_value); + details_header_constraints.weightx=.5; + details_header_layout.setConstraints(details_status,details_header_constraints); + details_header.add(details_status); + details_header_layout.setConstraints(details_status_value,details_header_constraints); + details_header.add(details_status_value); + details_header.setBorder(etched_border); + request_label = new JLabel("SOAP Request", SwingConstants.CENTER); + request_text = new SOAPMonitorTextArea(); + request_text.setEditable(false); + request_scroll = new JScrollPane(request_text); + request_panel = new JPanel(); + request_panel.setLayout(new BorderLayout()); + request_panel.add(request_label, BorderLayout.NORTH); + request_panel.add(request_scroll, BorderLayout.CENTER); + response_label = new JLabel("SOAP Response", SwingConstants.CENTER); + response_text = new SOAPMonitorTextArea(); + response_text.setEditable(false); + response_scroll = new JScrollPane(response_text); + response_panel = new JPanel(); + response_panel.setLayout(new BorderLayout()); + response_panel.add(response_label, BorderLayout.NORTH); + response_panel.add(response_scroll, BorderLayout.CENTER); + details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + details_soap.setTopComponent(request_panel); + details_soap.setRightComponent(response_panel); + details_soap.setResizeWeight(.5); + details_panel = new JPanel(); + layout_button = new JButton("Switch Layout"); + layout_button.addActionListener(this); + reflow_xml = new JCheckBox("Reflow XML text"); + reflow_xml.addActionListener(this); + details_buttons = new JPanel(); + details_buttons.setLayout(new FlowLayout()); + details_buttons.add(reflow_xml); + details_buttons.add(layout_button); + details_panel.setLayout(new BorderLayout()); + details_panel.add(details_header,BorderLayout.NORTH); + details_panel.add(details_soap,BorderLayout.CENTER); + details_panel.add(details_buttons,BorderLayout.SOUTH); + details_panel.setBorder(empty_border); + // Add the two parts to the age split pane + split = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + split.setTopComponent(list_panel); + split.setRightComponent(details_panel); + // Build status area + start_button = new JButton("Start"); + start_button.addActionListener(this); + stop_button = new JButton("Stop"); + stop_button.addActionListener(this); + status_buttons = new JPanel(); + status_buttons.setLayout(new FlowLayout()); + status_buttons.add(start_button); + status_buttons.add(stop_button); + status_text = new JLabel(); + status_text.setBorder(new BevelBorder(BevelBorder.LOWERED)); + status_text_panel = new JPanel(); + status_text_panel.setLayout(new BorderLayout()); + status_text_panel.add(status_text, BorderLayout.CENTER); + status_text_panel.setBorder(empty_border); + status_area = new JPanel(); + status_area.setLayout(new BorderLayout()); + status_area.add(status_buttons, BorderLayout.WEST); + status_area.add(status_text_panel, BorderLayout.CENTER); + status_area.setBorder(etched_border); + // Add the split and status area to page + setLayout(new BorderLayout()); + add(split, BorderLayout.CENTER); + add(status_area, BorderLayout.SOUTH); + } + + /** + * Get the name of the host we are displaying + */ + public String getHost() { + return host; + } + + /** + * Set the status text + */ + public void setStatus(String txt) { + status_text.setForeground(Color.black); + status_text.setText(" "+txt); + } + + /** + * Set the status text to an error + */ + public void setErrorStatus(String txt) { + status_text.setForeground(Color.red); + status_text.setText(" "+txt); + } + + /** + * Start talking to the server + */ + public void start() { + String codehost = getCodeBase().getHost(); + if (socket == null) { + try { + // Open the socket to the server + socket = new Socket(codehost, port); + // Create output stream + out = new ObjectOutputStream(socket.getOutputStream()); + out.flush(); + // Create input stream and start background + // thread to read data from the server + in = new ObjectInputStream(socket.getInputStream()); + new Thread(this).start(); + } catch (Exception e) { + // Exceptions here are unexpected, but we can't + // really do anything (so just write it to stdout + // in case someone cares and then ignore it) + System.out.println("Exception! "+e.toString()); + e.printStackTrace(); + setErrorStatus(STATUS_NOCONNECT); + socket = null; + } + } else { + // Already started + } + if (socket != null) { + // Make sure the right buttons are enabled + start_button.setEnabled(false); + stop_button.setEnabled(true); + setStatus(STATUS_ACTIVE); + } + } + + /** + * Stop talking to the server + */ + public void stop() { + if (socket != null) { + // Close all the streams and socket + if (out != null) { + try { + out.close(); + } catch (IOException ioe) { + } + out = null; + } + if (in != null) { + try { + in.close(); + } catch (IOException ioe) { + } + in = null; + } + if (socket != null) { + try { + socket.close(); + } catch (IOException ioe) { + } + socket = null; + } + } else { + // Already stopped + } + // Make sure the right buttons are enabled + start_button.setEnabled(true); + stop_button.setEnabled(false); + setStatus(STATUS_STOPPED); + } + + /** + * Background thread used to receive data from + * the server. + */ + public void run() { + Long id; + Integer message_type; + String target; + String soap; + SOAPMonitorData data; + int selected; + int row; + boolean update_needed; + while (socket != null) { + try { + // Get the data from the server + message_type = (Integer) in.readObject(); + // Process the data depending on its type + switch (message_type.intValue()) { + case SOAPMonitorConstants.SOAP_MONITOR_REQUEST: + // Get the id, target and soap info + id = (Long) in.readObject(); + target = (String) in.readObject(); + soap = (String) in.readObject(); + // Add new request data to the table + data = new SOAPMonitorData(id,target,soap); + model.addData(data); + // If "most recent" selected then update + // the details area if needed + selected = table.getSelectedRow(); + if ((selected == 0) && model.filterMatch(data)) { + valueChanged(null); + } + break; + case SOAPMonitorConstants.SOAP_MONITOR_RESPONSE: + // Get the id and soap info + id = (Long) in.readObject(); + soap = (String) in.readObject(); + data = model.findData(id); + if (data != null) { + update_needed = false; + // Get the selected row + selected = table.getSelectedRow(); + // If "most recent", then always + // update details area + if (selected == 0) { + update_needed = true; + } + // If the data being updated is + // selected then update details + row = model.findRow(data); + if ((row != -1) && (row == selected)) { + update_needed = true; + } + // Set the response and update table + data.setSOAPResponse(soap); + model.updateData(data); + // Refresh details area (if needed) + if (update_needed) { + valueChanged(null); + } + } + break; + } + + } catch (Exception e) { + // Exceptions are expected here when the + // server communication has been terminated. + if (stop_button.isEnabled()) { + stop(); + setErrorStatus(STATUS_CLOSED); + } + } + } + } + + /** + * Listener to handle table selection changes + */ + public void valueChanged(ListSelectionEvent e) { + int row = table.getSelectedRow(); + // Check if they selected a specific row + if (row > 0) { + remove_button.setEnabled(true); + } else { + remove_button.setEnabled(false); + } + // Check for "most recent" selection + if (row == 0) { + row = model.getRowCount() - 1; + if (row == 0) { + row = -1; + } + } + if (row == -1) { + // Clear the details panel + details_time_value.setText(""); + details_target_value.setText(""); + details_status_value.setText(""); + request_text.setText(""); + response_text.setText(""); + } else { + // Show the details for the row + SOAPMonitorData soap = model.getData(row); + details_time_value.setText(soap.getTime()); + details_target_value.setText(soap.getTargetService()); + details_status_value.setText(soap.getStatus()); + if (soap.getSOAPRequest() == null) { + request_text.setText(""); + } else { + request_text.setText(soap.getSOAPRequest()); + request_text.setCaretPosition(0); + } + if (soap.getSOAPResponse() == null) { + response_text.setText(""); + } else { + response_text.setText(soap.getSOAPResponse()); + response_text.setCaretPosition(0); + } + } + } + + /** + * Listener to handle button actions + */ + public void actionPerformed(ActionEvent e) { + // Check if the user pressed the remove button + if (e.getSource() == remove_button) { + int row = table.getSelectedRow(); + model.removeRow(row); + table.clearSelection(); + table.repaint(); + valueChanged(null); + } + // Check if the user pressed the remove all button + if (e.getSource() == remove_all_button) { + model.clearAll(); + table.setRowSelectionInterval(0,0); + table.repaint(); + valueChanged(null); + } + // Check if the user pressed the filter button + if (e.getSource() == filter_button) { + filter.showDialog(); + if (filter.okPressed()) { + // Update the display with new filter + model.setFilter(filter); + table.repaint(); + } + } + // Check if the user pressed the start button + if (e.getSource() == start_button) { + start(); + } + // Check if the user pressed the stop button + if (e.getSource() == stop_button) { + stop(); + } + // Check if the user wants to switch layout + if (e.getSource() == layout_button) { + details_panel.remove(details_soap); + details_soap.removeAll(); + if (details_soap.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) { + details_soap = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + } else { + details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + } + details_soap.setTopComponent(request_panel); + details_soap.setRightComponent(response_panel); + details_soap.setResizeWeight(.5); + details_panel.add(details_soap, BorderLayout.CENTER); + details_panel.validate(); + details_panel.repaint(); + } + // Check if the user is changing the reflow option + if (e.getSource() == reflow_xml) { + request_text.setReflowXML(reflow_xml.isSelected()); + response_text.setReflowXML(reflow_xml.isSelected()); + } + } + } + + /** + * This class represend the data for a SOAP request/response pair + */ + class SOAPMonitorData { + + /** + * Private data + */ + private Long id; + private String time; + private String target; + private String soap_request; + private String soap_response; + + /** + * Constructor + */ + public SOAPMonitorData(Long id, String target, String soap_request) { + this.id = id; + // A null id is used to signal that the "most recent" entry + // is being created. + if (id == null) { + this.time = "Most Recent"; + this.target = "---"; + this.soap_request = null; + this.soap_response = null; + } else { + this.time = DateFormat.getTimeInstance().format(new Date()); + this.target = target; + this.soap_request = soap_request; + this.soap_response = null; + } + } + + /** + * Get the id for the SOAP message + */ + public Long getId() { + return id; + } + + /** + * Get the time the SOAP request was received by the applet + */ + public String getTime() { + return time; + } + + /** + * Get the SOAP request target service name + */ + public String getTargetService() { + return target; + } + + /** + * Get the status of the request + */ + public String getStatus() { + String status = "---"; + if (id != null) { + status = "Complete"; + if (soap_response == null) { + status = "Active"; + } + } + return status; + } + + /** + * Get the request SOAP contents + */ + public String getSOAPRequest() { + return soap_request; + } + + /** + * Set the resposne SOAP contents + */ + public void setSOAPResponse(String response) { + soap_response = response; + } + + /** + * Get the response SOAP contents + */ + public String getSOAPResponse() { + return soap_response; + } + } + + /** + * This table model is used to manage the table displayed + * at the top of the page to show all the SOAP messages + * we have received and to control which message details are + * to be displayed on the bottom of the page. + */ + class SOAPMonitorTableModel extends AbstractTableModel { + + /** + * Column titles + */ + private final String[] column_names = { "Time", + "Target Service", + "Status" }; + /** + * Private data + */ + private Vector data; + private Vector filter_include; + private Vector filter_exclude; + private boolean filter_active; + private boolean filter_complete; + private Vector filter_data; + + /** + * Constructor + */ + public SOAPMonitorTableModel() { + data = new Vector(); + // Add "most recent" entry to top of table + SOAPMonitorData soap = new SOAPMonitorData(null,null,null); + data.addElement(soap); + filter_include = null; + filter_exclude = null; + filter_active = false; + filter_complete = false; + filter_data = null; + // By default, exclude NotificationService and + // EventViewerService messages + filter_exclude = new Vector(); + filter_exclude.addElement("NotificationService"); + filter_exclude.addElement("EventViewerService"); + filter_data = new Vector(); + filter_data.addElement(soap); + } + + /** + * Get column count (part of table model interface) + */ + public int getColumnCount() { + return column_names.length; + } + + /** + * Get row count (part of table model interface) + */ + public int getRowCount() { + int count = data.size(); + if (filter_data != null) { + count = filter_data.size(); + } + return count; + } + + /** + * Get column name (part of table model interface) + */ + public String getColumnName(int col) { + return column_names[col]; + } + + /** + * Get value at (part of table model interface) + */ + public Object getValueAt(int row, int col) { + SOAPMonitorData soap; + String value = null; + soap = (SOAPMonitorData) data.elementAt(row); + if (filter_data != null) { + soap = (SOAPMonitorData) filter_data.elementAt(row); + } + switch (col) { + case 0: + value = soap.getTime(); + break; + case 1: + value = soap.getTargetService(); + break; + case 2: + value = soap.getStatus(); + break; + } + return value; + } + + /** + * Check if soap data matches filter + */ + public boolean filterMatch(SOAPMonitorData soap) { + boolean match = true; + if (filter_include != null) { + // Check for service match + Enumeration e = filter_include.elements(); + match = false; + while (e.hasMoreElements() && !match) { + String service = (String) e.nextElement(); + if (service.equals(soap.getTargetService())) { + match = true; + } + } + } + if (filter_exclude != null) { + // Check for service match + Enumeration e = filter_exclude.elements(); + while (e.hasMoreElements() && match) { + String service = (String) e.nextElement(); + if (service.equals(soap.getTargetService())) { + match = false; + } + } + } + if (filter_active) { + // Check for active status match + if (soap.getSOAPResponse() != null) { + match = false; + } + } + if (filter_complete) { + // Check for complete status match + if (soap.getSOAPResponse() == null) { + match = false; + } + } + // The "most recent" is always a match + if (soap.getId() == null) { + match = true; + } + return match; + } + + /** + * Add data to the table as a new row + */ + public void addData(SOAPMonitorData soap) { + int row = data.size(); + data.addElement(soap); + if (filter_data != null) { + if (filterMatch(soap)) { + row = filter_data.size(); + filter_data.addElement(soap); + fireTableRowsInserted(row,row); + } + } else { + fireTableRowsInserted(row,row); + } + } + + /** + * Find the data for a given id + */ + public SOAPMonitorData findData(Long id) { + SOAPMonitorData soap = null; + for (int row=data.size(); (row > 0) && (soap == null); row--) { + soap = (SOAPMonitorData) data.elementAt(row-1); + if (soap.getId().longValue() != id.longValue()) { + soap = null; + } + } + return soap; + } + + /** + * Find the row in the table for a given message id + */ + public int findRow(SOAPMonitorData soap) { + int row = -1; + if (filter_data != null) { + row = filter_data.indexOf(soap); + } else { + row = data.indexOf(soap); + } + return row; + } + + /** + * Remove all messages from the table (but leave "most recent") + */ + public void clearAll() { + int last_row = data.size() - 1; + if (last_row > 0) { + data.removeAllElements(); + SOAPMonitorData soap = new SOAPMonitorData(null,null,null); + data.addElement(soap); + if (filter_data != null) { + filter_data.removeAllElements(); + filter_data.addElement(soap); + } + fireTableDataChanged(); + } + } + + /** + * Remove a message from the table + */ + public void removeRow(int row) { + SOAPMonitorData soap = null; + if (filter_data == null) { + soap = (SOAPMonitorData) data.elementAt(row); + data.remove(soap); + } else { + soap = (SOAPMonitorData) filter_data.elementAt(row); + filter_data.remove(soap); + data.remove(soap); + } + fireTableRowsDeleted(row,row); + } + + /** + * Set a new filter + */ + public void setFilter(SOAPMonitorFilter filter) { + // Save new filter criteria + filter_include = filter.getFilterIncludeList(); + filter_exclude = filter.getFilterExcludeList(); + filter_active = filter.getFilterActive(); + filter_complete = filter.getFilterComplete(); + applyFilter(); + } + + /** + * Refilter the list of messages + */ + public void applyFilter() { + // Re-filter using new criteria + filter_data = null; + if ((filter_include != null) || + (filter_exclude != null) || + filter_active || filter_complete ) { + filter_data = new Vector(); + Enumeration e = data.elements(); + SOAPMonitorData soap; + while (e.hasMoreElements()) { + soap = (SOAPMonitorData) e.nextElement(); + if (filterMatch(soap)) { + filter_data.addElement(soap); + } + } + } + fireTableDataChanged(); + } + + /** + * Get the data for a row + */ + public SOAPMonitorData getData(int row) { + SOAPMonitorData soap = null; + if (filter_data == null) { + soap = (SOAPMonitorData) data.elementAt(row); + } else { + soap = (SOAPMonitorData) filter_data.elementAt(row); + } + return soap; + } + + /** + * Update a message + */ + public void updateData (SOAPMonitorData soap) { + int row; + if (filter_data == null) { + // No filter, so just fire table updated + row = data.indexOf(soap); + if (row != -1) { + fireTableRowsUpdated(row,row); + } + } else { + // Check if the row was being displayed + row = filter_data.indexOf(soap); + if (row == -1) { + // Row was not displayed, so check for if it + // now needs to be displayed + if (filterMatch(soap)) { + int index = -1; + row = data.indexOf(soap) + 1; + while ((row < data.size()) && (index == -1)) { + index = filter_data.indexOf(data.elementAt(row)); + if (index != -1) { + // Insert at this location + filter_data.add(index,soap); + } + row++; + } + if (index == -1) { + // Insert at end + index = filter_data.size(); + filter_data.addElement(soap); + } + fireTableRowsInserted(index,index); + } + } else { + // Row was displayed, so check if it needs to + // be updated or removed + if (filterMatch(soap)) { + fireTableRowsUpdated(row,row); + } else { + filter_data.remove(soap); + fireTableRowsDeleted(row,row); + } + } + } + } + + } + + /** + * Panel with checkbox and list + */ + class ServiceFilterPanel extends JPanel + implements ActionListener, + ListSelectionListener, + DocumentListener { + + private JCheckBox service_box = null; + private Vector filter_list = null; + private Vector service_data = null; + private JList service_list = null; + private JScrollPane service_scroll = null; + private JButton remove_service_button = null; + private JPanel remove_service_panel = null; + private EmptyBorder indent_border = null; + private EmptyBorder empty_border = null; + private JPanel service_area = null; + private JPanel add_service_area = null; + private JTextField add_service_field = null; + private JButton add_service_button = null; + private JPanel add_service_panel = null; + + /** + * Constructor + */ + public ServiceFilterPanel(String text, Vector list) { + empty_border = new EmptyBorder(5,5,0,5); + indent_border = new EmptyBorder(5,25,5,5); + service_box = new JCheckBox(text); + service_box.addActionListener(this); + service_data = new Vector(); + if (list != null) { + service_box.setSelected(true); + service_data = (Vector) list.clone(); + } + service_list = new JList(service_data); + service_list.setBorder(new EtchedBorder()); + service_list.setVisibleRowCount(5); + service_list.addListSelectionListener(this); + service_list.setEnabled(service_box.isSelected()); + service_scroll = new JScrollPane(service_list); + service_scroll.setBorder(new EtchedBorder()); + remove_service_button = new JButton("Remove"); + remove_service_button.addActionListener(this); + remove_service_button.setEnabled(false); + remove_service_panel = new JPanel(); + remove_service_panel.setLayout(new FlowLayout()); + remove_service_panel.add(remove_service_button); + service_area = new JPanel(); + service_area.setLayout(new BorderLayout()); + service_area.add(service_scroll, BorderLayout.CENTER); + service_area.add(remove_service_panel, BorderLayout.EAST); + service_area.setBorder(indent_border); + add_service_field = new JTextField(); + add_service_field.addActionListener(this); + add_service_field.getDocument().addDocumentListener(this); + add_service_field.setEnabled(service_box.isSelected()); + add_service_button = new JButton("Add"); + add_service_button.addActionListener(this); + add_service_button.setEnabled(false); + add_service_panel = new JPanel(); + add_service_panel.setLayout(new BorderLayout()); + JPanel dummy = new JPanel(); + dummy.setBorder(empty_border); + add_service_panel.add(dummy, BorderLayout.WEST); + add_service_panel.add(add_service_button, BorderLayout.EAST); + add_service_area = new JPanel(); + add_service_area.setLayout(new BorderLayout()); + add_service_area.add(add_service_field, BorderLayout.CENTER); + add_service_area.add(add_service_panel, BorderLayout.EAST); + add_service_area.setBorder(indent_border); + setLayout(new BorderLayout()); + add(service_box, BorderLayout.NORTH); + add(service_area, BorderLayout.CENTER); + add(add_service_area, BorderLayout.SOUTH); + setBorder(empty_border); + } + + /** + * Get the current list of services + */ + public Vector getServiceList() { + Vector list = null; + if (service_box.isSelected()) { + list = service_data; + } + return list; + } + + /** + * Listener to handle button actions + */ + public void actionPerformed(ActionEvent e) { + // Check if the user changed the service filter option + if (e.getSource() == service_box) { + service_list.setEnabled(service_box.isSelected()); + service_list.clearSelection(); + remove_service_button.setEnabled(false); + add_service_field.setEnabled(service_box.isSelected()); + add_service_field.setText(""); + add_service_button.setEnabled(false); + } + // Check if the user pressed the add service button + if ((e.getSource() == add_service_button) || + (e.getSource() == add_service_field)) { + String text = add_service_field.getText(); + if ((text != null) && (text.length() > 0)) { + service_data.addElement(text); + service_list.setListData(service_data); + } + add_service_field.setText(""); + add_service_field.requestFocus(); + } + // Check if the user pressed the remove service button + if (e.getSource() == remove_service_button) { + Object[] sels = service_list.getSelectedValues(); + for (int i=0; i 0)) { + add_service_button.setEnabled(true); + } else { + add_service_button.setEnabled(false); + } + } + + /** + * Handle changes to the text field + */ + public void insertUpdate(DocumentEvent e) { + changedUpdate(e); + } + + /** + * Handle changes to the text field + */ + public void removeUpdate(DocumentEvent e) { + changedUpdate(e); + } + + /** + * Listener to handle service list selection changes + */ + public void valueChanged(ListSelectionEvent e) { + if (service_list.getSelectedIndex() == -1) { + remove_service_button.setEnabled(false); + } else { + remove_service_button.setEnabled(true); + } + } + } + + /** + * Class for showing the filter dialog + */ + class SOAPMonitorFilter implements ActionListener { + + /** + * Private data + */ + private JDialog dialog = null; + private JPanel panel = null; + private JPanel buttons = null; + private JButton ok_button = null; + private JButton cancel_button = null; + private ServiceFilterPanel include_panel = null; + private ServiceFilterPanel exclude_panel = null; + private JPanel status_panel = null; + private JCheckBox status_box = null; + private EmptyBorder empty_border = null; + private EmptyBorder indent_border = null; + private JPanel status_options = null; + private ButtonGroup status_group = null; + private JRadioButton status_active = null; + private JRadioButton status_complete = null; + private Vector filter_include_list = null; + private Vector filter_exclude_list = null; + private boolean filter_active = false; + private boolean filter_complete = false; + private boolean ok_pressed = false; + + /** + * Constructor + */ + public SOAPMonitorFilter() { + // By default, exclude NotificationService and + // EventViewerService messages + filter_exclude_list = new Vector(); + filter_exclude_list.addElement("NotificationService"); + filter_exclude_list.addElement("EventViewerService"); + } + + /** + * Get list of services to be included + */ + public Vector getFilterIncludeList() { + return filter_include_list; + } + + /** + * Get list of services to be excluded + */ + public Vector getFilterExcludeList() { + return filter_exclude_list; + } + + /** + * Check if filter active messages + */ + public boolean getFilterActive() { + return filter_active; + } + + /** + * Check if filter complete messages + */ + public boolean getFilterComplete() { + return filter_complete; + } + + /** + * Show the filter dialog + */ + public void showDialog() { + empty_border = new EmptyBorder(5,5,0,5); + indent_border = new EmptyBorder(5,25,5,5); + include_panel = new ServiceFilterPanel("Include messages based on target service:", + filter_include_list); + exclude_panel = new ServiceFilterPanel("Exclude messages based on target service:", + filter_exclude_list); + status_box = new JCheckBox("Filter messages based on status:"); + status_box.addActionListener(this); + status_active = new JRadioButton("Active messages only"); + status_active.setSelected(true); + status_active.setEnabled(false); + status_complete = new JRadioButton("Complete messages only"); + status_complete.setEnabled(false); + status_group = new ButtonGroup(); + status_group.add(status_active); + status_group.add(status_complete); + if (filter_active || filter_complete) { + status_box.setSelected(true); + status_active.setEnabled(true); + status_complete.setEnabled(true); + if (filter_complete) { + status_complete.setSelected(true); + } + } + status_options = new JPanel(); + status_options.setLayout(new BoxLayout(status_options, BoxLayout.Y_AXIS)); + status_options.add(status_active); + status_options.add(status_complete); + status_options.setBorder(indent_border); + status_panel = new JPanel(); + status_panel.setLayout(new BorderLayout()); + status_panel.add(status_box, BorderLayout.NORTH); + status_panel.add(status_options, BorderLayout.CENTER); + status_panel.setBorder(empty_border); + ok_button = new JButton("Ok"); + ok_button.addActionListener(this); + cancel_button = new JButton("Cancel"); + cancel_button.addActionListener(this); + buttons = new JPanel(); + buttons.setLayout(new FlowLayout()); + buttons.add(ok_button); + buttons.add(cancel_button); + panel = new JPanel(); + panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); + panel.add(include_panel); + panel.add(exclude_panel); + panel.add(status_panel); + panel.add(buttons); + dialog = new JDialog(); + dialog.setTitle("SOAP Monitor Filter"); + dialog.setContentPane(panel); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setModal(true); + dialog.pack(); + Dimension d = dialog.getToolkit().getScreenSize(); + dialog.setLocation((d.width-dialog.getWidth())/2, + (d.height-dialog.getHeight())/2); + ok_pressed = false; + dialog.show(); + } + + /** + * Listener to handle button actions + */ + public void actionPerformed(ActionEvent e) { + // Check if the user pressed the ok button + if (e.getSource() == ok_button) { + filter_include_list = include_panel.getServiceList(); + filter_exclude_list = exclude_panel.getServiceList(); + if (status_box.isSelected()) { + filter_active = status_active.isSelected(); + filter_complete = status_complete.isSelected(); + } else { + filter_active = false; + filter_complete = false; + } + ok_pressed = true; + dialog.dispose(); + } + // Check if the user pressed the cancel button + if (e.getSource() == cancel_button) { + dialog.dispose(); + } + // Check if the user changed the status filter option + if (e.getSource() == status_box) { + status_active.setEnabled(status_box.isSelected()); + status_complete.setEnabled(status_box.isSelected()); + } + } + + /** + * Check if the user pressed the ok button + */ + public boolean okPressed() { + return ok_pressed; + } + } + + /** + * Text panel class that supports XML reflow + */ + class SOAPMonitorTextArea extends JTextArea { + + /** + * Private data + */ + private boolean format = false; + private String original = ""; + private String formatted = null; + + /** + * Constructor + */ + public SOAPMonitorTextArea() { + } + + /** + * Override setText to do formatting + */ + public void setText(String text) { + original = text; + formatted = null; + if (format) { + doFormat(); + super.setText(formatted); + } else { + super.setText(original); + } + } + + /** + * Turn reflow on or off + */ + public void setReflowXML(boolean reflow) { + format = reflow; + if (format) { + if (formatted == null) { + doFormat(); + } + super.setText(formatted); + } else { + super.setText(original); + } + } + + /** + * Reflow XML + */ + public void doFormat() { + Vector parts = new Vector(); + char[] chars = original.toCharArray(); + int index = 0; + int first = 0; + String part = null; + while (index < chars.length) { + // Check for start of tag + if (chars[index] == '<') { + // Did we have data before this tag? + if (first < index) { + part = new String(chars,first,index-first); + part = part.trim(); + // Save non-whitespace data + if (part.length() > 0) { + parts.addElement(part); + } + } + // Save the start of tag + first = index; + } + // Check for end of tag + if (chars[index] == '>') { + // Save the tag + part = new String(chars,first,index-first+1); + parts.addElement(part); + first = index+1; + } + // Check for end of line + if ((chars[index] == '\n') || (chars[index] == '\r')) { + // Was there data on this line? + if (first < index) { + part = new String(chars,first,index-first); + part = part.trim(); + // Save non-whitespace data + if (part.length() > 0) { + parts.addElement(part); + } + } + first = index+1; + } + index++; + } + // Reflow as XML + StringBuffer buf = new StringBuffer(); + Object[] list = parts.toArray(); + int indent = 0; + int pad = 0; + index = 0; + while (index < list.length) { + part = (String) list[index]; + if (buf.length() == 0) { + // Just add first tag (should be XML header) + buf.append(part); + } else { + // All other parts need to start on a new line + buf.append('\n'); + // If we're at an end tag then decrease indent + if (part.startsWith("")) { + indent++; + // Check for special data case + if ((index + 2) < list.length) { + part = (String) list[index+2]; + if (part.startsWith(" + + +<%@ 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"); +%> + + + + Apache-Axis + + + + +

Apache-AXIS

+ +<%= getLocaleChoice() %> + +<% + out.print(getMessage("welcomeMessage")+"

"); + out.print(getMessage("operationType")); +%> + +

+ +<% + out.print(getMessage("sideNote") +"

"); +%> + +<% + out.print("

"+ getMessage("validatingAxis") +"

"); + + out.print(getMessage("validationNote00") +"

"); + out.print(getMessage("validationNote01")); +%> + + diff --git a/services/additions/admin/axis/fingerprint.jsp b/services/additions/admin/axis/fingerprint.jsp new file mode 100644 index 000000000..fa122ce83 --- /dev/null +++ b/services/additions/admin/axis/fingerprint.jsp @@ -0,0 +1,274 @@ +<%-- $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" %> + + +System Fingerprint + + +<%! + + /* + * 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=""+file.getName()+""; + key+= ""+file.length()+""; + Date timestamp=new Date(file.lastModified()); + key+= ""+timestamp.toString()+""; + 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"); + out.print(title); + out.println(""); + out.println(""); + for (int i=0; i"+getFileVersion(jars[i])+""); + } + out.println("
"); + if(comment!=null && comment.length()>0) { + out.println("

"); + out.println(comment); + out.println("

"); + } + } + +%> +

System Fingerprint

+

JVM and Server Version

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Servlet Engine<%= getServletConfig().getServletContext().getServerInfo() %><%= getServletConfig().getServletContext().getMajorVersion() %><%= getServletConfig().getServletContext().getMinorVersion() %>
Java VM<%= System.getProperty("java.vm.vendor") %><%= System.getProperty("java.vm.name") %><%= System.getProperty("java.vm.version") %>
Java RE<%= System.getProperty("java.vendor") %><%= System.getProperty("java.version") %>
Platform<%= System.getProperty("os.name") %><%= System.getProperty("os.arch") %><%= System.getProperty("os.version") %>
+ +<% +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. +} +%> + + \ No newline at end of file diff --git a/services/additions/admin/axis/happyaxis.jsp b/services/additions/admin/axis/happyaxis.jsp new file mode 100644 index 000000000..1267783d2 --- /dev/null +++ b/services/additions/admin/axis/happyaxis.jsp @@ -0,0 +1,493 @@ +<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> + + +<%@ 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("
  • "+getMessage("foundClass00",description,classname)+"

  • "); + } + else { + out.write("
  • "+getMessage("foundClass01",description,classname,location)+"

  • "); + } + 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, + ""+getMessage("error")+"", + 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, + ""+getMessage("warning")+"", + 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"); +%> + + +<%= getMessage("pageTitle") %> + + + +<% + out.print("

    "+ getMessage("pageTitle") +"

    "); + out.print("

    "+ getMessage("pageRole") +"

    "); +%> + +<%= getLocaleChoice() %> + +<% + out.print("

    "+ getMessage("neededComponents") +"

    "); +%> + + +<% + out.print("

    "+ getMessage("optionalComponents") +"

    "); +%> + +<% + out.write("

    "); + //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("

    "); +%> + + +

    <%= getMessage("apsExamining") %>

    + + + +<% if(xmlParser.indexOf("crimson")>=0) { %> +

    + <%= getMessage("recommendedParser") %> +

    +<% } %> + +

    <%= getMessage("sysExamining") %>

    + +
    + <%= getMessage("apsPlatform") %>: + <%= getServletConfig().getServletContext().getServerInfo() %> + + diff --git a/services/additions/admin/axis/i18nLib.jsp b/services/additions/admin/axis/i18nLib.jsp new file mode 100644 index 000000000..545b69e0f --- /dev/null +++ b/services/additions/admin/axis/i18nLib.jsp @@ -0,0 +1,223 @@ +<%-- $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("
    \n"); + buf.append(getMessage("language")); + buf.append(": "); + + StringTokenizer st = new StringTokenizer(choice); + String locale = null; + while (st.hasMoreTokens()) { + locale = st.nextToken(); + buf.append("["+ locale +"] "); + } + buf.append("\n
    \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 \ No newline at end of file diff --git a/services/build.xml b/services/build.xml new file mode 100644 index 000000000..f70ea310e --- /dev/null +++ b/services/build.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compile webservices + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/lib/axis-ant.jar b/services/lib/axis-ant.jar new file mode 100644 index 000000000..17527ffdd Binary files /dev/null and b/services/lib/axis-ant.jar differ diff --git a/services/lib/axis.jar b/services/lib/axis.jar new file mode 100644 index 000000000..20b09a595 Binary files /dev/null and b/services/lib/axis.jar differ diff --git a/services/lib/commons-discovery-0.2.jar b/services/lib/commons-discovery-0.2.jar new file mode 100644 index 000000000..b88554847 Binary files /dev/null and b/services/lib/commons-discovery-0.2.jar differ diff --git a/services/lib/commons-logging-1.0.4.jar b/services/lib/commons-logging-1.0.4.jar new file mode 100644 index 000000000..b73a80fab Binary files /dev/null and b/services/lib/commons-logging-1.0.4.jar differ diff --git a/services/lib/jaxrpc.jar b/services/lib/jaxrpc.jar new file mode 100644 index 000000000..a2c13d9a2 Binary files /dev/null and b/services/lib/jaxrpc.jar differ diff --git a/services/lib/saaj.jar b/services/lib/saaj.jar new file mode 100644 index 000000000..4ea696e74 Binary files /dev/null and b/services/lib/saaj.jar differ diff --git a/services/lib/wsdl4j-1.5.1.jar b/services/lib/wsdl4j-1.5.1.jar new file mode 100644 index 000000000..c6254ee69 Binary files /dev/null and b/services/lib/wsdl4j-1.5.1.jar differ diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/VitroWs.java b/services/src/edu/cornell/mannlib/vitro/webservices/VitroWs.java new file mode 100644 index 000000000..60fb7677c --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/VitroWs.java @@ -0,0 +1,184 @@ +package edu.cornell.mannlib.vitro.webservices; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean; +import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; +import edu.cornell.mannlib.vitro.webapp.beans.Tab; +import edu.cornell.mannlib.vitro.webapp.dao.TabDao; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.dao.filtering.VitroFilters; +import edu.cornell.mannlib.vitro.webapp.dao.filtering.WebappDaoFactoryFiltering; +import edu.cornell.mannlib.vitro.webapp.utils.VitroFilterFactory; +import org.apache.axis.MessageContext; +import org.apache.axis.transport.http.HTTPConstants; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServlet; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Date; +import java.util.ListIterator; + +/** + + * This is exposed by apache axis to provide a web service where folks can + * get tabs and simple entities. Jim doesn't seem to be using the properties so + * they are commented out. + * + * + * Created: Wed Aug 16 11:36:15 2006 + * @version 1.0 + */ +public class VitroWs { + //private VitroFacade vf; + private WebappDaoFactory webDaoFactory; + private ApplicationBean appBean; + + public VitroWs() { + //System.out.println("is this even getting deployed?"); + //wow, this is how to get a servlet context in axis. + HttpServlet srv = + (HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET); + ServletContext context = srv.getServletContext(); + //vf = VitroDataSourceSetup.getFacade(context); + webDaoFactory = (WebappDaoFactory)context.getAttribute("webappDaoFactory"); + + appBean = new ApplicationBean(); //is this the correct way to get one of these? + } + + /** + Gets a tab with related entities. The returned Tab does not have + child tab list filled. + */ + public Tab getFullTab(int tabid, int portalid, int depth, boolean withEntities){ + Tab tab = null; + //System.out.println("is this even getting deployed?"); + VitroFilters dateFilter = VitroFilterFactory.getSunsetWindowFilter(new Date()); + + WebappDaoFactory wdf = new WebappDaoFactoryFiltering(webDaoFactory, dateFilter); + TabDao tabdao= wdf.getTabDao(); + tab = tabdao.getTab(tabid, PUBLIC_AUTH_LEVEL,appBean, depth); + + if( withEntities ) + tab.setRelatedEntityList(tab.getRelatedEntityList(null));//null indicates no alpha filtering + else + tab.setRelatedEntityList(Collections.EMPTY_LIST); + + strip(tab); + tab.placeEntityFactory(null); + return tab; + } + + /** Gets Entity with properties filled out. */ + public Individual getFullEntityById(String entityUri, int portalid){ + //System.out.println("is this even getting deployed?"); + //IndividualWebapp entity = vf.entityById(entityId); + Individual entity = webDaoFactory.getIndividualDao().getIndividualByURI( entityUri ); + setUpEntity(entity); + setUpDescription(entity); + return entity; + } + + public List getTabsForPortal( int portalid ){ + //System.out.println("is this even getting deployed?"); + //return vf.getTabsForPortal(portalid); + return webDaoFactory.getTabDao().getTabsForPortal(portalid); + } + + private void setUpEntity(Individual entity){ +// //webDaoFactory.getCoreDaoFactory().getEnts2EntsDao().fillExistingEnts2Ents( entity ); //this may filter entitys in the ents2ents list +// //webDaoFactory.getPropertyWebappDao().fillEntityProperties( entity ); + + //webDaoFactory.getDataPropertyStatementDao().fillExistingDataPropertyStatementsForIndividual( entity ); + + webDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(entity); + webDaoFactory.getIndividualDao().fillVClassForIndividual( entity ); + webDaoFactory.getLinksDao().addLinksToIndividual( entity ); + entity.setKeywords(webDaoFactory.getIndividualDao().getKeywordsForIndividual(entity.getURI())); + + // jc55 causes problems with web services if populated + entity.setHiddenFromDisplayBelowRoleLevel(null); + entity.setProhibitedFromUpdateBelowRoleLevel(null); +// //entity.sortForDisplay(); + } + + /** + * Set entity up with a description from data props if there is none. + * + * @param entity + */ + private void setUpDescription(Individual entity) { + if( entity != null && + (entity.getDescription() == null || entity.getDescription().length() == 0)){ + //if there is nothing in the desc then try to get a dataprop and stick that in the desc + List e2d = entity.getDataPropertyStatements(); + if( e2d != null && e2d.size() > 0 ){ + Iterator it = e2d.iterator(); + while(it.hasNext()){ + DataPropertyStatement data = (DataPropertyStatement) it.next(); + if( RESEARCH_FOCUS_DATAPROP_URI.equals( data.getDatapropURI() ) + && data.getData() != null && data.getData().length() > 0 ){ + entity.setDescription(data.getData()); + break; + } + } + } + } + } + + + private void strip(Tab tab){ + if( tab == null ) return; + if( tab.getChildTabs() != null ){ + for( Tab childTab : tab.getChildTabs()){ + childTab.setChildTabs(null); + childTab.setRelatedEntityList(Collections.EMPTY_LIST); + } + } + if( tab.getRelatedEntities() != null ){ + for( Individual ind : tab.getRelatedEntities()){ + strip(ind); + } + } + } + + private void strip(Individual ind){ + webDaoFactory.getObjectPropertyDao().fillObjectPropertiesForIndividual(ind); + + List props = ind.getObjectPropertyList(); + + if( props != null && props.size() > 0 ){ + ListIterator iterator = props.listIterator(); + while(iterator.hasNext()){ + ObjectProperty prop= iterator.next(); + + // jc55 unlikely to be the source of the problem, but try anyway + prop.setProhibitedFromUpdateBelowRoleLevel(null); + prop.setHiddenFromDisplayBelowRoleLevel(null); + + if(! ( HAS_TEACHER.equals( prop.getURI() ) + || IN_SEMESTER.equals( prop.getURI()) )){ + iterator.remove(); + } + } + } + + ind.setDatatypePropertyList(Collections.EMPTY_LIST); + ind.setDataPropertyStatements(Collections.EMPTY_LIST); + ind.setKeywords(Collections.EMPTY_LIST); + } + + + final int PUBLIC_AUTH_LEVEL = 0; + final String RESEARCH_FOCUS_DATAPROP_URI = "http://vivo.library.cornell.edu/ns/0.1#researchFocus"; + + final String HAS_TEACHER = "http://vivo.library.cornell.edu/ns/0.1#SemesterCourseHasTeacherPerson"; + final String IN_SEMESTER = "http://vivo.library.cornell.edu/ns/0.1#SemesterCourseOccursInSemester"; +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/semantic.cache b/services/src/edu/cornell/mannlib/vitro/webservices/semantic.cache new file mode 100644 index 000000000..00c5584ec --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/semantic.cache @@ -0,0 +1,15 @@ +;; Object webservices/ +;; SEMANTICDB Tags save file +(semanticdb-project-database-file "webservices/" + :tables (list + (semanticdb-table "VitroWs.java" + :major-mode 'jde-mode + :tags '(("edu.cornell.mannlib.vitro.webservices" package nil nil [1 47]) ("edu.cornell.mannlib.vitro.db.dao.VitroFacade" include nil nil [49 101]) ("edu.cornell.mannlib.vitro.beans.Tab" include nil nil [102 145]) ("edu.cornell.mannlib.vitro.flags.PortalFlag" include nil nil [146 196]) ("formbeans.ApplicationBean" include nil nil [197 230]) ("edu.cornell.mannlib.vitro.beans.Entity" include nil nil [231 277]) ("java.util.List" include nil nil [278 300]) ("VitroWs" type (:typemodifiers ("public") :members (("VitroWs" function (:constructor-flag t :typemodifiers ("public")) (reparse-symbol class_member_declaration) [394 413]) ("getFullTab" function (:typemodifiers ("public") :arguments (("tabid" variable (:type "int") (reparse-symbol formal_parameters) [559 568]) ("portalid" variable (:type "int") (reparse-symbol formal_parameters) [570 582])) :type "Tab") (reparse-symbol class_member_declaration) [537 848]) ("getFullEntityById" function (:typemodifiers ("public") :arguments (("entityId" variable (:type "int") (reparse-symbol formal_parameters) [948 960]) ("portalid" variable (:type "int") (reparse-symbol formal_parameters) [962 974])) :type "Entity") (reparse-symbol class_member_declaration) [916 1175]) ("getTabsForPortal" function (:typemodifiers ("public") :arguments (("portalid" variable (:type "int") (reparse-symbol formal_parameters) [1211 1223])) :type "List") (reparse-symbol class_member_declaration) [1181 1330])) :type "class") nil [366 1532])) + :file "VitroWs.java" + :pointmax 1533 + ) + ) + :file "semantic.cache" + :semantic-tag-version "2.0pre3" + :semanticdb-version "2.0pre3" + ) diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerFactory.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerFactory.java new file mode 100644 index 000000000..100c4b37c --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerFactory.java @@ -0,0 +1,29 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializerFactory; + +import java.util.Iterator; +import java.util.Vector; + +/** + * * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class EntitySerFactory implements SerializerFactory { + private Vector mechanisms; + + public EntitySerFactory() { + } + public javax.xml.rpc.encoding.Serializer getSerializerAs(String mechanismType) { + return new EntitySerializer(); + } + public Iterator getSupportedMechanismTypes() { + if (mechanisms == null) { + mechanisms = new Vector(); + mechanisms.add(Constants.AXIS_SAX); + } + return mechanisms.iterator(); + } +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerializer.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerializer.java new file mode 100644 index 000000000..b11d761dc --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EntitySerializer.java @@ -0,0 +1,152 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializationContext; +import org.apache.axis.encoding.Serializer; +import org.apache.axis.wsdl.fromJava.Types; +import org.w3c.dom.Element; +import org.xml.sax.Attributes; + +import javax.xml.namespace.QName; +import java.io.IOException; +import java.util.Collections; +import java.util.Iterator; + +/** + * WARNING: SUPER AWFUL, OBJECT ORIENTED NO-NO'S AHEAD + * -- !serializing an entity will change it! -- + * * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class EntitySerializer implements Serializer { + public static final QName myTypeQName = new QName("typeNS", "VitroEntity"); + + public static final String ID_MBER = "id"; + public static final String NAME_MBER= "name"; + public static final String MONIKER_MBER= "moniker"; + public static final String VCLASS_MBER= "vClass"; + public static final String URL_MBER= "url"; + public static final String DESCRIPTION_MBER= "description"; + public static final String SUNRISE_MBER= "sunrise"; + public static final String SUNSET_MBER= "sunset"; + public static final String TIMEKEY_MBER= "timekey"; + //public static final String MODTIME_MBER= "modTime"; + public static final String IMAGEFILE_MBER= "imageFile"; + public static final String ANCHOR_MBER= "anchor"; + public static final String BLURB_MBER= "blurb"; + public static final String IMAGETHUMB_MBER= "imageThumb"; + public static final String CITATION_MBER= "citation"; + public static final String STATUS_MBER= "status"; + public static final String PROPERTYLIST_MBER= "propertyList"; + public static final String LINKSLIST_MBER= "linksList"; + public static final String KEYWORDS_MBER="keywords"; + public static final String VCLASSID_MBER= "vClassId"; + + /** this is not on the original Entity object */ + public static final String RELATED_ENTITIES_MBER ="relatedEntities"; + + /** + * Serialize an element named name, with the indicated attributes + * and value. + * @param name is the element name + * @param attributes are the attributes...serialize is free to add more. + * @param value is the value + * @param context is the SerializationContext + */ + public void serialize(QName name, Attributes attributes, + Object value, SerializationContext context) + throws IOException + { + if (!(value instanceof Individual)) + throw new IOException("Can't serialize a " + value.getClass().getName() + " with a EntitySerializer."); + Individual ent = (Individual)value; + + // jc55 causes problems with web services if populated + ent.setHiddenFromDisplayBelowRoleLevel(null); + ent.setProhibitedFromUpdateBelowRoleLevel(null); + + context.startElement(name, attributes); + + prepareForSerialization( ent ); + + context.serialize(new QName("", ID_MBER), null, ent.getURI()); + context.serialize(new QName("", NAME_MBER), null, ent.getName()); + context.serialize(new QName("", MONIKER_MBER), null, ent.getMoniker()); + context.serialize(new QName("", VCLASS_MBER), null, ent.getVClass()); + context.serialize(new QName("", URL_MBER), null, ent.getUrl()); + context.serialize(new QName("", DESCRIPTION_MBER), null, ent.getDescription()); + context.serialize(new QName("", SUNRISE_MBER), null, ent.getSunrise()); + context.serialize(new QName("", SUNSET_MBER), null, ent.getSunset()); + context.serialize(new QName("", TIMEKEY_MBER), null, ent.getTimekey()); + context.serialize(new QName("", IMAGEFILE_MBER), null, ent.getImageFile()); + context.serialize(new QName("", ANCHOR_MBER), null, ent.getAnchor()); + context.serialize(new QName("", BLURB_MBER), null, ent.getBlurb()); + context.serialize(new QName("", IMAGETHUMB_MBER), null, ent.getImageThumb()); + context.serialize(new QName("", CITATION_MBER), null, ent.getCitation()); + context.serialize(new QName("", STATUS_MBER), null, ent.getStatus()); + context.serialize(new QName("", LINKSLIST_MBER), null, ent.getLinksList()); + context.serialize(new QName("", KEYWORDS_MBER), null, ent.getKeywords()); + context.serialize(new QName("", VCLASSID_MBER), null, ent.getVClassURI()); + + //after the minimize this should only have property->ents2ent with no Entity objs. + context.serialize(new QName("", PROPERTYLIST_MBER), null, ent.getObjectPropertyList()); + + context.endElement(); + } + + public String getMechanismType() { return Constants.AXIS_SAX; } + + public Element writeSchema(Class javaType, Types types) throws Exception { + return null; + } + + /** + * 1) reflects props and ents2ents domainside, + * 2) sorts + * 3) removed domain Entity object from all ents2ents + * + */ + private final void prepareForSerialization(final Individual ent){ + if( ent == null || ent.getObjectPropertyList() == null) return; + + ent.sortForDisplay(); + //ent.forceAllPropertiesDomainSide(); + + Iterator it = ent.getObjectPropertyList().iterator(); + while(it.hasNext()){ + ObjectProperty prop = (ObjectProperty)it.next(); + prepareProperty(prop); + } + } + + /** + * calls prepareEnts2Ents on each ents2ents of Property + */ + private final void prepareProperty(final ObjectProperty prop){ + if( prop == null || prop.getObjectPropertyStatements() == null ) return; + + Iterator it = prop.getObjectPropertyStatements().iterator(); + while(it.hasNext()){ + prepareEnts2Ents((ObjectPropertyStatement)it.next()); + } + } + + private final void prepareEnts2Ents(final ObjectPropertyStatement e2e ){ + if( e2e != null){ + e2e.setSubject(null); + e2e.setProperty(null); + + //we don't want to serialize any deeper + Individual objInd = e2e.getObject(); + objInd.setObjectPropertyStatements(Collections.EMPTY_LIST); + objInd.setDataPropertyStatements(Collections.EMPTY_LIST); + objInd.setPropertyList(Collections.EMPTY_LIST); + objInd.setDatatypePropertyList(Collections.EMPTY_LIST); + + } + } +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerFactory.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerFactory.java new file mode 100644 index 000000000..3af5741dc --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerFactory.java @@ -0,0 +1,29 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializerFactory; + +import java.util.Iterator; +import java.util.Vector; + +/** + * * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class Ents2EntsSerFactory implements SerializerFactory { + private Vector mechanisms; + + public Ents2EntsSerFactory() { + } + public javax.xml.rpc.encoding.Serializer getSerializerAs(String mechanismType) { + return new Ents2EntsSerializer(); + } + public Iterator getSupportedMechanismTypes() { + if (mechanisms == null) { + mechanisms = new Vector(); + mechanisms.add(Constants.AXIS_SAX); + } + return mechanisms.iterator(); + } +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerializer.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerializer.java new file mode 100644 index 000000000..a7f2b310b --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/Ents2EntsSerializer.java @@ -0,0 +1,111 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializationContext; +import org.apache.axis.encoding.Serializer; +import org.apache.axis.wsdl.fromJava.Types; +import org.w3c.dom.Element; +import org.xml.sax.Attributes; + +import javax.xml.namespace.QName; +import java.io.IOException; + +/** + * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class Ents2EntsSerializer implements Serializer { + public static final QName myTypeQName = new QName("typeNS", "VitroEntity"); + + public static final String ENTS2ENTSID_MBER = "ents2entsId"; + public static final String DOMAINID_MBER = "domainId"; + public static final String DOMAIN_MBER = "domain"; + public static final String RANGEID_MBER = "rangeId"; + public static final String RANGE_MBER = "range"; + public static final String PROPERTYID_MBER = "propertyId"; + public static final String PROPERTY_MBER = "property"; + public static final String QUALIFIER_MBER = "qualifier"; + public static final String DOMAINORIENTED_MBER = "domainOriented"; + + + /** + * Serialize an element named name, with the indicated attributes + * and value. + * @param name is the element name + * @param attributes are the attributes...serialize is free to add more. + * @param value is the value + * @param context is the SerializationContext + */ + public void serialize(QName name, Attributes attributes, + Object value, SerializationContext context) + throws IOException + { + if (!(value instanceof ObjectPropertyStatement)) + throw new IOException("Can't serialize a " + value.getClass().getName() + " with a Ents2EntsSerializer."); + ObjectPropertyStatement e2e = (ObjectPropertyStatement)value; + context.startElement(name, attributes); + + //context.serialize(new QName("", ENTS2ENTSID_MBER), null, e2e.getEnts2entsId()); + //context.serialize(new QName("", DOMAINID_MBER), null, e2e.getDomainId()); + //context.serialize(new QName("", DOMAIN_MBER), null, e2e.getDomain()); + context.serialize(new QName("", RANGEID_MBER), null, e2e.getObjectURI()); + + //we don't want to serialize any further. + Individual object = e2e.getObject(); + object.setObjectPropertyStatements(null); + context.serialize(new QName("", RANGE_MBER), null, object); + + //context.serialize(new QName("", PROPERTYID_MBER), null, e2e.getPropertyId()); + //context.serialize(new QName("", PROPERTY_MBER), null, e2e.getProperty()); + context.serialize(new QName("", QUALIFIER_MBER), null, e2e.getQualifier()); + + context.endElement(); + } + + public String getMechanismType() { return Constants.AXIS_SAX; } + + public Element writeSchema(Class javaType, Types types) throws Exception { + return null; + } + +// /** +// * 1) reflects props and ents2ents domainside, +// * 2) sorts +// * 3) removed domain Entity object from all ents2ents +// * +// */ +// private final void prepareForSerialization(final Entity ent){ +// if( ent == null || ent.getPropertyList() == null) return; + +// ent.sortForDisplay(); +// ent.forceAllPropertiesDomainSide(); + +// Iterator it = ent.getPropertyList().iterator(); +// while(it.hasNext()){ +// Property prop = (Property)it.next(); +// prepareProperty(prop); +// } +// } + +// /** +// * calls prepareEnts2Ents on each ents2ents of Property +// */ +// private final void prepareProperty(final Property prop){ +// if( prop == null || prop.getEnts2Ents() == null ) return; + +// Iterator it = prop.getEnts2Ents().iterator(); +// while(it.hasNext()){ +// prepareEnts2Ents((Ents2Ents)it.next()); +// } +// } + +// private final void prepareEnts2Ents(final Ents2Ents e2e ){ +// if( e2e != null){ +// e2e.setDomain(null); +// e2e.setProperty(null); +// } +// } +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerFactory.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerFactory.java new file mode 100644 index 000000000..223429041 --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerFactory.java @@ -0,0 +1,29 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializerFactory; + +import java.util.Iterator; +import java.util.Vector; + +/** + * * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class EshipRetroObjectPropertySerFactory implements SerializerFactory { + private Vector mechanisms; + + public EshipRetroObjectPropertySerFactory () { + } + public javax.xml.rpc.encoding.Serializer getSerializerAs(String mechanismType) { + return new EshipRetroObjectPropertySerializer(); + } + public Iterator getSupportedMechanismTypes() { + if (mechanisms == null) { + mechanisms = new Vector(); + mechanisms.add(Constants.AXIS_SAX); + } + return mechanisms.iterator(); + } +} diff --git a/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerializer.java b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerializer.java new file mode 100644 index 000000000..fa40c6135 --- /dev/null +++ b/services/src/edu/cornell/mannlib/vitro/webservices/serializers/EshipRetroObjectPropertySerializer.java @@ -0,0 +1,78 @@ +package edu.cornell.mannlib.vitro.webservices.serializers; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import org.apache.axis.Constants; +import org.apache.axis.encoding.SerializationContext; +import org.apache.axis.encoding.Serializer; +import org.apache.axis.wsdl.fromJava.Types; +import org.w3c.dom.Element; +import org.xml.sax.Attributes; + +import javax.xml.namespace.QName; +import java.io.IOException; +import java.util.List; + + +/** + * This is used to by the axis webservices. see vitro/webservices/wsdd/VitroWs.wsdd + */ +public class EshipRetroObjectPropertySerializer implements Serializer { + public static final QName myTypeQName = new QName("typeNS", "VitroEntity"); + + public static final String ENTS2ENTSID_MBER = "ents2entsId"; + public static final String DOMAINID_MBER = "domainId"; + public static final String DOMAIN_MBER = "domain"; + public static final String RANGEID_MBER = "rangeId"; + public static final String RANGE_MBER = "range"; + public static final String PROPERTYID_MBER = "propertyId"; + public static final String PROPERTY_MBER = "property"; + public static final String QUALIFIER_MBER = "qualifier"; + public static final String DOMAINORIENTED_MBER = "domainOriented"; + + + /** + * Serialize an element named name, with the indicated attributes + * and value. + * @param name is the element name + * @param attributes are the attributes...serialize is free to add more. + * @param value is the value + * @param context is the SerializationContext + */ + public void serialize(QName name, Attributes attributes, + Object value, SerializationContext context) + throws IOException + { + if (!(value instanceof ObjectProperty )) + throw new IOException("Can't serialize a " + value.getClass().getName() + " with a EshipRetroObjectPropertySerializer."); + ObjectProperty e2e = (ObjectProperty)value; + + //jc55 trouble with RoleLevel objects + e2e.setProhibitedFromUpdateBelowRoleLevel(null); + e2e.setHiddenFromDisplayBelowRoleLevel(null); + + context.startElement(name, attributes); + + //context.serialize(new QName("", ENTS2ENTSID_MBER), null, e2e.getEnts2entsId()); + //context.serialize(new QName("", DOMAINID_MBER), null, e2e.getDomainId()); + //context.serialize(new QName("", DOMAIN_MBER), null, e2e.getDomain()); + context.serialize(new QName("", "URI" ), null, e2e.getURI()); + context.serialize(new QName("", "domainPublic"), null, e2e.getDomainPublic()); + context.serialize(new QName("", "domainSide" ), null, e2e.getDomainSide()); + + List stmts = e2e.getObjectPropertyStatements(); + context.serialize(new QName("", "ents2Ents" ), null, stmts); + + context.endElement(); + } + + public String getMechanismType() { return Constants.AXIS_SAX; } + + public Element writeSchema(Class javaType, Types types) throws Exception { + return null; + } + +} diff --git a/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EntityXmlTest.java b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EntityXmlTest.java new file mode 100644 index 000000000..319dbf8e5 --- /dev/null +++ b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EntityXmlTest.java @@ -0,0 +1,337 @@ +package edu.cornell.mannlib.vitro.webservices.xml.convert.test; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import junit.framework.TestCase; + +import org.dom4j.Element; +import org.dom4j.io.HTMLWriter; + +import edu.cornell.mannlib.vitro.beans.Entity; +import edu.cornell.mannlib.vitro.webapp.dao.VitroFacade; +import edu.cornell.mannlib.vitro.webservices.xml.convert.EntityXml; + +public class EntityXmlTest extends TestCase { + + public void testEntityProperties(){ + String resultXml = null; + VitroFacade facade = new VitroFacade(); + Entity ent = facade.entityById(1); + ent = facade.fillExistingEnts2Ents(ent); +// assertTrue(ent.getDomainEnts2ents() != null && +// ent.getDomainEnts2ents().size() > 0); +// assertTrue(ent.getRangeEnts2ents() != null && +// ent.getRangeEnts2ents().size() > 0); + Element elem = EntityXml.toXmlElem(ent,EntityXml.FULL); + assertTrue( elem != null ); + try{ + resultXml = HTMLWriter.prettyPrintXHTML( elem.asXML() ); + }catch(Exception ex){ + fail("exception: " + ex.toString()); + } + assertTrue(resultXml != null && resultXml.length() > 0); + } + + public static void main(String[] args) { + junit.textui.TestRunner.run( EntityXmlTest.class ); + } + +} +// +// +// 1 +// Albert R. Mann Library +// library +// +// Mann Library web page +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9036 +// PRESERVING THE HISTORY OF UNITED STATES AGRICULTURE AND RURAL LIFE: STATE AND LOCAL LITERATURE, 1820-1945, PHASE IV +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9390 +// AGORA: ACCESS TO GLOBAL ONLINE RESEARCH IN AGRICULTURE +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9461 +// COORDINATED COLLECTION DEVELOPMENT AID +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9500 +// PRESERVING THE HISTORY OF UNITED STATES AGRICULTURE AND RURAL LIFE: STATE AND LOCAL LITERATURE, 1820-1945: PHASE V, 2004-2006 +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9561 +// TEEAL(THE ESSENTIAL ELECTRONIC AGRICULTURAL LIBRARY) +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9774 +// PLANNING INFORMATION INFRASTRUCTURE THROUGH A NEW LIBRARY-RESEARCH PARTNERSHIP +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9833 +// DISSEMINATION AND PRESERVAITON OF DIGITAL AGRICULTURAL ECONOMIC DATA ON THE INTERNET +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9848 +// BUILDING A SERVICE ORIENTED ARCHITECTURE FOR AGNIC +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 9859 +// THE ESSENTIAL ELECTRONIC AGRICULTURAL LIBRARY +// +// +// +// +// administers sponsored project +// administered by +// +// +// CUL unit library +// +// +// +// +// research grant +// +// +// +// +// +// +// +// +// 1 +// Albert R. Mann Library +// +// +// +// +// 11579 +// COORDINATED COLLECTION DEVELOPMENT AID +// +// +// +// +// administers sponsored project +// administered by +// +// <"); + return obj; + } + + public void testAttributes(){ + Ents2Ents ent = makeObj(); + Ents2EntsXml xmler = new Ents2EntsXml(); + Element elem = xmler.toXmlElem(ent); + assertEquals(elem.valueOf("@ents2entsId"), + Integer.toString(ent.getEnts2entsId())); + assertEquals(elem.valueOf("@domainId"), + Integer.toString(ent.getDomainId())); + assertEquals(elem.valueOf("@rangeId"), + Integer.toString(ent.getRangeId())); + assertEquals(elem.valueOf("@etypes2RelationsId"), + Integer.toString(ent.getPropertyId())); + assertEquals(elem.valueOf("@qualifier"),ent.getQualifier()); + } + + public static void main(String[] args) { + junit.textui.TestRunner.run( Ents2EntsTest.class ); + } + +} diff --git a/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EtypeXmlTest.java b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EtypeXmlTest.java new file mode 100644 index 000000000..d3cb9167e --- /dev/null +++ b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/EtypeXmlTest.java @@ -0,0 +1,26 @@ +package edu.cornell.mannlib.vitro.webservices.xml.convert.test; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.beans.VClass; +import edu.cornell.mannlib.vitro.webservices.xml.convert.*; +import edu.cornell.mannlib.vitro.dao.db.test.EntityDaoTest; +import junit.framework.TestCase; + +public class EtypeXmlTest extends TestCase { + public void testXml1(){ + String result = ""+ + "testtype"; + VClass etype = new VClass(); + etype.setId(2132); +// etype.setTypename("testtype"); + etype.setQuickEditJsp("bleck/editjsp.bla"); + EtypeXml xmler = new EtypeXml(); + assertEquals(result, xmler.toXmlStr(etype)); + + } + public static void main(String[] args) { + junit.textui.TestRunner.run( EtypeXmlTest.class ); + } +//this is a test change +} diff --git a/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/PropertyXmlTest.java b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/PropertyXmlTest.java new file mode 100644 index 000000000..5e6839c02 --- /dev/null +++ b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/PropertyXmlTest.java @@ -0,0 +1,48 @@ +package edu.cornell.mannlib.vitro.webservices.xml.convert.test; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import junit.framework.TestCase; +import edu.cornell.mannlib.vitro.webservices.xml.convert.*; +import edu.cornell.mannlib.vitro.beans.*; + +public class PropertyXmlTest extends TestCase { + public void testXml1(){ + String expected = + ""; + + Property prop = new Property(); + prop.setId(12); + prop.setParentId(1); + prop.setMinCardinality(0); + prop.setMaxCardinality(23); +// prop.setDomainEtypeId(2323); +// prop.setRangeEtypeId(2443); + PropertyXml xmler = new PropertyXml(); + assertEquals(expected,xmler.toXmlStr(prop)); + } + + public void testXml2(){ + String expected = + ""; + + Property prop = new Property(); + prop.setId(12); + prop.setParentId(1); + prop.setMinCardinality(0); + prop.setMaxCardinality(23); +// prop.setDomainEtypeId(2323); +// prop.setRangeEtypeId(2443); + PropertyXml xmler = new PropertyXml(); + assertEquals(expected,xmler.toXmlStr(prop)); + } + + public static void main(String[] args) { + junit.textui.TestRunner.run( PropertyXmlTest.class ); + } + +} diff --git a/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/TabXmlTest.java b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/TabXmlTest.java new file mode 100755 index 000000000..1bb569e92 --- /dev/null +++ b/services/test/edu/cornell/mannlib/vitro/webservices/xml/convert/TabXmlTest.java @@ -0,0 +1,43 @@ +package edu.cornell.mannlib.vitro.webservices.xml.convert.test; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import org.dom4j.Element; +import org.dom4j.io.HTMLWriter; + +import junit.framework.TestCase; +import edu.cornell.mannlib.vitro.beans.*; +import edu.cornell.mannlib.vitro.dao.db.*; +import edu.cornell.mannlib.vitro.webservices.xml.convert.TabXml; + +public class TabXmlTest extends TestCase { + + private void doTabXmlTest(int tabId){ +// Tab tab = TabDao.getTab(tabId, 1,"now()",10,60,0,null,null,null); +// Element elem = TabXml.toXmlElem(tab, 10); +// assertTrue( elem != null ); +// String resultXml = null; +// try{ +// resultXml = HTMLWriter.prettyPrintXHTML( elem.asXML() ); +// }catch(Exception ex){ +// fail("exception: " + ex.toString()); +// } +// assertTrue(resultXml != null && resultXml.length() > 0); + + } + + public void testTabs(){ + doTabXmlTest(63); + doTabXmlTest(18); + doTabXmlTest(19); + //bad xhtml doTabXmlTest(23); + doTabXmlTest(25); + doTabXmlTest(35); + doTabXmlTest(64); + doTabXmlTest(42); + } + + public static void main(String[] args){ + junit.textui.TestRunner.run( TabXmlTest.class ); + } +} diff --git a/services/wsdd/TabWs.wsdd b/services/wsdd/TabWs.wsdd new file mode 100644 index 000000000..cab6ad580 --- /dev/null +++ b/services/wsdd/TabWs.wsdd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/services/wsdd/VitroFacade.wsdd b/services/wsdd/VitroFacade.wsdd new file mode 100644 index 000000000..2ad52464c --- /dev/null +++ b/services/wsdd/VitroFacade.wsdd @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/services/wsdd/VitroWs.wsdd b/services/wsdd/VitroWs.wsdd new file mode 100644 index 000000000..cab6ad580 --- /dev/null +++ b/services/wsdd/VitroWs.wsdd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/services/wsdd/VitroWs2.wsdd b/services/wsdd/VitroWs2.wsdd new file mode 100644 index 000000000..11b20c51e --- /dev/null +++ b/services/wsdd/VitroWs2.wsdd @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/wsdd/VitroWs3.wsdd b/services/wsdd/VitroWs3.wsdd new file mode 100644 index 000000000..4bf51ab69 --- /dev/null +++ b/services/wsdd/VitroWs3.wsdd @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/xfire/additions/WEB-INF/classes/META-INF/xfire/services.xml b/services/xfire/additions/WEB-INF/classes/META-INF/xfire/services.xml new file mode 100644 index 000000000..f19f9f35c --- /dev/null +++ b/services/xfire/additions/WEB-INF/classes/META-INF/xfire/services.xml @@ -0,0 +1,9 @@ + + + VitroWs + http://vitro.mannlib.cornell.edu/VitroWs2 + edu.cornell.mannlib.vitro.webservices.VitroWs2 + edu.cornell.mannlib.vitro.webservices.VitroWs2 + + + diff --git a/services/xsl/entity2eng.xsl b/services/xsl/entity2eng.xsl new file mode 100644 index 000000000..f5e5220dd --- /dev/null +++ b/services/xsl/entity2eng.xsl @@ -0,0 +1,47 @@ + + + + + + + + + + + + +
    +

    +

    | + |

    +
    address:
    +
    phone:
    +
    email:
    +

    + +

    +
    + +
    +
    + +
    +
    +
    + + + +
      + +
    +
    + + +
  • + + + | + | +
  • +
    +
    diff --git a/webapp/build.xml b/webapp/build.xml new file mode 100644 index 000000000..4d0989a71 --- /dev/null +++ b/webapp/build.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compile webapp + + + + + + Compile unit tests + + + + + + + + + + + + + + + + + + + + + + + + + + + ${tomcat.home} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/config/VitroWs3.wsdd b/webapp/config/VitroWs3.wsdd new file mode 100644 index 000000000..4e4f35df1 --- /dev/null +++ b/webapp/config/VitroWs3.wsdd @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/config/axisproperties/i18n.properties b/webapp/config/axisproperties/i18n.properties new file mode 100644 index 000000000..8b1deba2e --- /dev/null +++ b/webapp/config/axisproperties/i18n.properties @@ -0,0 +1,132 @@ +############################################################ +# i18n settings for the Axis Web-Application +# + +#################### [i18n global setting] ################# +# +locales=en ja + +#################### [index.jsp] ########################### +# + +### Header ### +# +language=Language +welcomeMessage=Hello! Welcome to Apache-Axis. + +### Operation list ### +# +operationType=What do you want to do today? + +# Validation +validation=Validation +validationURL=happyaxis.jsp +validationFootnote00=Validate the local installation's configuration +validationFootnote01=see below if this does not work. + +# List +serviceList=List +serviceListURL=servlet/AxisServlet +serviceListFootnote=View the list of deployed Web services + +# Call +callAnEndpoint=Call +callAnEndpointURL=EchoHeaders.jws?method=list +callAnEndpointFootnote00=Call a local endpoint that list's the caller's http headers +callAnEndpointFootnote01=(or see its WSDL). + +# Visit +visit=Visit +visitURL=http://ws.apache.org/axis/ +visitFootnote=Visit the Apache-Axis Home Page + +# Admin +admin=Administer Axis +adminURL=servlet/AdminServlet +adminFootnote=[disabled by default for security reasons] + +# SOAPMonitor +soapMonitor=SOAPMonitor +soapMonitorURL=SOAPMonitor +soapMonitorFootnote=[disabled by default for security reasons] + +# Sidenote +sideNote=To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it. + +### Validating Axis ### +# + +# Title +validatingAxis=Validating Axis + +# Note 0 +validationNote00=If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers. + +# Note 1 +validationNote01=If you have problems getting Axis to work, consult the Axis Wiki and then try the Axis user mailing list. + +# +#################### [index.jsp] ########################### + +#################### [happyaxis.jsp] ####################### +# + +pageTitle=Axis Happiness Page +pageRole=Examining webapp configuration + +### Needed Components ### +# +neededComponents=Needed Components +error=Error +warning=Warning +criticalErrorMessage=Axis will not work. +uncertainErrorMessage=Axis may not work. +# parameters = url, name +seeHomepage=
    See {0} +# parameters = category, classname, jarFile, errorText, url +couldNotFound=

    {0}: could not find class {1} from file {2}
    {3} {4}

    +# parameters = description, classname +foundClass00=Found {0} ( {1} ) +# parameters = description, classname +foundClass01=Found {0} ( {1} ) at {2} +# parameters = category, classname, errorText, url +couldNotFoundDep=

    {0}: could not find a dependency of class {1} from file {2}
    {3} {4} +# parameters = ncdfe.getMessage(), classname +theRootCause=
    The root cause was: {0}
    This can happen e.g. if {1} is in the 'common' classpath, but a dependency like activation.jar is only in the webapp classpath.

    +# parameters = location +invalidSAAJ=Error: Invalid version of SAAJ API found in {0}. Make sure that Axis' saaj.jar precedes {0} in CLASSPATH.
    +axisInstallation=Axis installation instructions + +### Optional Components ### +# + +optionalComponents=Optional Components +attachmentsError=Attachments will not work. +xmlSecurityError=XML Security is not supported. +httpsError=https is not supported. + +happyResult00=The core axis libraries are present. +happyResult01=The optional components are present. +# parameters = needed(num of missing libraries) +unhappyResult00={0} core axis library(ies) are missing +# parameters = wanted(num of missing libraries) +unhappyResult01={0} wanted optional axis librar(ies) are missing + +hintString=Note: On Tomcat 4.x and Java1.4, you may need to put libraries that contain java.* or javax.* packages into CATALINA_HOME/common/lib
    jaxrpc.jar and saaj.jar are two such libraries.

    +noteString=Note: Even if everything this page probes for is present, there is no guarantee your web service will work, because there are many configuration options that we do not check for. These tests are necessary but not sufficient


    + +### Examining Application Server ### +# +apsExamining=Examining Application Server +recommendedParser=We recommend Xerces 2 over Crimson as the XML parser for Axis +couldNotCreateParser=Could not create an XML Parser + +### Examining System Properties ### +# +sysExamining=Examining System Properties +sysPropError=System properties are not accessible.

    +classFoundError=an unknown location +apsPlatform=Platform + +# +#################### [happyaxis.jsp] ####################### \ No newline at end of file diff --git a/webapp/config/axisproperties/i18n_ja.properties b/webapp/config/axisproperties/i18n_ja.properties new file mode 100644 index 000000000..91fb3cf14 --- /dev/null +++ b/webapp/config/axisproperties/i18n_ja.properties @@ -0,0 +1,127 @@ +############################################################ +# Japanese settings for the Axis Web-Application +# + +#################### [index.jsp] ########################### +# + +### Header ### +# +language=\u8a00\u8a9e +welcomeMessage=\u3053\u3093\u306b\u3061\u306f\uff01 Apache-Axis\u3078\u3088\u3046\u3053\u305d + +### Operation list ### +# +operationType=\u4eca\u65e5\u306f\u4f55\u3092\u3057\u305f\u3044\u3067\u3059\u304b\uff1f + +# Validation +validation=\u691c\u8a3c +validationURL=happyaxis.jsp +validationFootnote00=\u30ed\u30fc\u30ab\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u72b6\u6cc1\u3092\u691c\u8a3c\u3059\u308b +validationFootnote01=\u3046\u307e\u304f\u6a5f\u80fd\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u4e0b\u8a18\u300cAxis\u306e\u691c\u8a3c\u300d\u3092\u53c2\u7167 + +# List +serviceList=\u30ea\u30b9\u30c8 +serviceListURL=servlet/AxisServlet +serviceListFootnote=\u30c7\u30d7\u30ed\u30a4\u6e08\u307f\u306eWeb\u30b5\u30fc\u30d3\u30b9\u30ea\u30b9\u30c8\u3092\u898b\u308b + +# Call +callAnEndpoint=\u547c\u51fa\u3057 +callAnEndpointURL=EchoHeaders.jws?method=list +callAnEndpointFootnote00=HTTP\u30d8\u30c3\u30c0\u306e\u4e00\u89a7\u8868\u793a\u3092\u884c\u3046\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u8d77\u52d5\u3059\u308b +callAnEndpointFootnote01=(\u3082\u3057\u304f\u306fWSDL\u306e\u53c2\u7167) + +# Visit +visit=\u8a2a\u554f +visitURL=http://ws.apache.org/axis/ja/index.html +visitFootnote=Apache Axis\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u8a2a\u554f\u3059\u308b + +# Admin +admin=Axis\u306e\u7ba1\u7406 +adminURL=servlet/AdminServlet +adminFootnote=[\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5229\u7528\u4e0d\u53ef] + +# SOAPMonitor +soapMonitor=SOAP\u30e2\u30cb\u30bf +soapMonitorURL=SOAPMonitor +soapMonitorFootnote=[\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u7406\u7531\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5229\u7528\u4e0d\u53ef] + +# Sidenote +sideNote=\u4e0a\u8a18\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5229\u7528\u3067\u304d\u306a\u3044\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u306eWEB-INF/web.xml\u30d5\u30a1\u30a4\u30eb\u306e\u8a72\u5f53\u3059\u308b\u5ba3\u8a00\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002 + +### Validating Axis ### +# + +# Title +validatingAxis=Axis\u306e\u691c\u8a3c + +# Note 0 +validationNote00="happyaxis"\u691c\u8a3c\u30da\u30fc\u30b8\u304c\u72b6\u614b\u8868\u793a\u3067\u306f\u306a\u304f\u4f8b\u5916\u3092\u8868\u793a\u3059\u308b\u5834\u5408\u3001\u539f\u56e0\u3068\u3057\u3066\u306f\u30af\u30e9\u30b9\u30d1\u30b9\u5185\u306b\u8907\u6570\u306eXML\u30d1\u30fc\u30b5\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002\u95a2\u4fc2\u306a\u3044\u30d1\u30fc\u30b5\u3092\u30af\u30e9\u30b9\u30d1\u30b9\u304b\u3089\u53d6\u308a\u9664\u3044\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002 + +# Note 1 +validationNote01=Axis\u3092\u52d5\u4f5c\u3055\u305b\u308b\u4e0a\u3067\u554f\u984c\u3092\u62b1\u3048\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u307e\u305aAxis Wiki\u3092\u53c2\u8003\u306b\u3057\u3001\u305d\u306e\u5f8c\u3067Axis\u30e6\u30fc\u30b6\u30e1\u30fc\u30ea\u30f3\u30b0\u30ea\u30b9\u30c8\u306b\u6295\u7a3f\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002 + +# +#################### [index.jsp] ########################### + +#################### [happyaxis.jsp] ####################### +# +pageTitle=Axis Happiness Page +pageRole=webapp\u306e\u69cb\u6210\u306b\u95a2\u3059\u308b\u8abf\u67fb + +### Needed Components ### +# +neededComponents=\u5fc5\u9808\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 +error=\u30a8\u30e9\u30fc +warning=\u8b66\u544a +criticalErrorMessage=\u304a\u305d\u3089\u304fAxis\u306f\u52d5\u304d\u307e\u305b\u3093\u3002 +uncertainErrorMessage=Axis\u306f\u52d5\u304b\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +# parameters = url, name +seeHomepage=
    {0}\u3092\u898b\u3066\u4e0b\u3055\u3044\u3002 +# parameters = category, classname, jarFile, errorText, url +couldNotFound=

    {0}: {2}\u30d5\u30a1\u30a4\u30eb\u304c\u63d0\u4f9b\u3059\u308b{1}\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002
    {3} {4}

    +# parameters = description, classname +foundClass00={0} ( {1} ) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 +# parameters = description, classname, location +foundClass01={0} ( {1} ) \u304c{2}\u3067\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 +# parameters = category, classname, errorText, url +couldNotFoundDep=

    {0}: {2}\u30d5\u30a1\u30a4\u30eb\u304c\u63d0\u4f9b\u3059\u308b{1}\u30af\u30e9\u30b9\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u89e3\u6c7a\u3067\u304d\u307e\u305b\u3093\u3002
    {3} {4} +# parameters = ncdfe.getMessage(), classname +theRootCause=
    \u6839\u672c\u539f\u56e0: {0}
    \u3053\u306e\u30a8\u30e9\u30fc\u306f\u6b21\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u300c\u5171\u901a\u306e\u300d\u30af\u30e9\u30b9\u30d1\u30b9\u306b{1}\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001activation.jar \u306e\u3088\u3046\u306a\u4f9d\u5b58\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u304cwebapp\u306e\u30af\u30e9\u30b9\u30d1\u30b9\u3060\u3051\u306b\u3057\u304b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u5834\u5408\u3067\u3059\u3002

    +# parameters = location +invalidSAAJ=\u30a8\u30e9\u30fc: {0}\u306b\u9069\u5207\u3067\u306a\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eSAAJ API\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002Axis\u306esaaj.jar\u3092\u3001CLASSPATH\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b{0} \u3088\u308a\u3082\u524d\u65b9\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002
    +axisInstallation=Axis\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806 + +### Optional Components ### +# +optionalComponents=\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 +attachmentsError=\u304a\u305d\u3089\u304fAttachments\u306f\u6a5f\u80fd\u3057\u307e\u305b\u3093\u3002 +xmlSecurityError=XML Security\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002 +httpsError=https\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002 + +happyResult00=axis\u306e\u30b3\u30a2\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u5168\u3066\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002 +happyResult01=\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002 +# parameters = needed(num of missing libraries) +unhappyResult00=axis\u306e\u30b3\u30a2\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u304c{0}\u3064\u6b20\u3051\u3066\u3044\u307e\u3059\u3002 +# parameters = wanted(num of missing libraries) +unhappyResult01=axis\u306e\u30aa\u30d7\u30b7\u30e7\u30ca\u30eb\uff65\u30e9\u30a4\u30d6\u30e9\u30ea\u304c{0}\u3064\u6b20\u3051\u3066\u3044\u307e\u3059\u3002 + +hintString=\u6ce8\u610f: Tomcat 4.x \u3068 Java1.4 \u4e0a\u3067\u306f\u3001CATALINA_HOME/common/lib \u306b\u3001java.* \u3082\u3057\u304f\u306f javax.* \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u542b\u3080\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u914d\u7f6e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002
    \u4f8b\u3048\u3070 jaxrpc.jar \u3068 saaj.jar \u306f\u3001\u305d\u306e\u3088\u3046\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002

    +noteString=\u6ce8\u610f: \u30da\u30fc\u30b8\u306b\u5168\u3066\u306e\u8abf\u67fb\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u305f\u3068\u3057\u3066\u3082\u3001\u30c1\u30a7\u30c3\u30af\u3067\u304d\u306a\u3044\u69cb\u6210\u30aa\u30d7\u30b7\u30e7\u30f3\u3082\u591a\u3044\u305f\u3081\u3001\u3042\u306a\u305f\u306eWeb\u30b5\u30fc\u30d3\u30b9\u304c\u6b63\u5e38\u306b\u6a5f\u80fd\u3059\u308b\u4fdd\u969c\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u3089\u306e\u30c6\u30b9\u30c8\u306f\u5fc5\u8981\u306a\u3082\u306e\u3067\u3059\u304c\u3001\u5341\u5206\u306a\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 + +### Examining Application Server ### +# +apsExamining=\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff65\u30b5\u30fc\u30d0\u30fc\u306b\u95a2\u3059\u308b\u8abf\u67fb +recommendedParser=Axis\u3067\u4f7f\u7528\u3059\u308bXML\u30d1\u30fc\u30b5\u30fc\u306b\u306f Crimson \u3067\u306f\u306a\u304f\u3001Xerces 2 \u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002 +couldNotCreateParser=XML Parser\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002 + +### Examining System Properties ### +# +sysExamining=\u30b7\u30b9\u30c6\u30e0\uff65\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u95a2\u3059\u308b\u8abf\u67fb +sysPropError=\u30b7\u30b9\u30c6\u30e0\uff65\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002

    + +classFoundError=\u4e0d\u660e\u306a\u5834\u6240 +apsPlatform=\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0 + +# +#################### [happyaxis.jsp] ####################### diff --git a/webapp/config/default.clone.log4j.properties b/webapp/config/default.clone.log4j.properties new file mode 100644 index 000000000..71f77ef5e --- /dev/null +++ b/webapp/config/default.clone.log4j.properties @@ -0,0 +1,68 @@ +LuceneSetup.indexDir=${luceneIndexDir} + +# The default.log4j.properties file will only get used if there is no +# debugging.log4j.properties file in the directory otherwise, the debugging.log4j.properties will +# be deployed and used. + +# If you want to have a logging config for debugging +# and testing copy the default.log4j.properties file to debugging.log4j.properties, +# make your modifications and deploy. debugging.log4j.properties +# will be used instead of the default.log4j.properties file. + +# levels: <-- more messages ALL DEBUG INFO WARN ERROR FATAL OFF fewer messages --> + +log4j.rootLogger=WARN, AllAppender +log4j.appender.AllAppender=org.apache.log4j.RollingFileAppender +log4j.appender.AllAppender.File= ${tomcat.home}/logs/${clone}.all.log +log4j.appender.AllAppender.MaxFileSize=10MB +log4j.appender.AllAppender.MaxBackupIndex=10 +log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.AllAppender.layout.ConversionPattern=%p %t %c - %m%n + +log4j.logger.org.apache.catalina=INFO, AllAppender +log4j.logger.org.diretwebremoting=ERROR, AllAppender + +#log4j.logger.edu.cornell.mannlib.vitro.webapp.auth=INFO, AllAppender + +#### setup a debugging logger +log4j.appender.DebuggingAppender=org.apache.log4j.FileAppender +log4j.appender.DebuggingAppender.File=${tomcat.home}/logs/${clone}.debugging.log +log4j.appender.DebuggingAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.DebuggingAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +#log4j.logger.edu.cornell.mannlib.vitro.webapp=DEBUG, DebuggingAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.auth=DEBUG, DebuggingAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.dao.jena=DEBUG, DebuggingAppender + + +#### setup a debugging logger for the JSPs +#JSPs need to have a line like: +#<% org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("edu.cornell.mannlib.vitro.webapp.jsp.SOMEIDFORYOURJSP"); %> +log4j.appender.JspAppender=org.apache.log4j.FileAppender +log4j.appender.JspAppender.File=${tomcat.home}/logs/${clone}.jsp.log +log4j.appender.JspAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.JspAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.edu.cornell.mannlib.vitro.webapp.jsp=INFO, JspAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.jsp.edit=DEBUG, JspAppender + + +#### setup a pellet logger +log4j.appender.PelletAppender=org.apache.log4j.FileAppender +log4j.appender.PelletAppender.File=${tomcat.home}/logs/${clone}.pellet.log +log4j.appender.PelletAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.PelletAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.org.mindswap=WARN, PelletAppender + + +#### setup a jena logger +log4j.appender.JenaAppender=org.apache.log4j.FileAppender +log4j.appender.JenaAppender.File=${tomcat.home}/logs/${clone}.jena.log +log4j.appender.JenaAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.JenaAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.com.hp.hpl=WARN, JenaAppender + +# documentation for this file can be found here: +# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String,%20org.apache.log4j.spi.LoggerRepository) diff --git a/webapp/config/default.log4j.properties b/webapp/config/default.log4j.properties new file mode 100644 index 000000000..a54f7a2e7 --- /dev/null +++ b/webapp/config/default.log4j.properties @@ -0,0 +1,68 @@ +LuceneSetup.indexDir=${luceneIndexDir} + +# The default.log4j.properties file will only get used if there is no +# debugging.log4j.properties file in the directory otherwise, the debugging.log4j.properties will +# be deployed and used. + +# If you want to have a logging config for debugging +# and testing copy the default.log4j.properties file to debugging.log4j.properties, +# make your modifications and deploy. debugging.log4j.properties +# will be used instead of the default.log4j.properties file. + +# levels: <-- more messages ALL DEBUG INFO WARN ERROR FATAL OFF fewer messages --> + +log4j.rootLogger=WARN, AllAppender +log4j.appender.AllAppender=org.apache.log4j.RollingFileAppender +log4j.appender.AllAppender.File= ${tomcat.home}/logs/vitro.all.log +log4j.appender.AllAppender.MaxFileSize=10MB +log4j.appender.AllAppender.MaxBackupIndex=10 +log4j.appender.AllAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.AllAppender.layout.ConversionPattern=%p %t %c - %m%n + +log4j.logger.org.apache.catalina=INFO, AllAppender +log4j.logger.org.diretwebremoting=ERROR, AllAppender + +#log4j.logger.edu.cornell.mannlib.vitro.webapp.auth=INFO, AllAppender + +#### setup a debugging logger +log4j.appender.DebuggingAppender=org.apache.log4j.FileAppender +log4j.appender.DebuggingAppender.File=${tomcat.home}/logs/vitro.debugging.log +log4j.appender.DebuggingAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.DebuggingAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +#log4j.logger.edu.cornell.mannlib.vitro.webapp=DEBUG, DebuggingAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.auth=DEBUG, DebuggingAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.dao.jena=DEBUG, DebuggingAppender + + +#### setup a debugging logger for the JSPs +#JSPs need to have a line like: +#<% org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("edu.cornell.mannlib.vitro.webapp.jsp.SOMEIDFORYOURJSP"); %> +log4j.appender.JspAppender=org.apache.log4j.FileAppender +log4j.appender.JspAppender.File=${tomcat.home}/logs/vitro.jsp.log +log4j.appender.JspAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.JspAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.edu.cornell.mannlib.vitro.webapp.jsp=INFO, JspAppender +#log4j.logger.edu.cornell.mannlib.vitro.webapp.jsp.edit=DEBUG, JspAppender + + +#### setup a pellet logger +log4j.appender.PelletAppender=org.apache.log4j.FileAppender +log4j.appender.PelletAppender.File=${tomcat.home}/logs/vitro.pellet.log +log4j.appender.PelletAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.PelletAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.org.mindswap=WARN, PelletAppender + + +#### setup a jena logger +log4j.appender.JenaAppender=org.apache.log4j.FileAppender +log4j.appender.JenaAppender.File=${tomcat.home}/logs/vitro.jena.log +log4j.appender.JenaAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.JenaAppender.layout.ConversionPattern=%5r %-5p [%t] %c{2} - %m%n + +log4j.logger.com.hp.hpl=WARN, JenaAppender + +# documentation for this file can be found here: +# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String,%20org.apache.log4j.spi.LoggerRepository) diff --git a/webapp/config/dwr.xml b/webapp/config/dwr.xml new file mode 100755 index 000000000..d5b93ba70 --- /dev/null +++ b/webapp/config/dwr.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/config/example.LuceneSetup.properties b/webapp/config/example.LuceneSetup.properties new file mode 100644 index 000000000..38481ab25 --- /dev/null +++ b/webapp/config/example.LuceneSetup.properties @@ -0,0 +1,11 @@ +#this is an example of what needs to be in this +#file to setup the lucene index directory +# +# The default location is /usr/local/lucene/vitrodefault + +#You could hard code the location like this: +#LuceneSetup.indexDir=/usr/local/lucene/example + +#this line will be setup by ant to work for clones +#if you hardcode the dir, this line should be commented out +LuceneSetup.indexDir=${luceneIndexDir} diff --git a/webapp/config/example.connection.properties b/webapp/config/example.connection.properties new file mode 100755 index 000000000..e30b647ea --- /dev/null +++ b/webapp/config/example.connection.properties @@ -0,0 +1,80 @@ +################################################################################ +# DataSource properties file +################################################################################ + +######################### DataSource Properties ################################ + +VitroConnection.DataSource.url=jdbc:mysql://localhost/vitro +VitroConnection.DataSource.username=vitroweb +VitroConnection.DataSource.password=vitrovitro + +####################### Other Important Properties ############################# + +# CHANGE the following property unless you're using Cornell's VIVO ontology +Vitro.defaultNamespace=http://vivo.library.cornell.edu/ns/0.1# + +# Uncomment this next line and specify an SMTP host to activate the Contact Us form +#Vitro.smtpHost= + +################################################################################ + + + + + + + + + + + + + +# maximum number of connections to the db server +# This must not be greater than the mysql max_connection parameter. +# defaults to 40 +#VitroConnection.DataSource.MaxActive=40 + +# maximum number of connections to the db server to keep +# around when nothing is happening. +# defaults to 10 +#VitroConnection.DataSource.MaxIdle=10 + +# Time to wait in msec for a result from the sql server +# defaults to 10000 +#VitroConnection.DataSource.MaxWait=10000 + +# query to use to test to see if a connection to the db server is live. +# defaults to SELECT 1 +#VitroConnection.DataSource.ValidationQuery=SELECT 1 + +# should the connection pool test the connections it gets from the pool? +#defaults to true +#VitroConnection.DataSource.TestOnBorrow=true + +# should the connection pool test connections it puts back in pool? +#defaults to true +#VitroConnection.DataSource.TestOnReturn=true + +# Nnumber of milliseconds to sleep between runs of the idle object +# evictor thread. When non-positive, no idle object evictor thread will +# be run. defaults to 30min +#VitroConnection.DataSource.TimeBetweenEvictions= + +# The number of objects to examine during each +# run of the idle object evictor thread (if any). +# defaults to 3 +#VitroConnection.DataSource.TestsPerEviction=3 + +# The minimum amount of time +# an object may sit idle in the pool before it is eligable for eviction +# by the idle object evictor (if any). +# defaults to 30min +#VitroConnection.DataSource.MinEvictionIdleTime= + +################################################ # other notes: +# The file checked into source control is example.connection.properties so +# that if you have a connection.properties on your machine it will not be +# under source control. This is useful so that your customizations for your +# database setup are less likely to be checked into source control and then +# overwrite other folks' customizations. diff --git a/webapp/config/example.upload.properties b/webapp/config/example.upload.properties new file mode 100644 index 000000000..38741b8ab --- /dev/null +++ b/webapp/config/example.upload.properties @@ -0,0 +1,26 @@ +# The UploadImagesServlet will upload the images to a directory +# that is under tomcat and serve them from there. +# This causes a problem when the tomcat/webapps dir is deleted +# or deployed because you will lose all the images that the +# curators have uploaded. We deal with this by copying +# the files to another directory, one that is under version control. + +# This property indicates which non-tomcat directory to save the images in. +# ${uploadDir} is defined in the main build.xml via the following statements: +# +# +# +# +# +# But, this value will be replaced by the Vitro/clones/build.xml +# to point to the clones/{clone}/modifications directory based on the following +# +# +# +# +# The UploadImagesServlet.getSourceDirName() method then looks at this parameter +# in the upload.properties file, which file is stuck by the clones/build.xml file +# into the clone's modifications/WEB-INF/classes directory: +UploadImagesServlet.sourceDirName=${uploadDir} + + diff --git a/webapp/config/setenv.sh b/webapp/config/setenv.sh new file mode 100755 index 000000000..6edba8086 --- /dev/null +++ b/webapp/config/setenv.sh @@ -0,0 +1,149 @@ +JAVA_HOME=/usr/local/java/jdk1.5.0_06 +TOMCAT_HOME=/usr/local/tomcat +CATALINA_HOME=/usr/local/tomcat + +#these are for options that are only set at start time +# useful for jmx or remote debugging. +START_OPTS="" + +# the gc log and the jvm options are saved in the logs directory +DATESTR=`date +%Y%m%d.%H%M` +GCFILE=$CATALINA_HOME/logs/gc$DATESTR.txt +OPT_FILE=$CATALINA_HOME/logs/opts$DATESTR.txt + +# This is an example of the setenv.sh file from +# cugir-tng.mannlib.cornell.edu + +# To use this file copy it to /usr/local/tomcat/bin/setenv.sh +# When catalina.sh is called this file will be used to +# set the environmental variables that are +# in effect when starting the JVM for tomcat. + +# java memory tools: +# jconsole is useful to watch the survivor, Edan, tenured and +# perm spaces. gcviewer is useful for statistics. + +#An acceptable group of settings, use this as a starting point +# CATALINA_OPTS=" -Xms1024m -Xmx1024m -XX:MaxPermSize=128m \ +# -XX:+UseParallelGC \ +# -Dfile.encoding=UTF-8 \ +# -Xloggc:$GCFILE -XX:+PrintGCDetails -XX:+PrintGCTimeStamps " + +# attempting a low GCTimeRatio, +# GCTimeRatio indicates how much time to spend in gc vs. application +# app time / gc time = 1 / (1+ GCTimeRatio) +# GCTimeRatio of 11 is aprox %8 of the time in GC +# +# Result: best so far. After about 12 hours the heap is +# hovering around 100mb. This is the first group of settings +# that seem like they will be stable for a long period of time. +# throughput is 98.79% +# This is a log for these settings: /usr/local/tomcat/logs/gc20060809.1638.txt +CATALINA_OPTS=" -Xms1024m -Xmx1024m -XX:MaxPermSize=128m \ +-XX:+UseParallelGC -XX:GCTimeRatio=11 -XX:+UseAdaptiveSizePolicy \ +-Dfile.encoding=UTF-8 \ +-Xloggc:$GCFILE -XX:+PrintGCDetails -XX:+PrintGCTimeStamps " + +# bdc34 2006-08-08 +# Trying adaptiveSizePolicy with parallel GC. +# Result: This did an out of memory when a crawler came along +# but even before that it looked bad. +# CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m \ +# -XX:NewSize=512m \ +# -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy \ +# -Dfile.encoding=UTF-8 \ +# -XX:+PrintGCDetails -XX:+PrintGCTimeStamps \ +# -Xloggc:$GCFILE " + +# bdc34 2006-08-08 +# Trying the concurrent gc +# Result: after 10min it seems odd. The survivor space doesn't get +# used at all. It is always showing up in jconsole as zero mb. So +# objects are going directly from the edan space to the tenured space? +# +# Result: sort of rapid growth of heap with odd paterns of collection. +# doesn't seem useful +# CATALINA_OPTS="-Xms512m -Xmx512m -XX:MaxPermSize=256m \ +# -XX:+UseConcMarkSweepGC \ +# -XX:+UseAdaptiveSizePolicy \ +# -XX:-TraceClassUnloading \ +# -Dfile.encoding=UTF-8 \ +# -XX:+PrintGCDetails -XX:+PrintGCTimeStamps \ +# -Xloggc:/usr/local/tomcat/logs/gc.txt " + +# bdc34 2006-08-07 +# Attempting to increase the PermGen Size. Notice +# that PermGen size is in addition to the heap +# size specified in -Xmx. +# +# Also removing GCTimeRatio to allow for +# a lot of garbage collecting. I don't want +# any bound on GC, time or throughput. I don't +# know if not specifying a value will achieve this. +# +# Logging gc to /usr/local/tomcat/logs/gc.txt +# so I can look at it with http://www.tagtraum.com/gcviewer.html +# +# Setting max heap to initial heap to avoid growing the +# heap and associated gc cycles. +# +# Result: I ran this for two days and it seemed to work well. +# It would do minor collections for about 20h. The heap would +# get to around 1G and then the jvm would do +# a full colleciton that would drop the heap down to 50m. +# It seems that having the heap at 1G only buys time and +# that the application could live in 128-256mb. +# gcviewer was reporting 99.0% collection rates. +# It seems that these settings would work but might need to +# be restarted about once a week. +# +# Increasing the MaxPermSize seems to be important. +# The permGen includes things like classes and code. This is +# a problem since JSPs are classes and code so reloading a JSP +# adds to the permGen. The documentation weakly indicates that +# the permGen gets collected in full collections. I have not +# seen evidence that this it does when watching jconsole. +# Sun's JVM seperates the heap and classes but IBM and BEA do not. +# +# CATALINA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m \ +# -XX:+UseParallelGC \ +# -Dfile.encoding=UTF-8 \ +# -XX:+PrintGCDetails -XX:+PrintGCTimeStamps \ +# -Xloggc:/usr/local/tomcat/logs/gc.txt " + +#bdc 2005-10-18 +# CATALINA_OPTS="-server -Xms512m -Xmx1024m \ +# -XX:+UseParallelGC \ +# -XX:ParallelGCThreads=8 -XX:-PrintTenuringDistribution \ +# -XX:MaxPermSize=256 \ +# -XX:NewRatio=5 -XX:GCTimeRatio=19 -XX:SurvivorRatio=32 \ +# -Dfile.encoding=UTF-8 \ +# -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/usr/local/tomcat/log/gc.txt \ +# -verbose:gc " + +#These are the java command args needed to allow remote jmx +JMXREMOTE=" -Dcom.sun.management.jmxremote.port=8022 " + +#we only what jmxremote when we start, not on stop since the +#port will be in use. This also could be done with jpda +START_OPTS="$JMXREMOTE" + +# we want to allow access to files created by tomcat by the mannit group +umask 002 + +# this makes a link from the current gc log to a place were we can get it over http +# those '&& true' are just to force success so we don't exit +rm -f /usr/local/apache/htdocs/private/tmp/gc.txt && true +ln -f -s $GCFILE /usr/local/apache/htdocs/private/tmp/gc.txt && true + +#We want a record of the JVM options to compare with the gc log. +echo "CATALINA_OPTS: $CATALINA_OPTS" > $OPT_FILE +echo "START_OPTS: $START_OPTS" >> $OPT_FILE + +# We need to export any variables that are to be used outside of script: +export JAVA_HOME CATALINA_OPTS TOMCAT_HOME CATALINA_HOME +export START_OPTS + +# displays a note about what parameters will be used: +#echo "Using CATALINA Opts from tomcat/bin/setenv.sh: " +#echo " $CATALINA_OPTS" diff --git a/webapp/config/tlds/ListSparqlTag.tld b/webapp/config/tlds/ListSparqlTag.tld new file mode 100644 index 000000000..d9cdcf6e5 --- /dev/null +++ b/webapp/config/tlds/ListSparqlTag.tld @@ -0,0 +1,51 @@ + + + + + List SPARQL JSP taglib + 1.0 + sparql + http://mannlib.cornell.edu/vitro/ListSparqlTag/0.1/ + + + SPARQL select tag. (Must be nested inside sparql:sparql) + SPARQL select tag + select + edu.cornell.mannlib.vitro.webapp.web.jsptags.ListSparqlTag + tagdependent + + + var + java.util.List + AT_BEGIN + + + + + model + true + true + com.hp.hpl.jena.rdf.model.Model + + + + + var + true + true + java.lang.String + + + true + + + + + + + + \ No newline at end of file diff --git a/webapp/config/tlds/PropertyEditLink.tld b/webapp/config/tlds/PropertyEditLink.tld new file mode 100644 index 000000000..a4bda18f1 --- /dev/null +++ b/webapp/config/tlds/PropertyEditLink.tld @@ -0,0 +1,43 @@ + + + + + Property Edit Link taglib + 1.0 + + Vitro Property Edit Link generator + + + + editLinks + Edit Links for Propery + + Create the A elements for a specified Property. + + edu.cornell.mannlib.vitro.webapp.web.jsptags.PropertyEditLinks + empty + + item + true + true + + + var + false + false + + + icons + false + true + + + + \ No newline at end of file diff --git a/webapp/config/tlds/StringProcessorTag.tld b/webapp/config/tlds/StringProcessorTag.tld new file mode 100644 index 000000000..6a6bff18b --- /dev/null +++ b/webapp/config/tlds/StringProcessorTag.tld @@ -0,0 +1,28 @@ + + + + + 1.0 + http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag + + + + + process + edu.cornell.mannlib.vitro.webapp.web.jsptags.StringProcessorTag + String Processor + + Processes output using "StringProcessor" from request. + + + scriptless + + + \ No newline at end of file diff --git a/webapp/config/tlds/c.tld b/webapp/config/tlds/c.tld new file mode 100644 index 000000000..1fbb0899c --- /dev/null +++ b/webapp/config/tlds/c.tld @@ -0,0 +1,565 @@ + + + + + + + JSTL 1.1 core library + JSTL core + 1.1 + c + http://java.sun.com/jsp/jstl/core + + + + Provides core validation features for JSTL tags. + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + + + + Catches any Throwable that occurs in its body and optionally + exposes it. + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + +Name of the exported scoped variable for the +exception thrown from a nested action. The type of the +scoped variable is the type of the exception thrown. + + var + false + false + + + + + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + + + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + if + org.apache.taglibs.standard.tag.rt.core.IfTag + JSP + + +The test condition that determines whether or +not the body content should be processed. + + test + true + true + boolean + + + +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + + var + false + false + + + +Scope for var. + + scope + false + false + + + + + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + import + org.apache.taglibs.standard.tag.rt.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + +The URL of the resource to import. + + url + true + true + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +Name of the exported scoped variable for the +resource's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL resource that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +resource. + + charEncoding + false + true + + + + + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + forEach + org.apache.taglibs.standard.tag.rt.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + +Collection of items to iterate over. + + items + false + true + java.lang.Object + + + +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + + begin + false + true + int + + + +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Iterates over tokens, separated by the supplied delimeters + + forTokens + org.apache.taglibs.standard.tag.rt.core.ForTokensTag + JSP + + +String of tokens to iterate over. + + items + true + true + java.lang.String + + + +The set of delimiters (the characters that +separate the tokens in the string). + + delims + true + true + java.lang.String + + + +Iteration begins at the token located at the +specified index. First token has index 0. + + begin + false + true + int + + + +Iteration ends at the token located at the +specified index (inclusive). + + end + false + true + int + + + +Iteration will only process every step tokens +of the string, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Like <%= ... >, but for expressions. + + out + org.apache.taglibs.standard.tag.rt.core.OutTag + JSP + + +Expression to be evaluated. + + value + true + true + + + +Default value if the resulting value is null. + + default + false + true + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + + escapeXml + false + true + + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'import' tag's URL. + + param + org.apache.taglibs.standard.tag.rt.core.ParamTag + JSP + + +Name of the query string parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Redirects to a new URL. + + redirect + org.apache.taglibs.standard.tag.rt.core.RedirectTag + JSP + + +The URL of the resource to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Removes a scoped variable (from a particular scope, if specified). + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + +Name of the scoped variable to be removed. + + var + true + false + + + +Scope for var. + + scope + false + false + + + + + + Sets the result of an expression evaluation in a 'scope' + + set + org.apache.taglibs.standard.tag.rt.core.SetTag + JSP + + +Name of the exported scoped variable to hold the value +specified in the action. The type of the scoped variable is +whatever type the value expression evaluates to. + + var + false + false + + + +Expression to be evaluated. + + value + false + true + + + +Target object whose property will be set. Must evaluate to +a JavaBeans object with setter property property, or to a +java.util.Map object. + + target + false + true + + + +Name of the property to be set in the target object. + + property + false + true + + + +Scope for var. + + scope + false + false + + + + + + Creates a URL with optional query parameters. + + url + org.apache.taglibs.standard.tag.rt.core.UrlTag + JSP + + +Name of the exported scoped variable for the +processed url. The type of the scoped variable is +String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +URL to be processed. + + value + false + true + + + +Name of the context when specifying a relative URL +resource that belongs to a foreign context. + + context + false + true + + + + + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + when + org.apache.taglibs.standard.tag.rt.core.WhenTag + JSP + + +The test condition that determines whether or not the +body content should be processed. + + test + true + true + boolean + + + + diff --git a/webapp/config/tlds/database.tld b/webapp/config/tlds/database.tld new file mode 100644 index 000000000..31a9e46a9 --- /dev/null +++ b/webapp/config/tlds/database.tld @@ -0,0 +1,185 @@ + + + + + 1.0 + 1.1 + Sun Microsystems Press Tag library modified for Mann Library, Cornell + + + query + tags.jdbc.QueryTag + + JSP + + id + true + true + + + scope + false + true + + + update + false + true + + + + rows + tags.jdbc.RowsTag + JSP + + query + true + true + + + startRow + false + true + + + endRow + false + true + + + + columnNames + tags.jdbc.ColumnNamesTag + tags.jdbc.ColumnNamesTagInfo + JSP + + query + true + true + + + id + true + true + + + + columns + tags.jdbc.ColumnsTag + tags.jdbc.ColumnsTagInfo + JSP + + query + true + true + + + id + true + true + + + + select_columns + tags.jdbc.SelectColumnsTag + tags.jdbc.SelectColumnsTagInfo + JSP + + query + true + true + + + id + true + true + + + selectValue + true + true + + + + release + tags.jdbc.ReleaseTag + JSP + + query + true + true + + + diff --git a/webapp/config/tlds/fn.tld b/webapp/config/tlds/fn.tld new file mode 100644 index 000000000..650435124 --- /dev/null +++ b/webapp/config/tlds/fn.tld @@ -0,0 +1,207 @@ + + + + + JSTL 1.1 functions library + JSTL functions + 1.1 + fn + http://java.sun.com/jsp/jstl/functions + + + + Tests if an input string contains the specified substring. + + contains + org.apache.taglibs.standard.functions.Functions + boolean contains(java.lang.String, java.lang.String) + + <c:if test="${fn:contains(name, searchString)}"> + + + + + + Tests if an input string contains the specified substring in a case insensitive way. + + containsIgnoreCase + org.apache.taglibs.standard.functions.Functions + boolean containsIgnoreCase(java.lang.String, java.lang.String) + + <c:if test="${fn:containsIgnoreCase(name, searchString)}"> + + + + + + Tests if an input string ends with the specified suffix. + + endsWith + org.apache.taglibs.standard.functions.Functions + boolean endsWith(java.lang.String, java.lang.String) + + <c:if test="${fn:endsWith(filename, ".txt")}"> + + + + + + Escapes characters that could be interpreted as XML markup. + + escapeXml + org.apache.taglibs.standard.functions.Functions + java.lang.String escapeXml(java.lang.String) + + ${fn:escapeXml(param:info)} + + + + + + Returns the index withing a string of the first occurrence of a specified substring. + + indexOf + org.apache.taglibs.standard.functions.Functions + int indexOf(java.lang.String, java.lang.String) + + ${fn:indexOf(name, "-")} + + + + + + Joins all elements of an array into a string. + + join + org.apache.taglibs.standard.functions.Functions + java.lang.String join(java.lang.String[], java.lang.String) + + ${fn:join(array, ";")} + + + + + + Returns the number of items in a collection, or the number of characters in a string. + + length + org.apache.taglibs.standard.functions.Functions + int length(java.lang.Object) + + You have ${fn:length(shoppingCart.products)} in your shopping cart. + + + + + + Returns a string resulting from replacing in an input string all occurrences + of a "before" string into an "after" substring. + + replace + org.apache.taglibs.standard.functions.Functions + java.lang.String replace(java.lang.String, java.lang.String, java.lang.String) + + ${fn:replace(text, "-", "•")} + + + + + + Splits a string into an array of substrings. + + split + org.apache.taglibs.standard.functions.Functions + java.lang.String[] split(java.lang.String, java.lang.String) + + ${fn:split(customerNames, ";")} + + + + + + Tests if an input string starts with the specified prefix. + + startsWith + org.apache.taglibs.standard.functions.Functions + boolean startsWith(java.lang.String, java.lang.String) + + <c:if test="${fn:startsWith(product.id, "100-")}"> + + + + + + Returns a subset of a string. + + substring + org.apache.taglibs.standard.functions.Functions + java.lang.String substring(java.lang.String, int, int) + + P.O. Box: ${fn:substring(zip, 6, -1)} + + + + + + Returns a subset of a string following a specific substring. + + substringAfter + org.apache.taglibs.standard.functions.Functions + java.lang.String substringAfter(java.lang.String, java.lang.String) + + P.O. Box: ${fn:substringAfter(zip, "-")} + + + + + + Returns a subset of a string before a specific substring. + + substringBefore + org.apache.taglibs.standard.functions.Functions + java.lang.String substringBefore(java.lang.String, java.lang.String) + + Zip (without P.O. Box): ${fn:substringBefore(zip, "-")} + + + + + + Converts all of the characters of a string to lower case. + + toLowerCase + org.apache.taglibs.standard.functions.Functions + java.lang.String toLowerCase(java.lang.String) + + Product name: ${fn.toLowerCase(product.name)} + + + + + + Converts all of the characters of a string to upper case. + + toUpperCase + org.apache.taglibs.standard.functions.Functions + java.lang.String toUpperCase(java.lang.String) + + Product name: ${fn.UpperCase(product.name)} + + + + + + Removes white spaces from both ends of a string. + + trim + org.apache.taglibs.standard.functions.Functions + java.lang.String trim(java.lang.String) + + Name: ${fn.trim(name)} + + + + diff --git a/webapp/config/tlds/form.tld b/webapp/config/tlds/form.tld new file mode 100644 index 000000000..666c487aa --- /dev/null +++ b/webapp/config/tlds/form.tld @@ -0,0 +1,66 @@ + + + + + 1.0 + 1.1 + Vitro Editing Form Library + + This tag library contains tags for constructing vitro + editing forms. The tag names shadow html elements + but provide additional attributes for specifying + how dynamic content should be retrieved from persistent + storage. + + + + option + edu.cornell.mannlib.vedit.tags.OptionTag + empty + + name + false + true + + + + + value + edu.cornell.mannlib.vedit.tags.ValueTag + empty + + name + false + true + + + + + dynamicFields + edu.cornell.mannlib.vedit.tags.DynamicFieldsTag + empty + + type + true + true + + + usePage + true + true + + + + + error + edu.cornell.mannlib.vedit.tags.ErrorTag + empty + + name + false + true + + + + diff --git a/webapp/config/tlds/sparqltag.tld b/webapp/config/tlds/sparqltag.tld new file mode 100644 index 000000000..772851e48 --- /dev/null +++ b/webapp/config/tlds/sparqltag.tld @@ -0,0 +1,280 @@ + + + + + + + + SPARQL JSP taglib + 1.0 + sparql + http://djpowell.net/tmp/sparql-tag/0.1/ + + + + + + SPARQL container tag.

    +

    This tag must be placed around sparql:select tags to + ensure that the live ResultSet's gets closed, + when this tag goes out of scope. + ]]> + + SPARQL container tag + sparql + net.djpowell.sparqltag.SparqlTag + scriptless + + + + + + + Obtains a lock or transaction on a model until the tag is closed. + + SPARQL lock tag + lock + net.djpowell.sparqltag.LockTag + net.djpowell.sparqltag.LockTagInfo + scriptless + + + The model to lock, or execute in a transaction + model + true + true + com.hp.hpl.jena.rdf.model.Model + + + + + Indicates whether transactions should be used instead of + critical sections. + + transactions + + false + true + java.lang.String + + + + + If critical sections are being used, indicates whether a + read lock is sufficient, or whether a write-lock is required. + The default is true, meaning a read-lock. + + readonly + + false + true + java.lang.String + + + + + + + + SPARQL load tag. Convenience tag for creating a new model from an RDF/XML URI. + SPARQL load tag + load + net.djpowell.sparqltag.LoadTag + net.djpowell.sparqltag.LoadTagInfo + empty + + + var + com.hp.hpl.jena.rdf.model.Model + AT_END + + + + + var + true + true + java.lang.String + + + + + uri + true + true + java.lang.String + + + + + + + + SPARQL ask tag. (Must be nested inside sparql:sparql) + SPARQL ask tag + ask + net.djpowell.sparqltag.AskTag + tagdependent + + + + var + java.lang.Boolean + AT_END + + + + + model + true + true + com.hp.hpl.jena.rdf.model.Model + + + + + var + true + false + java.lang.String + + + true + + + + + + + + + + + + SPARQL construct tag. (Must be nested inside sparql:sparql) + SPARQL construct tag + construct + net.djpowell.sparqltag.ConstructTag + tagdependent + + + var + com.hp.hpl.jena.rdf.model.Model + AT_END + + + + + model + true + false + com.hp.hpl.jena.rdf.model.Model + + + + + var + true + true + java.lang.String + + + true + + + + + + + + + + + SPARQL describe tag. (Must be nested inside sparql:sparql) + SPARQL describe tag + describe + net.djpowell.sparqltag.DescribeTag + tagdependent + + + var + com.hp.hpl.jena.rdf.model.Model + AT_END + + + + + model + true + true + com.hp.hpl.jena.rdf.model.Model + + + + + var + true + false + java.lang.String + + + true + + + + + + + + + + + + SPARQL select tag. (Must be nested inside sparql:sparql) + SPARQL select tag + select + net.djpowell.sparqltag.SelectTag + tagdependent + + + var + net.djpowell.sparqltag.SelectTag.RSWrapper + + AT_END + + + + + model + true + true + com.hp.hpl.jena.rdf.model.Model + + + + + var + true + true + java.lang.String + + + true + + + + + + + + + + diff --git a/webapp/config/tlds/taglibs-mailer.tld b/webapp/config/tlds/taglibs-mailer.tld new file mode 100644 index 000000000..27c357de8 --- /dev/null +++ b/webapp/config/tlds/taglibs-mailer.tld @@ -0,0 +1,256 @@ + + + + + + + 1.1 + 1.1 + mailer + http://jakarta.apache.org/taglibs/mailer-1.1 + This custom tag library is used to send e-mail.E-mail can be sent in three ways. The first way requires the name of the + SMTP host to use. The second requires the name of a JNDI Resource for a + JavaMail Session. The third requires the name of a JNDI Resource for a + JavaMail MimePartDataSource. Refer to your servlet container documentation + to determine which of these three methods you should use. During the + creation of an e-mail message, the addresses are checked for the correct + format. After the e-mail message has been created the send tag spawns a + thread to send the message in the background so that the user does not have + to wait for the SMTP host if it is busy. + +<!-- Create a message by entering the name of the SMTP host. --> +<!-- The default for this attribute is localhost; for a host other --> +<!-- than localhost supply it's name with the server attribute --> +<!-- as in the example below. The body of the e-mail is supplied in the --> +<!-- message tag. The send tag is necessary to send the message. --> +<mt:mail server="home.net" to="foo@home.net" +from="bar@home.net" subject="mail taglib"> + <mt:message>[body of message]</mt:message> + <mt:send/> +</mt:mail> + +<!-- Using a JNDI named JavaMail Session object defined by the --> +<!-- session attribute. --> +<mt:mail session="java:/comp/env/session" to="foo@home.net" +from="bar@home.net" subject="mail taglib"> + <mt:message>[body of message]</mt:message> + <mt:send/> +</mt:mail> + +<!-- Or using a JNDI named JavaMail MimePartDataSource object --> +<!-- defined by mimeMessage attribute. --> +<mt:mail mimeMessage="java:/comp/env/message" to="foo@home.net" +from="bar@home.net" subject="mail taglib"> + <mt:message>[body of message]</mt:message> + <mt:send/> +</mt:mail> +How e-mail is delivered depends on the JavaMail SMTP host settings. The + JavaMail SMTP host can be configured by your Servlet Container so that + bounced or undeliverable e-mails are returned to the sender by setting the + folowing properties.NameTypeDescriptionmail.smtp.dsn.notifyStringProperty determines if the user will be notified of undeliverable mail. + Either NEVER, or some combination of SUCCESS, FAILURE, and DELAY + (separated by commas). + mail.smtp.dsn.retStringDetermines what part of the undeliverable message will be returned in + the message to the sender. Either FULL or HDRS. + mail.smtp.sendpartialboolean + If set to true, and a message has some valid and some invalid addresses, + send the message anyway, reporting the partial failure with a + SendFailedException. If set to false (the default), the message is not + sent to any of the recipients if there is an invalid recipient address. + + + mail + org.apache.taglibs.mailer.MailTag + JSP + + server + no + yes + + + session + no + no + + + mimeMessage + no + no + + + authenticate + no + no + + + user + no + yes + + + password + no + yes + + + to + no + no + + + replyTo + no + no + + + from + no + no + + + cc + no + no + + + bcc + no + no + + + subject + no + no + + + + server + org.apache.taglibs.mailer.ServerTag + JSP + + + message + org.apache.taglibs.mailer.MessageTag + JSP + + type + no + no + + + + header + org.apache.taglibs.mailer.HeaderTag + JSP + + name + yes + no + + + value + no + no + + + + setrecipient + org.apache.taglibs.mailer.SetRecipientTag + JSP + + type + yes + no + + + address + no + no + + + + addrecipient + org.apache.taglibs.mailer.AddRecipientTag + JSP + + type + yes + no + + + address + no + no + + + + replyto + org.apache.taglibs.mailer.ReplyToTag + JSP + + + from + org.apache.taglibs.mailer.FromTag + JSP + + + attach + org.apache.taglibs.mailer.AttachTag + JSP + + file + no + no + + + url + no + no + + + type + no + no + + + + subject + org.apache.taglibs.mailer.SubjectTag + JSP + + + send + org.apache.taglibs.mailer.SendTag + JSP + + + error + org.apache.taglibs.mailer.ErrorTag + org.apache.taglibs.mailer.ErrorTEI + JSP + + id + yes + no + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/config/tlds/taglibs-random.tld b/webapp/config/tlds/taglibs-random.tld new file mode 100644 index 000000000..645d4c0d3 --- /dev/null +++ b/webapp/config/tlds/taglibs-random.tld @@ -0,0 +1,90 @@ + + + + + + + 1.0.2 + 1.1 + random + http://jakarta.apache.org/taglibs/random-1.0 + + The Random tag library creates random strings and random numbers. You may + specify a set of allowable characters as well as the length for randomly + generated strings. You may specify a range of allowable integers or a + random floating point number between zero and one for randomly generated + numbers. + + string + org.apache.taglibs.random.RandomStrgTag + org.apache.taglibs.random.RandomStrgTEI + Empty + + id + yes + no + + + length + no + no + + + map + no + no + + + charset + no + no + + + algorithm + no + no + + + provider + no + no + + + + number + org.apache.taglibs.random.RandomNumTag + org.apache.taglibs.random.RandomNumTEI + Empty + + id + yes + no + + + range + no + no + + + algorithm + no + no + + + provider + no + no + + + + + + + + + + + + + + diff --git a/webapp/config/tlds/taglibs-string.tld b/webapp/config/tlds/taglibs-string.tld new file mode 100644 index 000000000..3ea15ae64 --- /dev/null +++ b/webapp/config/tlds/taglibs-string.tld @@ -0,0 +1,745 @@ + + + + + + + 1.1.0 + 1.1 + string + http://jakarta.apache.org/taglibs/string-1.1 + + The String taglibrary provides a host of tags for manipulating + java.lang.Strings. The style is that the String to act upon is the + body of the tag, and attributes are used as parameters for the + manipulation. + + + length + org.apache.taglibs.string.LengthTag + JSP + + var + false + true + + + + capitalize + org.apache.taglibs.string.CapitalizeTag + JSP + + var + false + true + + + + uncapitalize + org.apache.taglibs.string.UncapitalizeTag + JSP + + var + false + true + + + + upperCase + org.apache.taglibs.string.UpperCaseTag + JSP + + var + false + true + + + + lowerCase + org.apache.taglibs.string.LowerCaseTag + JSP + + var + false + true + + + + trim + org.apache.taglibs.string.TrimTag + JSP + + var + false + true + + + + chop + org.apache.taglibs.string.ChopTag + JSP + + var + false + true + + + + chopNewline + org.apache.taglibs.string.ChopNewlineTag + JSP + + var + false + true + + + + escape + org.apache.taglibs.string.EscapeTag + JSP + + var + false + true + + + + reverse + org.apache.taglibs.string.ReverseTag + JSP + + var + false + true + + + + swapCase + org.apache.taglibs.string.SwapCaseTag + JSP + + var + false + true + + + + soundex + org.apache.taglibs.string.SoundexTag + JSP + + var + false + true + + + + metaphone + org.apache.taglibs.string.MetaphoneTag + JSP + + var + false + true + + + + quoteRegexp + org.apache.taglibs.string.QuoteRegexpTag + JSP + + var + false + true + + + + capitalizeAllWords + org.apache.taglibs.string.CapitalizeAllWordsTag + JSP + + var + false + true + + + + removeXml + org.apache.taglibs.string.RemoveXmlTag + JSP + + var + false + true + + + + encodeUrl + org.apache.taglibs.string.EncodeUrlTag + JSP + + var + false + true + + + + decodeUrl + org.apache.taglibs.string.DecodeUrlTag + JSP + + var + false + true + + + + count + org.apache.taglibs.string.CountTag + JSP + + var + false + true + + + set + true + true + + + + delete + org.apache.taglibs.string.DeleteTag + JSP + + var + false + true + + + set + true + true + + + + squeeze + org.apache.taglibs.string.SqueezeTag + JSP + + var + false + true + + + set + true + true + + + + center + org.apache.taglibs.string.CenterTag + JSP + + var + false + true + + + delimiter + false + true + + + width + true + true + + + + rightPad + org.apache.taglibs.string.RightPadTag + JSP + + var + false + true + + + delimiter + false + true + + + width + true + true + + + + leftPad + org.apache.taglibs.string.LeftPadTag + JSP + + var + false + true + + + delimiter + false + true + + + width + true + true + + + + chomp + org.apache.taglibs.string.ChompTag + JSP + + var + false + true + + + delimiter + false + true + + + + getChomp + org.apache.taglibs.string.GetChompTag + JSP + + var + false + true + + + delimiter + false + true + + + + prechomp + org.apache.taglibs.string.PrechompTag + JSP + + var + false + true + + + delimiter + false + true + + + + getPrechomp + org.apache.taglibs.string.GetPrechompTag + JSP + + var + false + true + + + delimiter + false + true + + + + strip + org.apache.taglibs.string.StripTag + JSP + + var + false + true + + + delimiter + false + true + + + + stripEnd + org.apache.taglibs.string.StripEndTag + JSP + + var + false + true + + + delimiter + false + true + + + + stripStart + org.apache.taglibs.string.StripStartTag + JSP + + var + false + true + + + delimiter + false + true + + + + reverseDelimitedString + org.apache.taglibs.string.ReverseDelimitedStringTag + JSP + + var + false + true + + + delimiter + false + true + + + + overlay + org.apache.taglibs.string.OverlayTag + JSP + + var + false + true + + + with + true + true + + + start + true + true + + + end + true + true + + + + substring + org.apache.taglibs.string.SubstringTag + JSP + + var + false + true + + + start + false + true + + + end + false + true + + + + repeat + org.apache.taglibs.string.RepeatTag + JSP + + var + false + true + + + count + true + true + + + + wordWrap + org.apache.taglibs.string.WordWrapTag + JSP + + var + false + true + + + width + false + true + + + delimiter + false + true + + + split + false + true + + + delimiterInside + false + false + + + + nestedString + org.apache.taglibs.string.NestedStringTag + JSP + + var + false + true + + + open + true + true + + + close + false + true + + + + countMatches + org.apache.taglibs.string.CountMatchesTag + JSP + + var + false + true + + + substring + true + true + + + + default + org.apache.taglibs.string.DefaultTag + JSP + + var + false + true + + + value + false + true + + + default + false + true + + + + replace + org.apache.taglibs.string.ReplaceTag + JSP + + var + false + true + + + replace + true + true + + + with + true + true + + + count + false + true + + + newlineToken + false + true + + + carriageToken + false + true + + + + randomString + org.apache.taglibs.string.RandomStringTag + JSP + + var + false + true + + + count + true + true + + + start + false + true + + + end + false + true + + + type + false + true + + + + left + org.apache.taglibs.string.LeftTag + JSP + + var + false + true + + + count + true + true + + + + right + org.apache.taglibs.string.RightTag + JSP + + var + false + true + + + count + true + true + + + + mid + org.apache.taglibs.string.MidTag + JSP + + var + false + true + + + start + false + true + + + count + true + true + + + + truncateNicely + org.apache.taglibs.string.TruncateNicelyTag + JSP + + var + false + true + + + lower + false + true + + + upper + false + true + + + appendToEnd + false + true + + + + join + org.apache.taglibs.string.JoinTag + EMPTY + + items + true + true + + + separator + false + true + + + + split + org.apache.taglibs.string.SplitTag + JSP + + separator + true + true + + + var + true + true + + + + + + + + + + + diff --git a/webapp/config/tlds/vitroForm.tld b/webapp/config/tlds/vitroForm.tld new file mode 100644 index 000000000..7c9de7131 --- /dev/null +++ b/webapp/config/tlds/vitroForm.tld @@ -0,0 +1,198 @@ + + + + + + + + SPARQL JSP taglib + 1.0 + + Vitro DAO access Form Library + + + + optionsForProperty + Options For Property + + Create the option elements for a specified subject and predicate. + + edu.cornell.mannlib.vitro.webapp.web.jsptags.OptionsForPropertyTag + empty + + subjectUri + true + true + + + predicateUri + true + true + + + selectedUri + false + true + + + + + + optionsForVClass + Options For VClass + + Create the option elements for a specified vitro class. + + edu.cornell.mannlib.vitro.webapp.web.jsptags.OptionsForClassTag + empty + + classUri + true + true + + + selectedUri + false + true + + + + + + option + Options for Form Field + + Create the option elements for a specified field using information in the + editConfiguration to build the list and the editSubmission to mark one + of the options as selected. + + edu.cornell.mannlib.vitro.webapp.web.jsptags.Options + empty + + name + true + true + + + + + jsonset + edu.cornell.mannlib.vitro.webapp.web.jsptags.JsonSet + scriptless + + var + true + true + + + + + value + value for a Form Field + + If there is a value in a edit submission object that matches the name, + Then output that value. otherwise, output nothing + + edu.cornell.mannlib.vitro.webapp.web.jsptags.Value + empty + + name + true + true + + + + + + errorMessage + errorMessage value for a Form Field + + If there is a value in a edit submission.validation object that matches the name, + Then output that value. otherwise, output nothing + + edu.cornell.mannlib.vitro.webapp.web.jsptags.ErrorMessage + empty + + name + true + true + + + + + input + Input Element Formatting + + Format a form input element of a specified element type + + edu.cornell.mannlib.vitro.webapp.web.jsptags.InputElementFormattingTag + empty + + type + true + true + + + id + true + true + + + label + false + true + + + cssClass + false + true + + + value + false + true + + + error + false + true + + + size + false + true + + + rows + false + true + + + cols + false + true + + + multiple + false + true + + + listMarkup + false + true + + + cancel + false + true + + + + \ No newline at end of file diff --git a/webapp/config/tomcat.server.log4j.properties.example b/webapp/config/tomcat.server.log4j.properties.example new file mode 100644 index 000000000..d5e2c22bf --- /dev/null +++ b/webapp/config/tomcat.server.log4j.properties.example @@ -0,0 +1,47 @@ +# from tomcat documentation http://tomcat.apache.org/tomcat-5.5-doc/logging.html +# put commons-logging-1.1.jar, log4j-1.2.14.jar in tomcat/common/lib +# and this properties file in tomcat/common/classes + +# This log4j configuration sets up a file called tomcat.log in your +# Tomcat logs folder with a maximum file size of 10MB and up to 10 +# backups. DEBUG level is specified which will result in the most +# verbose output from Tomcat. +# +# You can (and should) be more picky about which packages to include in +# the logging. Tomcat 5.5 uses defines loggers by Engine and Host +# names. For example, for a default Catalina localhost log, add this to +# the end of the log4j.properties above. Note that there are known +# issues with using this naming convention (with square brackets) in +# log4j XML based configuration files, so we recommend you use a +# properties file as described until a future version of log4j allows +# this convention. +# +#* log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R +#* log4j.logger.org.apache.catalina.core=DEBUG, R +#* log4j.logger.org.apache.catalina.session=DEBUG, R +# +# Be warned a level of DEBUG will produce megabytes of logging and slow +# startup of Tomcat. This level should be used sparingly when debugging +# of internal Tomcat operations is required. +# +# Your web applications should certainly use their own log4j +# configuration. This is valid with the above configuration. You would +# place a similar log4j.properties file in your web application's +# WEB-INF/classes folder, and log4j1.2.8.jar into WEB-INF/lib. Then +# specify your package level logging. This is a basic setup of log4j +# which does *not* require Commons-Logging, and you should consult the +# log4j documentation for more options. + +log4j.rootLogger=INFO, R +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.File=${catalina.home}/logs/tomcat.server.log +log4j.appender.R.MaxFileSize=5MB +log4j.appender.R.MaxBackupIndex=3 +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n +log4j.logger.org.apache.catalina=INFO, R + + + + + diff --git a/webapp/config/web.xml b/webapp/config/web.xml new file mode 100644 index 000000000..d79070fdd --- /dev/null +++ b/webapp/config/web.xml @@ -0,0 +1,1180 @@ + + + + + + + + + + + + + + + jdbc/vitro/connectionType + + + java.lang.String + PROPERTIES_FILE_POOL + + + + + jdbc/vitro/namedDS + + java.lang.String + mySharedDBPool + + + + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.DefaultThemeSetup + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.VitroJenaModelMakerSetup + + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaPersistentDataSourceSetup + + + + + + + + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetup + + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.AttachSubmodels + + + + + + + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.PelletReasonerSetup + + + + + + + + + + + edu.cornell.mannlib.vitro.webapp.search.lucene.LuceneSetup + + + + + + edu.cornell.mannlib.vitro.webapp.auth.policy.setup.EditorEditingPolicySetup + + + + + edu.cornell.mannlib.vitro.webapp.auth.policy.setup.CuratorEditingPolicySetup + + + + + edu.cornell.mannlib.vitro.webapp.auth.policy.setup.DbAdminEditingPolicySetup + + + + + + + + + + + + Character Set Encoding Filter + edu.cornell.mannlib.vitro.webapp.filters.CharsetEncodingFilter + + + Character Set Encoding Filter + /* + + + JSession Strip Filter + edu.cornell.mannlib.vitro.webapp.filters.JSessionStripFilter + + + JSession Strip Filter + /* + + + + URL Rewriter Filter + edu.cornell.mannlib.vitro.webapp.filters.URLRewriterFilter + + + URL Rewriter Filter + /* + + + Portal Picker Filter + edu.cornell.mannlib.vitro.webapp.filters.PortalPickerFilter + + + Portal Picker Filter + /* + + + + VitroRequestPrep + edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep + + + VitroRequestPrep + /* + request + forward + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + + trimSpaces + true + + 3 + + + + IndexController + edu.cornell.mannlib.vitro.webapp.search.controller.IndexController + + + IndexController + /SearchIndex + + + + TestController + edu.cornell.mannlib.vitro.webapp.controller.TestController + + + TestController + /test + + + + + fetch + edu.cornell.mannlib.vitro.webapp.QueryServlet + + + + + AboutController + edu.cornell.mannlib.vitro.webapp.controller.AboutController + + + AboutController + /about + + + + SiteAdminController + edu.cornell.mannlib.vitro.webapp.controller.edit.SiteAdminController + + + SiteAdminController + /siteAdmin + + + SiteAdminController + /siteAdmin.jsp + + + + ImageUploadController + edu.cornell.mannlib.vitro.webapp.controller.edit.ImageUploadController + + + ImageUploadController + /uploadimages + + + ImageUploadController + /uploadimages.jsp + + + + FlagUpdateController + edu.cornell.mannlib.vitro.webapp.controller.edit.FlagUpdateController + + + FlagUpdateController + /flagUpdate + + + + SitemapIndexController + edu.cornell.mannlib.vitro.webapp.controller.SitemapIndexController + + + SitemapIndexController + /sitemap.xml + + + + RDFUploadFormController + edu.cornell.mannlib.vitro.webapp.controller.jena.RDFUploadFormController + + + RDFUploadFormController + /uploadRDFForm + + + + RDFUploadController + edu.cornell.mannlib.vitro.webapp.controller.jena.RDFUploadController + + + RDFUploadController + /uploadRDF + + + + JenaIngestController + edu.cornell.mannlib.vitro.webapp.controller.jena.JenaIngestController + + + JenaIngestController + /ingest + + + + JenaExportController + edu.cornell.mannlib.vitro.webapp.controller.jena.JenaExportController + + + JenaExportController + /export/* + + + + JenaXMLFileUpload + edu.cornell.mannlib.vitro.webapp.controller.jena.JenaXMLFileUpload + + + JenaXMLFileUpload + /jenaXmlFileUpload/* + + + + OwlImportController + edu.cornell.mannlib.vitro.webapp.owl.OwlImportController + + + OwlImportController + /owl + + + + OwlImportServlet + edu.cornell.mannlib.vitro.webapp.owl.ProtegeOwlImportServlet + + + OwlImportServlet + /importOwl + + + + JenaAdminServlet + edu.cornell.mannlib.vitro.webapp.controller.jena.JenaAdminActions + + + JenaAdminServlet + /jenaAdmin + + + + EditFrontController + edu.cornell.mannlib.vedit.controller.EditFrontController + + + EditFrontController + /editForm + + + + OperationController + edu.cornell.mannlib.vedit.controller.OperationController + + + OperationController + /doEdit + + + + EntityEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.EntityEditController + + + EntityEditController + /entityEdit + + + + VclassEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.VclassEditController + + + VclassEditController + /vclassEdit + + + + Classes2ClassesOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.Classes2ClassesOperationController + + + Classes2ClassesOperationController + /classes2ClassesOp + + + + Properties2PropertiesOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.Properties2PropertiesOperationController + + + Properties2PropertiesOperationController + /props2PropsOp + + + + NamespacePrefixOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.NamespacePrefixOperationController + + + NamespacePrefixOperationController + /namespacePrefixOp + + + + RefactorOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.RefactorOperationController + + + RefactorOperationController + /refactorOp + + + + IndividualTypeOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.IndividualTypeOperationController + + + IndividualTypeOperationController + /individualTypeOp + + + + Tabs2TypesOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.Tabs2TypesOperationController + + + Tabs2TypesOperationController + /tabs2TypesOp + + + + TabIndividualRelationOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.TabIndividualRelationOperationController + + + TabIndividualRelationOperationController + /tabIndividualRelationOp + + + + TabHierarchyOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.TabHierarchyOperationController + + + TabHierarchyOperationController + /doTabHierarchyOperation + + + + DatapropEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.DatapropEditController + + + DatapropEditController + /datapropEdit + + + + + KeywordEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.KeywordEditController + + + KeywordEditController + /keywordEdit + + + + TabEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.TabEditController + + + TabEditController + /tabEdit + + + + UserEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.UserEditController + + + UserEditController + /userEdit + + + + OntologyEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.OntologyEditController + + + OntologyEditController + /ontologyEdit + + + + PropertyEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.PropertyEditController + + + PropertyEditController + /propertyEdit + + + + PortalEditController + edu.cornell.mannlib.vitro.webapp.controller.edit.PortalEditController + + + PortalEditController + /portalEdit + + + + EntityRetryController + edu.cornell.mannlib.vitro.webapp.controller.edit.EntityRetryController + + + EntityRetryController + /entity_retry + + + + VclassRetryController + edu.cornell.mannlib.vitro.webapp.controller.edit.VclassRetryController + + + VclassRetryController + /vclass_retry + + + + DatatypeRetryController + edu.cornell.mannlib.vitro.webapp.controller.edit.DatatypeRetryController + + + DatatypeRetryController + /datatype_retry + + + + AllTabsForPortalListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.AllTabsForPortalListingController + + + AllTabsForPortalListingController + /listTabs + + + + AllClassGroupsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.AllClassGroupsListingController + + + AllClassGroupsListingController + /listGroups + + + + PropertyGroupsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.PropertyGroupsListingController + + + PropertyGroupsListingController + /listPropertyGroups + + + + OntologiesListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.OntologiesListingController + + + OntologiesListingController + /listOntologies + + + + NamespacesListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.jena.NamespacesListingController + + + NamespacesListingController + /listNamespaces + + + + RestrictionsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.jena.RestrictionsListingController + + + RestrictionsListingController + /listRestrictions + + + + RestrictionOperationController + edu.cornell.mannlib.vitro.webapp.controller.edit.RestrictionOperationController + + + RestrictionOperationController + /addRestriction + + + + PortalsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.PortalsListingController + + + PortalsListingController + /listPortals + + + + UsersListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.UsersListingController + + + UsersListingController + /listUsers + + + + StatementChangeListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.jena.StatementChangeListingController + + + StatementChangeListingController + /statementHistory + + + + WriteOutChangesController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.jena.WriteOutChangesController + + + WriteOutChangesController + /writeOutChanges + + + + VClassWebappsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.VClassWebappsListingController + + + VClassWebappsListingController + /listVClassWebapps + + + + IndividualsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.IndividualsListingController + + + IndividualsListingController + /listIndividuals + + + + + ClassHierarchyListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.ClassHierarchyListingController + + + ClassHierarchyListingController + /showClassHierarchy + + + + ObjectPropertyHierarchyListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.ObjectPropertyHierarchyListingController + + + ObjectPropertyHierarchyListingController + /showObjectPropertyHierarchy + + + + DataPropertyHierarchyListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.DataPropertyHierarchyListingController + + + DataPropertyHierarchyListingController + /showDataPropertyHierarchy + + + + PropertyWebappsListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.PropertyWebappsListingController + + + PropertyWebappsListingController + /listPropertyWebapps + + + + DatatypePropertiesListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.DatatypePropertiesListingController + + + DatatypePropertiesListingController + /listDatatypeProperties + + + + DataPropertyStatementListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.DataPropertyStatementListingController + + + DataPropertyStatementListingController + /listDataPropertyStatements + + + + ObjectPropertyStatementListingController + edu.cornell.mannlib.vitro.webapp.controller.edit.listing.ObjectPropertyStatementListingController + + + ObjectPropertyStatementListingController + /listObjectPropertyStatements + + + + EntityListController + edu.cornell.mannlib.vitro.webapp.controller.EntityListController + + + EntityListController + /entitylist + + + + SearchController + edu.cornell.mannlib.vitro.webapp.search.controller.PagedSearchController + + + SearchController + /search + + + + SearchController + /search.jsp + + + SearchController + /fedsearch + + + SearchController + /searchcontroller + + + + AdminController + edu.cornell.mannlib.vitro.webapp.controller.AdminController + + + AdminController + /adminCon + + + + TermsOfUseController + edu.cornell.mannlib.vitro.webapp.controller.TermsOfUseController + + + TermsOfUseController + /termsOfUse + + + + CommentsController + edu.cornell.mannlib.vitro.webapp.controller.CommentsController + + + CommentsController + /comments + + + + JSON Service + edu.cornell.mannlib.vitro.webapp.controller.JSONServlet + + + JSON Service + /dataservice + + + + TabEntitiesController + edu.cornell.mannlib.vitro.webapp.controller.TabEntitiesController + + + TabEntitiesController + /TabEntitiesController + + + + + TabController + edu.cornell.mannlib.vitro.webapp.controller.TabController + + + TabController + /index.jsp + + + + + + EntityMergedPropertyListController + edu.cornell.mannlib.vitro.webapp.controller.EntityMergedPropertyListController + + + EntityMergedPropertyListController + /entityMergedPropList + + + + DashboardPropertyListController + edu.cornell.mannlib.vitro.webapp.controller.DashboardPropertyListController + + + DashboardPropertyListController + /dashboardPropList + + + + dwr-invoker + uk.ltd.getahead.dwr.DWRServlet + + debug + true + + + logLevel + DEBUG + + + + dwr-invoker + /dwr/* + + + + sendmail + edu.cornell.mannlib.vitro.webapp.controller.ContactMailServlet + 5 + + + + entity + edu.cornell.mannlib.vitro.webapp.controller.EntityController + + + + updateEntityFlags + edu.cornell.mannlib.vitro.webapp.UpdateEntityFlagServlet + + + + authenticate + edu.cornell.mannlib.vitro.webapp.controller.edit.Authenticate + + + + logout + edu.cornell.mannlib.vitro.webapp.controller.edit.Logout + + properties + WEB-INF/classes/formbeans/Login_forms.properties + + + + + + browsecontroller + edu.cornell.mannlib.vitro.webapp.controller.BrowseController + 5 + + + + pubsbyorg + edu.cornell.mannlib.vitro.webapp.controller.vclass.PubsByDepartmentServlet + + workspaceDir + /usr/local/services/vivo/logs + + + + + + coauthors + edu.cornell.mannlib.vitro.webapp.controller.vclass.CoAuthorServlet + + workspaceDir + /usr/local/services/vivo/logs + + + + + + generic_create + edu.cornell.mannlib.vitro.webapp.GenericDBCreate + + + + + uploadImages + edu.cornell.mannlib.vitro.webapp.controller.edit.UploadImagesServlet + + workspaceDir + + /usr/local/src/Vitro/dream/common/web + + + + + + generic_editprep + edu.cornell.mannlib.vitro.webapp.GenericDBEditPrep + + + + generic_update + edu.cornell.mannlib.vitro.webapp.GenericDBUpdate + + + + generic_delete + edu.cornell.mannlib.vitro.webapp.GenericDBDelete + + + + SparqlQuery + edu.cornell.mannlib.vitro.webapp.controller.SparqlQueryServlet + + + + SparqlQuery + /admin/sparqlquery + + + + authtest + edu.cornell.mannlib.vitro.webapp.auth.AuthTestController + + + authtest + /authtest + + + + + fetch + /fetch + + + sendmail + /sendmail + + + entity + /entity + + + entity + /entity/* + + + entity + /individual/* + + + updateEntityFlags + /updateEntityFlags + + + authenticate + /authenticate + + + logout + /logout + + + browsecontroller + /browsecontroller + + + pubsbyorg + /pubsbyorg + + + coauthors + /coauthors + + + uploadImages + /uploadImages + + + generic_create + /generic_create + + + generic_editprep + /generic_editprep + + + generic_update + /generic_update + + + generic_delete + /generic_delete + + + + + + /WEB-INF/tlds/database.tld + /WEB-INF/tlds/database.tld + + + + http://java.sun.com/jstl/core + /WEB-INF/tlds/c.tld + + + + http://java.sun.com/jstl/functions + /WEB-INF/tlds/fn.tld + + + + http://vitro.mannlib.cornell.edu/edit/tags + /WEB-INF/tlds/form.tld + + + + http://vitro.mannlib.cornell.edu/vitro/tags + /WEB-INF/tlds/vitroForm.tld + + + + http://vitro.mannlib.cornell.edu/vitro/tags/PropertyEditLink + /WEB-INF/tlds/PropertyEditLink.tld + + + + http://mannlib.cornell.edu/vitro/ListSparqlTag/0.1/ + /WEB-INF/tlds/ListSparqlTag.tld + + + + http://jakarta.apache.org/taglibs/string-1.1 + /WEB-INF/tlds/taglibs-string.tld + + + + + + + + + + + + + + org.apache.axis.transport.http.AxisHTTPSessionListener + + + + AxisServlet + org.apache.axis.transport.http.AxisServlet + + + + AxisAdminServlet + org.apache.axis.transport.http.AdminServlet + 100 + + + + SOAPMonitorService + org.apache.axis.monitor.SOAPMonitorService + + SOAPMonitorPort + 5001 + + 100 + + + + AxisAdminServlet + /AxisAdminServlet + + + + AxisServlet + /servlet/AxisServlet + + + + AxisServlet + *.jws + + + + AxisServlet + /services/* + + + + SOAPMonitorService + /SOAPMonitor + + + + xsd + text/xml + + + wsdl + text/xml + + + diff --git a/webapp/lib/README.txt b/webapp/lib/README.txt new file mode 100644 index 000000000..29a58ede4 --- /dev/null +++ b/webapp/lib/README.txt @@ -0,0 +1,15 @@ +notes about jar files in lib dir: + +commons-pool-1.2.jar - for connection pools and dbcp +commons-collections-3.1.jar - for commons-pool-1.2.jar +These previous two jars were not in the lib directory because +we had been putting them in tomcat/common/lib for the +server.xml database connection. + +cos.jar +com.oreilly.servlet.* classes. Many different utilities for +servlets from http://servlets.com/cos/ +There is a set of file upload tools, an email utility, a cache, +a base64 encode/decode, a parameter parser. + +updated by bdc who need ServletUtils. diff --git a/webapp/lib/XmlSchema-1.0.3.jar b/webapp/lib/XmlSchema-1.0.3.jar new file mode 100644 index 000000000..f38984515 Binary files /dev/null and b/webapp/lib/XmlSchema-1.0.3.jar differ diff --git a/webapp/lib/activation-1.1.jar b/webapp/lib/activation-1.1.jar new file mode 100644 index 000000000..53f82a1c4 Binary files /dev/null and b/webapp/lib/activation-1.1.jar differ diff --git a/webapp/lib/aduna-appbase-core-3.4.jar b/webapp/lib/aduna-appbase-core-3.4.jar new file mode 100644 index 000000000..135939595 Binary files /dev/null and b/webapp/lib/aduna-appbase-core-3.4.jar differ diff --git a/webapp/lib/aduna-appbase-logging-api-3.4.jar b/webapp/lib/aduna-appbase-logging-api-3.4.jar new file mode 100644 index 000000000..3d12c25ec Binary files /dev/null and b/webapp/lib/aduna-appbase-logging-api-3.4.jar differ diff --git a/webapp/lib/aduna-appbase-logging-file-3.4.jar b/webapp/lib/aduna-appbase-logging-file-3.4.jar new file mode 100644 index 000000000..41df8ca75 Binary files /dev/null and b/webapp/lib/aduna-appbase-logging-file-3.4.jar differ diff --git a/webapp/lib/aduna-appbase-webapp-base-core-3.4.jar b/webapp/lib/aduna-appbase-webapp-base-core-3.4.jar new file mode 100644 index 000000000..538bb93c2 Binary files /dev/null and b/webapp/lib/aduna-appbase-webapp-base-core-3.4.jar differ diff --git a/webapp/lib/aduna-commons-collections-2.3.jar b/webapp/lib/aduna-commons-collections-2.3.jar new file mode 100644 index 000000000..665f995d9 Binary files /dev/null and b/webapp/lib/aduna-commons-collections-2.3.jar differ diff --git a/webapp/lib/aduna-commons-concurrent-2.2.jar b/webapp/lib/aduna-commons-concurrent-2.2.jar new file mode 100644 index 000000000..f2d73fdf7 Binary files /dev/null and b/webapp/lib/aduna-commons-concurrent-2.2.jar differ diff --git a/webapp/lib/aduna-commons-i18n-1.0.jar b/webapp/lib/aduna-commons-i18n-1.0.jar new file mode 100644 index 000000000..3ad0bfec2 Binary files /dev/null and b/webapp/lib/aduna-commons-i18n-1.0.jar differ diff --git a/webapp/lib/aduna-commons-io-2.4.jar b/webapp/lib/aduna-commons-io-2.4.jar new file mode 100644 index 000000000..6642ac658 Binary files /dev/null and b/webapp/lib/aduna-commons-io-2.4.jar differ diff --git a/webapp/lib/aduna-commons-iteration-2.3.jar b/webapp/lib/aduna-commons-iteration-2.3.jar new file mode 100644 index 000000000..366d2cbe6 Binary files /dev/null and b/webapp/lib/aduna-commons-iteration-2.3.jar differ diff --git a/webapp/lib/aduna-commons-lang-2.2.jar b/webapp/lib/aduna-commons-lang-2.2.jar new file mode 100644 index 000000000..842faee4b Binary files /dev/null and b/webapp/lib/aduna-commons-lang-2.2.jar differ diff --git a/webapp/lib/aduna-commons-net-2.2.jar b/webapp/lib/aduna-commons-net-2.2.jar new file mode 100644 index 000000000..88273c0c9 Binary files /dev/null and b/webapp/lib/aduna-commons-net-2.2.jar differ diff --git a/webapp/lib/aduna-commons-platform-info-2.4.jar b/webapp/lib/aduna-commons-platform-info-2.4.jar new file mode 100644 index 000000000..e2517c19c Binary files /dev/null and b/webapp/lib/aduna-commons-platform-info-2.4.jar differ diff --git a/webapp/lib/aduna-commons-text-2.2.jar b/webapp/lib/aduna-commons-text-2.2.jar new file mode 100644 index 000000000..76b817335 Binary files /dev/null and b/webapp/lib/aduna-commons-text-2.2.jar differ diff --git a/webapp/lib/aduna-commons-webapp-core-2.3.jar b/webapp/lib/aduna-commons-webapp-core-2.3.jar new file mode 100644 index 000000000..cba1835ed Binary files /dev/null and b/webapp/lib/aduna-commons-webapp-core-2.3.jar differ diff --git a/webapp/lib/aduna-commons-xml-2.2.jar b/webapp/lib/aduna-commons-xml-2.2.jar new file mode 100644 index 000000000..76ece0936 Binary files /dev/null and b/webapp/lib/aduna-commons-xml-2.2.jar differ diff --git a/webapp/lib/antlr-2.7.5.jar b/webapp/lib/antlr-2.7.5.jar new file mode 100644 index 000000000..fbe5e3cd3 Binary files /dev/null and b/webapp/lib/antlr-2.7.5.jar differ diff --git a/webapp/lib/arq-extra.jar b/webapp/lib/arq-extra.jar new file mode 100644 index 000000000..fbf2d7735 Binary files /dev/null and b/webapp/lib/arq-extra.jar differ diff --git a/webapp/lib/arq.jar b/webapp/lib/arq.jar new file mode 100644 index 000000000..3196a9f6f Binary files /dev/null and b/webapp/lib/arq.jar differ diff --git a/webapp/lib/aterm-java-1.6.jar b/webapp/lib/aterm-java-1.6.jar new file mode 100644 index 000000000..c56edd997 Binary files /dev/null and b/webapp/lib/aterm-java-1.6.jar differ diff --git a/webapp/lib/axis-ant.jar b/webapp/lib/axis-ant.jar new file mode 100644 index 000000000..17527ffdd Binary files /dev/null and b/webapp/lib/axis-ant.jar differ diff --git a/webapp/lib/axis.jar b/webapp/lib/axis.jar new file mode 100644 index 000000000..20b09a595 Binary files /dev/null and b/webapp/lib/axis.jar differ diff --git a/webapp/lib/commons-beanutils-core.jar b/webapp/lib/commons-beanutils-core.jar new file mode 100644 index 000000000..ce79cbeef Binary files /dev/null and b/webapp/lib/commons-beanutils-core.jar differ diff --git a/webapp/lib/commons-betwixt-0.7.jar b/webapp/lib/commons-betwixt-0.7.jar new file mode 100644 index 000000000..7b0d69280 Binary files /dev/null and b/webapp/lib/commons-betwixt-0.7.jar differ diff --git a/webapp/lib/commons-cli-1.1.jar b/webapp/lib/commons-cli-1.1.jar new file mode 100644 index 000000000..e633afbe6 Binary files /dev/null and b/webapp/lib/commons-cli-1.1.jar differ diff --git a/webapp/lib/commons-codec-1.3.jar b/webapp/lib/commons-codec-1.3.jar new file mode 100644 index 000000000..957b6752a Binary files /dev/null and b/webapp/lib/commons-codec-1.3.jar differ diff --git a/webapp/lib/commons-collections-3.1.jar b/webapp/lib/commons-collections-3.1.jar new file mode 100644 index 000000000..41e230fee Binary files /dev/null and b/webapp/lib/commons-collections-3.1.jar differ diff --git a/webapp/lib/commons-dbcp-1.2.1.jar b/webapp/lib/commons-dbcp-1.2.1.jar new file mode 100644 index 000000000..08440c02e Binary files /dev/null and b/webapp/lib/commons-dbcp-1.2.1.jar differ diff --git a/webapp/lib/commons-dbcp-1.2.2.jar b/webapp/lib/commons-dbcp-1.2.2.jar new file mode 100644 index 000000000..faea05626 Binary files /dev/null and b/webapp/lib/commons-dbcp-1.2.2.jar differ diff --git a/webapp/lib/commons-digester-1.7.jar b/webapp/lib/commons-digester-1.7.jar new file mode 100644 index 000000000..1783dbea2 Binary files /dev/null and b/webapp/lib/commons-digester-1.7.jar differ diff --git a/webapp/lib/commons-discovery-0.2.jar b/webapp/lib/commons-discovery-0.2.jar new file mode 100644 index 000000000..b88554847 Binary files /dev/null and b/webapp/lib/commons-discovery-0.2.jar differ diff --git a/webapp/lib/commons-fileupload-1.2.1.jar b/webapp/lib/commons-fileupload-1.2.1.jar new file mode 100644 index 000000000..aa209b388 Binary files /dev/null and b/webapp/lib/commons-fileupload-1.2.1.jar differ diff --git a/webapp/lib/commons-httpclient-3.1.jar b/webapp/lib/commons-httpclient-3.1.jar new file mode 100644 index 000000000..7c59774ae Binary files /dev/null and b/webapp/lib/commons-httpclient-3.1.jar differ diff --git a/webapp/lib/commons-io-1.3.2.jar b/webapp/lib/commons-io-1.3.2.jar new file mode 100644 index 000000000..865c9e41c Binary files /dev/null and b/webapp/lib/commons-io-1.3.2.jar differ diff --git a/webapp/lib/commons-lang-2.1.jar b/webapp/lib/commons-lang-2.1.jar new file mode 100644 index 000000000..87b80ab5d Binary files /dev/null and b/webapp/lib/commons-lang-2.1.jar differ diff --git a/webapp/lib/commons-logging-1.1.1.jar b/webapp/lib/commons-logging-1.1.1.jar new file mode 100644 index 000000000..8758a96b7 Binary files /dev/null and b/webapp/lib/commons-logging-1.1.1.jar differ diff --git a/webapp/lib/commons-pool-1.3.jar b/webapp/lib/commons-pool-1.3.jar new file mode 100644 index 000000000..623b1c0a7 Binary files /dev/null and b/webapp/lib/commons-pool-1.3.jar differ diff --git a/webapp/lib/concurrent.jar b/webapp/lib/concurrent.jar new file mode 100644 index 000000000..f01955af9 Binary files /dev/null and b/webapp/lib/concurrent.jar differ diff --git a/webapp/lib/cos.jar b/webapp/lib/cos.jar new file mode 100644 index 000000000..6a4a1ff5f Binary files /dev/null and b/webapp/lib/cos.jar differ diff --git a/webapp/lib/csv-1.0.jar b/webapp/lib/csv-1.0.jar new file mode 100644 index 000000000..e65c43b86 Binary files /dev/null and b/webapp/lib/csv-1.0.jar differ diff --git a/webapp/lib/dom4j-1.6.1.jar b/webapp/lib/dom4j-1.6.1.jar new file mode 100644 index 000000000..c8c4dbb92 Binary files /dev/null and b/webapp/lib/dom4j-1.6.1.jar differ diff --git a/webapp/lib/dwr-2.0.M2.8.jar b/webapp/lib/dwr-2.0.M2.8.jar new file mode 100644 index 000000000..5aa6736b8 Binary files /dev/null and b/webapp/lib/dwr-2.0.M2.8.jar differ diff --git a/webapp/lib/fedora-client.jar b/webapp/lib/fedora-client.jar new file mode 100644 index 000000000..21bfea243 Binary files /dev/null and b/webapp/lib/fedora-client.jar differ diff --git a/webapp/lib/icu4j_3_4.jar b/webapp/lib/icu4j_3_4.jar new file mode 100644 index 000000000..d35e3c346 Binary files /dev/null and b/webapp/lib/icu4j_3_4.jar differ diff --git a/webapp/lib/iri.jar b/webapp/lib/iri.jar new file mode 100644 index 000000000..b2026e455 Binary files /dev/null and b/webapp/lib/iri.jar differ diff --git a/webapp/lib/jakarta-jstl1.2-jstl.jar b/webapp/lib/jakarta-jstl1.2-jstl.jar new file mode 100644 index 000000000..a02abecc8 Binary files /dev/null and b/webapp/lib/jakarta-jstl1.2-jstl.jar differ diff --git a/webapp/lib/jakarta-jstl1.2-standard.jar b/webapp/lib/jakarta-jstl1.2-standard.jar new file mode 100644 index 000000000..bc528acb9 Binary files /dev/null and b/webapp/lib/jakarta-jstl1.2-standard.jar differ diff --git a/webapp/lib/jakarta-oro-2.0.8.jar b/webapp/lib/jakarta-oro-2.0.8.jar new file mode 100644 index 000000000..23488d260 Binary files /dev/null and b/webapp/lib/jakarta-oro-2.0.8.jar differ diff --git a/webapp/lib/jaxen-1.1-beta-6.jar b/webapp/lib/jaxen-1.1-beta-6.jar new file mode 100644 index 000000000..6cef35dac Binary files /dev/null and b/webapp/lib/jaxen-1.1-beta-6.jar differ diff --git a/webapp/lib/jaxen-1.1-beta-9.jar b/webapp/lib/jaxen-1.1-beta-9.jar new file mode 100644 index 000000000..6402d3273 Binary files /dev/null and b/webapp/lib/jaxen-1.1-beta-9.jar differ diff --git a/webapp/lib/jaxrpc.jar b/webapp/lib/jaxrpc.jar new file mode 100644 index 000000000..a2c13d9a2 Binary files /dev/null and b/webapp/lib/jaxrpc.jar differ diff --git a/webapp/lib/jcalendar.jar b/webapp/lib/jcalendar.jar new file mode 100644 index 000000000..d5c455896 Binary files /dev/null and b/webapp/lib/jcalendar.jar differ diff --git a/webapp/lib/jdom-1.0.jar b/webapp/lib/jdom-1.0.jar new file mode 100644 index 000000000..288e64cb5 Binary files /dev/null and b/webapp/lib/jdom-1.0.jar differ diff --git a/webapp/lib/jdom.jar b/webapp/lib/jdom.jar new file mode 100644 index 000000000..14fbcba60 Binary files /dev/null and b/webapp/lib/jdom.jar differ diff --git a/webapp/lib/jena.jar b/webapp/lib/jena.jar new file mode 100644 index 000000000..6a532bd43 Binary files /dev/null and b/webapp/lib/jena.jar differ diff --git a/webapp/lib/jenatest.jar b/webapp/lib/jenatest.jar new file mode 100644 index 000000000..54b665847 Binary files /dev/null and b/webapp/lib/jenatest.jar differ diff --git a/webapp/lib/jga-0.8.jar b/webapp/lib/jga-0.8.jar new file mode 100644 index 000000000..8db44d2ce Binary files /dev/null and b/webapp/lib/jga-0.8.jar differ diff --git a/webapp/lib/joda-time-1.4.jar b/webapp/lib/joda-time-1.4.jar new file mode 100644 index 000000000..351ad69c1 Binary files /dev/null and b/webapp/lib/joda-time-1.4.jar differ diff --git a/webapp/lib/json-taglib-0.4.1.jar b/webapp/lib/json-taglib-0.4.1.jar new file mode 100644 index 000000000..631e700d5 Binary files /dev/null and b/webapp/lib/json-taglib-0.4.1.jar differ diff --git a/webapp/lib/json.jar b/webapp/lib/json.jar new file mode 100644 index 000000000..92b6be245 Binary files /dev/null and b/webapp/lib/json.jar differ diff --git a/webapp/lib/jsp-api.jar b/webapp/lib/jsp-api.jar new file mode 100644 index 000000000..e4e36ea32 Binary files /dev/null and b/webapp/lib/jsp-api.jar differ diff --git a/webapp/lib/jtidy-8.0-20060801.124516-2.jar b/webapp/lib/jtidy-8.0-20060801.124516-2.jar new file mode 100644 index 000000000..295616d99 Binary files /dev/null and b/webapp/lib/jtidy-8.0-20060801.124516-2.jar differ diff --git a/webapp/lib/junit-4.8.1.jar b/webapp/lib/junit-4.8.1.jar new file mode 100644 index 000000000..524cd65ce Binary files /dev/null and b/webapp/lib/junit-4.8.1.jar differ diff --git a/webapp/lib/ldap.jar b/webapp/lib/ldap.jar new file mode 100644 index 000000000..85eb8f918 Binary files /dev/null and b/webapp/lib/ldap.jar differ diff --git a/webapp/lib/log4j-1.2.14.jar b/webapp/lib/log4j-1.2.14.jar new file mode 100644 index 000000000..625130719 Binary files /dev/null and b/webapp/lib/log4j-1.2.14.jar differ diff --git a/webapp/lib/lucene-analyzers-2.4.jar b/webapp/lib/lucene-analyzers-2.4.jar new file mode 100644 index 000000000..5cd81f6fa Binary files /dev/null and b/webapp/lib/lucene-analyzers-2.4.jar differ diff --git a/webapp/lib/lucene-core-2.4.0.jar b/webapp/lib/lucene-core-2.4.0.jar new file mode 100644 index 000000000..440d76865 Binary files /dev/null and b/webapp/lib/lucene-core-2.4.0.jar differ diff --git a/webapp/lib/lucene-highlighter-2.4.jar b/webapp/lib/lucene-highlighter-2.4.jar new file mode 100644 index 000000000..31332477b Binary files /dev/null and b/webapp/lib/lucene-highlighter-2.4.jar differ diff --git a/webapp/lib/mail-1.4.jar b/webapp/lib/mail-1.4.jar new file mode 100644 index 000000000..fd4555b35 Binary files /dev/null and b/webapp/lib/mail-1.4.jar differ diff --git a/webapp/lib/mysql-connector-java-3.0.16-ga-bin.jar b/webapp/lib/mysql-connector-java-3.0.16-ga-bin.jar new file mode 100644 index 000000000..8deaaf498 Binary files /dev/null and b/webapp/lib/mysql-connector-java-3.0.16-ga-bin.jar differ diff --git a/webapp/lib/ojdbc14_g.jar b/webapp/lib/ojdbc14_g.jar new file mode 100644 index 000000000..349627b9e Binary files /dev/null and b/webapp/lib/ojdbc14_g.jar differ diff --git a/webapp/lib/pellet-cli.jar b/webapp/lib/pellet-cli.jar new file mode 100644 index 000000000..71ee447b6 Binary files /dev/null and b/webapp/lib/pellet-cli.jar differ diff --git a/webapp/lib/pellet-core.jar b/webapp/lib/pellet-core.jar new file mode 100644 index 000000000..89b9a06a8 Binary files /dev/null and b/webapp/lib/pellet-core.jar differ diff --git a/webapp/lib/pellet-datatypes.jar b/webapp/lib/pellet-datatypes.jar new file mode 100644 index 000000000..89444fa8a Binary files /dev/null and b/webapp/lib/pellet-datatypes.jar differ diff --git a/webapp/lib/pellet-dig.jar b/webapp/lib/pellet-dig.jar new file mode 100644 index 000000000..02a684ee2 Binary files /dev/null and b/webapp/lib/pellet-dig.jar differ diff --git a/webapp/lib/pellet-el.jar b/webapp/lib/pellet-el.jar new file mode 100644 index 000000000..41bd39511 Binary files /dev/null and b/webapp/lib/pellet-el.jar differ diff --git a/webapp/lib/pellet-explanation.jar b/webapp/lib/pellet-explanation.jar new file mode 100644 index 000000000..8ccf9cb0e Binary files /dev/null and b/webapp/lib/pellet-explanation.jar differ diff --git a/webapp/lib/pellet-jena.jar b/webapp/lib/pellet-jena.jar new file mode 100644 index 000000000..d712c6aca Binary files /dev/null and b/webapp/lib/pellet-jena.jar differ diff --git a/webapp/lib/pellet-modularity.jar b/webapp/lib/pellet-modularity.jar new file mode 100644 index 000000000..112c89888 Binary files /dev/null and b/webapp/lib/pellet-modularity.jar differ diff --git a/webapp/lib/pellet-owlapi.jar b/webapp/lib/pellet-owlapi.jar new file mode 100644 index 000000000..f7c20fac4 Binary files /dev/null and b/webapp/lib/pellet-owlapi.jar differ diff --git a/webapp/lib/pellet-pellint.jar b/webapp/lib/pellet-pellint.jar new file mode 100644 index 000000000..acdc5f87b Binary files /dev/null and b/webapp/lib/pellet-pellint.jar differ diff --git a/webapp/lib/pellet-query.jar b/webapp/lib/pellet-query.jar new file mode 100644 index 000000000..6a341d375 Binary files /dev/null and b/webapp/lib/pellet-query.jar differ diff --git a/webapp/lib/pellet-rules.jar b/webapp/lib/pellet-rules.jar new file mode 100644 index 000000000..62ade5616 Binary files /dev/null and b/webapp/lib/pellet-rules.jar differ diff --git a/webapp/lib/pellet-test.jar b/webapp/lib/pellet-test.jar new file mode 100644 index 000000000..9d09dc489 Binary files /dev/null and b/webapp/lib/pellet-test.jar differ diff --git a/webapp/lib/pellet.jar b/webapp/lib/pellet.jar new file mode 100644 index 000000000..89b9a06a8 Binary files /dev/null and b/webapp/lib/pellet.jar differ diff --git a/webapp/lib/relaxngDatatype.jar b/webapp/lib/relaxngDatatype.jar new file mode 100644 index 000000000..5f1c323d8 Binary files /dev/null and b/webapp/lib/relaxngDatatype.jar differ diff --git a/webapp/lib/rowset-20040728-v101.jar b/webapp/lib/rowset-20040728-v101.jar new file mode 100644 index 000000000..91bca8893 Binary files /dev/null and b/webapp/lib/rowset-20040728-v101.jar differ diff --git a/webapp/lib/rsslib4j-0.2.jar b/webapp/lib/rsslib4j-0.2.jar new file mode 100644 index 000000000..7aa1334b0 Binary files /dev/null and b/webapp/lib/rsslib4j-0.2.jar differ diff --git a/webapp/lib/saaj.jar b/webapp/lib/saaj.jar new file mode 100644 index 000000000..4ea696e74 Binary files /dev/null and b/webapp/lib/saaj.jar differ diff --git a/webapp/lib/saxon9he.jar b/webapp/lib/saxon9he.jar new file mode 100644 index 000000000..0719a94fa Binary files /dev/null and b/webapp/lib/saxon9he.jar differ diff --git a/webapp/lib/sdb.jar b/webapp/lib/sdb.jar new file mode 100644 index 000000000..6a11cfaec Binary files /dev/null and b/webapp/lib/sdb.jar differ diff --git a/webapp/lib/servlet-api.jar b/webapp/lib/servlet-api.jar new file mode 100644 index 000000000..5285f8194 Binary files /dev/null and b/webapp/lib/servlet-api.jar differ diff --git a/webapp/lib/sesame-console-2.2.3.jar b/webapp/lib/sesame-console-2.2.3.jar new file mode 100644 index 000000000..3a4d3f814 Binary files /dev/null and b/webapp/lib/sesame-console-2.2.3.jar differ diff --git a/webapp/lib/sesame-http-client-2.2.3.jar b/webapp/lib/sesame-http-client-2.2.3.jar new file mode 100644 index 000000000..99950b701 Binary files /dev/null and b/webapp/lib/sesame-http-client-2.2.3.jar differ diff --git a/webapp/lib/sesame-http-protocol-2.2.3.jar b/webapp/lib/sesame-http-protocol-2.2.3.jar new file mode 100644 index 000000000..e34a1bcb0 Binary files /dev/null and b/webapp/lib/sesame-http-protocol-2.2.3.jar differ diff --git a/webapp/lib/sesame-http-server-spring-2.2.3.jar b/webapp/lib/sesame-http-server-spring-2.2.3.jar new file mode 100644 index 000000000..945952517 Binary files /dev/null and b/webapp/lib/sesame-http-server-spring-2.2.3.jar differ diff --git a/webapp/lib/sesame-model-2.2.3.jar b/webapp/lib/sesame-model-2.2.3.jar new file mode 100644 index 000000000..16976caa0 Binary files /dev/null and b/webapp/lib/sesame-model-2.2.3.jar differ diff --git a/webapp/lib/sesame-query-2.2.3.jar b/webapp/lib/sesame-query-2.2.3.jar new file mode 100644 index 000000000..a6715a2fe Binary files /dev/null and b/webapp/lib/sesame-query-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryalgebra-evaluation-2.2.3.jar b/webapp/lib/sesame-queryalgebra-evaluation-2.2.3.jar new file mode 100644 index 000000000..692c1fd80 Binary files /dev/null and b/webapp/lib/sesame-queryalgebra-evaluation-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryalgebra-model-2.2.3.jar b/webapp/lib/sesame-queryalgebra-model-2.2.3.jar new file mode 100644 index 000000000..45aa02f98 Binary files /dev/null and b/webapp/lib/sesame-queryalgebra-model-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryparser-api-2.2.3.jar b/webapp/lib/sesame-queryparser-api-2.2.3.jar new file mode 100644 index 000000000..8b02bfb49 Binary files /dev/null and b/webapp/lib/sesame-queryparser-api-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryparser-serql-2.2.3.jar b/webapp/lib/sesame-queryparser-serql-2.2.3.jar new file mode 100644 index 000000000..3c85383da Binary files /dev/null and b/webapp/lib/sesame-queryparser-serql-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryparser-sparql-2.2.3.jar b/webapp/lib/sesame-queryparser-sparql-2.2.3.jar new file mode 100644 index 000000000..1aa04b75b Binary files /dev/null and b/webapp/lib/sesame-queryparser-sparql-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryresultio-api-2.2.3.jar b/webapp/lib/sesame-queryresultio-api-2.2.3.jar new file mode 100644 index 000000000..6242ec0eb Binary files /dev/null and b/webapp/lib/sesame-queryresultio-api-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryresultio-binary-2.2.3.jar b/webapp/lib/sesame-queryresultio-binary-2.2.3.jar new file mode 100644 index 000000000..c5cf69af2 Binary files /dev/null and b/webapp/lib/sesame-queryresultio-binary-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryresultio-sparqljson-2.2.3.jar b/webapp/lib/sesame-queryresultio-sparqljson-2.2.3.jar new file mode 100644 index 000000000..c2669c6f4 Binary files /dev/null and b/webapp/lib/sesame-queryresultio-sparqljson-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryresultio-sparqlxml-2.2.3.jar b/webapp/lib/sesame-queryresultio-sparqlxml-2.2.3.jar new file mode 100644 index 000000000..e6f23cb22 Binary files /dev/null and b/webapp/lib/sesame-queryresultio-sparqlxml-2.2.3.jar differ diff --git a/webapp/lib/sesame-queryresultio-text-2.2.3.jar b/webapp/lib/sesame-queryresultio-text-2.2.3.jar new file mode 100644 index 000000000..4b2679409 Binary files /dev/null and b/webapp/lib/sesame-queryresultio-text-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-api-2.2.3.jar b/webapp/lib/sesame-repository-api-2.2.3.jar new file mode 100644 index 000000000..dd1d902ee Binary files /dev/null and b/webapp/lib/sesame-repository-api-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-contextaware-2.2.3.jar b/webapp/lib/sesame-repository-contextaware-2.2.3.jar new file mode 100644 index 000000000..403913253 Binary files /dev/null and b/webapp/lib/sesame-repository-contextaware-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-dataset-2.2.3.jar b/webapp/lib/sesame-repository-dataset-2.2.3.jar new file mode 100644 index 000000000..7ad06db35 Binary files /dev/null and b/webapp/lib/sesame-repository-dataset-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-event-2.2.3.jar b/webapp/lib/sesame-repository-event-2.2.3.jar new file mode 100644 index 000000000..3972602bc Binary files /dev/null and b/webapp/lib/sesame-repository-event-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-http-2.2.3.jar b/webapp/lib/sesame-repository-http-2.2.3.jar new file mode 100644 index 000000000..3aec0b909 Binary files /dev/null and b/webapp/lib/sesame-repository-http-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-manager-2.2.3.jar b/webapp/lib/sesame-repository-manager-2.2.3.jar new file mode 100644 index 000000000..dd77b1c6c Binary files /dev/null and b/webapp/lib/sesame-repository-manager-2.2.3.jar differ diff --git a/webapp/lib/sesame-repository-sail-2.2.3.jar b/webapp/lib/sesame-repository-sail-2.2.3.jar new file mode 100644 index 000000000..74be53e4c Binary files /dev/null and b/webapp/lib/sesame-repository-sail-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-api-2.2.3.jar b/webapp/lib/sesame-rio-api-2.2.3.jar new file mode 100644 index 000000000..5a7d2b14e Binary files /dev/null and b/webapp/lib/sesame-rio-api-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-n3-2.2.3.jar b/webapp/lib/sesame-rio-n3-2.2.3.jar new file mode 100644 index 000000000..285b119e1 Binary files /dev/null and b/webapp/lib/sesame-rio-n3-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-ntriples-2.2.3.jar b/webapp/lib/sesame-rio-ntriples-2.2.3.jar new file mode 100644 index 000000000..97fb1089d Binary files /dev/null and b/webapp/lib/sesame-rio-ntriples-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-rdfxml-2.2.3.jar b/webapp/lib/sesame-rio-rdfxml-2.2.3.jar new file mode 100644 index 000000000..99b5677b9 Binary files /dev/null and b/webapp/lib/sesame-rio-rdfxml-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-trig-2.2.3.jar b/webapp/lib/sesame-rio-trig-2.2.3.jar new file mode 100644 index 000000000..9430a1541 Binary files /dev/null and b/webapp/lib/sesame-rio-trig-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-trix-2.2.3.jar b/webapp/lib/sesame-rio-trix-2.2.3.jar new file mode 100644 index 000000000..205d59463 Binary files /dev/null and b/webapp/lib/sesame-rio-trix-2.2.3.jar differ diff --git a/webapp/lib/sesame-rio-turtle-2.2.3.jar b/webapp/lib/sesame-rio-turtle-2.2.3.jar new file mode 100644 index 000000000..e209e4750 Binary files /dev/null and b/webapp/lib/sesame-rio-turtle-2.2.3.jar differ diff --git a/webapp/lib/sesame-runtime-2.2.3.jar b/webapp/lib/sesame-runtime-2.2.3.jar new file mode 100644 index 000000000..7ca2cbe5c Binary files /dev/null and b/webapp/lib/sesame-runtime-2.2.3.jar differ diff --git a/webapp/lib/sesame-sail-api-2.2.3.jar b/webapp/lib/sesame-sail-api-2.2.3.jar new file mode 100644 index 000000000..8f5ef02b5 Binary files /dev/null and b/webapp/lib/sesame-sail-api-2.2.3.jar differ diff --git a/webapp/lib/sesame-sail-inferencer-2.2.3.jar b/webapp/lib/sesame-sail-inferencer-2.2.3.jar new file mode 100644 index 000000000..e4cca68dd Binary files /dev/null and b/webapp/lib/sesame-sail-inferencer-2.2.3.jar differ diff --git a/webapp/lib/sesame-sail-memory-2.2.3.jar b/webapp/lib/sesame-sail-memory-2.2.3.jar new file mode 100644 index 000000000..5d05c7bf9 Binary files /dev/null and b/webapp/lib/sesame-sail-memory-2.2.3.jar differ diff --git a/webapp/lib/sesame-sail-nativerdf-2.2.3.jar b/webapp/lib/sesame-sail-nativerdf-2.2.3.jar new file mode 100644 index 000000000..49aa8bb86 Binary files /dev/null and b/webapp/lib/sesame-sail-nativerdf-2.2.3.jar differ diff --git a/webapp/lib/sesame-sail-rdbms-2.2.3.jar b/webapp/lib/sesame-sail-rdbms-2.2.3.jar new file mode 100644 index 000000000..f44a25876 Binary files /dev/null and b/webapp/lib/sesame-sail-rdbms-2.2.3.jar differ diff --git a/webapp/lib/slf4j-api-1.5.6.jar b/webapp/lib/slf4j-api-1.5.6.jar new file mode 100644 index 000000000..9b4221694 Binary files /dev/null and b/webapp/lib/slf4j-api-1.5.6.jar differ diff --git a/webapp/lib/slf4j-log4j12-1.5.6.jar b/webapp/lib/slf4j-log4j12-1.5.6.jar new file mode 100644 index 000000000..0c40e9c8b Binary files /dev/null and b/webapp/lib/slf4j-log4j12-1.5.6.jar differ diff --git a/webapp/lib/solr-1.0.jar b/webapp/lib/solr-1.0.jar new file mode 100644 index 000000000..96bee9482 Binary files /dev/null and b/webapp/lib/solr-1.0.jar differ diff --git a/webapp/lib/sparqltag.jar b/webapp/lib/sparqltag.jar new file mode 100644 index 000000000..ee2f00108 Binary files /dev/null and b/webapp/lib/sparqltag.jar differ diff --git a/webapp/lib/spring2.5.6.jar b/webapp/lib/spring2.5.6.jar new file mode 100644 index 000000000..527367005 Binary files /dev/null and b/webapp/lib/spring2.5.6.jar differ diff --git a/webapp/lib/stax-api-1.0.1.jar b/webapp/lib/stax-api-1.0.1.jar new file mode 100644 index 000000000..d9a166515 Binary files /dev/null and b/webapp/lib/stax-api-1.0.1.jar differ diff --git a/webapp/lib/stax-api-1.0.jar b/webapp/lib/stax-api-1.0.jar new file mode 100644 index 000000000..2d03f2ce3 Binary files /dev/null and b/webapp/lib/stax-api-1.0.jar differ diff --git a/webapp/lib/taglibs-mailer.jar b/webapp/lib/taglibs-mailer.jar new file mode 100644 index 000000000..620105494 Binary files /dev/null and b/webapp/lib/taglibs-mailer.jar differ diff --git a/webapp/lib/taglibs-random.jar b/webapp/lib/taglibs-random.jar new file mode 100644 index 000000000..14ede8f8d Binary files /dev/null and b/webapp/lib/taglibs-random.jar differ diff --git a/webapp/lib/taglibs-string.jar b/webapp/lib/taglibs-string.jar new file mode 100644 index 000000000..c1b3baa33 Binary files /dev/null and b/webapp/lib/taglibs-string.jar differ diff --git a/webapp/lib/trippi-1.3.2-core.jar b/webapp/lib/trippi-1.3.2-core.jar new file mode 100644 index 000000000..13ecb582d Binary files /dev/null and b/webapp/lib/trippi-1.3.2-core.jar differ diff --git a/webapp/lib/wsdl4j-1.5.2.jar b/webapp/lib/wsdl4j-1.5.2.jar new file mode 100644 index 000000000..2877271ac Binary files /dev/null and b/webapp/lib/wsdl4j-1.5.2.jar differ diff --git a/webapp/lib/wstx-asl-3.0.0.jar b/webapp/lib/wstx-asl-3.0.0.jar new file mode 100644 index 000000000..4bbab210d Binary files /dev/null and b/webapp/lib/wstx-asl-3.0.0.jar differ diff --git a/webapp/lib/xalan.jar b/webapp/lib/xalan.jar new file mode 100644 index 000000000..0cb96a457 Binary files /dev/null and b/webapp/lib/xalan.jar differ diff --git a/webapp/lib/xbean-2.1.0.jar b/webapp/lib/xbean-2.1.0.jar new file mode 100644 index 000000000..5af695bb1 Binary files /dev/null and b/webapp/lib/xbean-2.1.0.jar differ diff --git a/webapp/lib/xbean-spring-2.5.jar b/webapp/lib/xbean-spring-2.5.jar new file mode 100644 index 000000000..2e983c9de Binary files /dev/null and b/webapp/lib/xbean-spring-2.5.jar differ diff --git a/webapp/lib/xercesImpl.jar b/webapp/lib/xercesImpl.jar new file mode 100644 index 000000000..eac75ae8e Binary files /dev/null and b/webapp/lib/xercesImpl.jar differ diff --git a/webapp/lib/xml-apis.jar b/webapp/lib/xml-apis.jar new file mode 100644 index 000000000..243eaeaeb Binary files /dev/null and b/webapp/lib/xml-apis.jar differ diff --git a/webapp/lib/xpp3_min-1.1.3.4.O.jar b/webapp/lib/xpp3_min-1.1.3.4.O.jar new file mode 100644 index 000000000..640441dad Binary files /dev/null and b/webapp/lib/xpp3_min-1.1.3.4.O.jar differ diff --git a/webapp/lib/xsdlib.jar b/webapp/lib/xsdlib.jar new file mode 100644 index 000000000..0749a25ca Binary files /dev/null and b/webapp/lib/xsdlib.jar differ diff --git a/webapp/lib/xstream-1.2.2.jar b/webapp/lib/xstream-1.2.2.jar new file mode 100644 index 000000000..31721c5f3 Binary files /dev/null and b/webapp/lib/xstream-1.2.2.jar differ diff --git a/webapp/ontologies/auth/example.vitroUsers.owl b/webapp/ontologies/auth/example.vitroUsers.owl new file mode 100644 index 000000000..a1ce8eec4 --- /dev/null +++ b/webapp/ontologies/auth/example.vitroUsers.owl @@ -0,0 +1,19 @@ + + + + + + diff --git a/webapp/ontologies/system/vitro-0.7.owl b/webapp/ontologies/system/vitro-0.7.owl new file mode 100644 index 000000000..1050aee67 --- /dev/null +++ b/webapp/ontologies/system/vitro-0.7.owl @@ -0,0 +1,282 @@ + + + + ]> + + + + + + + + + + Vitro internals + 0.7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + curation note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/BeanDependency.java b/webapp/src/edu/cornell/mannlib/vedit/beans/BeanDependency.java new file mode 100644 index 000000000..102bef92b --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/BeanDependency.java @@ -0,0 +1,35 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +public class BeanDependency { + + private Object bean; + private String nearKey; + private String farKey; + + public Object getBean(){ + return bean; + } + + public void setBean(Object bean){ + this.bean = bean; + } + + public String getNearKey(){ + return nearKey; + } + + public void setNearKey (String nearKey){ + this.nearKey = nearKey; + } + + public String getFarKey(){ + return farKey; + } + + public void setFarKey(String farKey){ + this.farKey = farKey; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/ButtonForm.java b/webapp/src/edu/cornell/mannlib/vedit/beans/ButtonForm.java new file mode 100644 index 000000000..4039b8467 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/ButtonForm.java @@ -0,0 +1,62 @@ +package edu.cornell.mannlib.vedit.beans; +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.HashMap; + +public class ButtonForm { + private String action = ""; + private String label = "no label specified"; + private String cssClass = null; + private HashMap params = null; + + public ButtonForm() { + action = ""; // submits to same page + cssClass = null; + label = "no label specified"; + params = null; + } + + public ButtonForm(String actionStr, String classStr, String labelStr, HashMap paramMap) { + action = actionStr; + cssClass = classStr; // can be null + label = labelStr; + params = paramMap; + } + + public String getAction(){ + return action; + } + public void setAction(String s){ + action = s; + } + + public String getLabel(){ + return label; + } + public void setLabel(String s){ + label = s; + } + + public String getCssClass(){ + if (cssClass==null){ + return ""; + } + return "class=\""+cssClass+"\""; + } + public void setCssClass(String s){ + cssClass=s; + } + + public HashMap getParams(){ + return params; + } + public void setParams(HashMap p){ + params = p; + } + public void addParam(String key, String value){ + if (params==null){ + params = new HashMap(); + } + params.put(key, value); + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/Checkbox.java b/webapp/src/edu/cornell/mannlib/vedit/beans/Checkbox.java new file mode 100644 index 000000000..167a31a4c --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/Checkbox.java @@ -0,0 +1,44 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +public class Checkbox { + + private String name = null; + private String value = null; + private String body = null; + private boolean checked = false; + + public String getName(){ + return name; + } + + private void setName(String name){ + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public boolean getChecked (){ + return checked; + } + + public void setChecked (boolean checked){ + this.checked = checked; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicField.java b/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicField.java new file mode 100644 index 000000000..3d62d8c57 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicField.java @@ -0,0 +1,98 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +public class DynamicField { + + private String name = null; + + private String table = null; + + private int maxCardinality = 1; + private int minCardinality = -1; + private int visible = -1; + + private List rowList = null; + private DynamicFieldRow rowTemplate = null; + + private HashMap metadata = new HashMap(); + + private Boolean deleteable = true; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTable() { + return table; + } + + public void setTable(String table) { + this.table = table; + } + + public int getMaxCardinality() { + return maxCardinality; + } + + public void setMaxCardinality (int maxCardinality) { + this.maxCardinality = maxCardinality; + } + + public int getMinCardinality () { + return minCardinality; + } + + public void setMinCardinality(int minCardinality) { + this.minCardinality = minCardinality; + } + + public int getVisible() { + return visible; + } + + public void setVisible(int visible) { + this.visible = visible; + } + + public boolean getDeleteable() { + return deleteable; + } + + public void setDeleteable(boolean deleteable) { + this.deleteable = deleteable; + } + + public HashMap getMetadata() { + return metadata; + } + + public void setMetadata(HashMap metadata) { + this.metadata = metadata; + } + + public List getRowList() { + return rowList; + } + + public void setRowList (List rowList) { + this.rowList = rowList; + } + + public DynamicFieldRow getRowTemplate() { + return rowTemplate; + } + + public void setRowTemplate(DynamicFieldRow dfr) { + rowTemplate = dfr; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicFieldRow.java b/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicFieldRow.java new file mode 100644 index 000000000..ae4fc2191 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/DynamicFieldRow.java @@ -0,0 +1,37 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.Map; + +public class DynamicFieldRow { + + private int id = -1; + private String value = null; + private Map parameterMap = null; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Map getParameterMap() { + return parameterMap; + } + + public void setParameterMap(Map parameterMap) { + this.parameterMap = parameterMap; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/EditProcessObject.java b/webapp/src/edu/cornell/mannlib/vedit/beans/EditProcessObject.java new file mode 100644 index 000000000..da2989137 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/EditProcessObject.java @@ -0,0 +1,350 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.List; +import java.util.LinkedList; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; +import javax.servlet.http.HttpSession; + +import edu.cornell.mannlib.vedit.forwarder.PageForwarder; +import edu.cornell.mannlib.vedit.beans.BeanDependency; +import edu.cornell.mannlib.vedit.beans.FormObject; +import java.lang.reflect.Method; +import java.io.Serializable; + +public class EditProcessObject implements Serializable { + + private String key = null; + + private Class beanClass = null; + private Class implementationClass = null; + private boolean useRecycledBean = false; + + private Object beanMask = null; + private List simpleMask = new LinkedList(); + + private HashMap validatorMap = new HashMap(); + private HashMap errMsgMap = new HashMap(); + + private HashMap defaultValueMap = new HashMap(); + + private List preProcessorList = new LinkedList(); + private List changeListenerList = new LinkedList(); + + private Object originalBean = null; + private Object newBean = null; + + private String idFieldName = null; + private Class idFieldClass = null; + + private FormObject formObject = null; + + private Object dataAccessObject = null; + private HashMap additionalDaoMap = new HashMap(); + + private Method insertMethod = null; + private Method updateMethod = null; + private Method deleteMethod = null; + + private PageForwarder postInsertPageForwarder = null; + private PageForwarder postUpdatePageForwarder = null; + private PageForwarder postDeletePageForwarder = null; + + private HttpSession session = null; + private String referer = null; + + private String action = null; + + private Map requestParameterMap = null; + + private HashMap badValueMap = new HashMap(); + + private HashMap attributeMap = new HashMap(); + + /***** experimental ******/ + private Stack epoStack = new Stack(); + private HashMap beanDependencies = new HashMap(); + + private Method getMethod = null; + //assumed to take an integer primary key argument, at least for now + + public String getKey(){ + return key; + } + + public void setKey(String key){ + this.key = key; + } + + public Class getBeanClass(){ + return beanClass; + } + + public void setBeanClass(Class beanClass){ + this.beanClass = beanClass; + } + + public Class getImplementationClass(){ + return implementationClass; + } + + public void setImplementationClass(Class implementationClass){ + this.implementationClass = implementationClass; + } + + public Object getBeanMask() { + return beanMask; + } + + public void setBeanMask(Object beanMask) { + this.beanMask = beanMask; + } + + public List getSimpleMask(){ + return simpleMask; + } + + public void setSimpleMask(List simpleMask){ + this.simpleMask = simpleMask; + } + + public List getChangeListenerList() { + return changeListenerList; + } + + public void setChangeListenerList(List changeListenerList) { + this.changeListenerList = changeListenerList; + } + + public List getPreProcessorList() { + return preProcessorList; + } + + public void setPreProcessorList(List preProcessorList) { + this.preProcessorList = preProcessorList; + } + + public Object getOriginalBean(){ + return originalBean; + } + + public void setOriginalBean(Object originalBean){ + this.originalBean = originalBean; + } + + public Object getNewBean(){ + return newBean; + } + + public void setNewBean(Object newBean){ + this.newBean = newBean; + } + + public String getIdFieldName() { + return idFieldName; + } + + public void setIdFieldName(String ifn) { + this.idFieldName = ifn; + } + + public Class getIdFieldClass() { + return idFieldClass; + } + + public void setIdFieldClass(Class cls) { + this.idFieldClass = cls; + } + + public FormObject getFormObject() { + return formObject; + } + + public void setFormObject(FormObject foo){ + formObject=foo; + } + + public HttpSession getSession(){ + return session; + } + + public boolean getUseRecycledBean(){ + return useRecycledBean; + } + + public void setUseRecycledBean(boolean useRecycledBean){ + this.useRecycledBean = useRecycledBean; + } + + public void setSession(HttpSession session){ + this.session = session; + } + + public String getReferer(){ + return referer; + } + + public void setReferer(String referer){ + this.referer = referer; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public Map getRequestParameterMap() { + return requestParameterMap; + } + + public void setRequestParameterMap (Map rpmap) { + requestParameterMap = rpmap; + } + + public PageForwarder getPostInsertPageForwarder(){ + return postInsertPageForwarder; + } + + public void setPostInsertPageForwarder(PageForwarder pipf){ + postInsertPageForwarder = pipf; + } + + public PageForwarder getPostUpdatePageForwarder(){ + return postUpdatePageForwarder; + } + + public void setPostUpdatePageForwarder(PageForwarder pupf){ + postUpdatePageForwarder = pupf; + } + + public PageForwarder getPostDeletePageForwarder(){ + return postDeletePageForwarder; + } + + public void setPostDeletePageForwarder(PageForwarder pdpf){ + postDeletePageForwarder = pdpf; + } + + public Object getDataAccessObject() { + return dataAccessObject; + } + + public void setDataAccessObject(Object dao) { + dataAccessObject = dao; + } + + public HashMap getAdditionalDaoMap() { + return additionalDaoMap; + } + public void setAdditionalDaoMap(HashMap adm) { + additionalDaoMap = adm; + } + + public Method getInsertMethod(){ + return insertMethod; + } + + public void setInsertMethod(Method insertMethod){ + this.insertMethod = insertMethod; + } + + public Method getUpdateMethod(){ + return updateMethod; + } + + public void setUpdateMethod(Method updateMethod){ + this.updateMethod = updateMethod; + } + + public Method getDeleteMethod(){ + return deleteMethod; + } + + public void setDeleteMethod(Method deleteMethod){ + this.deleteMethod = deleteMethod; + } + + public Method getGetMethod(){ + return getMethod; + } + + public void setGetMethod(Method getMethod){ + this.getMethod = getMethod; + } + + public HashMap getDefaultValueMap() { + return defaultValueMap; + } + + public void setDefaultValueMap(HashMap dvh) { + this.defaultValueMap = dvh; + } + + public HashMap getValidatorMap(){ + return validatorMap; + } + + public void setValidatorMap(HashMap validatorMap){ + this.validatorMap = validatorMap; + } + + public HashMap getErrMsgMap() { + return errMsgMap; + } + + public void setErrMsgMap(HashMap emh){ + errMsgMap = emh; + } + + public HashMap getBadValueMap() { + return badValueMap; + } + + public void setBadValueMap(HashMap bvh){ + badValueMap = bvh; + } + + public Map getAttributeMap() { + return this.attributeMap; + } + + public Object getAttribute(String key) { + return this.attributeMap.get(key); + } + + public void setAttribute(String key, Object value) { + this.attributeMap.put(key, value); + } + + public Stack getEpoStack(){ + return epoStack; + } + + public HashMap /*to BeanDependency*/ getBeanDependencies(){ + return beanDependencies; + } + + public void setBeanDependencies(HashMap beanDependencies){ + this.beanDependencies = beanDependencies; + } + + public BeanDependency getBeanDependency(String name){ + return (BeanDependency) beanDependencies.get(name); + } + + public Object getDependentBean(String name){ + return ((BeanDependency)beanDependencies.get(name)).getBean(); + } + + /******* probably will need to change this *******/ + public void setEpoStack(Stack epoStack){ + this.epoStack = epoStack; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/FieldHelp.java b/webapp/src/edu/cornell/mannlib/vedit/beans/FieldHelp.java new file mode 100644 index 000000000..dfb53d689 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/FieldHelp.java @@ -0,0 +1,54 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +public class FieldHelp { + + private String description = null; + private String descriptionUri = null; + private String examples = null; + private String examplesUri = null; + + private String helpUri = null; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescriptionUri() { + return descriptionUri; + } + + public void setDescriptionUri(String descriptionUri) { + this.descriptionUri = descriptionUri; + } + + public String getExamples() { + return examples; + } + + public void setExamples(String examples) { + this.examples = examples; + } + + public String getExamplesUri() { + return examplesUri; + } + + public void setExamplesUri(String examplesUri) { + this.examplesUri = examplesUri; + } + + public String getHelpUri() { + return helpUri; + } + + public void setHelpUri(String helpUri) { + this.helpUri = helpUri; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/FormObject.java b/webapp/src/edu/cornell/mannlib/vedit/beans/FormObject.java new file mode 100644 index 000000000..da5d9249f --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/FormObject.java @@ -0,0 +1,62 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.io.Serializable; +import java.util.HashMap; +import java.util.List; +import edu.cornell.mannlib.vedit.beans.Option; + +public class FormObject implements Serializable { + + private HashMap values = new HashMap(); + private HashMap optionLists = new HashMap(); + private HashMap checkboxLists = new HashMap(); + private HashMap errorMap = new HashMap(); + private List dynamicFields = null; + + public HashMap getValues(){ + return values; + } + + public void setValues(HashMap values){ + this.values = values; + } + + public String valueByName(String name){ + return (String) values.get(name); + } + + public HashMap getOptionLists() { + return optionLists; + } + + public void setOptionLists(HashMap optionLists) { + this.optionLists = optionLists; + } + + public List optionListByName(String key){ + return (List) optionLists.get(key); + } + + public HashMap getCheckboxLists(){ + return checkboxLists; + } + + public HashMap getErrorMap(){ + return errorMap; + } + + public void setErrorMap(HashMap errorMap){ + this.errorMap = errorMap; + } + + public List getDynamicFields() { + return dynamicFields; + } + + public void setDynamicFields(List dynamicFields){ + this.dynamicFields = dynamicFields; + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/LoginFormBean.java b/webapp/src/edu/cornell/mannlib/vedit/beans/LoginFormBean.java new file mode 100644 index 000000000..0d5e38675 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/LoginFormBean.java @@ -0,0 +1,214 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +import javax.servlet.*; +import javax.servlet.http.*; +import java.util.*; + +/** + * + * @author jc55 + * + */ +public class LoginFormBean { + public static final int ANYBODY=0; + public int getAnybody(){ return ANYBODY; } + public static final int NON_EDITOR = 1; + public int getNonEditor(){ return NON_EDITOR; } + public static final int EDITOR =4; + public int getEditor(){return EDITOR;} + public static final int CURATOR=5; + public int getCurator(){return CURATOR;} + public static final int DBA =50; + public int getDba(){return DBA;} + + public boolean getBla(){ return true; } + + private String userURI; + private String sessionId; + private String loginBrowser; + private String loginRemoteAddr; + private String loginName; + private String loginPassword; + private String loginStatus; + private int loginUserId; + private String loginRole; + private String duplicatePassword; + private String emailAddress; + private Hashtable errors; + + public boolean validateLoginForm() { + boolean allOk=true; + + if ( loginName.equals("")) { + errors.put( "loginName","Please enter your Vivo user name" ); + loginName = ""; + allOk = false; + } + + if ( loginPassword.equals("")) { + errors.put( "loginPassword","Please enter your Vivo password" ); + loginPassword=""; + allOk=false; + } + + return allOk; + } + + public LoginFormBean() { + sessionId = ""; + loginBrowser = ""; + loginRemoteAddr = ""; + loginName = ""; + loginPassword = ""; + loginStatus = "none"; + loginUserId = 0; + loginRole = "1"; + duplicatePassword = ""; + emailAddress = ""; + + errors = new Hashtable(); + } + + public String toString(){ + String name = "-not-logged-in-"; + if( getLoginName() != null && !"".equals(getLoginName()) ) + name = getLoginName(); + + return this.getClass().getName() + +" loginName: " + name + +" loginStatus: "+ getLoginStatus() + +" loginRole: "+ getLoginRole(); + } + /** + Tests a HttpSession to see if logged in and authenticated. + @returns loginRole if seems to be authenticated, -1 otherwise + */ + public int testSessionLevel( HttpServletRequest request ){ + //TODO: security code added by bdc34, should be checked by jc55 + HttpSession currentSession = request.getSession(); + int returnRole = -1; + if ( getLoginStatus().equals("authenticated") && + currentSession.getId().equals( getSessionId() ) && + request.getRemoteAddr().equals( getLoginRemoteAddr() ) ) { + try{ + returnRole = Integer.parseInt( getLoginRole() ); + }catch(Throwable thr){ } + } + return returnRole; + } + + public static boolean loggedIn(HttpServletRequest request, int minLevel) { + if( request == null ) return false; + HttpSession sess = request.getSession(false); + if( sess == null ) return false; + Object obj = sess.getAttribute("loginHandler"); + if( obj == null || ! (obj instanceof LoginFormBean)) + return false; + + LoginFormBean lfb = (LoginFormBean)obj; + return ( "authenticated".equals(lfb.loginStatus ) && + Integer.parseInt(lfb.loginRole ) >= minLevel) ; + } + + /********************** GET METHODS *********************/ + + public String getUserURI() { + return userURI; + } + + public String getSessionId() { + return sessionId; + } + + public String getLoginBrowser() { + return loginBrowser; + } + + public String getLoginRemoteAddr() { + return loginRemoteAddr; + } + public String getLoginName() { + return loginName; + } + + public String getLoginPassword() { + return loginPassword; + } + + public String getLoginStatus() { + return loginStatus; + } + + public int getLoginUserId() { + return loginUserId; + } + + public String getLoginRole() { + return loginRole; + } + + public String getDuplicatePassword() { + return duplicatePassword; + } + + public String getEmailAddress() { + return emailAddress; + } + + public String getErrorMsg( String s ) { + String errorMsg =(String) errors.get( s.trim() ); + return ( errorMsg == null ) ? "" : errorMsg; + } + + /********************** SET METHODS *********************/ + + public void setUserURI( String uri ) { + this.userURI = uri; + } + + public void setSessionId( String id ) { + sessionId = id; + } + + public void setLoginBrowser( String b ) { + loginBrowser = b; + } + + public void setLoginRemoteAddr( String ra ) { + loginRemoteAddr = ra; + } + + public void setLoginName( String ln ) { + loginName = ln; + } + + public void setLoginPassword( String lp ) { + loginPassword = lp; + } + + public void setLoginStatus( String ls ) { + loginStatus = ls; + } + + public void setLoginUserId(int int_val) { + loginUserId=int_val; + } + + public void setLoginRole( String lr ) { + loginRole = lr; + } + + public void setDuplicatePassword( String dp ) { + duplicatePassword = dp; + } + + public void setEmailAddress( String ea ) { + emailAddress = ea; + } + + public void setErrorMsg( String key, String msg ) { + errors.put( key,msg ); + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/Option.java b/webapp/src/edu/cornell/mannlib/vedit/beans/Option.java new file mode 100644 index 000000000..dd4213311 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/Option.java @@ -0,0 +1,59 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.io.Serializable; + +public class Option implements Serializable { + + private String value = null; + private String body = null; + private boolean selected = false; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public boolean getSelected (){ + return selected; + } + + public void setSelected (boolean selected){ + this.selected = selected; + } + + //default constructor + public Option() { + } + + public Option (String value, String body, boolean selected) { + this.value = value; + this.body = body; + this.selected = selected; + } + + // construct an Option with body and value + public Option(String value, String body) { + this(value, body, false); + } + + // construct an Option with equal body and value + public Option (String name){ + this(name, name, false); + } + + + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/beans/UserSession.java b/webapp/src/edu/cornell/mannlib/vedit/beans/UserSession.java new file mode 100644 index 000000000..c61d8a76f --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/beans/UserSession.java @@ -0,0 +1,195 @@ +package edu.cornell.mannlib.vedit.beans; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + + +/** + * User Session information + * @author John Fereira + * @since 29.06.2004 + */ +public class UserSession { + private int currentEntityId; + private int currentPortalId; + private int currentTabId; + private String lastSearchURL; + private boolean isPatronAuthenticated; + private boolean isAdminAuthenticated; + private String referer; + private String lastSearchTerm; + + private String flag1Pref; + public void setFlag1Pref(String s) { flag1Pref=s; } + public String getFlag1Pref() { return flag1Pref; } + + private String flag2Pref; + public void setFlag2Pref(String s) { flag2Pref=s; } + public String getFlag2Pref() { return flag2Pref; } + + private String flag3Pref; + public void setFlag3Pref(String s) { flag3Pref=s; } + public String getFlag3Pref() { return flag3Pref; } + +//search wrapper was part of the mysql full text search, no longer in use. +// private SearchWrapper searchWrapper; +// public void setSearchWrapper(SearchWrapper sw) { searchWrapper=sw; } +// public SearchWrapper getSearchWrapper() { return searchWrapper; } +// public void disposeOf(SearchWrapper sw) { +// if (sw!=null){ +// sw.dispose(); +// } +// this.searchWrapper=null; +// } + + /** constructor */ + public UserSession() { + this.isPatronAuthenticated = false; + this.isAdminAuthenticated = false; + } + + /** + * set current entity id + * @param currentEntityId : unique id + */ + public void setCurrentEntityId(int currentEntityId) { + this.currentEntityId = currentEntityId; + } + + /** + * get Current entity Id + * @return : the entity Id + */ + public int getCurrentEntityId() { + return currentEntityId; + } + + /** + * set current portal id + * @param currentPortalId : unique id + */ + public void setCurrentPortalId(int currentPortalId) { + this.currentPortalId = currentPortalId; + } + + /** + * get Current portal Id + * @return : the portal Id + */ + public int getCurrentPortalId() { + return currentPortalId; + } + + /** + * set current tab id + * @param currentTabId : unique id + */ + public void setCurrentTabId(int currentTabId) { + this.currentTabId = currentTabId; + } + + /** + * get current tab id + * @return : the tab Id + */ + public int getCurrentTabId() { + return currentTabId; + } + + + /** + * set last SearchURL in session + * @param lastSearchURL : a url string + */ + public void setLastSearchURL(String lastSearchURL) { + this.lastSearchURL = lastSearchURL; + } + + /** + * get last Search URL + * @return : last search url string + */ + public String getLastSearchURL() { + return lastSearchURL; + } + + /** + * Set boolen flag to indicated if patron has authenticated + * @param isPatronAuthenticated : true or false + */ + public void setIsPatronAuthenticated(boolean isPatronAuthenticated) { + this.isPatronAuthenticated = isPatronAuthenticated; + } + + /** + * get boolean flag indicating whethor or not patron has authenticated + * @return : true or false + */ + public boolean getIsPatronAuthenticated() { + return isPatronAuthenticated; + } + + /** + * set boolean flag indicating whether or not an Administrator has + * authenticated + * @param isAdminAuthenticated : true or false + */ + public void setIsAdminAuthenticated(boolean isAdminAuthenticated) { + this.isAdminAuthenticated = isAdminAuthenticated; + } + + /** + * get boolean flag indicating whether or not an Administrator has + * authenticated + * @return : true or false + */ + public boolean getIsAdminAuthenticated() { + return isAdminAuthenticated; + } + + /** + * set referer url in session + * @param referer : a referer url string + */ + public void setReferer(String referer) { + this.referer = referer; + } + + /** + * get referer url in session + * @return : a referer url string + */ + public String getReferer() { + return referer; + } + + /** + * set lastSearchTerm in session + * @param lastSearchTerm : a lastSearchTerm string + */ + public void setLastSearchTerm(String lastSearchTerm) { + this.lastSearchTerm = lastSearchTerm; + } + + /** + * get lastSearchTerm in session + * @return : a lastSearchTerm string + */ + public String getLastSearchTerm() { + return lastSearchTerm; + } + + + /** + * @param isAdminAuthenticated The isAdminAuthenticated to set. + */ + public void setAdminAuthenticated(boolean isAdminAuthenticated) { + this.isAdminAuthenticated = isAdminAuthenticated; + } + + /** + * @param isPatronAuthenticated The isPatronAuthenticated to set. + */ + public void setPatronAuthenticated(boolean isPatronAuthenticated) { + this.isPatronAuthenticated = isPatronAuthenticated; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java b/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java new file mode 100644 index 000000000..e616425c5 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/controller/BaseEditController.java @@ -0,0 +1,218 @@ +package edu.cornell.mannlib.vedit.controller; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; +import java.util.Random; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.ontology.OntModel; + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; +import edu.cornell.mannlib.vedit.beans.LoginFormBean; +import edu.cornell.mannlib.vedit.util.FormUtils; +import edu.cornell.mannlib.vitro.webapp.beans.Portal; +import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; +import edu.cornell.mannlib.vitro.webapp.controller.Controllers; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; + +public class BaseEditController extends VitroHttpServlet { + + public static final boolean FORCE_NEW = true; // when you know you're starting a new edit process + + public static final String JSP_PREFIX = "/templates/edit/specific/"; + + protected static DateFormat DISPLAY_DATE_FORMAT = new SimpleDateFormat("MM/dd/yyyy"); + + private static final Log log = LogFactory.getLog(BaseEditController.class.getName()); + private static final String DEFAULT_LANDING_PAGE = Controllers.SITE_ADMIN; + protected static final String MULTIPLEXED_PARAMETER_NAME = "multiplexedParam"; + private final String EPO_HASH_ATTR = "epoHash"; + private final String EPO_KEYLIST_ATTR = "epoKeylist"; + private final int MAX_EPOS = 5; + private final Calendar cal = Calendar.getInstance(); + private final Random rand = new Random(cal.getTimeInMillis()); + + /* EPO is reused if the controller is passed an epoKey, e.g. + if a previous form submission failed validation, or the edit is a multistage process. */ + + protected EditProcessObject createEpo(HttpServletRequest request) { + return createEpo(request, false); + } + + protected EditProcessObject createEpo(HttpServletRequest request, boolean forceNew) { + /* this is actually a bit of a misnomer, because we will reuse an epo + if an epoKey parameter is passed */ + EditProcessObject epo = null; + HashMap epoHash = getEpoHash(request); + String existingEpoKey = request.getParameter("_epoKey"); + if (!forceNew && existingEpoKey != null && epoHash.get(existingEpoKey) != null) { + epo = (EditProcessObject) epoHash.get(existingEpoKey); + epo.setKey(existingEpoKey); + epo.setUseRecycledBean(true); + } else { + LinkedList epoKeylist = getEpoKeylist(request); + if (epoHash.size() == MAX_EPOS) { + try { + epoHash.remove(epoKeylist.getFirst()); + epoKeylist.removeFirst(); + } catch (Exception e) { + // see JIRA issue VITRO-340, "Odd exception from backend editing" + // possible rare concurrency issue here + log.error("Error removing old EPO", e); + } + } + Random rand = new Random(); + String epoKey = createEpoKey(); + while (epoHash.get(epoKey) != null) { + epoKey+=Integer.toHexString(rand.nextInt()); + } + epo = new EditProcessObject(); + epoHash.put (epoKey,epo); + epoKeylist.add(epoKey); + epo.setKey(epoKey); + epo.setReferer( (forceNew) ? request.getRequestURL().append('?').append(request.getQueryString()).toString() : request.getHeader("Referer") ); + epo.setSession(request.getSession()); + } + return epo; + } + + private LinkedList getEpoKeylist(HttpServletRequest request){ + return (LinkedList) request.getSession().getAttribute(EPO_KEYLIST_ATTR); + } + + private HashMap getEpoHash(HttpServletRequest request){ + HashMap epoHash = (HashMap) request.getSession().getAttribute(EPO_HASH_ATTR); + if (epoHash == null) { + epoHash = new HashMap(); + request.getSession().setAttribute(EPO_HASH_ATTR,epoHash); + //since we're making a new EPO hash, we should also make a new keylist. + LinkedList epoKeylist = new LinkedList(); + request.getSession().setAttribute(EPO_KEYLIST_ATTR,epoKeylist); + } + return epoHash; + } + + private String createEpoKey(){ + return Long.toHexString(cal.getTimeInMillis()); + } + + protected boolean checkLoginStatus(HttpServletRequest request, HttpServletResponse response){ + return checkLoginStatus(request, response, null); + } + + protected boolean checkLoginStatus(HttpServletRequest request, HttpServletResponse response, String postLoginRedirectURI){ + LoginFormBean loginBean = (LoginFormBean) request.getSession().getAttribute("loginHandler"); + String loginPage = request.getContextPath() + Controllers.LOGIN; + if (loginBean == null){ + try{ + if (postLoginRedirectURI == null) + request.getSession().setAttribute("postLoginRequest",request.getRequestURI()+"?"+request.getQueryString()); + else + request.getSession().setAttribute("postLoginRequest",postLoginRedirectURI+"?"+request.getQueryString()); + response.sendRedirect(loginPage); + return false; + } catch (IOException ioe) { + log.error("checkLoginStatus() could not redirect to login page"); + return false; + } + } else { + if (!loginBean.getLoginStatus().equals("authenticated")) { + try{ + response.sendRedirect(loginPage); + return false; + } catch (IOException ioe) { + log.error("checkLoginStatus() could not redirect to login page"); + return false; + } + } + } + return true; + } + + protected void setRequestAttributes(HttpServletRequest request, EditProcessObject epo){ + Portal portal = (Portal)request.getAttribute("portalBean"); + request.setAttribute("epoKey",epo.getKey()); + request.setAttribute("epo",epo); + request.setAttribute("globalErrorMsg",epo.getAttribute("globalErrorMsg")); + request.setAttribute("portalBean",portal); + request.setAttribute("css", ""); + } + + protected void populateBeanFromParams(Object bean, HttpServletRequest request) { + Map params = request.getParameterMap(); + Enumeration paramNames = request.getParameterNames(); + while (paramNames.hasMoreElements()){ + String key = ""; + try { + key = (String) paramNames.nextElement(); + } catch (ClassCastException cce) { + log.error("populateBeanFromParams() could not cast parameter name to String"); + } + String value = ""; + if (key.equals(MULTIPLEXED_PARAMETER_NAME)) { + String multiplexedStr = request.getParameterValues(key)[0]; + Map paramMap = FormUtils.beanParamMapFromString(multiplexedStr); + Iterator paramIt = paramMap.keySet().iterator(); + while (paramIt.hasNext()) { + String param = (String) paramIt.next(); + String demultiplexedValue = (String) paramMap.get(param); + FormUtils.beanSet(bean, param, demultiplexedValue); + } + + } else { + try { + value = (String) request.getParameterValues(key)[0]; + } catch (ClassCastException cce) { + try { + value = ((Integer) params.get(key)).toString(); + } catch (ClassCastException ccf) { + log.error("populateBeanFromParams() could not cast parameter name to String"); + } + } + FormUtils.beanSet(bean, key, value); + } + } + } + + protected String MODEL_ATTR_NAME = "jenaOntModel"; + + protected OntModel getOntModel( HttpServletRequest request, ServletContext ctx ) { + + OntModel ontModel = null; + + try { + ontModel = (OntModel) request.getSession().getAttribute(MODEL_ATTR_NAME); + } catch (Exception e) {} + + if ( ontModel == null ) { + try { + ontModel = (OntModel) ctx.getAttribute(MODEL_ATTR_NAME); + } catch (Exception e) { + throw new RuntimeException("Could not find OntModel in context attribute '"+MODEL_ATTR_NAME+"'"); + } + } + + return ontModel; + + } + + public String getDefaultLandingPage(HttpServletRequest request) { + return(request.getContextPath() + DEFAULT_LANDING_PAGE); + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/controller/EditFrontController.java b/webapp/src/edu/cornell/mannlib/vedit/controller/EditFrontController.java new file mode 100644 index 000000000..d2ae9d257 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/controller/EditFrontController.java @@ -0,0 +1,78 @@ +package edu.cornell.mannlib.vedit.controller; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; +import java.io.IOException; + +/** + * This controller exists only so we can request different edit form controllers without having to have entries in web.xml for each. + * @author bjl23 + * + */ +public class EditFrontController extends VitroHttpServlet { + private static final Log log = LogFactory.getLog(EditFrontController.class.getName()); + private static final String CONTROLLER_PKG = "edu.cornell.mannlib.vitro.webapp.controller.edit"; + + public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { + try { + + String controllerName = request.getParameter("controller")+"RetryController"; + if (controllerName==null || controllerName.length()==0) { + log.error("doPost() found no controller parameter"); + } + Class controller = null; + Object controllerInstance = null; + try { + controller = Class.forName(CONTROLLER_PKG+"."+controllerName); + try { + controllerInstance = controller.getConstructor((Class[]) null).newInstance((Object[]) null); + ((HttpServlet)controllerInstance).init(getServletConfig()); + } catch (Exception e) { + log.error("doPost() could not instantiate specific controller "+controllerName); + } + } catch (ClassNotFoundException e){ + log.error("doPost() could not find controller "+CONTROLLER_PKG+"."+controllerName); + } + Class[] args = new Class[2]; + args[0] = HttpServletRequest.class; + args[1] = HttpServletResponse.class; + try { + Method meth = controller.getDeclaredMethod("doGet",args); + Object[] methArgs = new Object[2]; + methArgs[0] = request; + methArgs[1] = response; + try { + meth.invoke(controllerInstance,methArgs); + } catch (IllegalAccessException e) { + log.error("doPost() encountered IllegalAccessException on invoking "+controllerName); + } catch (InvocationTargetException e) { + log.error("doPost() encountered InvocationTargetException on invoking "+controllerName); + log.debug(e.getTargetException().getMessage()); + e.printStackTrace(); + } + + } catch (NoSuchMethodException e){ + log.error("could not find doPost() method in "+controllerName); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { + doPost(request,response); + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/controller/OperationController.java b/webapp/src/edu/cornell/mannlib/vedit/controller/OperationController.java new file mode 100644 index 000000000..0878aa7d6 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/controller/OperationController.java @@ -0,0 +1,499 @@ +package edu.cornell.mannlib.vedit.controller; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; +import edu.cornell.mannlib.vedit.forwarder.PageForwarder; +import edu.cornell.mannlib.vedit.listener.ChangeListener; +import edu.cornell.mannlib.vedit.listener.EditPreProcessor; +import edu.cornell.mannlib.vedit.util.FormUtils; +import edu.cornell.mannlib.vedit.util.OperationUtils; +import edu.cornell.mannlib.vedit.validator.ValidationObject; +import edu.cornell.mannlib.vedit.validator.Validator; + +public class OperationController extends BaseEditController { + + private static final Log log = LogFactory.getLog(OperationController.class.getName()); + + public void doPost (HttpServletRequest request, HttpServletResponse response) { + + String defaultLandingPage = getDefaultLandingPage(request); + + // get the Edit Process Object which will tell us wh + HashMap epoHash = null; + EditProcessObject epo = null; + try { + epoHash = (HashMap) request.getSession().getAttribute("epoHash"); + epo = (EditProcessObject) epoHash.get(request.getParameter("_epoKey")); + } catch (NullPointerException e) { + //session or edit process expired + try { + response.sendRedirect(defaultLandingPage); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + return; + } + + if (epo == null) { + try { + response.sendRedirect(defaultLandingPage); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + return; + } + + // if we're canceling, we don't need to do anything + if (request.getParameter("_cancel") != null){ + String referer = epo.getReferer(); + if (referer == null) { + try { + response.sendRedirect(defaultLandingPage); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + return; + } + else { + try { + response.sendRedirect(referer); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + return; + } + } + + // reset - if reset button is of type submit + if (request.getParameter("_reset") != null) { + try { + response.sendRedirect(request.getHeader("Referer")); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + return; + } + + try { + + Object newObj = getNewObj(epo); + + //populate this object from the req. params + boolean valid = populateObjectFromRequestParamsAndValidate(epo, newObj, request); + + //run preprocessors + runPreprocessors(epo, newObj); + + //applySimpleMask(epo, newObj); + + //put the newObj back in the epo where other things can look at it + epo.setNewBean(newObj); + + //if validation failed, go back to the form controller + if (!valid){ + retry(request,response); + return; + } + + String action = getAction(request); + + boolean status = performEdit(epo, newObj, action); + if (status == FAILURE) { + retry(request,response); + } + + /* put request parameters and attributes into epo where the listeners can see */ + epo.setRequestParameterMap(request.getParameterMap()); + + notifyChangeListeners(epo, action); + + /* send the user somewhere */ + if (action.equals("insert")){ + // Object[] args = new Object[1]; + // args[0] = result; + // epo.setNewBean(epo.getGetMethod().invoke(facade,args)); + PageForwarder pipf = epo.getPostInsertPageForwarder(); + if (pipf != null){ + pipf.doForward(request,response,epo); + return; + } + } else if (action.equals("update")){ + PageForwarder pupf = epo.getPostUpdatePageForwarder(); + if (pupf != null) { + pupf.doForward(request,response,epo); + return; + } + } else if (action.equals("delete")){ + PageForwarder pdpf = epo.getPostDeletePageForwarder(); + if (pdpf != null) { + pdpf.doForward(request,response,epo); + return; + } + } + + //if no page forwarder was set, just go back to referring page: + String referer = epo.getReferer(); + if (referer == null) + response.sendRedirect(defaultLandingPage); + else + response.sendRedirect(referer); + + } catch (Exception e) { + log.error("Error performing edit", e); + + String errMsg = (e.getMessage() != null) + ? e.getMessage() + : "Error performing edit"; + + epo.setAttribute("globalErrorMsg", errMsg); + + try { + retry(request, response); + } catch (IOException ioe) { + log.error(this.getClass().getName() + " IOError on redirect: ", ioe); + } + } + } + + private void retry(HttpServletRequest request, HttpServletResponse response) throws IOException { + String referer = request.getHeader("Referer"); + int epoKeyIndex = referer.indexOf("_epoKey"); + if (epoKeyIndex<0) + response.sendRedirect(referer+"&_epoKey="+request.getParameter("_epoKey")); + else{ + String url = referer.substring(0,epoKeyIndex) + "_epoKey="+request.getParameter("_epoKey"); + response.sendRedirect(url); + } + return; + } + + private void runPreprocessors(EditProcessObject epo, Object newObj) { + if (epo.getPreProcessorList() != null && epo.getPreProcessorList().size()>0) { + Iterator preIt = epo.getPreProcessorList().iterator(); + while (preIt.hasNext()) { + try { + EditPreProcessor epp = (EditPreProcessor) preIt.next(); + epp.process(newObj, epo); + } catch (ClassCastException e) {} + } + } + } + + private void applySimpleMask(EditProcessObject epo, Object newObj) { + // apply the simple mask + //if (epo.getSimpleMask() != null) { + // Iterator smaskIt = epo.getSimpleMask().iterator(); + // while (smaskIt.hasNext()){ + // Object[] simpleMaskPair = (Object[]) smaskIt.next(); + // FormUtils.beanSet(newObj,(String)simpleMaskPair[0],simpleMaskPair[1].toString()); + // } + //} + } + + private Object getNewObj(EditProcessObject epo) { + Object newObj = null; + if (epo.getOriginalBean() != null) { // we're updating or deleting an existing bean + if (epo.getImplementationClass() != null) { + newObj = OperationUtils.cloneBean(epo.getOriginalBean(), epo.getImplementationClass()); + } else { + newObj = OperationUtils.cloneBean(epo.getOriginalBean()); + } + } else { + Class cls = epo.getBeanClass(); + try { + newObj = cls.newInstance(); + } catch (IllegalAccessException iae) { + throw new RuntimeException("Illegal access - see error logs."); + } catch (InstantiationException ie) { + throw new RuntimeException("Unable to instantiate " + cls.getSimpleName()); + } + } + epo.setNewBean(newObj); // is this dangerous? + return newObj; + } + + private boolean populateObjectFromRequestParamsAndValidate(EditProcessObject epo, Object newObj, HttpServletRequest request) { + boolean valid = true; + String currParam=""; + Enumeration penum = request.getParameterNames(); + while (penum.hasMoreElements()){ + currParam = (String) penum.nextElement(); + if (!(currParam.indexOf("_")==0)){ + String currValue = request.getParameterValues(currParam)[0]; + // "altnew" values come in with the same input name but at position 1 of the array + if(currValue.length()==0 && request.getParameterValues(currParam).length>1) { + currValue = request.getParameterValues(currParam)[1]; + } + //validate the entry + boolean fieldValid = true; + if ( request.getParameter("_delete") == null ) { // don't do validation if we're deleting + List validatorList = (List) epo.getValidatorMap().get(currParam); + if (validatorList != null) { + Iterator valIt = validatorList.iterator(); + String errMsg = ""; + while (valIt.hasNext()){ + Validator val = (Validator)valIt.next(); + ValidationObject vo = val.validate(currValue); + if (!vo.getValid()){ + valid = false; + fieldValid = false; + errMsg += vo.getMessage() + " "; + epo.getBadValueMap().put(currParam,currValue); + } else { + try { + epo.getBadValueMap().remove(currParam); + epo.getErrMsgMap().remove(currParam); + } catch (Exception e) {} + } + } + if (errMsg.length()>0) { + epo.getErrMsgMap().put(currParam,errMsg); + log.info("doPost() putting error message "+errMsg+" for "+currParam); + } + } + } + if (fieldValid){ + if (currValue.length()==0) { + HashMap defaultHash = epo.getDefaultValueMap(); + try { + String defaultValue = (String)defaultHash.get(currParam); + if (defaultValue != null) + currValue=defaultValue; + } catch (Exception e) {} + } + try { + FormUtils.beanSet(newObj,currParam,currValue,epo); + epo.getErrMsgMap().remove(currParam); + epo.getBadValueMap().remove(currParam); + } catch (NumberFormatException e) { + if (currValue.length()>0) { + valid=false; + epo.getErrMsgMap().put(currParam,"Please enter an integer"); + epo.getBadValueMap().put(currParam,currValue); + } + } catch (IllegalArgumentException f) { + valid=false; + log.error("doPost() reports IllegalArgumentException for "+currParam); + log.debug("doPost() error message: "+f.getMessage()); + epo.getErrMsgMap().put(currParam, f.getMessage()); + epo.getBadValueMap().put(currParam,currValue); + } + } + } + } + return valid; + } + + private String getAction(HttpServletRequest request) { + if (request.getParameter("_update") != null ) { + return "update"; + } else if (request.getParameter("_delete") != null ) { + return "delete"; + } else { + return "insert"; + } + } + + private void notifyChangeListeners(EditProcessObject epo, String action) { + List changeListeners = epo.getChangeListenerList(); + if (changeListeners != null){ + Iterator changeIt = changeListeners.iterator(); + while (changeIt.hasNext()) { + ChangeListener cl = (ChangeListener) changeIt.next(); + if (action.equals("insert")) + cl.doInserted(epo.getNewBean(),epo); + else if (action.equals("update")) + cl.doUpdated(epo.getOriginalBean(),epo.getNewBean(),epo); + else if (action.equals("delete")) + cl.doDeleted(epo.getOriginalBean(),epo); + } + } + } + + private boolean SUCCESS = false; + private boolean FAILURE = !SUCCESS; + + private boolean performEdit(EditProcessObject epo, Object newObj, String action) { + /* do the actual edit operation */ + String partialClassName; + if (epo.getBeanClass() != null) { + partialClassName = epo.getBeanClass().getSimpleName(); + } else { + partialClassName = epo.getNewBean().getClass().getSimpleName(); + } + Object dataAccessObject = null; + if (epo.getDataAccessObject() != null) { + dataAccessObject = epo.getDataAccessObject(); + } else { + throw new RuntimeException(OperationController.class.getName()+" needs to be passed an EPO containing a data access object with which to perform the desired operation"); + } + Class[] classList = new Class[1]; + classList[0] = (epo.getBeanClass() != null) ? epo.getBeanClass() : newObj.getClass(); + newObj.getClass().getGenericSuperclass(); + Class[] superClassList = new Class[1]; + superClassList[0] = newObj.getClass().getSuperclass(); + Method meth=null; + Method deleteMeth=null; + Method insertMeth=null; + + // probably want to change this so it will walk up the class tree indefinitely looking for a good method to use + if ("update".equals(action)){ + if (epo.getUpdateMethod() != null) { + meth = epo.getUpdateMethod(); + } else { + try { + meth = dataAccessObject.getClass().getMethod("update"+partialClassName,classList); + } catch (NoSuchMethodException e) { + try { + meth = dataAccessObject.getClass().getMethod("update"+partialClassName,superClassList); + } catch (NoSuchMethodException f) { + try { // if there isn't a single update method, let's see if we can delete the old data and then insert the new + deleteMeth = dataAccessObject.getClass().getMethod("delete"+partialClassName,classList); + try { + insertMeth = dataAccessObject.getClass().getMethod("insert"+partialClassName,classList); + } catch (NoSuchMethodException ee) { + insertMeth = dataAccessObject.getClass().getMethod("insertNew"+partialClassName,classList); + } + } catch (NoSuchMethodException g) { + log.error("doPost() could not find method(s) for updating "+partialClassName); + } + } + } + } + } else if ("delete".equals(action)) { + if (epo.getDeleteMethod() != null) { + meth = epo.getDeleteMethod(); + } else { + try { + meth = dataAccessObject.getClass().getMethod("delete"+partialClassName,classList); + } catch (NoSuchMethodException e) { + try { + meth = dataAccessObject.getClass().getMethod("delete"+partialClassName,superClassList); + } catch (NoSuchMethodException f) { + log.error("doPost() could not find method delete"+partialClassName+"() on "+dataAccessObject.getClass().getName()); + } + } + } + } else { + if (epo.getInsertMethod() != null) { + meth = epo.getInsertMethod(); + } else { + try { + meth = dataAccessObject.getClass().getMethod("insert"+partialClassName,classList); + } catch (NoSuchMethodException e) { + try { + meth = dataAccessObject.getClass().getMethod("insertNew"+partialClassName,classList); + } catch (NoSuchMethodException f) { + try { + meth = dataAccessObject.getClass().getMethod("insertNew"+partialClassName,superClassList); + } catch (NoSuchMethodException g) { + try { + meth = dataAccessObject.getClass().getMethod("insertNew"+partialClassName,superClassList); + } catch (NoSuchMethodException h) { + log.error("doPost() could not find method for inserting "+partialClassName); + } + } + } + } + } + } + + Object[] insArgList = new Object[1]; + insArgList[0] = newObj; + + Object result = null; + + if ( (meth == null) && action.equals("update") ) { + //System.out.println("OperationController performing two-stage (deletion followed by insertion) update"); + try { + Object[] delArgList = new Object[1]; + delArgList[0] = epo.getOriginalBean(); + deleteMeth.invoke(dataAccessObject,delArgList); + insertMeth.invoke(dataAccessObject,insArgList); + } catch (InvocationTargetException e) { + log.error(this.getClass().getName()+" encountered exception performing two-stage update"); + Throwable innerE = e.getTargetException(); + log.error(innerE); + if (innerE.getMessage()!=null) { + log.error(innerE.getMessage()); + epo.setAttribute("globalErrorMsg",innerE.getMessage()); + } + return FAILURE; + } catch (IllegalAccessException iae) { + log.error(iae); + epo.setAttribute("globalErrorMessage", "Illegal access - see error logs."); + return FAILURE; + } + } else { + try { + result = meth.invoke(dataAccessObject,insArgList); + } catch (InvocationTargetException e) { + log.error(this.getClass().getName()+" encountered exception performing edit action"); + Throwable innerE = e.getTargetException(); + //innerE.printStackTrace(); + log.error(innerE); + if (innerE.getMessage()!=null) { + //System.out.println(innerE.getMessage()); + log.error(innerE.getMessage()); + epo.setAttribute("globalErrorMsg",innerE.getMessage()); + } + return FAILURE; + } catch (IllegalAccessException iae) { + log.error(iae); + epo.setAttribute("globalErrorMessage", "Illegal access - see error logs."); + return FAILURE; + } + } + + if (result != null) { + // need to put the result of the insert in the id of the newbean + try { + Class[] setIdArgs = new Class[1]; + if (epo.getIdFieldClass() != null) + setIdArgs[0] = epo.getIdFieldClass(); + else + setIdArgs[0] = int.class; + String idMutator = "set"; + if (epo.getIdFieldName() != null) { + idMutator += epo.getIdFieldName(); + } else { + idMutator += "Id"; + } + Method setIdMeth = epo.getNewBean().getClass().getMethod(idMutator,setIdArgs); + try { + Object[] idArg = new Object[1]; + idArg[0] = result; + setIdMeth.invoke((Object)epo.getNewBean(),idArg); + } catch (IllegalAccessException e) { + log.error("doPost() encountered IllegalAccessException setting id of new bean"); + } catch (InvocationTargetException f) { + log.error(f.getTargetException().getMessage()); + } + } catch (NoSuchMethodException e) { + //log.error("doPost() could not find setId() method for "+partialClassName); + } catch (Exception f) { + //log.error("doPost() could not set id of new bean."); + } + } + + return SUCCESS; + + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/forwarder/PageForwarder.java b/webapp/src/edu/cornell/mannlib/vedit/forwarder/PageForwarder.java new file mode 100644 index 000000000..e73dc38eb --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/forwarder/PageForwarder.java @@ -0,0 +1,12 @@ +package edu.cornell.mannlib.vedit.forwarder; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import edu.cornell.mannlib.vedit.beans.EditProcessObject; + +public interface PageForwarder { + + public void doForward(HttpServletRequest request, HttpServletResponse response, EditProcessObject epo); +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/forwarder/impl/UrlForwarder.java b/webapp/src/edu/cornell/mannlib/vedit/forwarder/impl/UrlForwarder.java new file mode 100644 index 000000000..8c32e37f5 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/forwarder/impl/UrlForwarder.java @@ -0,0 +1,37 @@ +package edu.cornell.mannlib.vedit.forwarder.impl; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.io.IOException; + +import java.net.URLEncoder; + +import edu.cornell.mannlib.vedit.forwarder.PageForwarder; +import edu.cornell.mannlib.vedit.beans.EditProcessObject; +import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class UrlForwarder implements PageForwarder { + private static final Log log = LogFactory.getLog(UrlForwarder.class.getName()); + + private String theUrl = null; + + public UrlForwarder (String theUrl) { + this.theUrl = theUrl; + } + + + public void doForward(HttpServletRequest request, HttpServletResponse response, EditProcessObject epo) { + try { + response.sendRedirect(response.encodeRedirectURL(theUrl)); + } catch (IOException ioe) { + log.error("doForward() could not send redirect."); + } + } + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/listener/ChangeListener.java b/webapp/src/edu/cornell/mannlib/vedit/listener/ChangeListener.java new file mode 100644 index 000000000..6dc0b5154 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/listener/ChangeListener.java @@ -0,0 +1,15 @@ +package edu.cornell.mannlib.vedit.listener; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; + +public interface ChangeListener { + + public void doInserted(Object newObj, EditProcessObject epo); + + public void doUpdated(Object oldObj, Object newObj, EditProcessObject epo); + + public void doDeleted(Object oldObj, EditProcessObject epo); + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/listener/EditPreProcessor.java b/webapp/src/edu/cornell/mannlib/vedit/listener/EditPreProcessor.java new file mode 100644 index 000000000..4516fc13a --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/listener/EditPreProcessor.java @@ -0,0 +1,11 @@ +package edu.cornell.mannlib.vedit.listener; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; + +public interface EditPreProcessor { + + public void process(Object o, EditProcessObject epo); + +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/tags/DynamicFieldsTag.java b/webapp/src/edu/cornell/mannlib/vedit/tags/DynamicFieldsTag.java new file mode 100644 index 000000000..1201a8413 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/tags/DynamicFieldsTag.java @@ -0,0 +1,223 @@ +package edu.cornell.mannlib.vedit.tags; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Iterator; + +import java.io.File; +import java.io.BufferedOutputStream; +import java.io.InputStream; +import java.io.FileInputStream; +import java.io.BufferedInputStream; +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspWriter; +import javax.servlet.ServletException; +import edu.cornell.mannlib.vedit.beans.FormObject; +import edu.cornell.mannlib.vedit.beans.DynamicField; +import edu.cornell.mannlib.vedit.beans.DynamicFieldRow; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang.StringEscapeUtils; +import edu.cornell.mannlib.vedit.tags.EditTag; + +public class DynamicFieldsTag extends EditTag { + + private char PATH_SEP = File.separatorChar; + + public final String MARKUP_FILE_PATH = "templates"+PATH_SEP+"edit"+PATH_SEP+"specific"+PATH_SEP; + + private String name = null; + private String type = null; + private String usePage = null; + + private String preMarkup = null; + private String templateMarkup = null; + private String postMarkup = null; + + public void setName( String name ) { + this.name = name; + } + + public void setType( String type ) { + this.type = type; + } + + public void setUsePage( String usePage ) { + this.usePage = usePage; + } + + public void parseMarkup() throws JspException{ + try { + + int preStart = -1; + int templateStart = -1; + int postStart = -1; + + InputStream fis = new FileInputStream (pageContext.getServletContext().getRealPath(new String())+PATH_SEP+MARKUP_FILE_PATH+usePage); + InputStream bis = new BufferedInputStream(fis); + BufferedReader in = new BufferedReader(new InputStreamReader(bis)); + List lines = new ArrayList(); + lines.add(""); // 0th line + int lineIndex = 0; + while (in.ready()) { + ++lineIndex; + String currentLine = in.readLine(); + if (currentLine != null && currentLine.indexOf(""); + String hiddenTemplatePreMarkup = new String(preMarkup); + // bit of a hack to hide the template from the user: + hiddenTemplatePreMarkup = strReplace(hiddenTemplatePreMarkup,"display\\:none\\;",""); + hiddenTemplatePreMarkup = strReplace(hiddenTemplatePreMarkup,"display\\:block\\;",""); + hiddenTemplatePreMarkup = strReplace(hiddenTemplatePreMarkup,"display\\:inline\\;",""); + hiddenTemplatePreMarkup = strReplace(hiddenTemplatePreMarkup,"style\\=\\\"","style=\"display:none;"); + out.print(hiddenTemplatePreMarkup); + String hiddenTemplateTemplateMarkup = new String(templateMarkup); + hiddenTemplateTemplateMarkup = strReplace(hiddenTemplateTemplateMarkup, "\\$\\$", ""); + out.print(hiddenTemplateTemplateMarkup); + out.print(postMarkup); + + } catch (Exception e){ + System.out.println("DynamicFieldsTag could not get the form object"); + } + + } catch(Exception ex) { + throw new JspException(ex.getMessage()); + } + return SKIP_BODY; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/tags/EditTag.java b/webapp/src/edu/cornell/mannlib/vedit/tags/EditTag.java new file mode 100644 index 000000000..04acc96b9 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/tags/EditTag.java @@ -0,0 +1,58 @@ +package edu.cornell.mannlib.vedit.tags; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.HashMap; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspWriter; + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; +import edu.cornell.mannlib.vedit.beans.FormObject; +import org.apache.commons.lang.StringEscapeUtils; + +public class EditTag extends TagSupport { + private String name = null; + + public void setName( String name ) { + this.name = name; + } + + public int doEndTag() throws JspException { + return SKIP_BODY; + } + + public EditProcessObject getEpo() { + EditProcessObject epo = null; + String epoKey = null; + String epoKeyAttr = (String) pageContext.getRequest().getAttribute("epoKey"); + if (epoKeyAttr != null) { + epoKey = epoKeyAttr; + } + else { + String epoKeyParam = (String) pageContext.getRequest().getParameter("epoKey"); + if (epoKeyParam != null) { + epoKey = epoKeyParam; + } + } + HashMap epoHash = (HashMap) pageContext.getSession().getAttribute("epoHash"); + try { + epo = (EditProcessObject) epoHash.get(epoKey); + } catch (NullPointerException npe) { + System.out.println("Null epoHash in edu.cornell.mannlib.vitro.edu.tags.utils.TagUtils.getEpo()"); + } + return epo; + } + + public FormObject getFormObject() { + FormObject foo=null; + try { + foo=getEpo().getFormObject(); + } catch (NullPointerException npe) { + System.out.println("Null epo in edu.cornell.mannlib.vitro.edit.tags.utils.TagUtils.getFormObject()"); + } + return foo; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/tags/ErrorTag.java b/webapp/src/edu/cornell/mannlib/vedit/tags/ErrorTag.java new file mode 100644 index 000000000..1737aeb20 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/tags/ErrorTag.java @@ -0,0 +1,40 @@ +package edu.cornell.mannlib.vedit.tags; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspWriter; +import edu.cornell.mannlib.vedit.beans.FormObject; +import edu.cornell.mannlib.vedit.tags.EditTag; +import org.apache.commons.lang.StringEscapeUtils; + +/** This tag allows validation error messages to be displayed on a form JSP **/ +public class ErrorTag extends EditTag { + private String name = null; + + public void setName( String name ) { + this.name = name; + } + + public int doEndTag() throws JspException { + try { + JspWriter out = pageContext.getOut(); + + String errors = null; + try { + errors = (String) getFormObject().getErrorMap().get(name); + } catch (Exception e){ + System.out.println("Could not get the form object from which to extract validation error message."); + } + + if (errors != null){ + out.print(StringEscapeUtils.escapeHtml((String) errors)); + } + + } catch(Exception ex) { + throw new JspException(ex.getMessage()); + } + return SKIP_BODY; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/tags/OptionTag.java b/webapp/src/edu/cornell/mannlib/vedit/tags/OptionTag.java new file mode 100644 index 000000000..c5328f726 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/tags/OptionTag.java @@ -0,0 +1,70 @@ +package edu.cornell.mannlib.vedit.tags; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import org.apache.commons.collections.map.ListOrderedMap; +import org.apache.commons.collections.OrderedMapIterator; +import java.util.List; +import java.util.Iterator; +import java.io.IOException; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; + +import edu.cornell.mannlib.vedit.beans.Option; +import edu.cornell.mannlib.vedit.tags.EditTag; +import org.apache.commons.lang.StringEscapeUtils; + +public class OptionTag extends EditTag { + private String name = null; + + public void setName( String name ) { + this.name = name; + } + + private void outputOptionsMarkup(List optList, JspWriter out) throws IOException { + Iterator it = optList.iterator(); + while (it.hasNext()){ + Option opt = (Option) it.next(); + if (opt.getValue() == null) + opt.setValue(""); + if (opt.getBody() == null) + opt.setBody(""); + out.print("\n"); + } + } + + public int doEndTag() throws JspException { + try { + JspWriter out = pageContext.getOut(); + + List optList = null; + ListOrderedMap optGroups = null; + + try { + optList = (List) getFormObject().getOptionLists().get(name); + outputOptionsMarkup(optList,out); + } catch (ClassCastException e){ + // maybe it's a ListOrderedMap of optgroups + optGroups = (ListOrderedMap) getFormObject().getOptionLists().get(name); + OrderedMapIterator ogKey = optGroups.orderedMapIterator(); + while (ogKey.hasNext()) { + String optGroupName = (String) ogKey.next(); + out.println(""); + outputOptionsMarkup((List)optGroups.get(optGroupName),out); + out.println(""); + } + } catch (NullPointerException npe) { + System.out.println("OptionTag could not find option list for "+name); + } + } catch(Exception ex) { + ex.printStackTrace(); + throw new JspException(ex.getMessage()); + } + return SKIP_BODY; // EVAL_PAGE; did colnames only //EVAL_PAGE in connection pooled version; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/tags/ValueTag.java b/webapp/src/edu/cornell/mannlib/vedit/tags/ValueTag.java new file mode 100644 index 000000000..a5f34e3d8 --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/tags/ValueTag.java @@ -0,0 +1,48 @@ +package edu.cornell.mannlib.vedit.tags; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.util.HashMap; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspWriter; +import edu.cornell.mannlib.vedit.beans.FormObject; +import org.apache.commons.lang.StringEscapeUtils; +import edu.cornell.mannlib.vedit.tags.EditTag; + +public class ValueTag extends EditTag { + private String name = null; + + public void setName( String name ) { + this.name = name; + } + + public int doEndTag() throws JspException { + try { + JspWriter out = pageContext.getOut(); + + HashMap values = null; + try { + // FormObject foo = (FormObject) pageContext.getSession().getAttribute("FormObject"); + // FormObject foo = TagUtils.getFormObject(pageContext); + FormObject foo = getFormObject(); + values = foo.getValues(); + } catch (Exception e){ + System.out.println("Could not get the form object from which to build an option list"); + } + + if (values != null){ + String value = (String) values.get(name); + if (value != null) + out.print(StringEscapeUtils.escapeHtml(value)); + } else { + System.out.println("ValueTag unable to get HashMap of form values"); + } + + } catch(Exception ex) { + throw new JspException(ex.getMessage()); + } + return SKIP_BODY; + } +} diff --git a/webapp/src/edu/cornell/mannlib/vedit/util/FormUtils.java b/webapp/src/edu/cornell/mannlib/vedit/util/FormUtils.java new file mode 100644 index 000000000..fbe32af6b --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vedit/util/FormUtils.java @@ -0,0 +1,416 @@ +package edu.cornell.mannlib.vedit.util; + +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +import java.lang.reflect.Method; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vedit.beans.EditProcessObject; +import edu.cornell.mannlib.vedit.beans.FormObject; +import edu.cornell.mannlib.vedit.beans.Option; +import edu.cornell.mannlib.vitro.webapp.beans.Ontology; +import edu.cornell.mannlib.vitro.webapp.beans.VClass; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; + +public class FormUtils { + + protected static final Log log = LogFactory.getLog(FormUtils.class.getName()); + + /* this class needs to be reworked */ + + public static String htmlFormFromBean (Object bean, String action, FormObject foo) { + return htmlFormFromBean(bean,action,null,foo,new HashMap()); + } + + public static String htmlFormFromBean (Object bean, String action, FormObject foo, HashMap badValuesHash) { + return htmlFormFromBean(bean,action,null,foo,badValuesHash); + } + + /** + * Creates a basic XHTML editing form for a bean class + * + * This is the simplest version, creating an input field for each and every setter method in the bean. + * + * @param bean the bean class for which an editing form should be built + * @return XHTML markup of an editing form for the specified class + * @author bjl23 + */ + public static String htmlFormFromBean (Object bean, String action, EditProcessObject epo, FormObject foo, HashMap BadValuesHash) { + + String formMarkup = ""; + + Class beanClass = (epo != null && epo.getBeanClass() != null) ? epo.getBeanClass() : bean.getClass(); + + Method[] meths = beanClass.getMethods(); + + for (int i=0; i-1 || currMethTypeStr.indexOf("class java.util.Date")>-1) { + //we only want people directly to type in ints, strings, and dates + //of course, most of the ints are probably foreign keys anyway... + + String elementName = currMeth.getName().substring(3,currMeth.getName().length()); + + formMarkup += ""; + + formMarkup += "

    "+elementName+"

    "; + + formMarkup += ""; + + formMarkup += " makeVClassOptionList(WebappDaoFactory wadf, String selectedVClassURI) { + List