Compare commits

..

No commits in common. "v20240530🐜" and "v20200614" have entirely different histories.

63 changed files with 589 additions and 1085 deletions

View file

@ -1,45 +0,0 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
LC_TIME: en_US.UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew assembleDist
- name: Create release
run: |
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--title "$(date +'%d %b %Y')" \
--generate-notes
- name: Upload assets
run: |
gh release upload "$GITHUB_REF_NAME" \
build/distributions/helma-*.* \
--clobber

View file

@ -1,50 +0,0 @@
name: Staging
on:
workflow_dispatch
env:
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
jobs:
install:
runs-on: ubuntu-latest
environment:
name: staging
url: https://antville-test.click
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew installDist
- name: Set up SSH agent
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
mkdir -p ~/.ssh
echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config
echo '${{ vars.KNOWN_HOSTS }}' > ~/.ssh/known_hosts
- name: Publish to staging server
run: |
rsync build/install/helma/ antville.dev:/ \
--verbose --archive --delete --compress \
--filter '+ launcher.jar' \
--filter '+ lib' \
--filter '+ *.jar' \
--filter '- *' \
- name: Restart Helma
run: ssh antville.dev restart

1
.gitignore vendored
View file

@ -1,5 +1,4 @@
.gradle .gradle
.idea
.settings .settings
build build

View file

@ -1 +0,0 @@
11.0

View file

@ -1,5 +0,0 @@
{
"recommendations": [
"vscjava.vscode-java-pack"
]
}

84
.vscode/launch.json vendored
View file

@ -1,84 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "ImageInfo",
"request": "launch",
"mainClass": "helma.image.ImageInfo",
"projectName": "helma_"
},
{
"type": "java",
"name": "CommandlineRunner",
"request": "launch",
"mainClass": "helma.main.CommandlineRunner",
"projectName": "helma_"
},
{
"type": "java",
"name": "Server",
"request": "launch",
"mainClass": "helma.main.Server",
"projectName": "helma_"
},
{
"type": "java",
"name": "XmlConverter",
"request": "launch",
"mainClass": "helma.objectmodel.dom.XmlConverter",
"projectName": "helma_"
},
{
"type": "java",
"name": "Crypt",
"request": "launch",
"mainClass": "helma.util.Crypt",
"projectName": "helma_"
},
{
"type": "java",
"name": "HtmlEncoder",
"request": "launch",
"mainClass": "helma.util.HtmlEncoder",
"projectName": "helma_"
},
{
"type": "java",
"name": "Logo",
"request": "launch",
"mainClass": "helma.util.Logo",
"projectName": "helma_"
},
{
"type": "java",
"name": "MarkdownProcessor",
"request": "launch",
"mainClass": "helma.util.MarkdownProcessor",
"projectName": "helma_"
},
{
"type": "java",
"name": "Commandline",
"request": "launch",
"mainClass": "helma.main.launcher.Commandline",
"projectName": "launcher"
},
{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "helma.main.launcher.Main",
"projectName": "launcher"
}
]
}

View file

@ -1,6 +0,0 @@
{
"files.watcherExclude": {
"apps/": true
},
"java.configuration.updateBuildConfiguration": "automatic"
}

View file

@ -2,7 +2,7 @@
## TL;DR ## TL;DR
- Make sure you have Java 17 or higher installed - Make sure you have Java 1.6 or higher installed
- Download and unpack the [latest release](https://github.com/antville/helma/releases) - Download and unpack the [latest release](https://github.com/antville/helma/releases)
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform - Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
- Direct your web browser to <http://localhost:8080> - Direct your web browser to <http://localhost:8080>
@ -21,9 +21,9 @@ Although Helma became a Grande Dame of server-side JavaScript already decades ag
## System Requirements ## System Requirements
You need a Java virtual machine version 17 or higher to run Helma. You need a Java virtual machine 1.6 or higher to run Helma.
Please consult the documentation of your platform on how to obtain and install Java. Please consult the documentation of your platform how to obtain and install Java.
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle. You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
@ -31,12 +31,7 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
## Development ## Development
### Additional Prerequisites Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `y`.
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
* [Node.js](https://nodejs.org) LTS version
Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `yes` or `no`.
> ⚠️ > ⚠️
> Please be aware that this step is going to overwrite files in the installation directory escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory. > Please be aware that this step is going to overwrite files in the installation directory escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
@ -45,7 +40,7 @@ Clone this repository to your machine and start the build process with `./gradle
After all files are put into place start Helma by invoking `./bin/helma.bat` or `./bin/helma`, depending on whether you are on Windows or Linux / Unix / OS X, respectively. If the `java` command is not found, try setting the `JAVA_HOME` environment variable to the location of your Java installation. After all files are put into place start Helma by invoking `./bin/helma.bat` or `./bin/helma`, depending on whether you are on Windows or Linux / Unix / OS X, respectively. If the `java` command is not found, try setting the `JAVA_HOME` environment variable to the location of your Java installation.
You can adjust server-wide settings in the `server.properties` file. For example, you could set the `smtp` property to the name of the SMTP server that Helma should use to send e-mail. Applications can be started or stopped by editing the `apps.properties` file, or through the web interface using the management application that is part of Helma. You can adjust server-wide settings in the `server.properties` file. For example, you could set the `smtp` property to the name of the SMTP server that Helma should use to send e-mail. Applications can be started or stopped by editing the `apps.properties` file through the web interface using the management application that is part of Helma.
If all goes well you should be able to connect your browser to <http://localhost:8080> port 8080 on the local machine, that is. If all goes well you should be able to connect your browser to <http://localhost:8080> port 8080 on the local machine, that is.
@ -60,7 +55,7 @@ Finally, Helma can be plugged into Servlet containers using Servlet classes that
After installing and running Helma, you will be able to access introductions to the features of Helma and the various included development tools. Further information you will find on the helma.org website: After installing and running Helma, you will be able to access introductions to the features of Helma and the various included development tools. Further information you will find on the helma.org website:
> 😿 > 😿
> Unfortunately, the Helma website disappeard in the meantime. However, with some archaeological web digging and thanks to the great search engines and archive services out there it is still possible to find useful resources. > Unfortunately, the Helma website disappeard in the meantime. However, with some archeological web digging and thanks to the great search engines and archive services out there it is still possible to find useful resources.
- [helma.org at Internet Archive](http://web.archive.org/web/20180122132315/http://helma.org) - [helma.org at Internet Archive](http://web.archive.org/web/20180122132315/http://helma.org)
- [Documentation](http://web.archive.org/web/20100530234322/http://helma.org/documentation/) - [Documentation](http://web.archive.org/web/20100530234322/http://helma.org/documentation/)

View file

@ -1,6 +1,6 @@
plugins { plugins {
id 'application' id 'application'
id 'com.github.jk1.dependency-license-report' version '2.7' id 'com.github.jk1.dependency-license-report' version '1.13'
} }
import org.apache.tools.ant.filters.FixCrLfFilter import org.apache.tools.ant.filters.FixCrLfFilter
@ -18,12 +18,8 @@ allprojects {
apply plugin: 'java' apply plugin: 'java'
compileJava { compileJava {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_1_6
}
repositories {
mavenCentral()
} }
} }
@ -32,16 +28,6 @@ version = new Date().format("yyyyMMdd")
tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport' tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
tasks.compileJava.dependsOn 'processSource' tasks.compileJava.dependsOn 'processSource'
// Disable DocLint for now
// See <https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html>
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
sourceSets { sourceSets {
main { main {
java { java {
@ -51,6 +37,11 @@ sourceSets {
} }
} }
repositories {
mavenCentral()
jcenter()
}
configurations { configurations {
// Wrapping implementation because it does not allow access to its files // Wrapping implementation because it does not allow access to its files
// (i.e. cannot be resolved) // (i.e. cannot be resolved)
@ -58,19 +49,19 @@ configurations {
} }
dependencies { dependencies {
implementation 'com.google.code.gson:gson:2.11.0' implementation 'com.google.code.gson:gson:2.8.6'
implementation 'commons-codec:commons-codec:1.17.0' implementation 'com.sun.activation:javax.activation:1.2.0'
implementation 'commons-fileupload:commons-fileupload:1.5' implementation 'commons-codec:commons-codec:1.14'
implementation 'commons-logging:commons-logging:1.3.2' implementation 'commons-fileupload:commons-fileupload:1.4'
implementation 'commons-net:commons-net:3.10.0' implementation 'commons-logging:commons-logging:1.2'
implementation 'commons-net:commons-net:3.6'
implementation 'com.sun.mail:javax.mail:1.6.2' implementation 'com.sun.mail:javax.mail:1.6.2'
implementation 'javax.servlet:javax.servlet-api:4.0.1' implementation 'javax.servlet:javax.servlet-api:4.0.1'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1' implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.54.v20240208' implementation 'org.eclipse.jetty:jetty-servlet:9.4.27.v20200227'
implementation 'org.eclipse.jetty:jetty-xml:9.4.54.v20240208' implementation 'org.eclipse.jetty:jetty-xml:9.4.27.v20200227'
implementation 'org.mozilla:rhino:1.7.13' implementation 'org.mozilla:rhino:1.7.12'
implementation 'org.sejda.imageio:webp-imageio:0.1.6' implementation 'xerces:xercesImpl:2.12.0'
implementation 'xerces:xercesImpl:2.12.2'
implementation 'xmlrpc:xmlrpc:2.0.1' implementation 'xmlrpc:xmlrpc:2.0.1'
} }
@ -78,10 +69,11 @@ def rhinoJar = configurations.library.files.find { jar ->
jar.name.startsWith('rhino') jar.name.startsWith('rhino')
} }
startScripts { startScripts {
applicationName = 'helma' applicationName = 'helma'
classpath = files('../launcher.jar') classpath = files('../launcher.jar')
mainClass = 'helma.main.launcher.Main' mainClassName = 'helma.main.launcher.Main'
defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon] defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
@ -103,7 +95,6 @@ distributions {
} }
} }
application {
applicationDistribution.from(projectDir) { applicationDistribution.from(projectDir) {
include 'modules/**' include 'modules/**'
include 'LICENSE.md' include 'LICENSE.md'
@ -125,11 +116,8 @@ application {
include '**' include '**'
into 'licenses' into 'licenses'
} }
}
distTar { distTar {
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
compression = Compression.GZIP compression = Compression.GZIP
filesMatching(textFiles) { filesMatching(textFiles) {
@ -138,8 +126,6 @@ distTar {
} }
distZip { distZip {
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
filesMatching(textFiles) { filesMatching(textFiles) {
filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("crlf")) filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("crlf"))
} }
@ -147,11 +133,8 @@ distZip {
installDist { installDist {
dependsOn build dependsOn build
if (!System.getenv('CI')) {
finalizedBy 'update' finalizedBy 'update'
} }
}
run { run {
classpath = files('launcher.jar') classpath = files('launcher.jar')
@ -183,11 +166,11 @@ task processSource(type: Sync) {
} }
task update { task update {
def rsyncArgs = ['--archive', '--filter', '- backups'] def rsyncArgs = ['-a', '--info=progress2', '--exclude', 'backups']
def confirm = { def confirm = {
ant.input(message: 'Update this installation?', validargs: 'yes,no', addproperty: 'continue') ant.input(message: 'Update this installation?', validargs: 'y,n', addproperty: 'continue')
return ant.continue == 'yes' return ant.continue == 'y'
} }
onlyIf { confirm() } onlyIf { confirm() }
@ -198,29 +181,20 @@ task update {
mkdir backupDir mkdir backupDir
exec { exec {
// Create a backup with rsync instead of a CopyTask because the latter chokes on multi-byte characters // Using rsync instead of a CopyTask because the latter chokes on multi-byte characters
// See https://github.com/gradle/gradle/issues/789 // See https://github.com/gradle/gradle/issues/789
executable 'rsync' executable 'rsync'
args rsyncArgs args rsyncArgs
args "$projectDir/", backupDir args "$projectDir/", backupDir
} }
print "Created backup of ${projectDir} in ${backupDir}"
} }
doLast { doLast {
exec { exec {
// Using rsync to selectively update the repo directory // Using rsync instead of installDist task because it does not overwrite the project directory
executable 'rsync' executable 'rsync'
args '--delete'
args rsyncArgs args rsyncArgs
args '--filter', '+ bin/***' args '--exclude', 'bin'
args '--filter', '+ docs/***'
args '--filter', '+ extras/***'
args '--filter', '+ launcher.jar'
args '--filter', '+ lib'
args '--filter', '+ *.jar'
args '--filter', '- *'
args "${installDist.destinationDir}/", projectDir args "${installDist.destinationDir}/", projectDir
} }
} }
@ -238,6 +212,11 @@ task jsdoc(type: Exec) {
executable 'npx' executable 'npx'
args = ['jsdoc', '-d', "$destination"].plus(sources) args = ['jsdoc', '-d', "$destination"].plus(sources)
// As of writing jsdoc throws the following error:
// Unable to parse /home/tobi/Projects/helma/current/modules/jala/code/Database.js: Unexpected token, expected "(" (844:10)
// Seems to be related to the `for each` syntax but did not find any further references.
ignoreExitValue true
} }
task xgettext(type: JavaExec) { task xgettext(type: JavaExec) {
@ -245,7 +224,7 @@ task xgettext(type: JavaExec) {
group 'i18n' group 'i18n'
classpath = files('launcher.jar') classpath = files('launcher.jar')
mainClass = 'helma.main.launcher.Commandline' main = 'helma.main.launcher.Commandline'
// TODO: Decouple from Antville app // TODO: Decouple from Antville app
args = [ args = [
@ -262,7 +241,7 @@ task po2js(type: JavaExec) {
group 'i18n' group 'i18n'
classpath = files(rhinoJar) classpath = files(rhinoJar)
mainClass = 'org.mozilla.javascript.tools.shell.Main' main = 'org.mozilla.javascript.tools.shell.Main'
// TODO: Decouple from Antville app // TODO: Decouple from Antville app
args = [ args = [
@ -277,7 +256,7 @@ task rhinoShell(type: JavaExec) {
group 'Application' group 'Application'
classpath = files(rhinoJar) classpath = files(rhinoJar)
mainClass = 'org.mozilla.javascript.tools.shell.Main' main = 'org.mozilla.javascript.tools.shell.Main'
standardInput = System.in standardInput = System.in
} }
@ -289,6 +268,6 @@ task commandLine(type: JavaExec) {
group 'Application' group 'Application'
classpath = files('launcher.jar') classpath = files('launcher.jar')
mainClass = 'helma.main.launcher.Commandline' main = 'helma.main.launcher.Commandline'
args '-h', projectDir, function args '-h', projectDir, function
} }

Binary file not shown.

View file

@ -1,7 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

303
gradlew vendored
View file

@ -1,127 +1,78 @@
#!/bin/sh #!/usr/bin/env sh
#
# Copyright © 2015-2021 the original authors.
#
# 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
#
# https://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.
#
############################################################################## ##############################################################################
# ##
# Gradle start up script for POSIX generated by Gradle. ## Gradle start up script for UN*X
# ##
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
app_path=$0 PRG="$0"
# Need this for relative symlinks.
# Need this for daisy-chained symlinks. while [ -h "$PRG" ] ; do
while ls=`ls -ld "$PRG"`
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path link=`expr "$ls" : '.*-> \(.*\)$'`
[ -h "$app_path" ] if expr "$link" : '/.*' > /dev/null; then
do PRG="$link"
ls=$( ls -ld "$app_path" ) else
link=${ls#*' -> '} PRG=`dirname "$PRG"`"/$link"
case $link in #( fi
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
# This is normally unused APP_NAME="Gradle"
# shellcheck disable=SC2034 APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD="maximum"
warn () { warn () {
echo "$*" echo "$*"
} >&2 }
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} >&2 }
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "$( uname )" in #( case "`uname`" in
CYGWIN* ) cygwin=true ;; #( CYGWIN* )
Darwin* ) darwin=true ;; #( cygwin=true
MSYS* | MINGW* ) msys=true ;; #( ;;
NONSTOP* ) nonstop=true ;; Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java JAVACMD="$JAVA_HOME/jre/sh/java"
else else
JAVACMD=$JAVA_HOME/bin/java JAVACMD="$JAVA_HOME/bin/java"
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -130,120 +81,92 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD="java"
if ! command -v java >/dev/null 2>&1 which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
case $MAX_FD in #( MAX_FD_LIMIT=`ulimit -H -n`
max*) if [ $? -eq 0 ] ; then
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
# shellcheck disable=SC2039,SC3045 MAX_FD="$MAX_FD_LIMIT"
MAX_FD=$( ulimit -H -n ) || fi
warn "Could not query maximum file descriptor limit" ulimit -n $MAX_FD
esac if [ $? -ne 0 ] ; then
case $MAX_FD in #( warn "Could not set maximum file descriptor limit: $MAX_FD"
'' | soft) :;; #( fi
*) else
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
# shellcheck disable=SC2039,SC3045 fi
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi fi
# Collect all arguments for the java command, stacking in reverse order: # For Darwin, add options to specify how the application appears in the dock
# * args from the command line if $darwin; then
# * the main class name GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but # For Cygwin, switch paths to Windows format before running java
# possibly modified. if $cygwin ; then
# APP_HOME=`cygpath --path --mixed "$APP_HOME"`
# NB: a `for` loop captures its iteration list before it begins, so CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# changing the positional parameters here affects neither the number of JAVACMD=`cygpath --unix "$JAVACMD"`
# iterations, nor the values presented in `arg`.
shift # remove old arg # We build the pattern for arguments to be converted via cygpath
set -- "$@" "$arg" # push replacement arg ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Collect all arguments for the java command, following the shell quoting and substitution rules
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# Collect all arguments for the java command: # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
# and any embedded shellness will be escaped. cd "$(dirname "$0")"
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

72
gradlew.bat vendored
View file

@ -1,19 +1,3 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@ -26,28 +10,24 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS=
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if "%ERRORLEVEL%" == "0" goto init
echo. 1>&2 echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo. 1>&2 echo.
echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. 1>&2 echo location of your Java installation.
goto fail goto fail
@ -55,36 +35,48 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto init
echo. 1>&2 echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo. 1>&2 echo.
echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. 1>&2 echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd if "%ERRORLEVEL%"=="0" goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL% if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
if %EXIT_CODE% equ 0 set EXIT_CODE=1 exit /b 1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View file

@ -23,7 +23,7 @@
*/ */
// take care of any dependencies // take care of any dependencies
app.addRepository('modules/helma/jxl-2.5.7.jar'); app.addRepository('modules/helma/jxl.jar');
/** /**
* Define the global namespace if not existing * Define the global namespace if not existing

View file

@ -62,18 +62,17 @@ helma.Http = function() {
var responseHandler = function(connection, result) { var responseHandler = function(connection, result) {
var input; var input;
var stream;
try { try {
stream = connection.getInputStream(); if (method !== 'DELETE') {
} catch (error) { var stream = connection.getInputStream();
stream = connection.getErrorStream();
}
if (stream) {
if (connection.getContentEncoding() === 'gzip') { if (connection.getContentEncoding() === 'gzip') {
stream = new java.util.zip.GZIPInputStream(stream); stream = new java.util.zip.GZIPInputStream(stream);
} }
input = new java.io.BufferedInputStream(stream); input = new java.io.BufferedInputStream(stream);
} }
} catch (error) {
input = new java.io.BufferedInputStream(connection.getErrorStream());
}
if (input) { if (input) {
var body = new java.io.ByteArrayOutputStream(); var body = new java.io.ByteArrayOutputStream();
var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024); var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
@ -91,7 +90,8 @@ helma.Http = function() {
} catch (error) { } catch (error) {
// safe to ignore // safe to ignore
} }
if (binaryMode) { if (binaryMode && (result.code >= 200 && result.code < 300)) {
// only honor binaryMode if the request succeeded
result.content = body.toByteArray(); result.content = body.toByteArray();
} else { } else {
result.content = result.charset ? result.content = result.charset ?

View file

@ -31,8 +31,8 @@
*/ */
// take care of any dependencies // take care of any dependencies
app.addRepository('modules/helma/lucene-core-2.2.0.jar'); app.addRepository('modules/helma/lucene-core.jar');
app.addRepository('modules/helma/lucene-analyzers-2.2.0.jar'); app.addRepository('modules/helma/lucene-analyzers.jar');
if (!global.helma) { if (!global.helma) {

View file

@ -24,7 +24,7 @@
// take care of any dependencies // take care of any dependencies
app.addRepository('modules/helma/File.js'); app.addRepository('modules/helma/File.js');
app.addRepository('modules/helma/ganymed-ssh2-build208.jar'); app.addRepository('modules/helma/ganymed-ssh2.jar');
// define the helma namespace, if not existing // define the helma namespace, if not existing
if (!global.helma) { if (!global.helma) {

View file

@ -1,18 +0,0 @@
dependencies {
runtimeOnly 'ch.ethz.ganymed:ganymed-ssh2:build209'
runtimeOnly 'net.sourceforge.jexcelapi:jxl:2.5.7'
runtimeOnly 'org.apache.lucene:lucene-analyzers:2.2.0'
runtimeOnly 'org.apache.lucene:lucene-core:2.2.0'
}
jar.enabled = false
compileJava.enabled = false
compileTestJava.enabled = false
processResources.enabled = false
processTestResources.enabled = false
test.enabled = false
task deps(type: Copy) {
from sourceSets.main.runtimeClasspath
into '.'
}

Binary file not shown.

BIN
modules/helma/jxl.jar Normal file

Binary file not shown.

View file

@ -1,21 +0,0 @@
dependencies {
runtimeOnly 'dom4j:dom4j:1.1.3'
runtimeOnly 'jaxen:jaxen:1.1-beta-8'
runtimeOnly 'net.sf.javamusictag:jid3lib:0.5.4'
// FIXME: Did not find these two or appropriate replacements for them
//runtime 'id3:de.ueberdosis.mp3info:1.6.0d9'
//runtime 'javadns:org.wonderly:?'
}
jar.enabled = false
compileJava.enabled = false
compileTestJava.enabled = false
processResources.enabled = false
processTestResources.enabled = false
test.enabled = false
task deps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'lib'
}

View file

@ -841,7 +841,7 @@ jala.db.RamDatabase.prototype.copyTables = function(database, tables) {
tables = jala.db.metadata.getTableNames(dbMetadata); tables = jala.db.metadata.getTableNames(dbMetadata);
} }
for (let tableName of tables) { for each (var tableName in tables) {
// drop the table if it exists // drop the table if it exists
if (this.tableExists(tableName)) { if (this.tableExists(tableName)) {
this.dropTable(tableName); this.dropTable(tableName);

Binary file not shown.

View file

@ -1,16 +0,0 @@
dependencies {
// FIXME: Seems to be not used, anymore?
runtimeOnly 'bsf:bsf:2.4.0'
}
jar.enabled = false
compileJava.enabled = false
compileTestJava.enabled = false
processResources.enabled = false
processTestResources.enabled = false
test.enabled = false
task deps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'lib'
}

Binary file not shown.

View file

@ -330,7 +330,7 @@ MessageParser.prototype.parseSkinFile = function(file, encoding) {
var processMacros = function(macros) { var processMacros = function(macros) {
var re = gettext_macro.REGEX; var re = gettext_macro.REGEX;
var id, pluralId, name, args, param, key, msg; var id, pluralId, name, args, param, key, msg;
for (let macro of macros) { for each (var macro in macros) {
id = pluralId = null; id = pluralId = null;
name = macro.getName(); name = macro.getName();
param = macro.getNamedParams(); param = macro.getNamedParams();
@ -374,7 +374,7 @@ MessageParser.prototype.parseSkinFile = function(file, encoding) {
if (skin.hasMainskin()) { if (skin.hasMainskin()) {
processMacros(skin.getMacros()); processMacros(skin.getMacros());
} }
for (let name of skin.getSubskinNames()) { for each (var name in skin.getSubskinNames()) {
var subskin = skin.getSubskin(name); var subskin = skin.getSubskin(name);
processMacros(subskin.getMacros()); processMacros(subskin.getMacros());
} }

View file

@ -1,16 +0,0 @@
dependencies {
runtimeOnly 'org.subethamail:subethasmtp-smtp:1.2'
runtimeOnly 'org.subethamail:subethasmtp-wiser:1.2'
}
jar.enabled = false
compileJava.enabled = false
compileTestJava.enabled = false
processResources.enabled = false
processTestResources.enabled = false
test.enabled = false
task deps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'code'
}

View file

@ -1336,7 +1336,7 @@ jala.Test.DatabaseMgr.prototype.startDatabase = function(dbSourceName, copyTable
// collect the table names of all relational prototypes // collect the table names of all relational prototypes
tables = []; tables = [];
var protos = app.getPrototypes(); var protos = app.getPrototypes();
for (let proto of protos) { for each (var proto in protos) {
var dbMap = proto.getDbMapping(); var dbMap = proto.getDbMapping();
if (dbMap.isRelational()) { if (dbMap.isRelational()) {
tables.push(dbMap.getTableName()); tables.push(dbMap.getTableName());

Binary file not shown.

View file

@ -1,50 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"mergeConfidence:all-badges",
"npm:unpublishSafe",
":disableRateLimiting",
":pinVersions",
":semanticCommitsDisabled"
],
"osvVulnerabilityAlerts": true,
"vulnerabilityAlerts": {
"labels": ["security", "urgent"],
"automerge": true
},
"labels": ["dependency"],
"packageRules": [
{
"description": "Label Helma core packages",
"matchFiles": ["build.gradle"],
"addLabels": ["core"]
},
{
"description": "Label major version bumps",
"matchUpdateTypes": ["major"],
"addLabels": ["major"]
},
{
"description": "Label packages required at runtime",
"matchDepTypes": ["dependencies"],
"addLabels": ["runtime"]
},
{
"description": "Group Jetty packages",
"matchPackagePrefixes": ["org.eclipse.jetty"],
"groupName": "Jetty packages"
},
{
"description": "Group Lucene packages",
"matchPackagePrefixes": ["org.apache.lucene"],
"groupName": "Lucene packages"
}
]
}

View file

@ -7,12 +7,3 @@ org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.git/**')
org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.gitignore') org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.gitignore')
include 'launcher' include 'launcher'
include 'modules'
include 'jala'
include 'hopKit'
include 'test'
project(':modules').projectDir = file('modules/helma')
project(':jala').projectDir = file('modules/jala')
project(':hopKit').projectDir = file('modules/jala/util/HopKit')
project(':test').projectDir = file('modules/jala/util/Test')

View file

@ -149,7 +149,7 @@ function testOrder(org, pos) {
function cleanup() { function cleanup() {
var persons = root.persons.list(); var persons = root.persons.list();
for (let person of persons) { for each (var person in persons) {
person.remove(); person.remove();
} }
ikea.remove(); ikea.remove();

View file

@ -86,7 +86,7 @@ function testAdd() {
function cleanup() { function cleanup() {
var persons = org.generic.list(); var persons = org.generic.list();
for (let person of persons) { for each (var person in persons) {
person.remove(); person.remove();
} }
org.remove(); org.remove();

View file

@ -143,7 +143,7 @@ function testGroupTransient() {
function cleanup() { function cleanup() {
var orgs = root.organisations.list(); var orgs = root.organisations.list();
for (let org of orgs) { for each (var org in orgs) {
org.remove(); org.remove();
} }
} }

View file

@ -1,25 +0,0 @@
[Unit]
Description = Helma Object Publisher
After = syslog.target network.target
StartLimitIntervalSec = 0
[Service]
Type = simple
Restart = always
RestartSec = 1
SuccessExitStatus = 143
User = helma
WorkingDirectory = /home/helma
ExecStart = /usr/bin/java -server \
-Dfile.encoding=utf8 \
-Djava.awt.headless=true \
-Xms1024m -Xmx2048m \
-jar launcher.jar \
-w 8080 -x 8081
ExecReload = touch apps.properties && touch server.properties
ExecStop = /bin/kill -15 $MAINPID
[Install]
WantedBy = multi-user.target

View file

@ -6,15 +6,6 @@
# andreas bolka, 2003-11-30 # andreas bolka, 2003-11-30
# #
### BEGIN INIT INFO
# Provides: helma
# Required-Start: postgresql apache2
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-STop: 0 1 6
# Short-Description: Helma Application Server
### END INIT INFO
HELMA_CONFIG=/etc/helma.conf HELMA_CONFIG=/etc/helma.conf
### ###
@ -28,24 +19,22 @@ else
fi fi
# Check for missing files and directories # Check for missing files and directories
if [ ! -x $JAVA_BIN ]; then if [ ! -x $JAVA_BIN ]; then
echo "Config error: JAVA_BIN $JAVA_BIN not found or not executable" echo "Config error: JAVA_BIN $JAVA_BIN not found or not executable"
exit 5 exit 5
fi fi
if [ ! -r $HELMA_INSTALL/launcher.jar ]; then if [ ! -r $HELMA_INSTALL/launcher.jar ]; then
echo "Config error: $HELMA_INSTALL/launcher.jar not found or not readable" echo "Config error: $HELMA_INSTALL/launcher.jar not found or not readable"
exit 5 exit 5
fi fi
if [ ! -d $HELMA_HOME ]; then if [ ! -d $HELMA_HOME ]; then
echo "Config error: HELMA_HOME $HELMA_HOME not found" echo "Config error: HELMA_HOME $HELMA_HOME not found"
exit 5 exit 5
fi fi
RUN_CMD="su - $HELMA_USER" # local settins
RUN_ARGS="-c $JAVA_BIN $JAVA_OPTS -jar $HELMA_INSTALL/launcher.jar -h $HELMA_HOME $HELMA_ARGS" RUN_CMD="sudo -u $HELMA_USER $JAVA_BIN"
RUN_ARGS="$JAVA_OPTS -jar $HELMA_INSTALL/launcher.jar -h $HELMA_HOME $HELMA_ARGS"
case "$1" in case "$1" in
start) start)
@ -57,7 +46,7 @@ case "$1" in
fi fi
cd $HELMA_HOME cd $HELMA_HOME
nohup $RUN_CMD "$RUN_ARGS" > $HELMA_LOG 2>&1 & nohup $RUN_CMD $RUN_ARGS > $HELMA_LOG 2>&1 &
echo $! > $HELMA_PID echo $! > $HELMA_PID
echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) started." echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) started."
;; ;;
@ -92,5 +81,4 @@ case "$1" in
exit 1 exit 1
;; ;;
esac esac
exit 0 exit 0

View file

@ -1,44 +1,72 @@
# ##############################################################
# Helma Object Publisher configuration file ###
# ### Helma object publisher config file
# Authors: ### Author: Hannes Wallnoefer, <hannes@helma.at>
# Hannes Wallnoefer <hannes@helma.at>, ### Author: Andreas Bolka
# Andreas Bolka ###
# ### This file should be placed in /etc/helma.conf.
# This file should be placed in /etc/helma.conf. ### It is read by the Helma service control script,
# It is read by the Helma service control script, ### usually /etc/init.d/helma.
# usually /etc/init.d/helma. ###
# ##############################################################
# Full path to Java executable ##############################################################
JAVA_HOME=/usr/lib/jvm/default-java ### The name of this Helma server/service and the
JAVA_BIN=$JAVA_HOME/bin/java ### pid file to be used
#############################################################
# Options passed to the Java runtime
JAVA_OPTS="-server -Djava.awt.headless=true -Dfile.encoding=utf-8 -Djsse.enableSNIExtension=false"
# The name of this Helma server/service and the pid file to be used
HELMA_SERVICE=helma HELMA_SERVICE=helma
HELMA_PID=/var/run/helma.pid HELMA_PID=/var/run/helma.pid
# Helma install directory. This is where we look for the Helma jar files
# (launcher.jar, lib/* and lib/ext/*)
HELMA_INSTALL=/home/helma
# Helma home directory, in case it is different from the Helma install dir. ##############################################################
# This is where Helma will look for properties files and applications. ### Full path to Java executable
##############################################################
JAVA_HOME=/usr/lib/j2sdk1.5-sun
JAVA_BIN=$JAVA_HOME/bin/java
##############################################################
### Options passed to the Java runtime
##############################################################
JAVA_OPTS="-Djava.awt.headless=true"
##############################################################
### Helma install directory. This is where we look for
### the Helma jar files (launcher.jar, lib/* and lib/ext/*)
##############################################################
HELMA_INSTALL=/usr/local/helma/helma-1.6.x
##############################################################
### Helma home directory, in case it is different from the
### Helma install dir. This is where Helma will look for
### properties files and applications.
##############################################################
HELMA_HOME=$HELMA_INSTALL HELMA_HOME=$HELMA_INSTALL
# The user Helma should be running as
##############################################################
### The user Helma should be running as
##############################################################
HELMA_USER=helma HELMA_USER=helma
# File to which standard and error output from Helma is redirected
##############################################################
### File to which standard and error output from Helma
### is redirected
##############################################################
HELMA_LOG=$HELMA_HOME/log/helma-out.log HELMA_LOG=$HELMA_HOME/log/helma-out.log
# Helma options. Possible options are:
# -f file - Location of server.properties file ##############################################################
# -p port - RMI port ### Helma options. Possible options are:
# -w port - Web server port ###
# -x port - XML-RPC port ### -f file Specify server.properties file
# -jk port - AJP13 port ### -p port Specify RMI port number
### -w port Specify port number for embedded Web server
### -x port Specify XML-RPC port number
### -jk port Specify AJP13 port number
###
##############################################################
HELMA_ARGS="-w 8080" HELMA_ARGS="-w 8080"

View file

@ -24,13 +24,15 @@ import javax.servlet.http.Cookie;
* of an HTTP cookie. * of an HTTP cookie.
*/ */
public final class CookieTrans implements Serializable { public final class CookieTrans implements Serializable {
private String name; private static final long serialVersionUID = 1811202114296536258L;
private String value;
private String path; String name;
private String domain; String value;
private boolean isHttpOnly = true; String path;
private boolean isSecure = false; String domain;
private int days = -1; int days = -1;
boolean secure;
boolean httpOnly;
CookieTrans(String name, String value) { CookieTrans(String name, String value) {
this.name = name; this.name = name;
@ -53,15 +55,9 @@ public final class CookieTrans implements Serializable {
this.domain = domain; this.domain = domain;
} }
void setHttpOnly(boolean isHttpOnly) {
this.isHttpOnly = isHttpOnly;
}
void setSecure(boolean isSecure) {
this.isSecure = isSecure;
}
/** /**
*
*
* @return ... * @return ...
*/ */
public String getName() { public String getName() {
@ -69,6 +65,8 @@ public final class CookieTrans implements Serializable {
} }
/** /**
*
*
* @return ... * @return ...
*/ */
public String getValue() { public String getValue() {
@ -76,6 +74,8 @@ public final class CookieTrans implements Serializable {
} }
/** /**
*
*
* @return ... * @return ...
*/ */
public int getDays() { public int getDays() {
@ -83,6 +83,8 @@ public final class CookieTrans implements Serializable {
} }
/** /**
*
*
* @return ... * @return ...
*/ */
public String getPath() { public String getPath() {
@ -90,24 +92,28 @@ public final class CookieTrans implements Serializable {
} }
/** /**
*
*
* @return ... * @return ...
*/ */
public String getDomain() { public String getDomain() {
return domain; return domain;
} }
/** public boolean isSecure() {
* @return ... return secure;
*/
public boolean getHttpOnly() {
return isHttpOnly;
} }
/** void isSecure(boolean secure) {
* @return ... this.secure = secure;
*/ }
public boolean getSecure() {
return isSecure; public boolean isHttpOnly() {
return httpOnly;
}
void isHttpOnly(boolean httpOnly) {
this.httpOnly = httpOnly;
} }
/** /**
@ -141,8 +147,8 @@ public final class CookieTrans implements Serializable {
c.setDomain(defaultDomain); c.setDomain(defaultDomain);
} }
c.setHttpOnly(isHttpOnly); c.setHttpOnly(httpOnly);
c.setSecure(isSecure); c.setSecure(secure);
return c; return c;
} }

View file

@ -143,7 +143,7 @@ public class ResponseBean implements Serializable {
* @param value the cookie value * @param value the cookie value
*/ */
public void setCookie(String key, String value) { public void setCookie(String key, String value) {
res.setCookie(key, value, -1, null, null, true, false); res.setCookie(key, value, -1, null, null);
} }
/** /**
@ -156,7 +156,7 @@ public class ResponseBean implements Serializable {
* @param days number of days the cookie should be stored * @param days number of days the cookie should be stored
*/ */
public void setCookie(String key, String value, int days) { public void setCookie(String key, String value, int days) {
res.setCookie(key, value, days, null, null, true, false); res.setCookie(key, value, days, null, null);
} }
/** /**
@ -171,42 +171,7 @@ public class ResponseBean implements Serializable {
* @param path the URL path to apply the cookie to * @param path the URL path to apply the cookie to
*/ */
public void setCookie(String key, String value, int days, String path) { public void setCookie(String key, String value, int days, String path) {
res.setCookie(key, value, days, path, null, true, false); res.setCookie(key, value, days, path, null);
}
/**
* Set a HTTP cookie with the name and value that is only applied to
* the URLs matching the given path and is stored by the
* HTTP client for the given number of days. A days value of 0 means the
* cookie should be immediately discarded.
*
* @param key the cookie name
* @param value the cookie value
* @param days number of days the cookie should be stored
* @param path the URL path to apply the cookie to
* @param domain domain
* @param isHttpOnly marks the cookie as HttpOnly
*/
public void setCookie(String key, String value, int days, String path, String domain, boolean isHttpOnly) {
res.setCookie(key, value, days, path, domain, isHttpOnly, false);
}
/**
* Set a HTTP cookie with the name and value that is only applied to
* the URLs matching the given path and is stored by the
* HTTP client for the given number of days. A days value of 0 means the
* cookie should be immediately discarded.
*
* @param key the cookie name
* @param value the cookie value
* @param days number of days the cookie should be stored
* @param path the URL path to apply the cookie to
* @param domain domain
* @param isHttpOnly marks the cookie as HttpOnly
* @param isSecure limits the cookie to secure protocols
*/
public void setCookie(String key, String value, int days, String path, String domain, boolean isHttpOnly, boolean isSecure) {
res.setCookie(key, value, days, path, domain, isHttpOnly, isSecure);
} }
/** /**
@ -222,7 +187,7 @@ public class ResponseBean implements Serializable {
* @param domain domain * @param domain domain
*/ */
public void setCookie(String key, String value, int days, String path, String domain) { public void setCookie(String key, String value, int days, String path, String domain) {
res.setCookie(key, value, days, path, domain, true, false); res.setCookie(key, value, days, path, domain);
} }
/** /**
@ -232,7 +197,7 @@ public class ResponseBean implements Serializable {
* @param key the name of the cookie to be discarded * @param key the name of the cookie to be discarded
*/ */
public void unsetCookie(String key) { public void unsetCookie(String key) {
res.setCookie(key, "", 0, null, null, true, false); res.setCookie(key, "", 0, null, null);
} }
/** /**
@ -280,9 +245,9 @@ public class ResponseBean implements Serializable {
} }
/** /**
* add HTML formatted debug messages to the end of the page. * add an HTML formatted debug message to the end of the page.
* *
* @param messages the list of messages * @param message the message
*/ */
public void debug(String... messages) { public void debug(String... messages) {
if (messages == null) { if (messages == null) {

View file

@ -384,7 +384,7 @@ public final class ResponseTrans extends Writer implements Serializable {
} }
/** /**
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing * Replace special characters with entities, including <, > and ", thus allowing
* no HTML tags. * no HTML tags.
*/ */
public synchronized void encode(Object what) { public synchronized void encode(Object what) {
@ -415,7 +415,7 @@ public final class ResponseTrans extends Writer implements Serializable {
} }
/** /**
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing * Replace special characters with entities, including <, > and ", thus allowing
* no HTML tags. * no HTML tags.
*/ */
public synchronized void encodeXml(Object what) { public synchronized void encodeXml(Object what) {
@ -974,10 +974,8 @@ public final class ResponseTrans extends Writer implements Serializable {
* @param days the cookie's lifespan in days * @param days the cookie's lifespan in days
* @param path the URL path to apply the cookie to * @param path the URL path to apply the cookie to
* @param domain the domain to apply the cookie to * @param domain the domain to apply the cookie to
* @param isHttpOnly marks the cookie as HttpOnly
* @param isSecure limits the cookie for use with secure protocols
*/ */
public void setCookie(String key, String value, int days, String path, String domain, boolean isHttpOnly, boolean isSecure) { public void setCookie(String key, String value, int days, String path, String domain) {
CookieTrans c = null; CookieTrans c = null;
if (cookies == null) { if (cookies == null) {
@ -1003,11 +1001,11 @@ public final class ResponseTrans extends Writer implements Serializable {
c.setDomain(domain); c.setDomain(domain);
if (!"false".equalsIgnoreCase(app.getProperty("cookies.httpOnly"))) { if (!"false".equalsIgnoreCase(app.getProperty("cookies.httpOnly"))) {
c.setHttpOnly(true); c.isHttpOnly(true);
} }
if ("true".equalsIgnoreCase(app.getProperty("cookies.secure"))) { if ("true".equalsIgnoreCase(app.getProperty("cookies.secure"))) {
c.setSecure(true); c.isSecure(true);
} }
} }

View file

@ -192,7 +192,7 @@ public final class TypeManager {
long lastScan = lastRepoScan.containsKey(repository) ? long lastScan = lastRepoScan.containsKey(repository) ?
((Long) lastRepoScan.get(repository)).longValue() : 0; ((Long) lastRepoScan.get(repository)).longValue() : 0;
if (repository.lastModified() != lastScan) { if (repository.lastModified() != lastScan) {
lastRepoScan.put(repository, Long.valueOf(repository.lastModified())); lastRepoScan.put(repository, new Long(repository.lastModified()));
checkRepository(repository, false); checkRepository(repository, false);
} }
} }

View file

@ -514,7 +514,7 @@ public class ImageWrapper {
/** /**
* Reduces the colors used in the image. Necessary before saving as GIF. * Reduces the colors used in the image. Necessary before saving as GIF.
* *
* @param colors colors the number of colors to use, usually {@literal <}= 256. * @param colors colors the number of colors to use, usually <= 256.
*/ */
public void reduceColors(int colors) { public void reduceColors(int colors) {
reduceColors(colors, false); reduceColors(colors, false);
@ -523,7 +523,7 @@ public class ImageWrapper {
/** /**
* Reduces the colors used in the image. Necessary before saving as GIF. * Reduces the colors used in the image. Necessary before saving as GIF.
* *
* @param colors colors the number of colors to use, usually {@literal <}= 256. * @param colors colors the number of colors to use, usually <= 256.
* @param dither ... * @param dither ...
*/ */
public void reduceColors(int colors, boolean dither) { public void reduceColors(int colors, boolean dither) {
@ -534,7 +534,7 @@ public class ImageWrapper {
* Reduce the colors used in this image. Useful and necessary before saving * Reduce the colors used in this image. Useful and necessary before saving
* the image as GIF file. * the image as GIF file.
* *
* @param colors the number of colors to use, usually {@literal <}= 256. * @param colors the number of colors to use, usually <= 256.
* @param dither ... * @param dither ...
* @param alphaToBitmask ... * @param alphaToBitmask ...
*/ */

View file

@ -473,10 +473,10 @@ public class ApplicationManager implements XmlRpcHandler {
} }
// bind to Jetty HTTP server // bind to Jetty HTTP server
if (jetty != null) { if (ApplicationManager.this.jetty != null) {
if (context == null) { if(ApplicationManager.this.context == null) {
context = new ContextHandlerCollection(); ApplicationManager.this.context = new ContextHandlerCollection();
jetty.getHttpServer().setHandler(context); ApplicationManager.this.jetty.getHttpServer().setHandler(ApplicationManager.this.context);
} }
// if there is a static direcory specified, mount it // if there is a static direcory specified, mount it
@ -501,8 +501,9 @@ public class ApplicationManager implements XmlRpcHandler {
Class servletClass = servletClassName == null ? Class servletClass = servletClassName == null ?
EmbeddedServletClient.class : Class.forName(servletClassName); EmbeddedServletClient.class : Class.forName(servletClassName);
ServletHolder holder = new ServletHolder(servletClass); ServletHolder holder = new ServletHolder(servletClass);
holder.setInitParameter("application", appName); appContext.addServlet(holder, "/*"); //$NON-NLS-1$
appContext.addServlet(holder, "/*");
holder.setInitParameter("application", appName); //$NON-NLS-1$
if (this.cookieDomain != null) { if (this.cookieDomain != null) {
holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$ holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$
@ -528,9 +529,9 @@ public class ApplicationManager implements XmlRpcHandler {
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$ holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
} }
if (protectedStaticDir != null) { if (this.protectedStaticDir != null) {
File protectedContent = getAbsoluteFile(protectedStaticDir); File protectedContent = getAbsoluteFile(this.protectedStaticDir);
appContext.setResourceBase(protectedContent.getPath()); this.appContext.setResourceBase(protectedContent.getPath());
getLogger().info("Serving protected static from " + getLogger().info("Serving protected static from " +
protectedContent.getPath()); protectedContent.getPath());
} }

View file

@ -76,13 +76,13 @@ public final class TransientProperty implements IProperty, Serializable {
return svalue; return svalue;
case BOOLEAN: case BOOLEAN:
return Boolean.valueOf(bvalue); return new Boolean(bvalue);
case INTEGER: case INTEGER:
return Long.valueOf(lvalue); return new Long(lvalue);
case FLOAT: case FLOAT:
return Double.valueOf(dvalue); return new Double(dvalue);
case DATE: case DATE:
return new Date(lvalue); return new Date(lvalue);

View file

@ -93,7 +93,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
break; break;
case INTEGER: case INTEGER:
value = Long.valueOf(in.readLong()); value = new Long(in.readLong());
break; break;
@ -103,7 +103,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
break; break;
case FLOAT: case FLOAT:
value = Double.valueOf(in.readDouble()); value = new Double(in.readDouble());
break; break;
@ -231,7 +231,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
*/ */
public void setIntegerValue(long l) { public void setIntegerValue(long l) {
type = INTEGER; type = INTEGER;
value = Long.valueOf(l); value = new Long(l);
dirty = true; dirty = true;
} }
@ -242,7 +242,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
*/ */
public void setFloatValue(double d) { public void setFloatValue(double d) {
type = FLOAT; type = FLOAT;
value = Double.valueOf(d); value = new Double(d);
dirty = true; dirty = true;
} }

View file

@ -240,7 +240,7 @@ public class Transactor {
public void registerConnection(DbSource src, Connection con) { public void registerConnection(DbSource src, Connection con) {
sqlConnections.put(src, con); sqlConnections.put(src, con);
// we assume a freshly created connection is ok. // we assume a freshly created connection is ok.
testedConnections.put(src, Long.valueOf(System.currentTimeMillis())); testedConnections.put(src, new Long(System.currentTimeMillis()));
} }
/** /**
@ -262,7 +262,7 @@ public class Transactor {
stmt.execute("SELECT 1"); stmt.execute("SELECT 1");
} }
stmt.close(); stmt.close();
testedConnections.put(src, Long.valueOf(now)); testedConnections.put(src, new Long(now));
} catch (SQLException sx) { } catch (SQLException sx) {
try { try {
con.close(); con.close();

View file

@ -225,9 +225,9 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
prop.setStringValue(charValue); prop.setStringValue(charValue);
} }
} else if ("float".equals(elementType)) { } else if ("float".equals(elementType)) {
prop.setFloatValue((Double.valueOf(charValue)).doubleValue()); prop.setFloatValue((new Double(charValue)).doubleValue());
} else if ("integer".equals(elementType)) { } else if ("integer".equals(elementType)) {
prop.setIntegerValue((Long.valueOf(charValue)).longValue()); prop.setIntegerValue((new Long(charValue)).longValue());
} else { } else {
prop.setStringValue(charValue); prop.setStringValue(charValue);
} }

View file

@ -299,9 +299,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
currentNode.setString(elementName, charValue); currentNode.setString(elementName, charValue);
} }
} else if ("float".equals(elementType)) { } else if ("float".equals(elementType)) {
currentNode.setFloat(elementName, (Double.valueOf(charValue)).doubleValue()); currentNode.setFloat(elementName, (new Double(charValue)).doubleValue());
} else if ("integer".equals(elementType)) { } else if ("integer".equals(elementType)) {
currentNode.setInteger(elementName, (Long.valueOf(charValue)).longValue()); currentNode.setInteger(elementName, (new Long(charValue)).longValue());
} else { } else {
currentNode.setString(elementName, charValue); currentNode.setString(elementName, charValue);
} }

View file

@ -879,7 +879,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
if (d == null) { if (d == null) {
return null; return null;
} else { } else {
Object[] args = { Long.valueOf(d.getTime()) }; Object[] args = { new Long(d.getTime()) };
try { try {
return cx.newObject(core.global, "Date", args); return cx.newObject(core.global, "Date", args);
} catch (JavaScriptException nafx) { } catch (JavaScriptException nafx) {

View file

@ -100,7 +100,7 @@ public final class JSAdapter implements Scriptable, Function {
public Object get(int index, Scriptable start) { public Object get(int index, Scriptable start) {
Function func = getAdapteeFunction(GET_PROP); Function func = getAdapteeFunction(GET_PROP);
if (func != null) { if (func != null) {
return call(func, new Object[] { Integer.valueOf(index) }); return call(func, new Object[] { new Integer(index) });
} else { } else {
start = getAdaptee(); start = getAdaptee();
return start.get(index, start); return start.get(index, start);
@ -121,7 +121,7 @@ public final class JSAdapter implements Scriptable, Function {
public boolean has(int index, Scriptable start) { public boolean has(int index, Scriptable start) {
Function func = getAdapteeFunction(HAS_PROP); Function func = getAdapteeFunction(HAS_PROP);
if (func != null) { if (func != null) {
Object res = call(func, new Object[] { Integer.valueOf(index) }); Object res = call(func, new Object[] { new Integer(index) });
return Context.toBoolean(res); return Context.toBoolean(res);
} else { } else {
start = getAdaptee(); start = getAdaptee();
@ -147,7 +147,7 @@ public final class JSAdapter implements Scriptable, Function {
if (start == this) { if (start == this) {
Function func = getAdapteeFunction(PUT_PROP); Function func = getAdapteeFunction(PUT_PROP);
if( func != null) { if( func != null) {
call(func, new Object[] { Integer.valueOf(index), value }); call(func, new Object[] { new Integer(index), value });
} else { } else {
start = getAdaptee(); start = getAdaptee();
start.put(index, start, value); start.put(index, start, value);
@ -169,7 +169,7 @@ public final class JSAdapter implements Scriptable, Function {
public void delete(int index) { public void delete(int index) {
Function func = getAdapteeFunction(DEL_PROP); Function func = getAdapteeFunction(DEL_PROP);
if (func != null) { if (func != null) {
call(func, new Object[] { Integer.valueOf(index) }); call(func, new Object[] { new Integer(index) });
} else { } else {
getAdaptee().delete(index); getAdaptee().delete(index);
} }
@ -296,7 +296,7 @@ public final class JSAdapter implements Scriptable, Function {
// map a property id. Property id can only be an Integer or String // map a property id. Property id can only be an Integer or String
private Object mapToId(Object tmp) { private Object mapToId(Object tmp) {
if (tmp instanceof Double) { if (tmp instanceof Double) {
return Integer.valueOf(((Double)tmp).intValue()); return new Integer(((Double)tmp).intValue());
} else { } else {
return Context.toString(tmp); return Context.toString(tmp);
} }

View file

@ -106,7 +106,7 @@ public class PathWrapper extends ScriptableObject {
Object[] ids = new Object[path.size()]; Object[] ids = new Object[path.size()];
for (int i=0; i<ids.length; i++) { for (int i=0; i<ids.length; i++) {
ids[i] = Integer.valueOf(i); ids[i] = new Integer(i);
} }
return ids; return ids;

View file

@ -93,8 +93,8 @@ public final class RhinoCore implements ScopeProvider {
// optimization level for rhino engine, ranges from -1 to 9 // optimization level for rhino engine, ranges from -1 to 9
int optLevel = 0; int optLevel = 0;
// language version - default to ES6 // language version - default to JS 1.8
int languageVersion = 200; int languageVersion = 180;
// debugger/tracer flags // debugger/tracer flags
boolean hasDebugger = false; boolean hasDebugger = false;
@ -569,7 +569,7 @@ public final class RhinoCore implements ScopeProvider {
return arg; return arg;
if (arg instanceof Date) { if (arg instanceof Date) {
Date d = (Date) arg; Date d = (Date) arg;
Object[] args = { Long.valueOf(d.getTime()) }; Object[] args = { new Long(d.getTime()) };
return Context.getCurrentContext().newObject(global, "Date", args); return Context.getCurrentContext().newObject(global, "Date", args);
} }
return Context.toObject(arg, global); return Context.toObject(arg, global);
@ -618,9 +618,9 @@ public final class RhinoCore implements ScopeProvider {
} else if (arg instanceof Number) { } else if (arg instanceof Number) {
Number n = (Number) arg; Number n = (Number) arg;
if (arg instanceof Float || arg instanceof Long) { if (arg instanceof Float || arg instanceof Long) {
return Double.valueOf(n.doubleValue()); return new Double(n.doubleValue());
} else if (!(arg instanceof Double)) { } else if (!(arg instanceof Double)) {
return Integer.valueOf(n.intValue()); return new Integer(n.intValue());
} }
} else if (arg instanceof INode) { } else if (arg instanceof INode) {
// interpret HopObject as object/dict // interpret HopObject as object/dict
@ -1146,7 +1146,7 @@ public final class RhinoCore implements ScopeProvider {
// Convert java.util.Date objects to JavaScript Dates // Convert java.util.Date objects to JavaScript Dates
if (obj instanceof Date) { if (obj instanceof Date) {
Object[] args = { Long.valueOf(((Date) obj).getTime()) }; Object[] args = { new Long(((Date) obj).getTime()) };
try { try {
return cx.newObject(global, "Date", args); return cx.newObject(global, "Date", args);
} catch (JavaScriptException nafx) { } catch (JavaScriptException nafx) {

View file

@ -106,7 +106,7 @@ public class Profiler implements Debugger {
Scriptable thisObj, Object[] args) { Scriptable thisObj, Object[] args) {
long time = System.nanoTime(); long time = System.nanoTime();
timer.push(Long.valueOf(time)); timer.push(new Long(time));
} }
/** /**

View file

@ -216,23 +216,6 @@ public class DatabaseObject {
} }
} }
public RowSet executePreparedRetrieval(PreparedStatement statement) {
ResultSet resultSet = null;
try {
resultSet = statement.executeQuery();
return new RowSet(statement.toString(), this, statement, resultSet);
} catch (SQLException e) {
lastError = e;
try {
if (statement != null) statement.close();
} catch (Exception ignored) {
}
statement = null;
return null;
}
}
public int executeCommand(String sql) { public int executeCommand(String sql) {
int count = 0; int count = 0;
@ -456,7 +439,7 @@ public class DatabaseObject {
// First return system or or prototype properties // First return system or or prototype properties
if (propertyName.equals("length")) { if (propertyName.equals("length")) {
return Integer.valueOf(colNames.size()); return new Integer(colNames.size());
} else { } else {
if (resultSet == null) { if (resultSet == null) {
lastError = new SQLException("Attempt to access a released result set"); lastError = new SQLException("Attempt to access a released result set");
@ -515,12 +498,12 @@ public class DatabaseObject {
case Types.BIGINT: case Types.BIGINT:
case Types.SMALLINT: case Types.SMALLINT:
case Types.INTEGER: case Types.INTEGER:
return Long.valueOf(resultSet.getLong(index)); return new Long(resultSet.getLong(index));
case Types.REAL: case Types.REAL:
case Types.FLOAT: case Types.FLOAT:
case Types.DOUBLE: case Types.DOUBLE:
return Double.valueOf(resultSet.getDouble(index)); return new Double(resultSet.getDouble(index));
case Types.DECIMAL: case Types.DECIMAL:
case Types.NUMERIC: case Types.NUMERIC:
@ -530,9 +513,9 @@ public class DatabaseObject {
} }
if (num.scale() > 0) { if (num.scale() > 0) {
return Double.valueOf(num.doubleValue()); return new Double(num.doubleValue());
} else { } else {
return Long.valueOf(num.longValue()); return new Long(num.longValue());
} }
case Types.VARBINARY: case Types.VARBINARY:

View file

@ -554,13 +554,8 @@ public abstract class AbstractServletClient extends HttpServlet {
// If protected session cookies are enabled we also force a new session // If protected session cookies are enabled we also force a new session
// if the existing session id doesn't match the client's ip address // if the existing session id doesn't match the client's ip address
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
String ip = request.getHeader("X-Forwarded-For");
if (ip != null && ip.length() != 0) {
addIPAddress(buffer, ip);
} else {
addIPAddress(buffer, request.getRemoteAddr()); addIPAddress(buffer, request.getRemoteAddr());
} addIPAddress(buffer, request.getHeader("X-Forwarded-For"));
// Not sure, if this line can be removed
addIPAddress(buffer, request.getHeader("Client-ip")); addIPAddress(buffer, request.getHeader("Client-ip"));
if (reqtrans.getSession() == null || !reqtrans.getSession().startsWith(buffer.toString())) { if (reqtrans.getSession() == null || !reqtrans.getSession().startsWith(buffer.toString())) {
createSession(response, buffer.toString(), reqtrans, domain); createSession(response, buffer.toString(), reqtrans, domain);
@ -753,7 +748,7 @@ public abstract class AbstractServletClient extends HttpServlet {
* <strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed * <strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed
* individually on the parsed name and value elements, rather than on * individually on the parsed name and value elements, rather than on
* the entire query string ahead of time, to properly deal with the case * the entire query string ahead of time, to properly deal with the case
* where the name or value includes an encoded {@code =} or {@code &} character * where the name or value includes an encoded "=" or "&" character
* that would otherwise be interpreted as a delimiter. * that would otherwise be interpreted as a delimiter.
* *
* NOTE: byte array data is modified by this method. Caller beware. * NOTE: byte array data is modified by this method. Caller beware.

View file

@ -450,27 +450,27 @@ public class CronJob {
cal.setTime(date); cal.setTime(date);
// try and short-circuit as fast as possible. // try and short-circuit as fast as possible.
Integer theYear = Integer.valueOf(cal.get(Calendar.YEAR)); Integer theYear = new Integer(cal.get(Calendar.YEAR));
if (!year.contains(ALL_VALUE) && !year.contains(theYear)) if (!year.contains(ALL_VALUE) && !year.contains(theYear))
return false; return false;
Integer theMonth = Integer.valueOf(cal.get(Calendar.MONTH)); Integer theMonth = new Integer(cal.get(Calendar.MONTH));
if (!month.contains(ALL_VALUE) && !month.contains(theMonth)) if (!month.contains(ALL_VALUE) && !month.contains(theMonth))
return false; return false;
Integer theDay = Integer.valueOf(cal.get(Calendar.DAY_OF_MONTH)); Integer theDay = new Integer(cal.get(Calendar.DAY_OF_MONTH));
if (!day.contains(ALL_VALUE) && !day.contains(theDay)) if (!day.contains(ALL_VALUE) && !day.contains(theDay))
return false; return false;
Integer theWeekDay = Integer.valueOf(cal.get(Calendar.DAY_OF_WEEK)); Integer theWeekDay = new Integer(cal.get(Calendar.DAY_OF_WEEK));
if (!weekday.contains(ALL_VALUE) && !weekday.contains(theWeekDay)) if (!weekday.contains(ALL_VALUE) && !weekday.contains(theWeekDay))
return false; return false;
Integer theHour = Integer.valueOf(cal.get(Calendar.HOUR_OF_DAY)); Integer theHour = new Integer(cal.get(Calendar.HOUR_OF_DAY));
if (!hour.contains(ALL_VALUE) && !hour.contains(theHour)) if (!hour.contains(ALL_VALUE) && !hour.contains(theHour))
return false; return false;
Integer theMinute = Integer.valueOf(cal.get(Calendar.MINUTE)); Integer theMinute = new Integer(cal.get(Calendar.MINUTE));
if (!minute.contains(ALL_VALUE) && !minute.contains(theMinute)) if (!minute.contains(ALL_VALUE) && !minute.contains(theMinute))
return false; return false;
@ -484,7 +484,7 @@ public class CronJob {
public void addYear(int year) public void addYear(int year)
{ {
this.year.remove(ALL_VALUE); this.year.remove(ALL_VALUE);
this.year.add(Integer.valueOf(year)); this.year.add(new Integer(year));
} }
/** /**
@ -492,7 +492,7 @@ public class CronJob {
*/ */
public void removeYear(int year) public void removeYear(int year)
{ {
this.year.remove(Integer.valueOf(year)); this.year.remove(new Integer(year));
} }
/** /**
@ -520,7 +520,7 @@ public class CronJob {
public void addMonth(int month) public void addMonth(int month)
{ {
this.month.remove(ALL_VALUE); this.month.remove(ALL_VALUE);
this.month.add(Integer.valueOf(month)); this.month.add(new Integer(month));
} }
/** /**
@ -530,7 +530,7 @@ public class CronJob {
*/ */
public void removeMonth(int month) public void removeMonth(int month)
{ {
this.month.remove(Integer.valueOf(month)); this.month.remove(new Integer(month));
} }
/** /**
@ -556,7 +556,7 @@ public class CronJob {
public void addDay(int day) public void addDay(int day)
{ {
this.day.remove(ALL_VALUE); this.day.remove(ALL_VALUE);
this.day.add(Integer.valueOf(day)); this.day.add(new Integer(day));
} }
/** /**
@ -564,7 +564,7 @@ public class CronJob {
*/ */
public void removeDay(int day) public void removeDay(int day)
{ {
this.day.remove(Integer.valueOf(day)); this.day.remove(new Integer(day));
} }
/** /**
@ -592,7 +592,7 @@ public class CronJob {
public void addWeekday(int weekday) public void addWeekday(int weekday)
{ {
this.weekday.remove(ALL_VALUE); this.weekday.remove(ALL_VALUE);
this.weekday.add(Integer.valueOf(weekday)); this.weekday.add(new Integer(weekday));
} }
/** /**
@ -602,7 +602,7 @@ public class CronJob {
*/ */
public void removeWeekday(int weekday) public void removeWeekday(int weekday)
{ {
this.weekday.remove(Integer.valueOf(weekday)); this.weekday.remove(new Integer(weekday));
} }
/** /**
@ -628,7 +628,7 @@ public class CronJob {
public void addHour(int hour) public void addHour(int hour)
{ {
this.hour.remove(ALL_VALUE); this.hour.remove(ALL_VALUE);
this.hour.add(Integer.valueOf(hour)); this.hour.add(new Integer(hour));
} }
/** /**
@ -636,7 +636,7 @@ public class CronJob {
*/ */
public void removeHour(int hour) public void removeHour(int hour)
{ {
this.hour.remove(Integer.valueOf(hour)); this.hour.remove(new Integer(hour));
} }
/** /**
@ -662,7 +662,7 @@ public class CronJob {
public void addMinute(int minute) public void addMinute(int minute)
{ {
this.minute.remove(ALL_VALUE); this.minute.remove(ALL_VALUE);
this.minute.add(Integer.valueOf(minute)); this.minute.add(new Integer(minute));
} }
/** /**
@ -670,7 +670,7 @@ public class CronJob {
*/ */
public void removeMinute(int minute) public void removeMinute(int minute)
{ {
this.minute.remove(Integer.valueOf(minute)); this.minute.remove(new Integer(minute));
} }
/** /**

View file

@ -127,7 +127,7 @@ public final class HtmlEncoder {
/** /**
* Do "smart" encodging on a string. This means that valid HTML entities and tags, * Do "smart" encodging on a string. This means that valid HTML entities and tags,
* Helma macros and HTML comments are passed through unescaped, while * Helma macros and HTML comments are passed through unescaped, while
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities. * other occurrences of '<', '>' and '&' are encoded to HTML entities.
*/ */
public final static String encode(String str) { public final static String encode(String str) {
if (str == null) { if (str == null) {
@ -151,7 +151,7 @@ public final class HtmlEncoder {
/** /**
* Do "smart" encodging on a string. This means that valid HTML entities and tags, * Do "smart" encodging on a string. This means that valid HTML entities and tags,
* Helma macros and HTML comments are passed through unescaped, while * Helma macros and HTML comments are passed through unescaped, while
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities. * other occurrences of '<', '>' and '&' are encoded to HTML entities.
*/ */
public final static void encode(String str, StringBuffer ret) { public final static void encode(String str, StringBuffer ret) {
encode(str, ret, false, null); encode(str, ret, false, null);
@ -160,7 +160,7 @@ public final class HtmlEncoder {
/** /**
* Do "smart" encodging on a string. This means that valid HTML entities and tags, * Do "smart" encodging on a string. This means that valid HTML entities and tags,
* Helma macros and HTML comments are passed through unescaped, while * Helma macros and HTML comments are passed through unescaped, while
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities. * other occurrences of '<', '>' and '&' are encoded to HTML entities.
* *
* @param str the string to encode * @param str the string to encode
* @param ret the string buffer to encode to * @param ret the string buffer to encode to