Compare commits
233 commits
Author | SHA1 | Date | |
---|---|---|---|
38181e8e00 | |||
8adbd23569 | |||
e3a7732837 | |||
d9d3c9b863 | |||
808bc48ab9 | |||
6ebdd6aa31 | |||
2ff29317e5 | |||
84333d05cd | |||
3a8997ca5c | |||
8212600d40 | |||
1bb5a093da | |||
2c6dd96cd7 | |||
6f6ea55b7b | |||
b1a14ad87b | |||
d1ead6e081 | |||
94557dd28e | |||
5bfcd0b6ea | |||
70337bda40 | |||
ff4b4b0f07 | |||
156db3ee98 | |||
45adacd5cd | |||
dd9e473310 | |||
e2e67cf2cc | |||
f7add5ec47 | |||
0fc7d91348 | |||
1341c241bd | |||
6d355fc5bd | |||
d18513fb76 | |||
d10f8d6d90 | |||
66fa98353e | |||
c2b37a8243 | |||
0c9b00dbb1 | |||
c1e9371f6b | |||
3284a1ca19 | |||
cbb6599ce0 | |||
49c1be97bb | |||
31bdcc6c27 | |||
bdd4f7e280 | |||
154a4a916a | |||
|
28887aaccd | ||
a00e2f730a | |||
9c2c603d4a | |||
b0260259ea | |||
|
d3098c892f | ||
a5fa58dc3d | |||
20ea2a8fb9 | |||
de34e49fc0 | |||
f7fe09a294 | |||
|
4ebbcb01ae | ||
|
e93c501149 | ||
|
3809198380 | ||
|
65ac2df0ba | ||
|
12e7f298ad | ||
3365a2ef58 | |||
44f2375749 | |||
|
a975930192 | ||
|
a54b27c4aa | ||
608fd695c4 | |||
87675fd6cd | |||
efb7ad89b3 | |||
5de4616df0 | |||
bd70d2fb62 | |||
0f8bace3dd | |||
c1ad40ef72 | |||
6b694a83ed | |||
79b7e8092b | |||
196794cd93 | |||
ed56cf72f7 | |||
3a9c14898b | |||
82c32bb448 | |||
def303c069 | |||
64bcb63e4a | |||
55dbc0359c | |||
f2feef4332 | |||
14ccdf0691 | |||
4ae840d3c9 | |||
132f8f4d7d | |||
048cdc39f5 | |||
|
6d7774fd2e | ||
0e8ce1d7a7 | |||
57642f6f10 | |||
dd0bdc62ec | |||
|
656a023b27 | ||
7c52b6ba46 | |||
47f7b19fe9 | |||
ebf9b22f55 | |||
399f81c1dc | |||
d02dd85a45 | |||
0bfa585cb9 | |||
8ffb7b0b08 | |||
a68c478dd5 | |||
77ea53d949 | |||
2ff75f7879 | |||
052bfc0db1 | |||
63c5aec4df | |||
cfbfea51d7 | |||
bca560e577 | |||
7f8c776c57 | |||
7fa9b805d6 | |||
|
2ecd5b4e36 | ||
d23268095a | |||
daf8da61b1 | |||
db4dfd0ba7 | |||
f0ac6cdb5f | |||
d7f9882596 | |||
d6b7c97518 | |||
|
b984877877 | ||
1a1b676604 | |||
46dd4a2c31 | |||
|
ee2384f35a | ||
d25b8d207e | |||
f4cd065c59 | |||
4b7f3b216d | |||
23f09d2d4f | |||
|
b6ed068e26 | ||
e96c224abc | |||
|
519adc3d37 | ||
|
7d57badb94 | ||
|
b0e319f3dd | ||
b8abe5a355 | |||
7fa3f48cff | |||
d64ca1c7a8 | |||
eae2848e9e | |||
581b17bc72 | |||
ab116b2af9 | |||
d7ab9ff461 | |||
|
fd15c4703f | ||
5e1435433a | |||
958a3c1cfc | |||
5a4ad8eeda | |||
54b9002bf4 | |||
2e45fa4b6a | |||
0fec3244e3 | |||
|
aafd5f8a4c | ||
752e4a0df7 | |||
bf29398ade | |||
|
7555411cdc | ||
2f34fb5e05 | |||
6eb1feb5cd | |||
6eaf097aef | |||
|
48ddd69f19 | ||
|
0223cb4ffe | ||
|
1fa13b9fef | ||
3ccf0af87b | |||
0774054470 | |||
e6a893a52e | |||
|
50ef602d42 | ||
2cff9188cb | |||
1540c5d24f | |||
|
db966fb4e8 | ||
b04b1cf4bf | |||
d2e09554cd | |||
647ca18d7b | |||
a580f08c17 | |||
94d6b2d1a1 | |||
d80ad0bf33 | |||
|
dbb0b6bcfd | ||
|
d419342ee9 | ||
a7ee467cdc | |||
b812b33213 | |||
0e8f04c0f5 | |||
d601ec689d | |||
6d5288f94b | |||
7eae3ba273 | |||
796a6e7337 | |||
|
4ca91f5b2e | ||
|
fb4b11a426 | ||
|
7fbad44166 | ||
e61b654238 | |||
a19eb278c7 | |||
6701ac8095 | |||
1b4624d437 | |||
5bd6e521ce | |||
|
090afa9656 | ||
|
6c61b9a02b | ||
58d893f044 | |||
ec67204d51 | |||
a692d7718c | |||
08a5233bc6 | |||
6a3a90c4f4 | |||
5fe68aef81 | |||
db2ebbed9c | |||
9a0cf1a22d | |||
|
276290add0 | ||
832a9069f1 | |||
f78e37905c | |||
|
4bee79eca7 | ||
411b9198e4 | |||
|
524578e8de | ||
4fc158d6eb | |||
5a3514440c | |||
84f4a5f396 | |||
85e8088e40 | |||
e0e78b1349 | |||
9d5a504702 | |||
8eb3c53818 | |||
9b63e208d9 | |||
d3c325cef4 | |||
e54b36bb2a | |||
34b3a5d578 | |||
|
6ed340675a | ||
|
7f23ded63d | ||
e8d9f05b72 | |||
a7fece6218 | |||
ed5aac7f66 | |||
9e2bf074b7 | |||
aea04da690 | |||
2f8160526c | |||
ac02b90699 | |||
8b990e29ca | |||
926f62ec57 | |||
47abd0e404 | |||
ae2c1c6221 | |||
|
b5c6afda24 | ||
|
b7a8e68537 | ||
|
425e3671ba | ||
7a5e470821 | |||
b31b0dc2a5 | |||
|
4b9b78bb0f | ||
7e39892c4a | |||
|
62291171e3 | ||
97db46a66c | |||
8305d30bad | |||
|
f1fa050ea5 | ||
|
e82aa34967 | ||
|
65381e7638 | ||
|
21739a54d8 | ||
|
d1fb7d312e | ||
|
81f5e3cd8e | ||
|
75f0245817 | ||
|
021a24a100 | ||
|
390231e8dd | ||
|
b0ff574e95 |
71 changed files with 1284 additions and 628 deletions
42
.github/actions/ssh/action.yml
vendored
Normal file
42
.github/actions/ssh/action.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
name: SSH setup
|
||||||
|
description: Set up the SSH agent
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
config:
|
||||||
|
description: The SSH configuration
|
||||||
|
required: true
|
||||||
|
key:
|
||||||
|
description: The private SSH key
|
||||||
|
required: true
|
||||||
|
known-hosts:
|
||||||
|
description: The list of known hosts
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Configure SSH
|
||||||
|
shell: sh
|
||||||
|
env:
|
||||||
|
CONFIG: ${{ inputs.config }}
|
||||||
|
KNOWN_HOSTS: ${{ inputs.known-hosts }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${CONFIG}" > ~/.ssh/config
|
||||||
|
echo "${KNOWN_HOSTS}" > ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Start SSH agent
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SOCKET: /tmp/ssh-agent.sock
|
||||||
|
run: |
|
||||||
|
echo "SSH_AUTH_SOCK=${SOCKET}" >> $GITHUB_ENV
|
||||||
|
ssh-agent -a ${SOCKET} > /dev/null
|
||||||
|
|
||||||
|
- name: Add SSH key
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
KEY: ${{ inputs.key }}
|
||||||
|
run: |
|
||||||
|
ssh-add - <<< "${KEY}"
|
22
.github/workflows/build.yml
vendored
Normal file
22
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- .github/workflows/build.yml
|
||||||
|
- build.gradle
|
||||||
|
- settings.gradle
|
||||||
|
- src/**
|
||||||
|
- launcher/build.gradle
|
||||||
|
- launcher/src/**
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Compile with Gradle
|
||||||
|
run: ./gradlew :compileJava
|
15
.github/workflows/deploy.yml
vendored
Normal file
15
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
name: Deploy (Production)
|
||||||
|
|
||||||
|
on: workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: antville.org
|
||||||
|
url: https://antville.org
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Copy files to production server
|
||||||
|
run: ssh staging-server deploy-helma
|
59
.github/workflows/release.yml
vendored
Normal file
59
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
tags: '2*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
LC_TIME: en_US.UTF-8
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Create release notes
|
||||||
|
id: create_release_notes
|
||||||
|
run: |
|
||||||
|
release_notes=$(npx git-cliff@latest --latest)
|
||||||
|
# Write the release notes as a heredoc to the workflow output
|
||||||
|
# ⚠️ No white space around `<<` is crucial!
|
||||||
|
echo "release_notes<<.eot0x03" >> $GITHUB_OUTPUT
|
||||||
|
echo "$release_notes" >> $GITHUB_OUTPUT
|
||||||
|
echo ".eot0x03" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew assembleDist
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
uses: actions/forgejo-release@v2
|
||||||
|
with:
|
||||||
|
direction: upload
|
||||||
|
url: https://code.host.antville.org
|
||||||
|
token: ${{ github.token }}
|
||||||
|
title: Helma ${{ github.ref_name }}
|
||||||
|
release-dir: build/distributions
|
||||||
|
release-notes: ${{ steps.create_release_notes.outputs.release_notes }}
|
||||||
|
verbose: true
|
||||||
|
|
||||||
|
- name: Create release at GitHub
|
||||||
|
run: |
|
||||||
|
gh release create "$GITHUB_REF_NAME" \
|
||||||
|
--repo "$GITHUB_REPOSITORY" \
|
||||||
|
--title "Helma ${{ github.ref_name }}" \
|
||||||
|
--notes "${{ steps.create_release_notes.outputs.release_notes }}"
|
||||||
|
|
||||||
|
- name: Upload release assets to GitHub
|
||||||
|
run: |
|
||||||
|
gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \
|
||||||
|
--repo "$GITHUB_REPOSITORY" \
|
||||||
|
--clobber
|
44
.github/workflows/renovate.yml
vendored
Normal file
44
.github/workflows/renovate.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: Run Renovate
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "13 * * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
renovate:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run Renovate
|
||||||
|
# See <https://docs.renovatebot.com/troubleshooting/#log-debug-levels>
|
||||||
|
# debug | info | warn | error | fatal
|
||||||
|
run: LOG_LEVEL=info npx renovate
|
||||||
|
env:
|
||||||
|
# Renovate is using this token to retrieve release notes
|
||||||
|
GITHUB_COM_TOKEN: ${{ secrets.renovate_github_com_token }}
|
||||||
|
# Autodiscover is better suited for an extra repo running Renovate on all desired repos
|
||||||
|
#RENOVATE_AUTODISCOVER: 'true'
|
||||||
|
RENOVATE_CONFIG_FILE: renovate.json
|
||||||
|
RENOVATE_ENDPOINT: ${{ github.api_url }}
|
||||||
|
RENOVATE_GIT_AUTHOR: Renovate Bot <mail+renovate@antville.org>
|
||||||
|
#RENOVATE_GIT_IGNORED_AUTHORS:
|
||||||
|
# - 29139614+renovate[bot]@users.noreply.github.com
|
||||||
|
RENOVATE_IGNORE_PR_AUTHOR: 'true'
|
||||||
|
RENOVATE_LOG_FILE: renovate-log.ndjson
|
||||||
|
RENOVATE_LOG_FILE_LEVEL: debug
|
||||||
|
RENOVATE_PLATFORM: gitea
|
||||||
|
RENOVATE_REPOSITORIES: ${{ github.repository }}
|
||||||
|
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
||||||
|
# github.token is not working here, it lacks some permissions required by Renovate
|
||||||
|
RENOVATE_TOKEN: ${{ secrets.renovate_token }}
|
||||||
|
|
||||||
|
- name: Save log file
|
||||||
|
# FIXME: v4 of this action causes an error on Forgejo (“You must configure a GitHub token”)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: renovate-log.ndjson
|
||||||
|
path: renovate-log.ndjson
|
32
.github/workflows/stage.yml
vendored
Normal file
32
.github/workflows/stage.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
name: Deploy (Staging)
|
||||||
|
|
||||||
|
on: workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stage:
|
||||||
|
runs-on: antville
|
||||||
|
|
||||||
|
environment:
|
||||||
|
name: stage
|
||||||
|
url: ${{ vars.stage_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew installDist
|
||||||
|
|
||||||
|
- name: Publish to staging server
|
||||||
|
run: |
|
||||||
|
rsync ./build/install/helma/ staging-server:./ \
|
||||||
|
--verbose --archive --delete --compress \
|
||||||
|
--filter '+ /bin' \
|
||||||
|
--filter '+ /extras' \
|
||||||
|
--filter '+ /launcher.jar' \
|
||||||
|
--filter '- /lib/ext' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '+ /modules' \
|
||||||
|
--filter '- /*'
|
||||||
|
|
||||||
|
- name: Restart Helma
|
||||||
|
run: ssh staging-server restart
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
.gradle
|
.gradle
|
||||||
|
.idea
|
||||||
.settings
|
.settings
|
||||||
build
|
build
|
||||||
|
|
||||||
|
|
1
.java-version
Normal file
1
.java-version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
11.0
|
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"vscjava.vscode-java-pack",
|
||||||
|
"vscjava.vscode-gradle"
|
||||||
|
]
|
||||||
|
}
|
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"apps/": true
|
||||||
|
},
|
||||||
|
"java.configuration.updateBuildConfiguration": "automatic"
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
# License
|
# License
|
||||||
|
|
||||||
Copyright (c) 1999-2008 Helma Project. All rights reserved.
|
Copyright (c) 1999-2025 Helma Project. All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
|
|
19
README.md
19
README.md
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|
||||||
- Make sure you have Java 1.6 or higher installed
|
- Make sure you have Java 11 or higher installed
|
||||||
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
- Download and unpack the [latest release](https://code.host.antville.org/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,7 +21,7 @@ Although Helma became a Grande Dame of server-side JavaScript already decades ag
|
||||||
|
|
||||||
## System Requirements
|
## System Requirements
|
||||||
|
|
||||||
You need a Java virtual machine 1.6 or higher to run Helma.
|
You need a Java virtual machine version 11 or higher to run Helma.
|
||||||
|
|
||||||
Please consult the documentation of your platform how to obtain and install Java.
|
Please consult the documentation of your platform how to obtain and install Java.
|
||||||
|
|
||||||
|
@ -31,7 +31,14 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
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`.
|
### Additional Prerequisites
|
||||||
|
|
||||||
|
* [Node.js](https://nodejs.org) LTS version
|
||||||
|
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
||||||
|
|
||||||
|
Clone this repository to your machine and run Helma with `./gradlew run`.
|
||||||
|
|
||||||
|
To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.
|
||||||
|
|
||||||
> ⚠️
|
> ⚠️
|
||||||
> 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.
|
||||||
|
@ -40,7 +47,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 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, or 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.
|
||||||
|
|
||||||
|
@ -55,7 +62,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 archeological 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 archaeological 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/)
|
||||||
|
|
185
build.gradle
185
build.gradle
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'com.github.jk1.dependency-license-report' version '1.13'
|
id 'com.github.jk1.dependency-license-report' version '2.9'
|
||||||
}
|
}
|
||||||
|
|
||||||
import org.apache.tools.ant.filters.FixCrLfFilter
|
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||||
|
@ -17,17 +17,31 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
compileJava {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_6
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version = new Date().format("yyyyMMdd")
|
version = new Date().format("yy.M.d")
|
||||||
|
|
||||||
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 {
|
||||||
|
@ -37,11 +51,6 @@ 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)
|
||||||
|
@ -49,19 +58,19 @@ configurations {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.12.1'
|
||||||
implementation 'com.sun.activation:javax.activation:1.2.0'
|
implementation 'commons-codec:commons-codec:1.18.0'
|
||||||
implementation 'commons-codec:commons-codec:1.14'
|
implementation 'commons-fileupload:commons-fileupload:1.5'
|
||||||
implementation 'commons-fileupload:commons-fileupload:1.4'
|
implementation 'commons-logging:commons-logging:1.3.5'
|
||||||
implementation 'commons-logging:commons-logging:1.2'
|
implementation 'commons-net:commons-net:3.11.1'
|
||||||
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.27.v20200227'
|
implementation 'org.eclipse.jetty:jetty-servlet:9.4.57.v20241219'
|
||||||
implementation 'org.eclipse.jetty:jetty-xml:9.4.27.v20200227'
|
implementation 'org.eclipse.jetty:jetty-xml:9.4.57.v20241219'
|
||||||
implementation 'org.mozilla:rhino:1.7.12'
|
implementation 'org.mozilla:rhino-all:1.8.0'
|
||||||
implementation 'xerces:xercesImpl:2.12.0'
|
implementation 'org.sejda.imageio:webp-imageio:0.1.6'
|
||||||
|
implementation 'xerces:xercesImpl:2.12.2'
|
||||||
implementation 'xmlrpc:xmlrpc:2.0.1'
|
implementation 'xmlrpc:xmlrpc:2.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,11 +78,41 @@ def rhinoJar = configurations.library.files.find { jar ->
|
||||||
jar.name.startsWith('rhino')
|
jar.name.startsWith('rhino')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run {
|
||||||
|
jvmArgs jettyLogLevel, suppressMacosDockIcon
|
||||||
|
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass = 'helma.main.Server'
|
||||||
|
|
||||||
|
applicationDistribution.from(projectDir) {
|
||||||
|
include 'modules/**'
|
||||||
|
include 'LICENSE.md'
|
||||||
|
include 'README.md'
|
||||||
|
include 'start.*'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from(javadoc.destinationDir) {
|
||||||
|
include '**'
|
||||||
|
into 'docs/javadoc'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from("${project.buildDir}/docs/jsdoc") {
|
||||||
|
include '**'
|
||||||
|
into 'docs/jsdoc'
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationDistribution.from("${project.buildDir}/reports/dependency-license") {
|
||||||
|
include '**'
|
||||||
|
into 'licenses'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
startScripts {
|
startScripts {
|
||||||
applicationName = 'helma'
|
applicationName = 'helma'
|
||||||
classpath = files('../launcher.jar')
|
classpath = files('../launcher.jar')
|
||||||
mainClassName = 'helma.main.launcher.Main'
|
mainClass = 'helma.main.launcher.Main'
|
||||||
|
|
||||||
defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
|
defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
|
||||||
|
|
||||||
|
@ -95,29 +134,9 @@ distributions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationDistribution.from(projectDir) {
|
|
||||||
include 'modules/**'
|
|
||||||
include 'LICENSE.md'
|
|
||||||
include 'README.md'
|
|
||||||
include 'start.*'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from(javadoc.destinationDir) {
|
|
||||||
include '**'
|
|
||||||
into 'docs/javadoc'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from("${project.buildDir}/docs/jsdoc") {
|
|
||||||
include '**'
|
|
||||||
into 'docs/jsdoc'
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationDistribution.from("${project.buildDir}/reports/dependency-license") {
|
|
||||||
include '**'
|
|
||||||
into 'licenses'
|
|
||||||
}
|
|
||||||
|
|
||||||
distTar {
|
distTar {
|
||||||
|
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
|
||||||
|
|
||||||
compression = Compression.GZIP
|
compression = Compression.GZIP
|
||||||
|
|
||||||
filesMatching(textFiles) {
|
filesMatching(textFiles) {
|
||||||
|
@ -126,6 +145,8 @@ 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"))
|
||||||
}
|
}
|
||||||
|
@ -133,44 +154,36 @@ distZip {
|
||||||
|
|
||||||
installDist {
|
installDist {
|
||||||
dependsOn build
|
dependsOn build
|
||||||
finalizedBy 'update'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run {
|
tasks.register('processSource', Sync) {
|
||||||
classpath = files('launcher.jar')
|
|
||||||
jvmArgs jettyLogLevel, suppressMacosDockIcon
|
|
||||||
}
|
|
||||||
|
|
||||||
task processSource(type: Sync) {
|
|
||||||
def date = new Date().format("MMMM dd, yyyy")
|
|
||||||
def gitOutput = new ByteArrayOutputStream()
|
def gitOutput = new ByteArrayOutputStream()
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
commandLine 'git', 'describe'
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
standardOutput = gitOutput
|
standardOutput = gitOutput
|
||||||
errorOutput = new ByteArrayOutputStream()
|
errorOutput = new ByteArrayOutputStream()
|
||||||
ignoreExitValue = true
|
ignoreExitValue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
def description = date
|
|
||||||
def tag = gitOutput.toString().trim()
|
|
||||||
|
|
||||||
// TODO: Implement extended description in Java code
|
|
||||||
if (tag) description = "$tag; $description"
|
|
||||||
|
|
||||||
from 'src'
|
from 'src'
|
||||||
|
|
||||||
filter {
|
filter {
|
||||||
line -> line.replaceAll('__builddate__', date)
|
line -> line
|
||||||
|
.replaceAll('__builddate__', new Date().format("d MMM yyyy"))
|
||||||
|
.replaceAll('__commithash__', gitOutput.toString().trim())
|
||||||
|
.replaceAll('__version__', version)
|
||||||
} into "${project.buildDir}/src"
|
} into "${project.buildDir}/src"
|
||||||
}
|
}
|
||||||
|
|
||||||
task update {
|
tasks.register('update') {
|
||||||
def rsyncArgs = ['-a', '--info=progress2', '--exclude', 'backups']
|
dependsOn installDist
|
||||||
|
|
||||||
|
def rsyncArgs = ['--archive', '--filter', '- backups']
|
||||||
|
|
||||||
def confirm = {
|
def confirm = {
|
||||||
ant.input(message: 'Update this installation?', validargs: 'y,n', addproperty: 'continue')
|
ant.input(message: 'Update this installation?', validargs: 'yes,no', addproperty: 'continue')
|
||||||
return ant.continue == 'y'
|
return ant.continue == 'yes'
|
||||||
}
|
}
|
||||||
|
|
||||||
onlyIf { confirm() }
|
onlyIf { confirm() }
|
||||||
|
@ -181,26 +194,35 @@ task update {
|
||||||
mkdir backupDir
|
mkdir backupDir
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
// Using rsync instead of a CopyTask because the latter chokes on multi-byte characters
|
// Create a backup with 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 instead of installDist task because it does not overwrite the project directory
|
// Using rsync to selectively update the repo directory
|
||||||
executable 'rsync'
|
executable 'rsync'
|
||||||
|
args '--delete'
|
||||||
args rsyncArgs
|
args rsyncArgs
|
||||||
args '--exclude', 'bin'
|
args '--filter', '+ 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task jsdoc(type: Exec) {
|
tasks.register('jsdoc', Exec) {
|
||||||
description 'Generates JSDoc API documentation for the included JavaScript modules.'
|
description 'Generates JSDoc API documentation for the included JavaScript modules.'
|
||||||
group 'Documentation'
|
group 'Documentation'
|
||||||
|
|
||||||
|
@ -212,19 +234,14 @@ 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) {
|
tasks.register('xgettext', JavaExec) {
|
||||||
description 'Extracts translatable message strings from source code.'
|
description 'Extracts translatable message strings from source code.'
|
||||||
group 'i18n'
|
group 'i18n'
|
||||||
|
|
||||||
classpath = files('launcher.jar')
|
classpath = files('launcher.jar')
|
||||||
main = 'helma.main.launcher.Commandline'
|
mainClass = 'helma.main.launcher.Commandline'
|
||||||
|
|
||||||
// TODO: Decouple from Antville app
|
// TODO: Decouple from Antville app
|
||||||
args = [
|
args = [
|
||||||
|
@ -236,12 +253,12 @@ task xgettext(type: JavaExec) {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task po2js(type: JavaExec) {
|
tasks.register('po2js', JavaExec) {
|
||||||
description 'Converts translated message strings from PO format to JavaScript.'
|
description 'Converts translated message strings from PO format to JavaScript.'
|
||||||
group 'i18n'
|
group 'i18n'
|
||||||
|
|
||||||
classpath = files(rhinoJar)
|
classpath = files(rhinoJar)
|
||||||
main = 'org.mozilla.javascript.tools.shell.Main'
|
mainClass = 'org.mozilla.javascript.tools.shell.Main'
|
||||||
|
|
||||||
// TODO: Decouple from Antville app
|
// TODO: Decouple from Antville app
|
||||||
args = [
|
args = [
|
||||||
|
@ -251,23 +268,31 @@ task po2js(type: JavaExec) {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task rhinoShell(type: JavaExec) {
|
tasks.register('rhinoShell', JavaExec) {
|
||||||
description 'Runs the interactive Rhino JavaScript shell.'
|
description 'Runs the interactive Rhino JavaScript shell.'
|
||||||
group 'Application'
|
group 'Application'
|
||||||
|
|
||||||
classpath = files(rhinoJar)
|
classpath = files(rhinoJar)
|
||||||
main = 'org.mozilla.javascript.tools.shell.Main'
|
mainClass = 'org.mozilla.javascript.tools.shell.Main'
|
||||||
|
|
||||||
standardInput = System.in
|
standardInput = System.in
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call this task with a function definition using the `-P` parameter, e.g.
|
// Call this task with a function definition using the `-P` parameter, e.g.
|
||||||
// `./gradlew commandLine -Pfunction=manage.getAllApplications`
|
// `./gradlew commandLine -Pfunction=manage.getAllApplications`
|
||||||
task commandLine(type: JavaExec) {
|
tasks.register('commandLine', JavaExec) {
|
||||||
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
|
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`.'
|
||||||
group 'Application'
|
group 'Application'
|
||||||
|
|
||||||
classpath = files('launcher.jar')
|
classpath = files('launcher.jar')
|
||||||
main = 'helma.main.launcher.Commandline'
|
mainClass = 'helma.main.launcher.Commandline'
|
||||||
args '-h', projectDir, function
|
args '-h', projectDir, function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('debug', JavaExec) {
|
||||||
|
group = 'application'
|
||||||
|
main = 'helma.main.Server'
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
|
||||||
|
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
|
||||||
|
}
|
||||||
|
|
52
cliff.toml
Normal file
52
cliff.toml
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
# git-cliff ~ default configuration file
|
||||||
|
# https://git-cliff.org/docs/configuration
|
||||||
|
#
|
||||||
|
# Lines starting with "#" are comments.
|
||||||
|
# Configuration options are organized into tables and keys.
|
||||||
|
# See documentation for more information on available options.
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
trim = true
|
||||||
|
|
||||||
|
header = "## Changes"
|
||||||
|
|
||||||
|
body = """
|
||||||
|
{% for group, commits in commits | filter(attribute="merge_commit") | group_by(attribute="group") %}
|
||||||
|
### {{ group | striptags | trim | upper_first }}
|
||||||
|
{% for commit in commits %}
|
||||||
|
* [<tt>{{ commit.id | split(pat="") | slice(end=11) | join() }}</tt>]\
|
||||||
|
(https://code.host.antville.org/antville/helma/commit/{{ commit.id }}) \
|
||||||
|
{% if commit.breaking %}**Breaking:** {% endif %}\
|
||||||
|
{{ commit.message | split(pat="\\n") | first | upper_first | escape }}\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
**Full Changelog:** [{{ previous.version }} → {{ version }}]\
|
||||||
|
(https://code.host.antville.org/antville/helma/compare/\
|
||||||
|
{{ previous.version | urlencode }}..{{ version | urlencode }})\n\n
|
||||||
|
"""
|
||||||
|
|
||||||
|
footer = """
|
||||||
|
Generated by [git-cliff](https://git-cliff.org/).
|
||||||
|
"""
|
||||||
|
|
||||||
|
[git]
|
||||||
|
conventional_commits = false
|
||||||
|
filter_commits = false
|
||||||
|
filter_unconventional = false
|
||||||
|
protect_breaking_commits = false
|
||||||
|
sort_commits = "newest"
|
||||||
|
split_commits = false
|
||||||
|
topo_order = false
|
||||||
|
|
||||||
|
commit_parsers = [
|
||||||
|
{ message = "^Apply \\d+ suggestion", skip = true },
|
||||||
|
{ message = "^Merge .*(branch|dependabot|dependency|renovate)", skip = true },
|
||||||
|
{ message = "^Lock file maintenance", skip = true },
|
||||||
|
{ message = "yarn\\.lock", skip = true },
|
||||||
|
|
||||||
|
{ message = "^[Ff]ix", group = "<!-- 0 --> 🐛 Bug Fixes" },
|
||||||
|
{ field = "author.name", pattern = "[Rr]enovate|[Dd]ependabot", group = "<!-- 3 --> 📦 Dependency Updates" },
|
||||||
|
{ message = "^Merge pull request", group = "<!-- 1 --> 🔀 Merges" },
|
||||||
|
{ message = ".*", group = "<!-- 2 --> Uncategorized" },
|
||||||
|
]
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
6
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,7 @@
|
||||||
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
|
||||||
zipStorePath=wrapper/dists
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
|
311
gradlew
vendored
311
gradlew
vendored
|
@ -1,78 +1,129 @@
|
||||||
#!/usr/bin/env sh
|
#!/bin/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.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# 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/platforms/jvm/plugins-application/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
|
||||||
PRG="$0"
|
app_path=$0
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
# Need this for daisy-chained symlinks.
|
||||||
ls=`ls -ld "$PRG"`
|
while
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
[ -h "$app_path" ]
|
||||||
PRG="$link"
|
do
|
||||||
else
|
ls=$( ls -ld "$app_path" )
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
link=${ls#*' -> '}
|
||||||
fi
|
case $link in #(
|
||||||
|
/*) 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
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# This is normally unused
|
||||||
APP_BASE_NAME=`basename "$0"`
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
DEFAULT_JVM_OPTS=""
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# 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* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
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
|
||||||
|
@ -81,92 +132,120 @@ 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
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
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" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC2039,SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
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
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=$(save "$@")
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
# 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
|
||||||
|
# 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
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * 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
|
||||||
|
|
||||||
|
# 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" "$@"
|
||||||
|
|
78
gradlew.bat
vendored
78
gradlew.bat
vendored
|
@ -1,4 +1,22 @@
|
||||||
@if "%DEBUG%" == "" @echo off
|
@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
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
|
@ -9,25 +27,29 @@
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
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=
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@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%" == "0" goto init
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@ -35,48 +57,36 @@ 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 init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
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 %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
: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%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 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!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=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
|
||||||
|
|
0
lib/ext/.keep
Normal file
0
lib/ext/.keep
Normal file
16
modules/helma/Chart.js
vendored
16
modules/helma/Chart.js
vendored
|
@ -18,12 +18,12 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Chart prototype
|
* @fileoverview Fields and methods of the helma.Chart prototype
|
||||||
* <br /><br />
|
* <br /><br />
|
||||||
* To use this optional module, its repository needs to be added to the
|
* To use this optional module, its repository needs to be added to the
|
||||||
* application, for example by calling app.addRepository('modules/helma/Chart.js')
|
* application, for example by calling app.addRepository('modules/helma/Chart.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// take care of any dependencies
|
// take care of any dependencies
|
||||||
app.addRepository('modules/helma/jxl.jar');
|
app.addRepository('modules/helma/jxl-2.5.7.jar');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the global namespace if not existing
|
* Define the global namespace if not existing
|
||||||
|
@ -55,12 +55,12 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
||||||
|
|
||||||
var workbook, file;
|
var workbook, file;
|
||||||
try {
|
try {
|
||||||
file = new java.io.File(fpath);
|
file = new java.io.File(fpath);
|
||||||
workbook = JXLPKG.getWorkbook(file);
|
workbook = JXLPKG.getWorkbook(file);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof TypeError == false)
|
if (e instanceof TypeError == false)
|
||||||
throw(e);
|
throw(e);
|
||||||
throw("helma.Chart needs " + JXLPKGNAME +
|
throw("helma.Chart needs " + JXLPKGNAME +
|
||||||
" in lib/ext or application directory " +
|
" in lib/ext or application directory " +
|
||||||
"[" + JXLPKGURL + "]");
|
"[" + JXLPKGURL + "]");
|
||||||
}
|
}
|
||||||
|
@ -98,9 +98,9 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
||||||
* Renders the Excel spreadsheet as XHTML table.
|
* Renders the Excel spreadsheet as XHTML table.
|
||||||
*/
|
*/
|
||||||
this.render = function() {
|
this.render = function() {
|
||||||
res.write('<table border="0" cellspacing="1" class="' +
|
res.write('<table border="0" cellspacing="1" class="' +
|
||||||
prefix + 'table">\n');
|
prefix + 'table">\n');
|
||||||
|
|
||||||
var rowBuf = [];
|
var rowBuf = [];
|
||||||
var rows = sheet.getRows();
|
var rows = sheet.getRows();
|
||||||
var max = 0;
|
var max = 0;
|
||||||
|
@ -110,7 +110,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
||||||
max = row.length;
|
max = row.length;
|
||||||
rowBuf.push(row);
|
rowBuf.push(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in rowBuf) {
|
for (var i in rowBuf) {
|
||||||
res.write('<tr class="' + prefix + 'row">\n');
|
res.write('<tr class="' + prefix + 'row">\n');
|
||||||
for (var n=0; n<max; n+=1) {
|
for (var n=0; n<max; n+=1) {
|
||||||
|
@ -145,7 +145,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
||||||
}
|
}
|
||||||
res.write('</tr>\n');
|
res.write('</tr>\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
res.write('</table>\n');
|
res.write('</table>\n');
|
||||||
workbook.close();
|
workbook.close();
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,16 +62,17 @@ helma.Http = function() {
|
||||||
|
|
||||||
var responseHandler = function(connection, result) {
|
var responseHandler = function(connection, result) {
|
||||||
var input;
|
var input;
|
||||||
|
var stream;
|
||||||
try {
|
try {
|
||||||
if (method !== 'DELETE') {
|
stream = connection.getInputStream();
|
||||||
var stream = connection.getInputStream();
|
|
||||||
if (connection.getContentEncoding() === 'gzip') {
|
|
||||||
stream = new java.util.zip.GZIPInputStream(stream);
|
|
||||||
}
|
|
||||||
input = new java.io.BufferedInputStream(stream);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
input = new java.io.BufferedInputStream(connection.getErrorStream());
|
stream = connection.getErrorStream();
|
||||||
|
}
|
||||||
|
if (stream) {
|
||||||
|
if (connection.getContentEncoding() === 'gzip') {
|
||||||
|
stream = new java.util.zip.GZIPInputStream(stream);
|
||||||
|
}
|
||||||
|
input = new java.io.BufferedInputStream(stream);
|
||||||
}
|
}
|
||||||
if (input) {
|
if (input) {
|
||||||
var body = new java.io.ByteArrayOutputStream();
|
var body = new java.io.ByteArrayOutputStream();
|
||||||
|
@ -90,8 +91,7 @@ helma.Http = function() {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// safe to ignore
|
// safe to ignore
|
||||||
}
|
}
|
||||||
if (binaryMode && (result.code >= 200 && result.code < 300)) {
|
if (binaryMode) {
|
||||||
// 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 ?
|
||||||
|
|
|
@ -26,13 +26,13 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Search class
|
* @fileoverview Fields and methods of the helma.Search class
|
||||||
* <br /><br />
|
* <br /><br />
|
||||||
* To use this optional module, its repository needs to be added to the
|
* To use this optional module, its repository needs to be added to the
|
||||||
* application, for example by calling app.addRepository('modules/helma/Search.js')
|
* application, for example by calling app.addRepository('modules/helma/Search.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// take care of any dependencies
|
// take care of any dependencies
|
||||||
app.addRepository('modules/helma/lucene-core.jar');
|
app.addRepository('modules/helma/lucene-core-2.2.0.jar');
|
||||||
app.addRepository('modules/helma/lucene-analyzers.jar');
|
app.addRepository('modules/helma/lucene-analyzers-2.2.0.jar');
|
||||||
|
|
||||||
|
|
||||||
if (!global.helma) {
|
if (!global.helma) {
|
||||||
|
@ -47,7 +47,7 @@ if (!global.helma) {
|
||||||
* creating a fulltext search index based on Apache Lucene.
|
* creating a fulltext search index based on Apache Lucene.
|
||||||
* @returns A newly created instance of this prototype.
|
* @returns A newly created instance of this prototype.
|
||||||
* @constructor
|
* @constructor
|
||||||
* @author Robert Gaggl <robert@nomatic.org>
|
* @author Robert Gaggl <robert@nomatic.org>
|
||||||
*/
|
*/
|
||||||
helma.Search = function() {
|
helma.Search = function() {
|
||||||
try {
|
try {
|
||||||
|
@ -309,7 +309,7 @@ helma.Search.Index = function(directory, analyzer) {
|
||||||
this.getAnalyzer = function() {
|
this.getAnalyzer = function() {
|
||||||
return analyzer;
|
return analyzer;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a searcher for querying this index.
|
* Returns a searcher for querying this index.
|
||||||
* @returns A searcher useable for querying the index.
|
* @returns A searcher useable for querying the index.
|
||||||
|
@ -318,7 +318,7 @@ helma.Search.Index = function(directory, analyzer) {
|
||||||
this.getSearcher = function() {
|
this.getSearcher = function() {
|
||||||
return new helma.Search.Searcher(this);
|
return new helma.Search.Searcher(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @ignore */
|
/** @ignore */
|
||||||
this.toString = function() {
|
this.toString = function() {
|
||||||
return ("[Lucene Index " + directory + "]");
|
return ("[Lucene Index " + directory + "]");
|
||||||
|
@ -773,7 +773,7 @@ helma.Search.HitCollection = function(hits) {
|
||||||
this.length = function() {
|
this.length = function() {
|
||||||
return this.size();
|
return this.size();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a provided function once per hit.
|
* Executes a provided function once per hit.
|
||||||
* @param {Function} fun Function to execute for each element
|
* @param {Function} fun Function to execute for each element
|
||||||
|
@ -793,7 +793,7 @@ helma.Search.HitCollection = function(hits) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1308,7 +1308,7 @@ helma.Search.Document.Field = function(name, value, options) {
|
||||||
var store = pkg.Store.YES;
|
var store = pkg.Store.YES;
|
||||||
var index = pkg.Index.TOKENIZED;
|
var index = pkg.Index.TOKENIZED;
|
||||||
var termVector = pkg.TermVector.NO;
|
var termVector = pkg.TermVector.NO;
|
||||||
|
|
||||||
var opt;
|
var opt;
|
||||||
if (options != null) {
|
if (options != null) {
|
||||||
if (options.store != null) {
|
if (options.store != null) {
|
||||||
|
|
|
@ -18,20 +18,20 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Ssh class.
|
* @fileoverview Fields and methods of the helma.Ssh class.
|
||||||
* <br /><br />
|
* <br /><br />
|
||||||
* To use this optional module, its repository needs to be added to the
|
* To use this optional module, its repository needs to be added to the
|
||||||
* application, for example by calling app.addRepository('modules/helma/Ssh.js')
|
* application, for example by calling app.addRepository('modules/helma/Ssh.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// 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.jar');
|
app.addRepository('modules/helma/ganymed-ssh2-build208.jar');
|
||||||
|
|
||||||
// define the helma namespace, if not existing
|
// define the helma namespace, if not existing
|
||||||
if (!global.helma) {
|
if (!global.helma) {
|
||||||
global.helma = {};
|
global.helma = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of helma.Ssh
|
* Creates a new instance of helma.Ssh
|
||||||
* @class This class provides methods for connecting to a remote
|
* @class This class provides methods for connecting to a remote
|
||||||
* server via secure shell (ssh) and copying files from/to a remote
|
* server via secure shell (ssh) and copying files from/to a remote
|
||||||
|
@ -43,7 +43,7 @@ if (!global.helma) {
|
||||||
* file. This argument is optional.
|
* file. This argument is optional.
|
||||||
* @constructor
|
* @constructor
|
||||||
* @returns A newly created instance of helma.Ssh
|
* @returns A newly created instance of helma.Ssh
|
||||||
* @author Robert Gaggl <robert@nomatic.org>
|
* @author Robert Gaggl <robert@nomatic.org>
|
||||||
*/
|
*/
|
||||||
helma.Ssh = function(server, hosts) {
|
helma.Ssh = function(server, hosts) {
|
||||||
var SSHPKG = Packages.ch.ethz.ssh2;
|
var SSHPKG = Packages.ch.ethz.ssh2;
|
||||||
|
@ -61,11 +61,11 @@ helma.Ssh = function(server, hosts) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof TypeError == false)
|
if (e instanceof TypeError == false)
|
||||||
throw(e);
|
throw(e);
|
||||||
throw("helma.Ssh needs " + SSHPKGNAME +
|
throw("helma.Ssh needs " + SSHPKGNAME +
|
||||||
" in lib/ext or application directory " +
|
" in lib/ext or application directory " +
|
||||||
"[" + SSHPKGURL + "]");
|
"[" + SSHPKGURL + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple verifier for verifying host keys
|
* A simple verifier for verifying host keys
|
||||||
* @private
|
* @private
|
||||||
|
@ -96,7 +96,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the argument into an instance of java.io.File
|
* Converts the argument into an instance of java.io.File
|
||||||
* @param {helma.File|java.io.File|String} file Either a file
|
* @param {helma.File|java.io.File|String} file Either a file
|
||||||
|
@ -131,7 +131,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private helper method for debugging output using app.logger
|
* Private helper method for debugging output using app.logger
|
||||||
* @param {String} methodName The name of the method
|
* @param {String} methodName The name of the method
|
||||||
|
@ -175,7 +175,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connects to a remote host using plain username/password authentication.
|
* Connects to a remote host using plain username/password authentication.
|
||||||
* @param {String} username The username
|
* @param {String} username The username
|
||||||
|
@ -217,7 +217,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnects this client from the remote server.
|
* Disconnects this client from the remote server.
|
||||||
*/
|
*/
|
||||||
|
@ -325,7 +325,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles paranoid mode. If set to true this client tries to
|
* Toggles paranoid mode. If set to true this client tries to
|
||||||
* verify the host key against the its list of known hosts
|
* verify the host key against the its list of known hosts
|
||||||
|
@ -346,7 +346,7 @@ helma.Ssh = function(server, hosts) {
|
||||||
this.isParanoid = function() {
|
this.isParanoid = function() {
|
||||||
return paranoid;
|
return paranoid;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main constructor body
|
* main constructor body
|
||||||
*/
|
*/
|
||||||
|
|
18
modules/helma/build.gradle
Normal file
18
modules/helma/build.gradle
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
tasks.register('deps', Copy) {
|
||||||
|
from sourceSets.main.runtimeClasspath
|
||||||
|
into '.'
|
||||||
|
}
|
BIN
modules/helma/jxl-2.5.7.jar
Normal file
BIN
modules/helma/jxl-2.5.7.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
21
modules/jala/build.gradle
Normal file
21
modules/jala/build.gradle
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
tasks.register('deps', Copy) {
|
||||||
|
from sourceSets.main.runtimeClasspath
|
||||||
|
into 'lib'
|
||||||
|
}
|
|
@ -518,7 +518,7 @@ jala.db.DataType = function(type, typeName, params) {
|
||||||
this.getParams = function() {
|
this.getParams = function() {
|
||||||
return params;
|
return params;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @ignore */
|
/** @ignore */
|
||||||
this.toString = function() {
|
this.toString = function() {
|
||||||
return "[DataType " +
|
return "[DataType " +
|
||||||
|
@ -597,7 +597,7 @@ jala.db.RamDatabase = function(name, username, password) {
|
||||||
this.getUsername = function() {
|
this.getUsername = function() {
|
||||||
return username || "sa";
|
return username || "sa";
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the password of this database
|
* Returns the password of this database
|
||||||
* @returns The password of this database
|
* @returns The password of this database
|
||||||
|
@ -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 each (var tableName in tables) {
|
for (let tableName of 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);
|
||||||
|
@ -1011,7 +1011,7 @@ jala.db.FileDatabase = function(name, directory, username, password) {
|
||||||
this.getUsername = function() {
|
this.getUsername = function() {
|
||||||
return username || "sa";
|
return username || "sa";
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the password of this database
|
* Returns the password of this database
|
||||||
* @returns The password of this database
|
* @returns The password of this database
|
||||||
|
|
Binary file not shown.
16
modules/jala/util/HopKit/build.gradle
Normal file
16
modules/jala/util/HopKit/build.gradle
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
tasks.register('deps', Copy) {
|
||||||
|
from sourceSets.main.runtimeClasspath
|
||||||
|
into 'lib'
|
||||||
|
}
|
BIN
modules/jala/util/HopKit/lib/bsf-2.4.0.jar
Normal file
BIN
modules/jala/util/HopKit/lib/bsf-2.4.0.jar
Normal file
Binary file not shown.
Binary file not shown.
|
@ -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 each (var macro in macros) {
|
for (let macro of 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 each (var name in skin.getSubskinNames()) {
|
for (let name of skin.getSubskinNames()) {
|
||||||
var subskin = skin.getSubskin(name);
|
var subskin = skin.getSubskin(name);
|
||||||
processMacros(subskin.getMacros());
|
processMacros(subskin.getMacros());
|
||||||
}
|
}
|
||||||
|
|
16
modules/jala/util/Test/build.gradle
Normal file
16
modules/jala/util/Test/build.gradle
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
tasks.register('deps', Copy) {
|
||||||
|
from sourceSets.main.runtimeClasspath
|
||||||
|
into 'code'
|
||||||
|
}
|
|
@ -41,7 +41,7 @@ app.addRepository("modules/helma/Http.js");
|
||||||
/**
|
/**
|
||||||
* Jala dependencies
|
* Jala dependencies
|
||||||
*/
|
*/
|
||||||
app.addRepository(getProperty("jala.dir", "modules/jala") +
|
app.addRepository(getProperty("jala.dir", "modules/jala") +
|
||||||
"/code/Database.js");
|
"/code/Database.js");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -573,11 +573,11 @@ jala.Test.prototype.executeTest = function(testFile) {
|
||||||
} finally {
|
} finally {
|
||||||
// exit the js context created above
|
// exit the js context created above
|
||||||
cx.exit();
|
cx.exit();
|
||||||
// FIXME (sim) don't polute global in the first place or
|
// FIXME (sim) don't polute global in the first place or
|
||||||
// get a fresh global for each testrun
|
// get a fresh global for each testrun
|
||||||
global.testFunctionIdents.forEach(function(funcName) {
|
global.testFunctionIdents.forEach(function(funcName) {
|
||||||
// NOTE won't work on var-defined props
|
// NOTE won't work on var-defined props
|
||||||
// delete global[funcName]]
|
// delete global[funcName]]
|
||||||
global[funcName] = "ignoreMe";
|
global[funcName] = "ignoreMe";
|
||||||
}, this);
|
}, this);
|
||||||
global["setup"] = "ignoreMe";
|
global["setup"] = "ignoreMe";
|
||||||
|
@ -861,7 +861,7 @@ jala.Test.prototype.assertEqualFile = function assertEqualFile(val, file) {
|
||||||
// the last linefeed in a file too
|
// the last linefeed in a file too
|
||||||
var str = value1.replace(/\r?\n$/g, "");
|
var str = value1.replace(/\r?\n$/g, "");
|
||||||
equals = str === file.readAll();
|
equals = str === file.readAll();
|
||||||
}
|
}
|
||||||
if (!equals) {
|
if (!equals) {
|
||||||
throw new jala.Test.TestException(comment,
|
throw new jala.Test.TestException(comment,
|
||||||
"Expected " + jala.Test.valueToString(value1) +
|
"Expected " + jala.Test.valueToString(value1) +
|
||||||
|
@ -1155,7 +1155,7 @@ jala.Test.HttpClient = function() {
|
||||||
this.getClient = function() {
|
this.getClient = function() {
|
||||||
return client;
|
return client;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the cookie to use for subsequent requests using this client
|
* Sets the cookie to use for subsequent requests using this client
|
||||||
* @param {Array} arr The cookie object as received from helma.Http.getUrl
|
* @param {Array} arr The cookie object as received from helma.Http.getUrl
|
||||||
|
@ -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 each (var proto in protos) {
|
for (let proto of protos) {
|
||||||
var dbMap = proto.getDbMapping();
|
var dbMap = proto.getDbMapping();
|
||||||
if (dbMap.isRelational()) {
|
if (dbMap.isRelational()) {
|
||||||
tables.push(dbMap.getTableName());
|
tables.push(dbMap.getTableName());
|
||||||
|
@ -1401,7 +1401,7 @@ jala.Test.DatabaseMgr.prototype.stopAll = function() {
|
||||||
*/
|
*/
|
||||||
jala.Test.SmtpServer = function(port) {
|
jala.Test.SmtpServer = function(port) {
|
||||||
var server = null;
|
var server = null;
|
||||||
|
|
||||||
var oldSmtpServer = null;
|
var oldSmtpServer = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Binary file not shown.
Binary file not shown.
BIN
modules/jala/util/Test/code/subethasmtp-wiser-1.2.jar
Normal file
BIN
modules/jala/util/Test/code/subethasmtp-wiser-1.2.jar
Normal file
Binary file not shown.
50
renovate.json
Normal file
50
renovate.json
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"$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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
@ -7,3 +7,12 @@ 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')
|
||||||
|
|
|
@ -149,7 +149,7 @@ function testOrder(org, pos) {
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
var persons = root.persons.list();
|
var persons = root.persons.list();
|
||||||
for each (var person in persons) {
|
for (let person of persons) {
|
||||||
person.remove();
|
person.remove();
|
||||||
}
|
}
|
||||||
ikea.remove();
|
ikea.remove();
|
||||||
|
|
2
src/dist/apps/test/tests/HopObjectGeneric.js
vendored
2
src/dist/apps/test/tests/HopObjectGeneric.js
vendored
|
@ -86,7 +86,7 @@ function testAdd() {
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
var persons = org.generic.list();
|
var persons = org.generic.list();
|
||||||
for each (var person in persons) {
|
for (let person of persons) {
|
||||||
person.remove();
|
person.remove();
|
||||||
}
|
}
|
||||||
org.remove();
|
org.remove();
|
||||||
|
|
8
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
8
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
|
@ -68,7 +68,7 @@ function testGroupByAddRemoveNoCommit() {
|
||||||
// FIXME HELMABUG: country is still accessible at this point
|
// FIXME HELMABUG: country is still accessible at this point
|
||||||
// similar to http://helma.org/bugs/show_bug.cgi?id=551
|
// similar to http://helma.org/bugs/show_bug.cgi?id=551
|
||||||
assertNull(root.organisationsByCountry.get(org.country));
|
assertNull(root.organisationsByCountry.get(org.country));
|
||||||
|
|
||||||
assertEqual(countryCount, root.organisationsByCountry.count());
|
assertEqual(countryCount, root.organisationsByCountry.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ function testGroupTransient() {
|
||||||
assertNotNull(country);
|
assertNotNull(country);
|
||||||
assertEqual(country._prototype, "Country");
|
assertEqual(country._prototype, "Country");
|
||||||
assertEqual(country.groupname, org.country);
|
assertEqual(country.groupname, org.country);
|
||||||
|
|
||||||
// These don't work as org uses the parent from type.properties
|
// These don't work as org uses the parent from type.properties
|
||||||
// which is root.organisations. Not sure if this is a bug or not.
|
// which is root.organisations. Not sure if this is a bug or not.
|
||||||
// assertEqual(country, org._parent);
|
// assertEqual(country, org._parent);
|
||||||
|
@ -143,7 +143,7 @@ function testGroupTransient() {
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
var orgs = root.organisations.list();
|
var orgs = root.organisations.list();
|
||||||
for each (var org in orgs) {
|
for (let org of orgs) {
|
||||||
org.remove();
|
org.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
60
src/dist/extras/deploy.sh
vendored
Normal file
60
src/dist/extras/deploy.sh
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Use this script as forced command of an authorized SSH key:
|
||||||
|
# command="/home/helma/extras/deploy.sh" ssh-ed25519 AAAAC3NzaC…
|
||||||
|
|
||||||
|
# Define HELMA_HOST and ANTVILLE_HOST in this file
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "$HOME"/deploy.env
|
||||||
|
|
||||||
|
case "$SSH_ORIGINAL_COMMAND" in
|
||||||
|
ping)
|
||||||
|
echo pong
|
||||||
|
;;
|
||||||
|
|
||||||
|
deploy-helma)
|
||||||
|
rsync ./ "$HELMA_HOST":./ \
|
||||||
|
--archive --compress --delete --verbose \
|
||||||
|
--filter '+ /bin' \
|
||||||
|
--filter '+ /extras' \
|
||||||
|
--filter '+ /launcher.jar' \
|
||||||
|
--filter '- /lib/ext' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '+ /modules' \
|
||||||
|
--filter '- /*'
|
||||||
|
printf 'Restarting Helma on HELMA_host… '
|
||||||
|
ssh "$HELMA_HOST" sudo /bin/systemctl restart helma
|
||||||
|
;;
|
||||||
|
|
||||||
|
deploy-antville)
|
||||||
|
rsync ./apps/antville/ "$ANTVILLE_HOST":./apps/antville/ \
|
||||||
|
--archive --compress --delete --verbose \
|
||||||
|
--filter '+ /claustra' \
|
||||||
|
--filter '+ /code' \
|
||||||
|
--filter '+ /compat' \
|
||||||
|
--filter '+ /i18n' \
|
||||||
|
--filter '+ /lib' \
|
||||||
|
--filter '- /*'
|
||||||
|
rsync ./apps/antville/static/helma/ "$ANTVILLE_HOST":./apps/antville/static/helma/ \
|
||||||
|
--archive --compress --verbose \
|
||||||
|
--filter '+ /fonts' \
|
||||||
|
--filter '+ /formica.html' \
|
||||||
|
--filter '+ /img' \
|
||||||
|
--filter '+ /scripts' \
|
||||||
|
--filter '+ /styles' \
|
||||||
|
--filter '- /*'
|
||||||
|
printf 'Restarting Helma on ANTVILLE_host… '
|
||||||
|
ssh "$ANTVILLE_HOST" sudo /bin/systemctl restart helma
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart)
|
||||||
|
printf 'Restarting Helma… '
|
||||||
|
sudo /bin/systemctl restart helma
|
||||||
|
printf '%s\n' 'done.'
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
# Allow any rsync command but restrict it to the installation directory
|
||||||
|
rrsync -wo /home/helma
|
||||||
|
;;
|
||||||
|
esac
|
25
src/dist/extras/helma.service
vendored
Normal file
25
src/dist/extras/helma.service
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
[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 = /bin/sh -c 'touch apps.properties && touch server.properties'
|
||||||
|
ExecStop = /bin/kill -15 $MAINPID
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy = multi-user.target
|
66
src/dist/extras/upstart/helma
vendored
66
src/dist/extras/upstart/helma
vendored
|
@ -6,56 +6,67 @@
|
||||||
# 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
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
# Check for existence of needed config file and source it
|
# Check for existence of needed config file and source it
|
||||||
if [ -r $HELMA_CONFIG ]; then
|
if [ -r $HELMA_CONFIG ]; then
|
||||||
source $HELMA_CONFIG
|
source $HELMA_CONFIG
|
||||||
else
|
else
|
||||||
echo "Can't read config file $HELMA_CONFIG"
|
echo "Can't read config file $HELMA_CONFIG"
|
||||||
exit 6
|
exit 6
|
||||||
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
|
|
||||||
if [ ! -r $HELMA_INSTALL/launcher.jar ]; then
|
|
||||||
echo "Config error: $HELMA_INSTALL/launcher.jar not found or not readable"
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
if [ ! -d $HELMA_HOME ]; then
|
|
||||||
echo "Config error: HELMA_HOME $HELMA_HOME not found"
|
|
||||||
exit 5
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# local settins
|
if [ ! -r $HELMA_INSTALL/launcher.jar ]; then
|
||||||
RUN_CMD="sudo -u $HELMA_USER $JAVA_BIN"
|
echo "Config error: $HELMA_INSTALL/launcher.jar not found or not readable"
|
||||||
RUN_ARGS="$JAVA_OPTS -jar $HELMA_INSTALL/launcher.jar -h $HELMA_HOME $HELMA_ARGS"
|
exit 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d $HELMA_HOME ]; then
|
||||||
|
echo "Config error: HELMA_HOME $HELMA_HOME not found"
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
RUN_CMD="su - $HELMA_USER"
|
||||||
|
RUN_ARGS="-c $JAVA_BIN $JAVA_OPTS -jar $HELMA_INSTALL/launcher.jar -h $HELMA_HOME $HELMA_ARGS"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo -n "Starting $HELMA_SERVICE: "
|
echo -n "Starting $HELMA_SERVICE: "
|
||||||
|
|
||||||
if [ -f $HELMA_PID ]; then
|
if [ -f $HELMA_PID ]; then
|
||||||
echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) already running"
|
echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) already running"
|
||||||
exit 1
|
exit 1
|
||||||
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."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
echo -n "Shutting down $HELMA_SERVICE: "
|
echo -n "Shutting down $HELMA_SERVICE: "
|
||||||
if [ ! -f $HELMA_PID ]; then
|
if [ ! -f $HELMA_PID ]; then
|
||||||
echo "$HELMA_SERVICE not running"
|
echo "$HELMA_SERVICE not running"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PID=`cat $HELMA_PID 2>/dev/null`
|
PID=`cat $HELMA_PID 2>/dev/null`
|
||||||
|
@ -65,20 +76,21 @@ stop)
|
||||||
echo "stopped."
|
echo "stopped."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
restart)
|
restart)
|
||||||
$0 stop && $0 start
|
$0 stop && $0 start
|
||||||
;;
|
;;
|
||||||
|
|
||||||
reload)
|
reload)
|
||||||
echo -n "Reloading $HELMA_SERVICE: $HELMA_SERVICE"
|
echo -n "Reloading $HELMA_SERVICE: $HELMA_SERVICE"
|
||||||
touch $HELMA_HOME/server.properties
|
touch $HELMA_HOME/server.properties
|
||||||
touch $HELMA_HOME/apps.properties
|
touch $HELMA_HOME/apps.properties
|
||||||
echo "."
|
echo "."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: /etc/init.d/helma start|stop|restart|reload"
|
echo "Usage: /etc/init.d/helma start|stop|restart|reload"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
92
src/dist/extras/upstart/helma.conf
vendored
92
src/dist/extras/upstart/helma.conf
vendored
|
@ -1,72 +1,44 @@
|
||||||
##############################################################
|
#
|
||||||
###
|
# Helma Object Publisher configuration file
|
||||||
### Helma object publisher config file
|
#
|
||||||
### Author: Hannes Wallnoefer, <hannes@helma.at>
|
# Authors:
|
||||||
### Author: Andreas Bolka
|
# Hannes Wallnoefer <hannes@helma.at>,
|
||||||
###
|
# Andreas Bolka
|
||||||
### This file should be placed in /etc/helma.conf.
|
#
|
||||||
### It is read by the Helma service control script,
|
# This file should be placed in /etc/helma.conf.
|
||||||
### usually /etc/init.d/helma.
|
# It is read by the Helma service control script,
|
||||||
###
|
# usually /etc/init.d/helma.
|
||||||
##############################################################
|
#
|
||||||
|
|
||||||
##############################################################
|
# Full path to Java executable
|
||||||
### The name of this Helma server/service and the
|
JAVA_HOME=/usr/lib/jvm/default-java
|
||||||
### pid file to be used
|
JAVA_BIN=$JAVA_HOME/bin/java
|
||||||
#############################################################
|
|
||||||
|
# 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.
|
||||||
### Full path to Java executable
|
# This is where Helma will look for properties files and applications.
|
||||||
##############################################################
|
|
||||||
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
|
||||||
### Helma options. Possible options are:
|
# -p port - RMI port
|
||||||
###
|
# -w port - Web server port
|
||||||
### -f file Specify server.properties file
|
# -x port - XML-RPC port
|
||||||
### -p port Specify RMI port number
|
# -jk port - AJP13 port
|
||||||
### -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"
|
||||||
|
|
|
@ -24,15 +24,13 @@ 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 static final long serialVersionUID = 1811202114296536258L;
|
private String name;
|
||||||
|
private String value;
|
||||||
String name;
|
private String path;
|
||||||
String value;
|
private String domain;
|
||||||
String path;
|
private boolean isHttpOnly = true;
|
||||||
String domain;
|
private boolean isSecure = false;
|
||||||
int days = -1;
|
private int days = -1;
|
||||||
boolean secure;
|
|
||||||
boolean httpOnly;
|
|
||||||
|
|
||||||
CookieTrans(String name, String value) {
|
CookieTrans(String name, String value) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -55,9 +53,15 @@ 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() {
|
||||||
|
@ -65,8 +69,6 @@ public final class CookieTrans implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
|
@ -74,8 +76,6 @@ public final class CookieTrans implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
public int getDays() {
|
public int getDays() {
|
||||||
|
@ -83,8 +83,6 @@ public final class CookieTrans implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
public String getPath() {
|
public String getPath() {
|
||||||
|
@ -92,28 +90,24 @@ public final class CookieTrans implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return ...
|
* @return ...
|
||||||
*/
|
*/
|
||||||
public String getDomain() {
|
public String getDomain() {
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSecure() {
|
/**
|
||||||
return secure;
|
* @return ...
|
||||||
|
*/
|
||||||
|
public boolean getHttpOnly() {
|
||||||
|
return isHttpOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
void isSecure(boolean secure) {
|
/**
|
||||||
this.secure = secure;
|
* @return ...
|
||||||
}
|
*/
|
||||||
|
public boolean getSecure() {
|
||||||
public boolean isHttpOnly() {
|
return isSecure;
|
||||||
return httpOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
void isHttpOnly(boolean httpOnly) {
|
|
||||||
this.httpOnly = httpOnly;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,8 +141,8 @@ public final class CookieTrans implements Serializable {
|
||||||
c.setDomain(defaultDomain);
|
c.setDomain(defaultDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.setHttpOnly(httpOnly);
|
c.setHttpOnly(isHttpOnly);
|
||||||
c.setSecure(secure);
|
c.setSecure(isSecure);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
res.setCookie(key, value, -1, null, null, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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);
|
res.setCookie(key, value, days, null, null, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,7 +171,42 @@ 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);
|
res.setCookie(key, value, days, path, null, true, 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
|
||||||
|
*/
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -187,7 +222,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);
|
res.setCookie(key, value, days, path, domain, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,7 +232,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);
|
res.setCookie(key, "", 0, null, null, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -245,9 +280,9 @@ public class ResponseBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add an HTML formatted debug message to the end of the page.
|
* add HTML formatted debug messages to the end of the page.
|
||||||
*
|
*
|
||||||
* @param message the message
|
* @param messages the list of messages
|
||||||
*/
|
*/
|
||||||
public void debug(String... messages) {
|
public void debug(String... messages) {
|
||||||
if (messages == null) {
|
if (messages == null) {
|
||||||
|
|
|
@ -384,7 +384,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace special characters with entities, including <, > and ", thus allowing
|
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, 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 <, > and ", thus allowing
|
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing
|
||||||
* no HTML tags.
|
* no HTML tags.
|
||||||
*/
|
*/
|
||||||
public synchronized void encodeXml(Object what) {
|
public synchronized void encodeXml(Object what) {
|
||||||
|
@ -974,8 +974,10 @@ 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) {
|
public void setCookie(String key, String value, int days, String path, String domain, boolean isHttpOnly, boolean isSecure) {
|
||||||
CookieTrans c = null;
|
CookieTrans c = null;
|
||||||
|
|
||||||
if (cookies == null) {
|
if (cookies == null) {
|
||||||
|
@ -1001,11 +1003,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.isHttpOnly(true);
|
c.setHttpOnly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("true".equalsIgnoreCase(app.getProperty("cookies.secure"))) {
|
if ("true".equalsIgnoreCase(app.getProperty("cookies.secure"))) {
|
||||||
c.isSecure(true);
|
c.setSecure(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ public final class TypeManager {
|
||||||
protected synchronized void checkRepository(Repository repository, boolean update) throws IOException {
|
protected synchronized void checkRepository(Repository repository, boolean update) throws IOException {
|
||||||
Repository[] list = repository.getRepositories();
|
Repository[] list = repository.getRepositories();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
|
|
||||||
// ignore dir name found - compare to shortname (= Prototype name)
|
// ignore dir name found - compare to shortname (= Prototype name)
|
||||||
if (ignoreDirs.contains(list[i].getShortName())) {
|
if (ignoreDirs.contains(list[i].getShortName())) {
|
||||||
// jump this repository
|
// jump this repository
|
||||||
|
@ -140,7 +140,7 @@ public final class TypeManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list[i].isScriptRoot()) {
|
if (list[i].isScriptRoot()) {
|
||||||
// this is an embedded top-level script repository
|
// this is an embedded top-level script repository
|
||||||
if (app.addRepository(list[i], list[i].getParentRepository())) {
|
if (app.addRepository(list[i], list[i].getParentRepository())) {
|
||||||
// repository is new, check it
|
// repository is new, check it
|
||||||
checkRepository(list[i], update);
|
checkRepository(list[i], update);
|
||||||
|
@ -153,7 +153,7 @@ public final class TypeManager {
|
||||||
// if prototype doesn't exist, create it
|
// if prototype doesn't exist, create it
|
||||||
if (proto == null) {
|
if (proto == null) {
|
||||||
// create new prototype if type name is valid
|
// create new prototype if type name is valid
|
||||||
if (isValidTypeName(name))
|
if (isValidTypeName(name))
|
||||||
createPrototype(name, list[i], null);
|
createPrototype(name, list[i], null);
|
||||||
} else {
|
} else {
|
||||||
proto.addRepository(list[i], update);
|
proto.addRepository(list[i], update);
|
||||||
|
@ -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, new Long(repository.lastModified()));
|
lastRepoScan.put(repository, Long.valueOf(repository.lastModified()));
|
||||||
checkRepository(repository, false);
|
checkRepository(repository, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ public final class TypeManager {
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
|
System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
// update prototype's type mapping
|
// update prototype's type mapping
|
||||||
DbMapping dbmap = proto.getDbMapping();
|
DbMapping dbmap = proto.getDbMapping();
|
||||||
|
|
|
@ -16,21 +16,21 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A few explanations:
|
* A few explanations:
|
||||||
*
|
*
|
||||||
* - this.image is either an AWT Image or a BufferedImage.
|
* - this.image is either an AWT Image or a BufferedImage.
|
||||||
* It depends on the ImageGenerator in what form the Image initially is.
|
* It depends on the ImageGenerator in what form the Image initially is.
|
||||||
* (the ImageIO implementation only uses BufferedImages for example.)
|
* (the ImageIO implementation only uses BufferedImages for example.)
|
||||||
*
|
*
|
||||||
* As soon as some action that needs the graphics object is performed and the
|
* As soon as some action that needs the graphics object is performed and the
|
||||||
* image is still in AWT format, it is converted to a BufferedImage
|
* image is still in AWT format, it is converted to a BufferedImage
|
||||||
*
|
*
|
||||||
* Any internal function that performs graphical actions needs to call
|
* Any internal function that performs graphical actions needs to call
|
||||||
* getGraphics, never rely on this.graphics being set correctly!
|
* getGraphics, never rely on this.graphics being set correctly!
|
||||||
*
|
*
|
||||||
* - ImageWrapper objects are created and safed by the ImageGenerator class
|
* - ImageWrapper objects are created and safed by the ImageGenerator class
|
||||||
* all different implementations of Imaging functionallity are implemented
|
* all different implementations of Imaging functionallity are implemented
|
||||||
* as a ImageGenerator extending class.
|
* as a ImageGenerator extending class.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package helma.image;
|
package helma.image;
|
||||||
|
@ -52,7 +52,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ImageWrapper object.
|
* Creates a new ImageWrapper object.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param width ...
|
* @param width ...
|
||||||
* @param height ...
|
* @param height ...
|
||||||
|
@ -66,7 +66,7 @@ public class ImageWrapper {
|
||||||
// graphics are turned off by default. getGraphics activates it if necessary.
|
// graphics are turned off by default. getGraphics activates it if necessary.
|
||||||
this.graphics = null;
|
this.graphics = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageWrapper(Image image, ImageGenerator generator) {
|
public ImageWrapper(Image image, ImageGenerator generator) {
|
||||||
this(image, image.getWidth(null), image.getHeight(null), generator);
|
this(image, image.getWidth(null), image.getHeight(null), generator);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class ImageWrapper {
|
||||||
* not. By using getBufferedImage, images are only converted to a
|
* not. By using getBufferedImage, images are only converted to a
|
||||||
* getBufferedImage when this is actually needed, which is better than
|
* getBufferedImage when this is actually needed, which is better than
|
||||||
* storing images as BufferedImage in general.
|
* storing images as BufferedImage in general.
|
||||||
*
|
*
|
||||||
* @return the Image object as a BufferedImage
|
* @return the Image object as a BufferedImage
|
||||||
*/
|
*/
|
||||||
public BufferedImage getBufferedImage() {
|
public BufferedImage getBufferedImage() {
|
||||||
|
@ -94,9 +94,9 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Graphics object to directly paint to this Image. Converts the
|
* Returns the Graphics object to directly paint to this Image. Converts the
|
||||||
* internal image to a BufferedImage if necessary.
|
* internal image to a BufferedImage if necessary.
|
||||||
*
|
*
|
||||||
* @return the Graphics object for drawing into this image
|
* @return the Graphics object for drawing into this image
|
||||||
*/
|
*/
|
||||||
public Graphics2D getGraphics() {
|
public Graphics2D getGraphics() {
|
||||||
|
@ -107,7 +107,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
return graphics;
|
return graphics;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the internal image and clears the stored graphics object.
|
* Sets the internal image and clears the stored graphics object.
|
||||||
* Any code that is changing the internal image should do it through this function
|
* Any code that is changing the internal image should do it through this function
|
||||||
|
@ -129,7 +129,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this image.
|
* Creates and returns a copy of this image.
|
||||||
*
|
*
|
||||||
* @return a clone of this image.
|
* @return a clone of this image.
|
||||||
*/
|
*/
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
|
@ -141,7 +141,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Image object represented by this ImageWrapper.
|
* Returns the Image object represented by this ImageWrapper.
|
||||||
*
|
*
|
||||||
* @return the image object
|
* @return the image object
|
||||||
*/
|
*/
|
||||||
public Image getImage() {
|
public Image getImage() {
|
||||||
|
@ -150,7 +150,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ImageProducer of the wrapped image
|
* Returns the ImageProducer of the wrapped image
|
||||||
*
|
*
|
||||||
* @return the images's ImageProducer
|
* @return the images's ImageProducer
|
||||||
*/
|
*/
|
||||||
public ImageProducer getSource() {
|
public ImageProducer getSource() {
|
||||||
|
@ -180,7 +180,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param red ...
|
* @param red ...
|
||||||
* @param green ...
|
* @param green ...
|
||||||
* @param blue ...
|
* @param blue ...
|
||||||
|
@ -191,7 +191,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(int color) {
|
public void setColor(int color) {
|
||||||
|
@ -200,7 +200,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(Color color) {
|
public void setColor(Color color) {
|
||||||
|
@ -209,7 +209,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(String color) {
|
public void setColor(String color) {
|
||||||
|
@ -217,7 +217,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Draws a string to this image at the given coordinates.
|
* Draws a string to this image at the given coordinates.
|
||||||
*
|
*
|
||||||
* @param str ...
|
* @param str ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
|
@ -228,7 +228,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a line to this image from x1/y1 to x2/y2.
|
* Draws a line to this image from x1/y1 to x2/y2.
|
||||||
*
|
*
|
||||||
* @param x1 ...
|
* @param x1 ...
|
||||||
* @param y1 ...
|
* @param y1 ...
|
||||||
* @param x2 ...
|
* @param x2 ...
|
||||||
|
@ -240,7 +240,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a rectangle to this image.
|
* Draws a rectangle to this image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -252,12 +252,12 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(String filename, int x, int y)
|
public void drawImage(String filename, int x, int y)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Image img = generator.read(filename);
|
Image img = generator.read(filename);
|
||||||
if (img != null)
|
if (img != null)
|
||||||
|
@ -266,30 +266,30 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(ImageWrapper image, int x, int y)
|
public void drawImage(ImageWrapper image, int x, int y)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
getGraphics().drawImage(image.getImage(), x, y, null);
|
getGraphics().drawImage(image.getImage(), x, y, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param at ...
|
* @param at ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(ImageWrapper image, AffineTransform at)
|
public void drawImage(ImageWrapper image, AffineTransform at)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
getGraphics().drawImage(image.getImage(), at, null);
|
getGraphics().drawImage(image.getImage(), at, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a filled rectangle to this image.
|
* Draws a filled rectangle to this image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -301,7 +301,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the width of this image.
|
* Returns the width of this image.
|
||||||
*
|
*
|
||||||
* @return the width of this image
|
* @return the width of this image
|
||||||
*/
|
*/
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
|
@ -310,7 +310,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the height of this image.
|
* Returns the height of this image.
|
||||||
*
|
*
|
||||||
* @return the height of this image
|
* @return the height of this image
|
||||||
*/
|
*/
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
|
@ -319,7 +319,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crops the image.
|
* Crops the image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -340,21 +340,21 @@ public class ImageWrapper {
|
||||||
setImage(buffered);
|
setImage(buffered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims the image.
|
* Trims the image.
|
||||||
*
|
*
|
||||||
* @param x the x-coordinate of the pixel specifying the background color
|
* @param x the x-coordinate of the pixel specifying the background color
|
||||||
* @param y the y-coordinate of the pixel specifying the background color
|
* @param y the y-coordinate of the pixel specifying the background color
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void trim(int x, int y) {
|
public void trim(int x, int y) {
|
||||||
trim(x, y, true, true, true, true);
|
trim(x, y, true, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims the image.
|
* Trims the image.
|
||||||
*
|
*
|
||||||
* @param x
|
* @param x
|
||||||
* @param y
|
* @param y
|
||||||
* @param trimLeft
|
* @param trimLeft
|
||||||
|
@ -369,7 +369,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
// create a BufferedImage of only 1 pixel height for fetching the rows of the image in the correct format (ARGB)
|
// create a BufferedImage of only 1 pixel height for fetching the rows of the image in the correct format (ARGB)
|
||||||
// This speeds up things by more than factor 2, compared to the standard BufferedImage.getRGB solution,
|
// This speeds up things by more than factor 2, compared to the standard BufferedImage.getRGB solution,
|
||||||
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
||||||
// very optimized code which may even be hardware accelerated.
|
// very optimized code which may even be hardware accelerated.
|
||||||
if (trimTop || trimBottom) {
|
if (trimTop || trimBottom) {
|
||||||
BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
|
BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
@ -445,7 +445,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
crop(left, top, right - left + 1, bottom - top + 1);
|
crop(left, top, right - left + 1, bottom - top + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the image using the Graphics2D approach
|
* Resizes the image using the Graphics2D approach
|
||||||
*/
|
*/
|
||||||
|
@ -453,12 +453,12 @@ public class ImageWrapper {
|
||||||
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D g2d = buffered.createGraphics();
|
Graphics2D g2d = buffered.createGraphics();
|
||||||
|
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||||
smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :
|
smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :
|
||||||
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
|
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
|
||||||
);
|
);
|
||||||
|
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
||||||
smooth ? RenderingHints.VALUE_RENDER_QUALITY :
|
smooth ? RenderingHints.VALUE_RENDER_QUALITY :
|
||||||
RenderingHints.VALUE_RENDER_SPEED
|
RenderingHints.VALUE_RENDER_SPEED
|
||||||
);
|
);
|
||||||
|
@ -474,7 +474,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the image
|
* Resizes the image
|
||||||
*
|
*
|
||||||
* @param w ...
|
* @param w ...
|
||||||
* @param h ...
|
* @param h ...
|
||||||
*/
|
*/
|
||||||
|
@ -494,7 +494,7 @@ public class ImageWrapper {
|
||||||
// Image scaled = ImageWaiter.waitForImage(image.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING));
|
// Image scaled = ImageWaiter.waitForImage(image.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING));
|
||||||
// if (scaled == null)
|
// if (scaled == null)
|
||||||
// throw new RuntimeException("Image cannot be resized.");
|
// throw new RuntimeException("Image cannot be resized.");
|
||||||
|
|
||||||
// This version is up to 4 times faster than getScaledInstance:
|
// This version is up to 4 times faster than getScaledInstance:
|
||||||
ImageFilterOp filter = new ImageFilterOp(new AreaAveragingScaleFilter(w, h));
|
ImageFilterOp filter = new ImageFilterOp(new AreaAveragingScaleFilter(w, h));
|
||||||
setImage(filter.filter(getBufferedImage(), null));
|
setImage(filter.filter(getBufferedImage(), null));
|
||||||
|
@ -503,7 +503,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize the image, using a fast and cheap algorithm
|
* Resize the image, using a fast and cheap algorithm
|
||||||
*
|
*
|
||||||
* @param w ...
|
* @param w ...
|
||||||
* @param h ...
|
* @param h ...
|
||||||
*/
|
*/
|
||||||
|
@ -513,8 +513,8 @@ 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 <= 256.
|
* @param colors colors the number of colors to use, usually {@literal <}= 256.
|
||||||
*/
|
*/
|
||||||
public void reduceColors(int colors) {
|
public void reduceColors(int colors) {
|
||||||
reduceColors(colors, false);
|
reduceColors(colors, false);
|
||||||
|
@ -522,8 +522,8 @@ 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 <= 256.
|
* @param colors colors the number of colors to use, usually {@literal <}= 256.
|
||||||
* @param dither ...
|
* @param dither ...
|
||||||
*/
|
*/
|
||||||
public void reduceColors(int colors, boolean dither) {
|
public void reduceColors(int colors, boolean dither) {
|
||||||
|
@ -533,8 +533,8 @@ 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 <= 256.
|
* @param colors the number of colors to use, usually {@literal <}= 256.
|
||||||
* @param dither ...
|
* @param dither ...
|
||||||
* @param alphaToBitmask ...
|
* @param alphaToBitmask ...
|
||||||
*/
|
*/
|
||||||
|
@ -546,7 +546,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the image. Image format is deduced from filename.
|
* Save the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@ -557,7 +557,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from filename.
|
* Saves the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
@ -569,7 +569,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from filename.
|
* Saves the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
* @param alpha ...
|
* @param alpha ...
|
||||||
|
@ -579,10 +579,10 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, checkFilename(filename), quality, alpha);
|
generator.write(this, checkFilename(filename), quality, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
@ -591,10 +591,10 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, out, mimeType, -1f, false); // -1 means default quality
|
generator.write(this, out, mimeType, -1f, false); // -1 means default quality
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
|
@ -607,7 +607,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
|
@ -618,7 +618,7 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, out, mimeType, quality, alpha);
|
generator.write(this, out, mimeType, quality, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the palette index of the transparent color for Images with an
|
* Sets the palette index of the transparent color for Images with an
|
||||||
* IndexColorModel. This can be used together with
|
* IndexColorModel. This can be used together with
|
||||||
|
@ -648,7 +648,7 @@ public class ImageWrapper {
|
||||||
/**
|
/**
|
||||||
* Returns the pixel at x, y. If the image is indexed, it returns the
|
* Returns the pixel at x, y. If the image is indexed, it returns the
|
||||||
* palette index, otherwise the rgb code of the color is returned.
|
* palette index, otherwise the rgb code of the color is returned.
|
||||||
*
|
*
|
||||||
* @param x the x coordinate of the pixel
|
* @param x the x coordinate of the pixel
|
||||||
* @param y the y coordinate of the pixel
|
* @param y the y coordinate of the pixel
|
||||||
* @return the pixel at x, y
|
* @return the pixel at x, y
|
||||||
|
@ -676,4 +676,4 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
return file.getPath();
|
return file.getPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,10 +473,10 @@ public class ApplicationManager implements XmlRpcHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// bind to Jetty HTTP server
|
// bind to Jetty HTTP server
|
||||||
if (ApplicationManager.this.jetty != null) {
|
if (jetty != null) {
|
||||||
if(ApplicationManager.this.context == null) {
|
if (context == null) {
|
||||||
ApplicationManager.this.context = new ContextHandlerCollection();
|
context = new ContextHandlerCollection();
|
||||||
ApplicationManager.this.jetty.getHttpServer().setHandler(ApplicationManager.this.context);
|
jetty.getHttpServer().setHandler(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there is a static direcory specified, mount it
|
// if there is a static direcory specified, mount it
|
||||||
|
@ -501,9 +501,8 @@ 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);
|
||||||
appContext.addServlet(holder, "/*"); //$NON-NLS-1$
|
holder.setInitParameter("application", appName);
|
||||||
|
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$
|
||||||
|
@ -529,9 +528,9 @@ public class ApplicationManager implements XmlRpcHandler {
|
||||||
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
|
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.protectedStaticDir != null) {
|
if (protectedStaticDir != null) {
|
||||||
File protectedContent = getAbsoluteFile(this.protectedStaticDir);
|
File protectedContent = getAbsoluteFile(protectedStaticDir);
|
||||||
this.appContext.setResourceBase(protectedContent.getPath());
|
appContext.setResourceBase(protectedContent.getPath());
|
||||||
getLogger().info("Serving protected static from " +
|
getLogger().info("Serving protected static from " +
|
||||||
protectedContent.getPath());
|
protectedContent.getPath());
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,13 @@ import helma.util.ResourceProperties;
|
||||||
*/
|
*/
|
||||||
public class Server implements Runnable {
|
public class Server implements Runnable {
|
||||||
// version string
|
// version string
|
||||||
public static final String version = "🐜 (__builddate__)";
|
public static final String version = "__version__";
|
||||||
|
|
||||||
|
// build date
|
||||||
|
public static final String buildDate = "__builddate__";
|
||||||
|
|
||||||
|
// commit hash
|
||||||
|
public static final String commitHash = "__commithash__";
|
||||||
|
|
||||||
// static server instance
|
// static server instance
|
||||||
private static Server server;
|
private static Server server;
|
||||||
|
@ -143,17 +149,13 @@ public class Server implements Runnable {
|
||||||
* check if we are running on a Java 2 VM - otherwise exit with an error message
|
* check if we are running on a Java 2 VM - otherwise exit with an error message
|
||||||
*/
|
*/
|
||||||
public static void checkJavaVersion() {
|
public static void checkJavaVersion() {
|
||||||
String javaVersion = System.getProperty("java.version");
|
String javaVersion = System.getProperty("java.version", "0");
|
||||||
|
int majorVersion = Integer.parseInt(javaVersion.split("\\.")[0]);
|
||||||
|
|
||||||
if ((javaVersion == null) || javaVersion.startsWith("1.5")
|
if (majorVersion < 11) {
|
||||||
|| javaVersion.startsWith("1.4")
|
System.err.println("This version of Helma requires Java 11 or greater.");
|
||||||
|| javaVersion.startsWith("1.3")
|
|
||||||
|| javaVersion.startsWith("1.2")
|
|
||||||
|| javaVersion.startsWith("1.1")
|
|
||||||
|| javaVersion.startsWith("1.0")) {
|
|
||||||
System.err.println("This version of Helma requires Java 1.6 or greater.");
|
|
||||||
|
|
||||||
if (javaVersion == null) { // don't think this will ever happen, but you never know
|
if (majorVersion == 0) { // don't think this will ever happen, but you never know
|
||||||
System.err.println("Your Java Runtime did not provide a version number. Please update to a more recent version.");
|
System.err.println("Your Java Runtime did not provide a version number. Please update to a more recent version.");
|
||||||
} else {
|
} else {
|
||||||
System.err.println("Your Java Runtime is version " + javaVersion +
|
System.err.println("Your Java Runtime is version " + javaVersion +
|
||||||
|
|
|
@ -76,13 +76,13 @@ public final class TransientProperty implements IProperty, Serializable {
|
||||||
return svalue;
|
return svalue;
|
||||||
|
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
return new Boolean(bvalue);
|
return Boolean.valueOf(bvalue);
|
||||||
|
|
||||||
case INTEGER:
|
case INTEGER:
|
||||||
return new Long(lvalue);
|
return Long.valueOf(lvalue);
|
||||||
|
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
return new Double(dvalue);
|
return Double.valueOf(dvalue);
|
||||||
|
|
||||||
case DATE:
|
case DATE:
|
||||||
return new Date(lvalue);
|
return new Date(lvalue);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INTEGER:
|
case INTEGER:
|
||||||
value = new Long(in.readLong());
|
value = Long.valueOf(in.readLong());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
value = new Double(in.readDouble());
|
value = Double.valueOf(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 = new Long(l);
|
value = Long.valueOf(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 = new Double(d);
|
value = Double.valueOf(d);
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,4 +544,4 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
Property p = (Property) obj;
|
Property p = (Property) obj;
|
||||||
return value == null ? p.value == null : value.equals(p.value);
|
return value == null ? p.value == null : value.equals(p.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, new Long(System.currentTimeMillis()));
|
testedConnections.put(src, Long.valueOf(System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,7 +262,7 @@ public class Transactor {
|
||||||
stmt.execute("SELECT 1");
|
stmt.execute("SELECT 1");
|
||||||
}
|
}
|
||||||
stmt.close();
|
stmt.close();
|
||||||
testedConnections.put(src, new Long(now));
|
testedConnections.put(src, Long.valueOf(now));
|
||||||
} catch (SQLException sx) {
|
} catch (SQLException sx) {
|
||||||
try {
|
try {
|
||||||
con.close();
|
con.close();
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Date;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class XmlDatabaseReader extends DefaultHandler implements XmlConstants {
|
public final class XmlDatabaseReader extends DefaultHandler implements XmlConstants {
|
||||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
|
@ -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((new Double(charValue)).doubleValue());
|
prop.setFloatValue((Double.valueOf(charValue)).doubleValue());
|
||||||
} else if ("integer".equals(elementType)) {
|
} else if ("integer".equals(elementType)) {
|
||||||
prop.setIntegerValue((new Long(charValue)).longValue());
|
prop.setIntegerValue((Long.valueOf(charValue)).longValue());
|
||||||
} else {
|
} else {
|
||||||
prop.setStringValue(charValue);
|
prop.setStringValue(charValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.HashMap;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class XmlReader extends DefaultHandler implements XmlConstants {
|
public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
|
@ -213,9 +213,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||||
if (propName == null) {
|
if (propName == null) {
|
||||||
propName = qName;
|
propName = qName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("hop:parent".equals(qName)) {
|
if ("hop:parent".equals(qName)) {
|
||||||
// FIXME: we ought to set parent here, but we're
|
// FIXME: we ought to set parent here, but we're
|
||||||
// dealing with INodes, which don't have a setParent().
|
// dealing with INodes, which don't have a setParent().
|
||||||
} else {
|
} else {
|
||||||
currentNode.setNode(propName, n);
|
currentNode.setNode(propName, n);
|
||||||
|
@ -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, (new Double(charValue)).doubleValue());
|
currentNode.setFloat(elementName, (Double.valueOf(charValue)).doubleValue());
|
||||||
} else if ("integer".equals(elementType)) {
|
} else if ("integer".equals(elementType)) {
|
||||||
currentNode.setInteger(elementName, (new Long(charValue)).longValue());
|
currentNode.setInteger(elementName, (Long.valueOf(charValue)).longValue());
|
||||||
} else {
|
} else {
|
||||||
currentNode.setString(elementName, charValue);
|
currentNode.setString(elementName, charValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
INode node = getNode();
|
INode node = getNode();
|
||||||
|
|
||||||
if (skin != null) {
|
if (skin != null) {
|
||||||
skin.render(engine.reval, node,
|
skin.render(engine.reval, node,
|
||||||
(paramobj == Undefined.instance) ? null : paramobj);
|
(paramobj == Undefined.instance) ? null : paramobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
public int jsFunction_contains(Object obj) {
|
public int jsFunction_contains(Object obj) {
|
||||||
return jsFunction_indexOf(obj);
|
return jsFunction_indexOf(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a property in this HopObject
|
* Set a property in this HopObject
|
||||||
*
|
*
|
||||||
|
@ -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 = { new Long(d.getTime()) };
|
Object[] args = { Long.valueOf(d.getTime()) };
|
||||||
try {
|
try {
|
||||||
return cx.newObject(core.global, "Date", args);
|
return cx.newObject(core.global, "Date", args);
|
||||||
} catch (JavaScriptException nafx) {
|
} catch (JavaScriptException nafx) {
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
/*
|
/*
|
||||||
* The contents of this file are subject to the terms
|
* The contents of this file are subject to the terms
|
||||||
* of the Common Development and Distribution License
|
* of the Common Development and Distribution License
|
||||||
* (the License). You may not use this file except in
|
* (the License). You may not use this file except in
|
||||||
* compliance with the License.
|
* compliance with the License.
|
||||||
*
|
*
|
||||||
* You can obtain a copy of the license at
|
* You can obtain a copy of the license at
|
||||||
* https://glassfish.dev.java.net/public/CDDLv1.0.html or
|
* https://glassfish.dev.java.net/public/CDDLv1.0.html or
|
||||||
* glassfish/bootstrap/legal/CDDLv1.0.txt.
|
* glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||||
* See the License for the specific language governing
|
* See the License for the specific language governing
|
||||||
* permissions and limitations under the License.
|
* permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
* When distributing Covered Code, include this CDDL
|
* When distributing Covered Code, include this CDDL
|
||||||
* Header Notice in each file and include the License file
|
* Header Notice in each file and include the License file
|
||||||
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||||
* If applicable, add the following below the CDDL Header,
|
* If applicable, add the following below the CDDL Header,
|
||||||
* with the fields enclosed by brackets [] replaced by
|
* with the fields enclosed by brackets [] replaced by
|
||||||
* you own identifying information:
|
* you own identifying information:
|
||||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||||
*
|
*
|
||||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package helma.scripting.rhino;
|
package helma.scripting.rhino;
|
||||||
|
|
||||||
import org.mozilla.javascript.*;
|
import org.mozilla.javascript.*;
|
||||||
|
@ -71,7 +71,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
private JSAdapter(Scriptable obj) {
|
private JSAdapter(Scriptable obj) {
|
||||||
setAdaptee(obj);
|
setAdaptee(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initializer to setup JSAdapter prototype in the given scope
|
// initializer to setup JSAdapter prototype in the given scope
|
||||||
public static void init(Context cx, Scriptable scope, boolean sealed)
|
public static void init(Context cx, Scriptable scope, boolean sealed)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
|
@ -82,11 +82,11 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
|
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
|
||||||
ScriptableObject.DONTENUM);
|
ScriptableObject.DONTENUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "JSAdapter";
|
return "JSAdapter";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String name, Scriptable start) {
|
public Object get(String name, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(GET_PROP);
|
Function func = getAdapteeFunction(GET_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -96,17 +96,17 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return start.get(name, start);
|
return start.get(name, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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[] { new Integer(index) });
|
return call(func, new Object[] { Integer.valueOf(index) });
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
return start.get(index, start);
|
return start.get(index, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(String name, Scriptable start) {
|
public boolean has(String name, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(HAS_PROP);
|
Function func = getAdapteeFunction(HAS_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -117,18 +117,18 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return start.has(name, start);
|
return start.has(name, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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[] { new Integer(index) });
|
Object res = call(func, new Object[] { Integer.valueOf(index) });
|
||||||
return Context.toBoolean(res);
|
return Context.toBoolean(res);
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
return start.has(index, start);
|
return start.has(index, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String name, Scriptable start, Object value) {
|
public void put(String name, Scriptable start, Object value) {
|
||||||
if (start == this) {
|
if (start == this) {
|
||||||
Function func = getAdapteeFunction(PUT_PROP);
|
Function func = getAdapteeFunction(PUT_PROP);
|
||||||
|
@ -142,12 +142,12 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
start.put(name, start, value);
|
start.put(name, start, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(int index, Scriptable start, Object value) {
|
public void put(int index, Scriptable start, Object value) {
|
||||||
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[] { new Integer(index), value });
|
call(func, new Object[] { Integer.valueOf(index), value });
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
start.put(index, start, value);
|
start.put(index, start, value);
|
||||||
|
@ -156,7 +156,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
start.put(index, start, value);
|
start.put(index, start, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(String name) {
|
public void delete(String name) {
|
||||||
Function func = getAdapteeFunction(DEL_PROP);
|
Function func = getAdapteeFunction(DEL_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -165,32 +165,32 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
getAdaptee().delete(name);
|
getAdaptee().delete(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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[] { new Integer(index) });
|
call(func, new Object[] { Integer.valueOf(index) });
|
||||||
} else {
|
} else {
|
||||||
getAdaptee().delete(index);
|
getAdaptee().delete(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getPrototype() {
|
public Scriptable getPrototype() {
|
||||||
return prototype;
|
return prototype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrototype(Scriptable prototype) {
|
public void setPrototype(Scriptable prototype) {
|
||||||
this.prototype = prototype;
|
this.prototype = prototype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getParentScope() {
|
public Scriptable getParentScope() {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParentScope(Scriptable parent) {
|
public void setParentScope(Scriptable parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object[] getIds() {
|
public Object[] getIds() {
|
||||||
Function func = getAdapteeFunction(GET_PROPIDS);
|
Function func = getAdapteeFunction(GET_PROPIDS);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -226,7 +226,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return getAdaptee().getIds();
|
return getAdaptee().getIds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasInstance(Scriptable scriptable) {
|
public boolean hasInstance(Scriptable scriptable) {
|
||||||
if (scriptable instanceof JSAdapter) {
|
if (scriptable instanceof JSAdapter) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -239,11 +239,11 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getDefaultValue(Class hint) {
|
public Object getDefaultValue(Class hint) {
|
||||||
return ScriptableObject.getDefaultValue(this, hint);
|
return ScriptableObject.getDefaultValue(this, hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
||||||
Object[] args)
|
Object[] args)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
|
@ -258,7 +258,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
|
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
if (isPrototype) {
|
if (isPrototype) {
|
||||||
|
@ -279,38 +279,38 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getAdaptee() {
|
public Scriptable getAdaptee() {
|
||||||
return adaptee;
|
return adaptee;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdaptee(Scriptable adaptee) {
|
public void setAdaptee(Scriptable adaptee) {
|
||||||
if (adaptee == null) {
|
if (adaptee == null) {
|
||||||
throw new NullPointerException("adaptee can not be null");
|
throw new NullPointerException("adaptee can not be null");
|
||||||
}
|
}
|
||||||
this.adaptee = adaptee;
|
this.adaptee = adaptee;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-- internals only below this point
|
//-- internals only below this point
|
||||||
|
|
||||||
// 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 new Integer(((Double)tmp).intValue());
|
return Integer.valueOf(((Double)tmp).intValue());
|
||||||
} else {
|
} else {
|
||||||
return Context.toString(tmp);
|
return Context.toString(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Scriptable getFunctionPrototype(Scriptable scope) {
|
private static Scriptable getFunctionPrototype(Scriptable scope) {
|
||||||
return ScriptableObject.getFunctionPrototype(scope);
|
return ScriptableObject.getFunctionPrototype(scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Function getAdapteeFunction(String name) {
|
private Function getAdapteeFunction(String name) {
|
||||||
Object o = ScriptableObject.getProperty(getAdaptee(), name);
|
Object o = ScriptableObject.getProperty(getAdaptee(), name);
|
||||||
return (o instanceof Function)? (Function)o : null;
|
return (o instanceof Function)? (Function)o : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object call(Function func, Object[] args) {
|
private Object call(Function func, Object[] args) {
|
||||||
Context cx = Context.getCurrentContext();
|
Context cx = Context.getCurrentContext();
|
||||||
Scriptable thisObj = getAdaptee();
|
Scriptable thisObj = getAdaptee();
|
||||||
|
@ -321,12 +321,12 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
throw Context.reportRuntimeError(re.getMessage());
|
throw Context.reportRuntimeError(re.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Scriptable prototype;
|
private Scriptable prototype;
|
||||||
private Scriptable parent;
|
private Scriptable parent;
|
||||||
private Scriptable adaptee;
|
private Scriptable adaptee;
|
||||||
private boolean isPrototype;
|
private boolean isPrototype;
|
||||||
|
|
||||||
// names of adaptee JavaScript functions
|
// names of adaptee JavaScript functions
|
||||||
private static final String GET_PROP = "__get__";
|
private static final String GET_PROP = "__get__";
|
||||||
private static final String HAS_PROP = "__has__";
|
private static final String HAS_PROP = "__has__";
|
||||||
|
|
|
@ -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] = new Integer(i);
|
ids[i] = Integer.valueOf(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids;
|
||||||
|
|
|
@ -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 JS 1.8
|
// language version - default to ES6
|
||||||
int languageVersion = 180;
|
int languageVersion = 200;
|
||||||
|
|
||||||
// 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 = { new Long(d.getTime()) };
|
Object[] args = { Long.valueOf(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 new Double(n.doubleValue());
|
return Double.valueOf(n.doubleValue());
|
||||||
} else if (!(arg instanceof Double)) {
|
} else if (!(arg instanceof Double)) {
|
||||||
return new Integer(n.intValue());
|
return Integer.valueOf(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 = { new Long(((Date) obj).getTime()) };
|
Object[] args = { Long.valueOf(((Date) obj).getTime()) };
|
||||||
try {
|
try {
|
||||||
return cx.newObject(global, "Date", args);
|
return cx.newObject(global, "Date", args);
|
||||||
} catch (JavaScriptException nafx) {
|
} catch (JavaScriptException nafx) {
|
||||||
|
|
|
@ -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(new Long(time));
|
timer.push(Long.valueOf(time));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -216,6 +216,23 @@ 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;
|
||||||
|
|
||||||
|
@ -439,7 +456,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 new Integer(colNames.size());
|
return Integer.valueOf(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");
|
||||||
|
@ -498,12 +515,12 @@ public class DatabaseObject {
|
||||||
case Types.BIGINT:
|
case Types.BIGINT:
|
||||||
case Types.SMALLINT:
|
case Types.SMALLINT:
|
||||||
case Types.INTEGER:
|
case Types.INTEGER:
|
||||||
return new Long(resultSet.getLong(index));
|
return Long.valueOf(resultSet.getLong(index));
|
||||||
|
|
||||||
case Types.REAL:
|
case Types.REAL:
|
||||||
case Types.FLOAT:
|
case Types.FLOAT:
|
||||||
case Types.DOUBLE:
|
case Types.DOUBLE:
|
||||||
return new Double(resultSet.getDouble(index));
|
return Double.valueOf(resultSet.getDouble(index));
|
||||||
|
|
||||||
case Types.DECIMAL:
|
case Types.DECIMAL:
|
||||||
case Types.NUMERIC:
|
case Types.NUMERIC:
|
||||||
|
@ -513,9 +530,9 @@ public class DatabaseObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num.scale() > 0) {
|
if (num.scale() > 0) {
|
||||||
return new Double(num.doubleValue());
|
return Double.valueOf(num.doubleValue());
|
||||||
} else {
|
} else {
|
||||||
return new Long(num.longValue());
|
return Long.valueOf(num.longValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
case Types.VARBINARY:
|
case Types.VARBINARY:
|
||||||
|
|
|
@ -554,8 +554,13 @@ 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();
|
||||||
addIPAddress(buffer, request.getRemoteAddr());
|
String ip = request.getHeader("X-Forwarded-For");
|
||||||
addIPAddress(buffer, request.getHeader("X-Forwarded-For"));
|
if (ip != null && ip.length() != 0) {
|
||||||
|
addIPAddress(buffer, ip);
|
||||||
|
} else {
|
||||||
|
addIPAddress(buffer, request.getRemoteAddr());
|
||||||
|
}
|
||||||
|
// 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);
|
||||||
|
@ -748,7 +753,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 "=" or "&" character
|
* where the name or value includes an encoded {@code =} or {@code &} 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.
|
||||||
|
|
|
@ -10,39 +10,39 @@ package helma.util;
|
||||||
/**
|
/**
|
||||||
* The Protomatter Software License, Version 1.0
|
* The Protomatter Software License, Version 1.0
|
||||||
* derived from The Apache Software License, Version 1.1
|
* derived from The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
|
* Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution,
|
* 3. The end-user documentation included with the redistribution,
|
||||||
* if any, must include the following acknowledgment:
|
* if any, must include the following acknowledgment:
|
||||||
* "This product includes software developed for the
|
* "This product includes software developed for the
|
||||||
* Protomatter Software Project
|
* Protomatter Software Project
|
||||||
* (http://protomatter.sourceforge.net/)."
|
* (http://protomatter.sourceforge.net/)."
|
||||||
* Alternately, this acknowledgment may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowledgments normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "Protomatter" and "Protomatter Software Project" must
|
* 4. The names "Protomatter" and "Protomatter Software Project" must
|
||||||
* not be used to endorse or promote products derived from this
|
* not be used to endorse or promote products derived from this
|
||||||
* software without prior written permission. For written
|
* software without prior written permission. For written
|
||||||
* permission, please contact support@protomatter.com.
|
* permission, please contact support@protomatter.com.
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Protomatter",
|
* 5. Products derived from this software may not be called "Protomatter",
|
||||||
* nor may "Protomatter" appear in their name, without prior written
|
* nor may "Protomatter" appear in their name, without prior written
|
||||||
* permission of the Protomatter Software Project
|
* permission of the Protomatter Software Project
|
||||||
* (support@protomatter.com).
|
* (support@protomatter.com).
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
@ -103,7 +103,7 @@ public class CronJob {
|
||||||
* cron.name1.minute = minute-list
|
* cron.name1.minute = minute-list
|
||||||
*
|
*
|
||||||
* cron.name1.timeout = timeout-value
|
* cron.name1.timeout = timeout-value
|
||||||
*
|
*
|
||||||
* </pre></blockquote><p>
|
* </pre></blockquote><p>
|
||||||
*
|
*
|
||||||
* And delivers corresponding <tt>CronJob</tt> objects in a collection.
|
* And delivers corresponding <tt>CronJob</tt> objects in a collection.
|
||||||
|
@ -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 = new Integer(cal.get(Calendar.YEAR));
|
Integer theYear = Integer.valueOf(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 = new Integer(cal.get(Calendar.MONTH));
|
Integer theMonth = Integer.valueOf(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 = new Integer(cal.get(Calendar.DAY_OF_MONTH));
|
Integer theDay = Integer.valueOf(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 = new Integer(cal.get(Calendar.DAY_OF_WEEK));
|
Integer theWeekDay = Integer.valueOf(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 = new Integer(cal.get(Calendar.HOUR_OF_DAY));
|
Integer theHour = Integer.valueOf(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 = new Integer(cal.get(Calendar.MINUTE));
|
Integer theMinute = Integer.valueOf(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(new Integer(year));
|
this.year.add(Integer.valueOf(year));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -492,7 +492,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeYear(int year)
|
public void removeYear(int year)
|
||||||
{
|
{
|
||||||
this.year.remove(new Integer(year));
|
this.year.remove(Integer.valueOf(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(new Integer(month));
|
this.month.add(Integer.valueOf(month));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -530,7 +530,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeMonth(int month)
|
public void removeMonth(int month)
|
||||||
{
|
{
|
||||||
this.month.remove(new Integer(month));
|
this.month.remove(Integer.valueOf(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(new Integer(day));
|
this.day.add(Integer.valueOf(day));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -564,7 +564,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeDay(int day)
|
public void removeDay(int day)
|
||||||
{
|
{
|
||||||
this.day.remove(new Integer(day));
|
this.day.remove(Integer.valueOf(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(new Integer(weekday));
|
this.weekday.add(Integer.valueOf(weekday));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -602,7 +602,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeWeekday(int weekday)
|
public void removeWeekday(int weekday)
|
||||||
{
|
{
|
||||||
this.weekday.remove(new Integer(weekday));
|
this.weekday.remove(Integer.valueOf(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(new Integer(hour));
|
this.hour.add(Integer.valueOf(hour));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -636,7 +636,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeHour(int hour)
|
public void removeHour(int hour)
|
||||||
{
|
{
|
||||||
this.hour.remove(new Integer(hour));
|
this.hour.remove(Integer.valueOf(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(new Integer(minute));
|
this.minute.add(Integer.valueOf(minute));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -670,7 +670,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeMinute(int minute)
|
public void removeMinute(int minute)
|
||||||
{
|
{
|
||||||
this.minute.remove(new Integer(minute));
|
this.minute.remove(Integer.valueOf(minute));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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 '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} 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 '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} 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 '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue