Compare commits
328 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 | |||
db18a003fe | |||
2ba24ccea8 | |||
244b92d750 | |||
b91ee88304 | |||
dfe9c5d1a3 | |||
8edc9db372 | |||
df3af8fab1 | |||
a5bc33db70 | |||
523d806b56 | |||
c984d3c4a2 | |||
657f66c0ce | |||
0bf39c8f4b | |||
2721db44ae | |||
ae50bc562e | |||
75f609d095 | |||
9950f4df46 | |||
5a958b2980 | |||
06eefa8e86 | |||
d6fd0ba6f7 | |||
75bda31376 | |||
9265d322a0 | |||
540d0eb0fc | |||
dd53c6f365 | |||
|
4d92cec456 | ||
91d052af48 | |||
768b7b5ed3 | |||
0c1f1d0beb | |||
060f6461cb | |||
23fdb31348 | |||
|
db8d239c32 | ||
|
9960e1c919 | ||
|
541286dc59 | ||
|
e0f590da98 | ||
|
37307708fd | ||
|
5abe737912 | ||
|
468a89bd05 | ||
|
7f3bb3a85b | ||
|
1acd176aa5 | ||
|
7cafee58c4 | ||
|
eda05c731a | ||
0929cd1e57 | |||
39f565252f | |||
|
be233eba03 | ||
f6656f7b4d | |||
0b938bf808 | |||
aa2a236d91 | |||
90e91ee9f7 | |||
a0f5729e58 | |||
708c02f670 | |||
9f49ad80b9 | |||
2a4ae9adcf | |||
265cf566b7 | |||
|
9f213ab7b9 | ||
8e973d1a1a | |||
cdc522b22e | |||
c2fcc1867a | |||
|
47fecff5b4 | ||
|
63b4ec8512 | ||
8433ed4f8c | |||
2fe0041d2d | |||
2f27921403 | |||
cb57b90c62 | |||
88b48b46ce | |||
c673e8e3f2 | |||
d985d1be0c | |||
bd552751f5 | |||
f29781e150 | |||
9cb7d08581 | |||
cfb31beeec | |||
39af201e78 | |||
2da9bcf00b | |||
56e9f6793b | |||
5cbeb9f01d | |||
cee0be52e0 | |||
7d6fb8f903 | |||
36b5ae6279 | |||
|
f7e52dbad5 | ||
dbbaa0fb1a | |||
74640c222a | |||
c07e4a9d7f | |||
8d62f24bee | |||
825ccb6463 | |||
e88c4f5d8f | |||
5902bf9d7f | |||
6571f4ff1b | |||
03e2718ff5 | |||
00762cf495 | |||
6e5d2061fa | |||
c399fd27e4 | |||
677cedd0eb | |||
|
f1fa050ea5 | ||
|
e82aa34967 | ||
|
65381e7638 | ||
|
21739a54d8 | ||
|
d1fb7d312e | ||
|
81f5e3cd8e | ||
|
75f0245817 | ||
|
021a24a100 | ||
|
390231e8dd | ||
c085492c27 | |||
98a8cdbc53 | |||
863c622631 | |||
12f9e1b1e3 | |||
655f965084 | |||
|
b0ff574e95 |
148 changed files with 3197 additions and 3805 deletions
15
.eslintrc
Normal file
15
.eslintrc
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"es6": true,
|
||||
"commonjs": true
|
||||
},
|
||||
"globals": {
|
||||
"app": "readonly",
|
||||
"HopObject": "readonly",
|
||||
"java": "readonly",
|
||||
"Packages": "readonly",
|
||||
"req": "readonly",
|
||||
"res": "readonly"
|
||||
}
|
||||
}
|
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
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
.gradle
|
||||
.idea
|
||||
.settings
|
||||
build
|
||||
|
||||
|
@ -9,6 +10,7 @@ build
|
|||
/docs
|
||||
/extras
|
||||
/lib
|
||||
/licenses
|
||||
/log
|
||||
/static
|
||||
|
||||
|
|
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"
|
||||
}
|
31
CHANGES.md
Normal file
31
CHANGES.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Change Log
|
||||
|
||||
## May 17, 2020
|
||||
|
||||
* Added support for colored log output
|
||||
* Added xgettext and po2js tasks (only running with Antville right now)
|
||||
|
||||
## April 13, 2020
|
||||
|
||||
* Added support for gzip compressed response in helma.Http
|
||||
* Fixed helma.Http.getURL() not following redirects if protocol changes (e.g. http → https)
|
||||
* Fixed references to obsolete Base64 encoder in modules
|
||||
* Updated JavaMail library to implementation package
|
||||
|
||||
## March 21, 2020
|
||||
|
||||
* Completely rewrote build system with Gradle
|
||||
* Separated launcher from main source as Gradle subproject
|
||||
* Launcher now includes all JARs found in `lib`
|
||||
* Upgraded Rhino to version 1.7.12
|
||||
* Upgraded Jetty to version 9.x
|
||||
* Fixed compatibility issues with Java 11
|
||||
* Removed support for Apache JServ Protocol (AJP)
|
||||
* Added support for CommonJS require() method
|
||||
* Allow variable arguments in res.write() and res.writeln()
|
||||
* Replaced Helma’s MD5 and Base64 methods with equivalent methods from Apache Commons
|
||||
* Refactored String methods from Java to JavaScript: encode(), encodeForm(), encodeXml(), stripTags()
|
||||
* Replaced custom String methods with Rhino’s built-in ones: endsWith(), repeat(), startsWith(), trim()
|
||||
* Refactored custom String.pad() method with built-in methods
|
||||
* Redefined custom Array.contains() method with built-in Array.includes()
|
||||
* Refactored custom Array methods with built-in methods: intersection(), union()
|
|
@ -1,6 +1,6 @@
|
|||
# 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
|
||||
modification, are permitted provided that the following conditions
|
||||
|
|
32
README.md
32
README.md
|
@ -2,7 +2,8 @@
|
|||
|
||||
## 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://code.host.antville.org/antville/helma/releases)
|
||||
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
|
||||
- Direct your web browser to <http://localhost:8080>
|
||||
|
||||
|
@ -20,27 +21,37 @@ Although Helma became a Grande Dame of server-side JavaScript already decades ag
|
|||
|
||||
## 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.
|
||||
|
||||
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
|
||||
|
||||
Helma is built with [Gradle](https://gradle.org).
|
||||
Helma is built with [Gradle](https://gradle.org), the build task depends on the binaries [rsync](https://rsync.samba.org) and [npx](https://www.npmjs.com/package/npx) being installed on your system.
|
||||
|
||||
## 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
|
||||
|
||||
> ⚠️ 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.
|
||||
* [Node.js](https://nodejs.org) LTS version
|
||||
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
||||
|
||||
After compilation 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` variable in the start script to the location of your Java installation.
|
||||
Clone this repository to your machine and run Helma with `./gradlew run`.
|
||||
|
||||
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.
|
||||
To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.
|
||||
|
||||
After startup you should be able to connect your browser to <http://localhost:8080> – port 8080 on the local machine, that is.
|
||||
> ⚠️
|
||||
> 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.
|
||||
>
|
||||
> Alternatively, you could move or copy the desired files manually from the installation directory `build/install/helma`.
|
||||
|
||||
Helma comes with a version of [Jetty](http://eclipse.org/jetty/), a lightweight yet industrial strenth web server.
|
||||
After all files are put into place start Helma by invoking `./bin/helma.bat` or `./bin/helma`, depending on whether you are on Windows or Linux / Unix / OS X, respectively. If the `java` command is not found, try setting the `JAVA_HOME` environment variable to the location of your Java installation.
|
||||
|
||||
You can adjust server-wide settings in the `server.properties` file. For example, you could set the `smtp` property to the name of the SMTP server that Helma should use to send e-mail. Applications can be started or stopped by editing the `apps.properties` file, or through the web interface using the management application that is part of Helma.
|
||||
|
||||
If all goes well you should be able to connect your browser to <http://localhost:8080> – port 8080 on the local machine, that is.
|
||||
|
||||
Helma comes with a version of [Jetty](http://eclipse.org/jetty/), a lightweight yet industrial strength web server.
|
||||
|
||||
While Jetty works well for development and in fact deploying real web sites, you might want to run Helma with the web server you are already using. This is most easily done by proxying Helma. Please consult the documentation of your web server how to achieve this.
|
||||
|
||||
|
@ -50,7 +61,8 @@ 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:
|
||||
|
||||
> 😿 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)
|
||||
- [Documentation](http://web.archive.org/web/20100530234322/http://helma.org/documentation/)
|
||||
|
|
227
build.gradle
227
build.gradle
|
@ -1,3 +1,8 @@
|
|||
plugins {
|
||||
id 'application'
|
||||
id 'com.github.jk1.dependency-license-report' version '2.9'
|
||||
}
|
||||
|
||||
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||
|
||||
def jettyLogLevel = '-Dorg.eclipse.jetty.LEVEL=WARN'
|
||||
|
@ -12,19 +17,31 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
|
|||
allprojects {
|
||||
apply plugin: 'java'
|
||||
|
||||
compileJava {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
version = new Date().format("yy.M.d")
|
||||
|
||||
version = new Date().format("yyyyMMdd")
|
||||
|
||||
tasks.build.dependsOn javadoc, 'jsdoc'
|
||||
tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
|
||||
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 {
|
||||
main {
|
||||
java {
|
||||
|
@ -34,11 +51,6 @@ sourceSets {
|
|||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
configurations {
|
||||
// Wrapping implementation because it does not allow access to its files
|
||||
// (i.e. cannot be resolved)
|
||||
|
@ -46,25 +58,61 @@ configurations {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'commons-codec:commons-codec:1.14'
|
||||
implementation 'commons-fileupload:commons-fileupload:1.4'
|
||||
implementation 'commons-logging:commons-logging:1.2'
|
||||
implementation 'commons-net:commons-net:3.6'
|
||||
implementation 'com.sun.activation:javax.activation:1.2.0'
|
||||
implementation 'javax.mail:javax.mail-api:1.6.2'
|
||||
implementation 'com.google.code.gson:gson:2.12.1'
|
||||
implementation 'commons-codec:commons-codec:1.18.0'
|
||||
implementation 'commons-fileupload:commons-fileupload:1.5'
|
||||
implementation 'commons-logging:commons-logging:1.3.5'
|
||||
implementation 'commons-net:commons-net:3.11.1'
|
||||
implementation 'com.sun.mail:javax.mail:1.6.2'
|
||||
implementation 'javax.servlet:javax.servlet-api:4.0.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-xml:9.4.27.v20200227'
|
||||
implementation 'org.mozilla:rhino:1.7.12'
|
||||
implementation 'xerces:xercesImpl:2.12.0'
|
||||
implementation 'org.eclipse.jetty:jetty-servlet:9.4.57.v20241219'
|
||||
implementation 'org.eclipse.jetty:jetty-xml:9.4.57.v20241219'
|
||||
implementation 'org.mozilla:rhino-all:1.8.0'
|
||||
implementation 'org.sejda.imageio:webp-imageio:0.1.6'
|
||||
implementation 'xerces:xercesImpl:2.12.2'
|
||||
implementation 'xmlrpc:xmlrpc:2.0.1'
|
||||
}
|
||||
|
||||
def rhinoJar = configurations.library.files.find { jar ->
|
||||
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 {
|
||||
applicationName = 'helma'
|
||||
classpath = files('../launcher.jar')
|
||||
mainClassName = 'helma.main.launcher.Main'
|
||||
mainClass = 'helma.main.launcher.Main'
|
||||
|
||||
defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]
|
||||
|
||||
|
@ -86,24 +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'
|
||||
}
|
||||
|
||||
distTar {
|
||||
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
|
||||
|
||||
compression = Compression.GZIP
|
||||
|
||||
filesMatching(textFiles) {
|
||||
|
@ -112,51 +145,45 @@ distTar {
|
|||
}
|
||||
|
||||
distZip {
|
||||
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'
|
||||
|
||||
filesMatching(textFiles) {
|
||||
filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("crlf"))
|
||||
}
|
||||
}
|
||||
|
||||
installDist {
|
||||
dependsOn javadoc, 'jsdoc'
|
||||
finalizedBy 'update'
|
||||
dependsOn build
|
||||
}
|
||||
|
||||
run {
|
||||
classpath = files('launcher.jar')
|
||||
jvmArgs jettyLogLevel, suppressMacosDockIcon
|
||||
}
|
||||
|
||||
task processSource(type: Sync) {
|
||||
def date = new Date().format("MMMM dd, yyyy")
|
||||
tasks.register('processSource', Sync) {
|
||||
def gitOutput = new ByteArrayOutputStream()
|
||||
|
||||
exec {
|
||||
commandLine 'git', 'describe'
|
||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||
standardOutput = gitOutput
|
||||
errorOutput = new ByteArrayOutputStream()
|
||||
ignoreExitValue = true
|
||||
}
|
||||
|
||||
def description = date
|
||||
def tag = gitOutput.toString().trim()
|
||||
|
||||
// TODO: Implement extended description in Java code
|
||||
if (tag) description = "$tag; $description"
|
||||
|
||||
from 'src'
|
||||
|
||||
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"
|
||||
}
|
||||
|
||||
task update {
|
||||
def rsyncArgs = ['-a', '--info=progress2', '--exclude', 'backups']
|
||||
tasks.register('update') {
|
||||
dependsOn installDist
|
||||
|
||||
def rsyncArgs = ['--archive', '--filter', '- backups']
|
||||
|
||||
def confirm = {
|
||||
ant.input(message: 'Update this installation?', validargs: 'y,n', addproperty: 'continue')
|
||||
return ant.continue == 'y'
|
||||
ant.input(message: 'Update this installation?', validargs: 'yes,no', addproperty: 'continue')
|
||||
return ant.continue == 'yes'
|
||||
}
|
||||
|
||||
onlyIf { confirm() }
|
||||
|
@ -167,28 +194,37 @@ task update {
|
|||
mkdir backupDir
|
||||
|
||||
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
|
||||
executable 'rsync'
|
||||
args rsyncArgs
|
||||
args "$projectDir/", backupDir
|
||||
}
|
||||
|
||||
print "Created backup of ${projectDir} in ${backupDir}"
|
||||
}
|
||||
|
||||
doLast {
|
||||
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'
|
||||
args '--delete'
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task jsdoc(type: Exec) {
|
||||
tasks.register('jsdoc', Exec) {
|
||||
description 'Generates JSDoc API documentation for the included JavaScript modules.'
|
||||
group 'Documentation'
|
||||
description 'Generates JSDoc API documentation for the included JavaScript modules'
|
||||
|
||||
def sources = ['modules/core', 'modules/helma', 'modules/jala/code']
|
||||
def destination = "${project.buildDir}/docs/jsdoc"
|
||||
|
@ -198,34 +234,65 @@ task jsdoc(type: Exec) {
|
|||
|
||||
executable 'npx'
|
||||
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 rhinoShell(type: JavaExec) {
|
||||
group 'Application'
|
||||
description 'Runs the interactive Rhino JavaScript shell'
|
||||
tasks.register('xgettext', JavaExec) {
|
||||
description 'Extracts translatable message strings from source code.'
|
||||
group 'i18n'
|
||||
|
||||
def rhinoJar = configurations.library.files.find { jar ->
|
||||
jar.name.startsWith('rhino')
|
||||
classpath = files('launcher.jar')
|
||||
mainClass = 'helma.main.launcher.Commandline'
|
||||
|
||||
// TODO: Decouple from Antville app
|
||||
args = [
|
||||
// Root.extractMessages is currently located in antville/code/Global/i18n.js
|
||||
'antville.extractMessages',
|
||||
'modules/jala/util/HopKit/scripts/MessageParser.js',
|
||||
'code compat',
|
||||
'apps/antville/i18n/antville.pot'
|
||||
]
|
||||
}
|
||||
|
||||
tasks.register('po2js', JavaExec) {
|
||||
description 'Converts translated message strings from PO format to JavaScript.'
|
||||
group 'i18n'
|
||||
|
||||
classpath = files(rhinoJar)
|
||||
main = 'org.mozilla.javascript.tools.shell.Main'
|
||||
mainClass = 'org.mozilla.javascript.tools.shell.Main'
|
||||
|
||||
// TODO: Decouple from Antville app
|
||||
args = [
|
||||
'modules/jala/util/HopKit/scripts/PoParser.js',
|
||||
'apps/antville/i18n',
|
||||
'apps/antville/i18n'
|
||||
]
|
||||
}
|
||||
|
||||
tasks.register('rhinoShell', JavaExec) {
|
||||
description 'Runs the interactive Rhino JavaScript shell.'
|
||||
group 'Application'
|
||||
|
||||
classpath = files(rhinoJar)
|
||||
mainClass = 'org.mozilla.javascript.tools.shell.Main'
|
||||
|
||||
standardInput = System.in
|
||||
}
|
||||
|
||||
// Call this task with a function definition using the `-P` parameter, e.g.
|
||||
// `./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`.'
|
||||
group 'Application'
|
||||
description 'Runs a function in a Helma application with `-Pfunction=app.functionName`'
|
||||
|
||||
classpath = files('launcher.jar')
|
||||
main = 'helma.main.launcher.Commandline'
|
||||
mainClass = 'helma.main.launcher.Commandline'
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
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.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
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."
|
||||
fi
|
||||
else
|
||||
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.
|
||||
JAVACMD=java
|
||||
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
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --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
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# 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
|
||||
|
||||
|
||||
# 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" "$@"
|
||||
|
|
74
gradlew.bat
vendored
74
gradlew.bat
vendored
|
@ -1,3 +1,21 @@
|
|||
@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
|
||||
|
@ -10,24 +28,28 @@ if "%OS%"=="Windows_NT" setlocal
|
|||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
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.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
@ -35,48 +57,36 @@ goto fail
|
|||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
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
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@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
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
|
|
@ -3,5 +3,3 @@ jar {
|
|||
from 'src/main/java/helma/main/launcher/manifest.txt'
|
||||
}
|
||||
}
|
||||
|
||||
//startScripts.enabled = false
|
||||
|
|
|
@ -19,6 +19,7 @@ package helma.main.launcher;
|
|||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
@ -135,10 +136,10 @@ public class Main {
|
|||
* @throws MalformedURLException
|
||||
*/
|
||||
public static ClassLoader createClassLoader(String installDir)
|
||||
throws MalformedURLException {
|
||||
throws MalformedURLException, UnsupportedEncodingException {
|
||||
|
||||
// decode installDir in case it is URL-encoded
|
||||
installDir = URLDecoder.decode(installDir);
|
||||
installDir = URLDecoder.decode(installDir, System.getProperty("helma.urlEncoding", "UTF-8"));
|
||||
|
||||
// set up the class path
|
||||
File libdir = new File(installDir, "lib");
|
||||
|
|
0
lib/ext/.keep
Normal file
0
lib/ext/.keep
Normal file
|
@ -1,118 +0,0 @@
|
|||
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications.
|
||||
|
||||
1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
|
||||
|
||||
1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
|
||||
|
||||
1.4. Executable means the Covered Software in any form other than Source Code.
|
||||
|
||||
1.5. Initial Developer means the individual or entity that first makes Original Software available under this License.
|
||||
|
||||
1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.7. License means this document.
|
||||
|
||||
1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. Modifications means the Source Code and Executable form of any of the following:
|
||||
|
||||
A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
|
||||
|
||||
B. Any new file that contains any part of the Original Software or previous Modification; or
|
||||
|
||||
C. Any new file that is contributed or otherwise made available under the terms of this License.
|
||||
|
||||
1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License.
|
||||
|
||||
1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
|
||||
|
||||
1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)‡the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)‡ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. License Grants.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
|
||||
(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
|
||||
(c) The licenses granted in Sections‡2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
|
||||
(d) Notwithstanding Section‡2.1(b) above, no patent license is granted: (1)‡for code that You delete from the Original Software, or (2)‡for infringements caused by: (i)‡the modification of the Original Software, or (ii)‡the combination of the Original Software with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
|
||||
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
|
||||
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)‡Modifications made by that Contributor (or portions thereof); and (2)‡the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
|
||||
(c) The licenses granted in Sections‡2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
|
||||
(d) Notwithstanding Section‡2.2(b) above, no patent license is granted: (1)‡for any code that Contributor has deleted from the Contributor Version; (2)‡for infringements caused by: (i)‡third party modifications of Contributor Version, or (ii)‡the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)‡under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Availability of Source Code.
|
||||
|
||||
Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
3.2. Modifications.
|
||||
|
||||
The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
|
||||
|
||||
3.3. Required Notices.
|
||||
You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
|
||||
|
||||
3.4. Application of Additional Terms.
|
||||
You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.5. Distribution of Executable Versions.
|
||||
You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
|
||||
|
||||
3.6. Larger Works.
|
||||
You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
|
||||
|
||||
4. Versions of the License.
|
||||
|
||||
4.1. New Versions.
|
||||
Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
|
||||
|
||||
4.2. Effect of New Versions.
|
||||
|
||||
You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
|
||||
4.3. Modified Versions.
|
||||
|
||||
When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)‡rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)‡otherwise make it clear that the license contains terms which differ from this License.
|
||||
|
||||
5. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
6. TERMINATION.
|
||||
|
||||
6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
|
||||
|
||||
6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections‡2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
|
||||
|
||||
6.3. In the event of termination under Sections‡6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
|
||||
|
||||
7. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
8. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Software is a commercial item, as that term is defined in 48‡C.F.R.‡2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. ‡252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48‡C.F.R.‡12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
|
||||
|
||||
9. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
|
||||
|
||||
10. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
|
||||
|
||||
NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
|
||||
The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
Copyright (c) 2009, incava.org
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of incava.org nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,159 +0,0 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Jetty License</TITLE>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<FONT FACE=ARIAL,HELVETICA>
|
||||
<CENTER><FONT SIZE=+3><B>Jetty License</B></FONT></CENTER>
|
||||
<CENTER><FONT SIZE=-1><B>$Revision$</B></FONT></CENTER>
|
||||
|
||||
<B>Preamble:</B><p>
|
||||
|
||||
The intent of this document is to state the conditions under which the
|
||||
Jetty Package may be copied, such that the Copyright Holder maintains some
|
||||
semblance of control over the development of the package, while giving the
|
||||
users of the package the right to use, distribute and make reasonable
|
||||
modifications to the Package in accordance with the goals and ideals of
|
||||
the Open Source concept as described at
|
||||
<A HREF="http://www.opensource.org">http://www.opensource.org</A>.
|
||||
<P>
|
||||
It is the intent of this license to allow commercial usage of the Jetty
|
||||
package, so long as the source code is distributed or suitable visible
|
||||
credit given or other arrangements made with the copyright holders.
|
||||
|
||||
<P><B>Definitions:</B><P>
|
||||
|
||||
<UL>
|
||||
<LI> "Jetty" refers to the collection of Java classes that are
|
||||
distributed as a HTTP server with servlet capabilities and
|
||||
associated utilities.<p>
|
||||
|
||||
<LI> "Package" refers to the collection of files distributed by the
|
||||
Copyright Holder, and derivatives of that collection of files
|
||||
created through textual modification.<P>
|
||||
|
||||
<LI> "Standard Version" refers to such a Package if it has not been
|
||||
modified, or has been modified in accordance with the wishes
|
||||
of the Copyright Holder.<P>
|
||||
|
||||
<LI> "Copyright Holder" is whoever is named in the copyright or
|
||||
copyrights for the package. <BR>
|
||||
Mort Bay Consulting Pty. Ltd. (Australia) is the "Copyright
|
||||
Holder" for the Jetty package.<P>
|
||||
|
||||
<LI> "You" is you, if you're thinking about copying or distributing
|
||||
this Package.<P>
|
||||
|
||||
<LI> "Reasonable copying fee" is whatever you can justify on the
|
||||
basis of media cost, duplication charges, time of people involved,
|
||||
and so on. (You will not be required to justify it to the
|
||||
Copyright Holder, but only to the computing community at large
|
||||
as a market that must bear the fee.)<P>
|
||||
|
||||
<LI> "Freely Available" means that no fee is charged for the item
|
||||
itself, though there may be fees involved in handling the item.
|
||||
It also means that recipients of the item may redistribute it
|
||||
under the same conditions they received it.<P>
|
||||
</UL>
|
||||
|
||||
0. The Jetty Package is Copyright (c) Mort Bay Consulting Pty. Ltd.
|
||||
(Australia) and others. Individual files in this package may contain
|
||||
additional copyright notices. The javax.servlet packages are copyright
|
||||
Sun Microsystems Inc. <P>
|
||||
|
||||
1. The Standard Version of the Jetty package is
|
||||
available from <A HREF=http://jetty.mortbay.org>http://jetty.mortbay.org</A>.<P>
|
||||
|
||||
2. You may make and distribute verbatim copies of the source form
|
||||
of the Standard Version of this Package without restriction, provided that
|
||||
you include this license and all of the original copyright notices
|
||||
and associated disclaimers.<P>
|
||||
|
||||
3. You may make and distribute verbatim copies of the compiled form of the
|
||||
Standard Version of this Package without restriction, provided that you
|
||||
include this license.<P>
|
||||
|
||||
4. You may apply bug fixes, portability fixes and other modifications
|
||||
derived from the Public Domain or from the Copyright Holder. A Package
|
||||
modified in such a way shall still be considered the Standard Version.<P>
|
||||
|
||||
5. You may otherwise modify your copy of this Package in any way, provided
|
||||
that you insert a prominent notice in each changed file stating how and
|
||||
when you changed that file, and provided that you do at least ONE of the
|
||||
following:<P>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
a) Place your modifications in the Public Domain or otherwise make them
|
||||
Freely Available, such as by posting said modifications to Usenet or
|
||||
an equivalent medium, or placing the modifications on a major archive
|
||||
site such as ftp.uu.net, or by allowing the Copyright Holder to include
|
||||
your modifications in the Standard Version of the Package.<P>
|
||||
|
||||
b) Use the modified Package only within your corporation or organization.<P>
|
||||
|
||||
c) Rename any non-standard classes so the names do not conflict
|
||||
with standard classes, which must also be provided, and provide
|
||||
a separate manual page for each non-standard class that clearly
|
||||
documents how it differs from the Standard Version.<P>
|
||||
|
||||
d) Make other arrangements with the Copyright Holder.<P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
6. You may distribute modifications or subsets of this Package in source
|
||||
code or compiled form, provided that you do at least ONE of the following:<P>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
a) Distribute this license and all original copyright messages, together
|
||||
with instructions (in the about dialog, manual page or equivalent) on where
|
||||
to get the complete Standard Version.<P>
|
||||
|
||||
b) Accompany the distribution with the machine-readable source of
|
||||
the Package with your modifications. The modified package must include
|
||||
this license and all of the original copyright notices and associated
|
||||
disclaimers, together with instructions on where to get the complete
|
||||
Standard Version.<P>
|
||||
|
||||
c) Make other arrangements with the Copyright Holder.<P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
7. You may charge a reasonable copying fee for any distribution of this
|
||||
Package. You may charge any fee you choose for support of this Package.
|
||||
You may not charge a fee for this Package itself. However,
|
||||
you may distribute this Package in aggregate with other (possibly
|
||||
commercial) programs as part of a larger (possibly commercial) software
|
||||
distribution provided that you meet the other distribution requirements
|
||||
of this license.<P>
|
||||
|
||||
8. Input to or the output produced from the programs of this Package
|
||||
do not automatically fall under the copyright of this Package, but
|
||||
belong to whomever generated them, and may be sold commercially, and
|
||||
may be aggregated with this Package.<P>
|
||||
|
||||
9. Any program subroutines supplied by you and linked into this Package
|
||||
shall not be considered part of this Package.<P>
|
||||
|
||||
10. The name of the Copyright Holder may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.<P>
|
||||
|
||||
11. This license may change with each release of a Standard Version of
|
||||
the Package. You may choose to use the license associated with version
|
||||
you are using or the license of the latest Standard Version.<P>
|
||||
|
||||
12. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<P>
|
||||
|
||||
13. If any superior law implies a warranty, the sole remedy under such shall
|
||||
be , at the Copyright Holders option either a) return of any price paid or
|
||||
b) use or reasonable endeavours to repair or replace the software.<P>
|
||||
|
||||
14. This license shall be read under the laws of Australia. <P>
|
||||
|
||||
<center>The End</center>
|
||||
|
||||
<center><FONT size=-1>This license was derived from the <I>Artistic</I> license published
|
||||
on <a href=http://www.opensource.org>http://www.opensource.com</a></font></center>
|
||||
</FONT>
|
||||
|
||||
|
|
@ -1,509 +0,0 @@
|
|||
The following license terms apply to the Lucene wrapper by Robert
|
||||
Gaggle, which is made available as helma.Search and is included in the
|
||||
Helma default distribution package as part of modules/helmaLib.zip
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -1,478 +0,0 @@
|
|||
|
||||
For a list of modification contained in the version of Rhino distributed
|
||||
with Helma and for the corresponding patches and/or bugzilla entries,
|
||||
see http://dev.helma.org/wiki/Rhino+Bugs+%26+Patches/
|
||||
|
||||
|
||||
---------------
|
||||
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
---------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.0.1. "Commercial Use" means distribution or otherwise making the
|
||||
Covered Code available to a third party.
|
||||
|
||||
1.1. "Contributor" means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. "Contributor Version" means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. "Covered Code" means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. "Electronic Distribution Mechanism" means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. "Executable" means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. "Initial Developer" means the individual or entity identified
|
||||
as the Initial Developer in the Source Code notice required by Exhibit
|
||||
A.
|
||||
|
||||
1.7. "Larger Work" means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. "License" means this document.
|
||||
|
||||
1.8.1. "Licensable" means having the right to grant, to the maximum
|
||||
extent possible, whether at the time of the initial grant or
|
||||
subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. "Modifications" means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. "Original Code" means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this
|
||||
License is not already Covered Code governed by this License.
|
||||
|
||||
1.10.1. "Patent Claims" means any patent claim(s), now owned or
|
||||
hereafter acquired, including without limitation, method, process,
|
||||
and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.11. "Source Code" means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus
|
||||
any associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. "You" (or "Your") means an individual or a legal entity
|
||||
exercising rights under, and complying with all of the terms of, this
|
||||
License or a future version of this License issued under Section 6.1.
|
||||
For legal entities, "You" includes any entity which controls, is
|
||||
controlled by, or is under common control with You. For purposes of
|
||||
this definition, "control" means (a) the power, direct or indirect,
|
||||
to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (b) ownership of more than fifty percent
|
||||
(50%) of the outstanding shares or beneficial ownership of such
|
||||
entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Initial Developer to use, reproduce,
|
||||
modify, display, perform, sublicense and distribute the Original
|
||||
Code (or portions thereof) with or without Modifications, and/or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patents Claims infringed by the making, using or
|
||||
selling of Original Code, to make, have made, use, practice,
|
||||
sell, and offer for sale, and/or otherwise dispose of the
|
||||
Original Code (or portions thereof).
|
||||
|
||||
(c) the licenses granted in this Section 2.1(a) and (b) are
|
||||
effective on the date Initial Developer first distributes
|
||||
Original Code under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2)
|
||||
separate from the Original Code; or 3) for infringements caused
|
||||
by: i) the modification of the Original Code or ii) the
|
||||
combination of the Original Code with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Subject to third party intellectual property claims, each Contributor
|
||||
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||
display, perform, sublicense and distribute the Modifications
|
||||
created by such Contributor (or portions thereof) either on an
|
||||
unmodified basis, with other Modifications, as Covered Code
|
||||
and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or
|
||||
selling of Modifications made by that Contributor either alone
|
||||
and/or in combination with its Contributor Version (or portions
|
||||
of such combination), to make, use, sell, offer for sale, have
|
||||
made, and/or otherwise dispose of: 1) Modifications made by that
|
||||
Contributor (or portions thereof); and 2) the combination of
|
||||
Modifications made by that Contributor with its Contributor
|
||||
Version (or portions of such combination).
|
||||
|
||||
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
|
||||
effective on the date Contributor first makes Commercial Use of
|
||||
the Covered Code.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is
|
||||
granted: 1) for any code that Contributor has deleted from the
|
||||
Contributor Version; 2) separate from the Contributor Version;
|
||||
3) for infringements caused by: i) third party modifications of
|
||||
Contributor Version or ii) the combination of Modifications made
|
||||
by that Contributor with other software (except as part of the
|
||||
Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by
|
||||
that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be
|
||||
distributed only under the terms of this License or a future version
|
||||
of this License released under Section 6.1, and You must include a
|
||||
copy of this License with every copy of the Source Code You
|
||||
distribute. You may not offer or impose any terms on any Source Code
|
||||
version that alters or restricts the applicable version of this
|
||||
License or the recipients' rights hereunder. However, You may include
|
||||
an additional document offering the additional rights described in
|
||||
Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which You contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that
|
||||
the Modification is derived, directly or indirectly, from Original
|
||||
Code provided by the Initial Developer and including the name of the
|
||||
Initial Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
(a) Third Party Claims.
|
||||
If Contributor has knowledge that a license under a third party's
|
||||
intellectual property rights is required to exercise the rights
|
||||
granted by such Contributor under Sections 2.1 or 2.2,
|
||||
Contributor must include a text file with the Source Code
|
||||
distribution titled "LEGAL" which describes the claim and the
|
||||
party making the claim in sufficient detail that a recipient will
|
||||
know whom to contact. If Contributor obtains such knowledge after
|
||||
the Modification is made available as described in Section 3.2,
|
||||
Contributor shall promptly modify the LEGAL file in all copies
|
||||
Contributor makes available thereafter and shall take other steps
|
||||
(such as notifying appropriate mailing lists or newsgroups)
|
||||
reasonably calculated to inform those who received the Covered
|
||||
Code that new knowledge has been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Contributor's Modifications include an application programming
|
||||
interface and Contributor has knowledge of patent licenses which
|
||||
are reasonably necessary to implement that API, Contributor must
|
||||
also include this information in the LEGAL file.
|
||||
|
||||
(c) Representations.
|
||||
Contributor represents that, except as disclosed pursuant to
|
||||
Section 3.4(a) above, Contributor believes that Contributor's
|
||||
Modifications are Contributor's original creation(s) and/or
|
||||
Contributor has sufficient rights to grant the rights conveyed by
|
||||
this License.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code. If it is not possible to put such notice in a particular Source
|
||||
Code file due to its structure, then You must include such notice in a
|
||||
location (such as a relevant directory) where a user would be likely
|
||||
to look for such a notice. If You created one or more Modification(s)
|
||||
You may add your name as a Contributor to the notice described in
|
||||
Exhibit A. You must also duplicate this License in any documentation
|
||||
for the Source Code where You describe recipients' rights or ownership
|
||||
rights relating to Covered Code. You may choose to offer, and to
|
||||
charge a fee for, warranty, support, indemnity or liability
|
||||
obligations to one or more recipients of Covered Code. However, You
|
||||
may do so only on Your own behalf, and not on behalf of the Initial
|
||||
Developer or any Contributor. You must make it absolutely clear than
|
||||
any such warranty, support, indemnity or liability obligation is
|
||||
offered by You alone, and You hereby agree to indemnify the Initial
|
||||
Developer and every Contributor for any liability incurred by the
|
||||
Initial Developer or such Contributor as a result of warranty,
|
||||
support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of
|
||||
the Covered Code is available under the terms of this License,
|
||||
including a description of how and where You have fulfilled the
|
||||
obligations of Section 3.2. The notice must be conspicuously included
|
||||
in any notice in an Executable version, related documentation or
|
||||
collateral in which You describe recipients' rights relating to the
|
||||
Covered Code. You may distribute the Executable version of Covered
|
||||
Code or ownership rights under a license of Your choice, which may
|
||||
contain terms different from this License, provided that You are in
|
||||
compliance with the terms of this License and that the license for the
|
||||
Executable version does not attempt to limit or alter the recipient's
|
||||
rights in the Source Code version from the rights set forth in this
|
||||
License. If You distribute the Executable version under a different
|
||||
license You must make it absolutely clear that any terms which differ
|
||||
from this License are offered by You alone, not by the Initial
|
||||
Developer or any Contributor. You hereby agree to indemnify the
|
||||
Initial Developer and every Contributor for any liability incurred by
|
||||
the Initial Developer or such Contributor as a result of any such
|
||||
terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description
|
||||
must be included in the LEGAL file described in Section 3.4 and must
|
||||
be included with all distributions of the Source Code. Except to the
|
||||
extent prohibited by statute or regulation, such description must be
|
||||
sufficiently detailed for a recipient of ordinary skill to be able to
|
||||
understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation ("Netscape") may publish revised
|
||||
and/or new versions of the License from time to time. Each version
|
||||
will be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If You create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), You must (a) rename Your license so that
|
||||
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
|
||||
"MPL", "NPL" or any confusingly similar phrase do not appear in your
|
||||
license (except to note that your license differs from this License)
|
||||
and (b) otherwise make it clear that Your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial
|
||||
Developer, Original Code or Contributor in the notice described in
|
||||
Exhibit A shall not of themselves be deemed to be modifications of
|
||||
this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
8.1. This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
8.2. If You initiate litigation by asserting a patent infringement
|
||||
claim (excluding declatory judgment actions) against Initial Developer
|
||||
or a Contributor (the Initial Developer or Contributor against whom
|
||||
You file such action is referred to as "Participant") alleging that:
|
||||
|
||||
(a) such Participant's Contributor Version directly or indirectly
|
||||
infringes any patent, then any and all rights granted by such
|
||||
Participant to You under Sections 2.1 and/or 2.2 of this License
|
||||
shall, upon 60 days notice from Participant terminate prospectively,
|
||||
unless if within 60 days after receipt of notice You either: (i)
|
||||
agree in writing to pay Participant a mutually agreeable reasonable
|
||||
royalty for Your past and future use of Modifications made by such
|
||||
Participant, or (ii) withdraw Your litigation claim with respect to
|
||||
the Contributor Version against such Participant. If within 60 days
|
||||
of notice, a reasonable royalty and payment arrangement are not
|
||||
mutually agreed upon in writing by the parties or the litigation claim
|
||||
is not withdrawn, the rights granted by Participant to You under
|
||||
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
|
||||
the 60 day notice period specified above.
|
||||
|
||||
(b) any software, hardware, or device, other than such Participant's
|
||||
Contributor Version, directly or indirectly infringes any patent, then
|
||||
any rights granted to You by such Participant under Sections 2.1(b)
|
||||
and 2.2(b) are revoked effective as of the date You first made, used,
|
||||
sold, distributed, or had made, Modifications made by that
|
||||
Participant.
|
||||
|
||||
8.3. If You assert a patent infringement claim against Participant
|
||||
alleging that such Participant's Contributor Version directly or
|
||||
indirectly infringes any patent where such claim is resolved (such as
|
||||
by license or settlement) prior to the initiation of patent
|
||||
infringement litigation, then the reasonable value of the licenses
|
||||
granted by such Participant under Sections 2.1 or 2.2 shall be taken
|
||||
into account in determining the amount or value of any payment or
|
||||
license.
|
||||
|
||||
8.4. In the event of termination under Sections 8.1 or 8.2 above,
|
||||
all end user license agreements (excluding distributors and resellers)
|
||||
which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
|
||||
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
|
||||
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
|
||||
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
|
||||
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
|
||||
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a "commercial item," as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
|
||||
software" and "commercial computer software documentation," as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if
|
||||
any, provides otherwise), excluding its conflict-of-law provisions.
|
||||
With respect to disputes in which at least one party is a citizen of,
|
||||
or an entity chartered or registered to do business in the United
|
||||
States of America, any litigation relating to this License shall be
|
||||
subject to the jurisdiction of the Federal Courts of the Northern
|
||||
District of California, with venue lying in Santa Clara County,
|
||||
California, with the losing party responsible for costs, including
|
||||
without limitation, court costs and reasonable attorneys' fees and
|
||||
expenses. The application of the United Nations Convention on
|
||||
Contracts for the International Sale of Goods is expressly excluded.
|
||||
Any law or regulation which provides that the language of a contract
|
||||
shall be construed against the drafter shall not apply to this
|
||||
License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly,
|
||||
out of its utilization of rights under this License and You agree to
|
||||
work with Initial Developer and Contributors to distribute such
|
||||
responsibility on an equitable basis. Nothing herein is intended or
|
||||
shall be deemed to constitute any admission of liability.
|
||||
|
||||
13. MULTIPLE-LICENSED CODE.
|
||||
|
||||
Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under
|
||||
Your choice of the NPL or the alternative licenses, if any, specified
|
||||
by the Initial Developer in the file described in Exhibit A.
|
||||
|
||||
EXHIBIT A -Mozilla Public License.
|
||||
|
||||
``The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is ______________________________________.
|
||||
|
||||
The Initial Developer of the Original Code is ________________________.
|
||||
Portions created by ______________________ are Copyright (C) ______
|
||||
_______________________. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the _____ license (the "[___] License"), in which case the
|
||||
provisions of [______] License are applicable instead of those
|
||||
above. If you wish to allow use of your version of this file only
|
||||
under the terms of the [____] License and not to allow others to use
|
||||
your version of this file under the MPL, indicate your decision by
|
||||
deleting the provisions above and replace them with the notice and
|
||||
other provisions required by the [___] License. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file
|
||||
under either the MPL or the [___] License."
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. You should
|
||||
use the text of this Exhibit A rather than the text found in the
|
||||
Original Code Source Code for Your Modifications.]
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
Sun Microsystems, Inc.
|
||||
Binary Code License Agreement
|
||||
|
||||
READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS
|
||||
(COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA
|
||||
PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF
|
||||
THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE
|
||||
YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END
|
||||
OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN
|
||||
THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE
|
||||
SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END
|
||||
OF THIS AGREEMENT.
|
||||
|
||||
1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable
|
||||
license for the internal use only of the accompanying software and
|
||||
documentation and any error corrections provided by Sun (collectively
|
||||
"Software"), by the number of users and the class of computer hardware for
|
||||
which the corresponding fee has been paid.
|
||||
|
||||
2. RESTRICTIONS. Software is confidential and copyrighted. Title to
|
||||
Software and all associated intellectual property rights is retained by Sun
|
||||
and/or its licensors. Except as specifically authorized in any Supplemental
|
||||
License Terms, you may not make copies of Software, other than a single copy
|
||||
of Software for archival purposes. Unless enforcement is prohibited by
|
||||
applicable law, you may not modify, decompile, or reverse engineer
|
||||
Software. You acknowledge that Software is not designed, licensed or
|
||||
intended for use in the design, construction, operation or maintenance of
|
||||
any nuclear facility. Sun disclaims any express or implied warranty of
|
||||
fitness for such uses. No right, title or interest in or to any trademark,
|
||||
service mark, logo or trade name of Sun or its licensors is granted under
|
||||
this Agreement.
|
||||
|
||||
3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90)
|
||||
days from the date of purchase, as evidenced by a copy of the receipt, the
|
||||
media on which Software is furnished (if any) will be free of defects in
|
||||
materials and workmanship under normal use. Except for the foregoing,
|
||||
Software is provided "AS IS". Your exclusive remedy and Sun's entire
|
||||
liability under this limited warranty will be at Sun's option to replace
|
||||
Software media or refund the fee paid for Software.
|
||||
|
||||
4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS
|
||||
OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED
|
||||
WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
|
||||
NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS
|
||||
ARE HELD TO BE LEGALLY INVALID.
|
||||
|
||||
5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO
|
||||
EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
|
||||
DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
|
||||
DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT
|
||||
OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's
|
||||
liability to you, whether in contract, tort (including negligence), or
|
||||
otherwise, exceed the amount paid by you for Software under this Agreement.
|
||||
The foregoing limitations will apply even if the above stated warranty fails
|
||||
of its essential purpose.
|
||||
|
||||
6. Termination. This Agreement is effective until terminated. You may
|
||||
terminate this Agreement at any time by destroying all copies of Software.
|
||||
This Agreement will terminate immediately without notice from Sun if you
|
||||
fail to comply with any provision of this Agreement. Upon Termination, you
|
||||
must destroy all copies of Software.
|
||||
|
||||
7. Export Regulations. All Software and technical data delivered under this
|
||||
Agreement are subject to US export control laws and may be subject to export
|
||||
or import regulations in other countries. You agree to comply strictly with
|
||||
all such laws and regulations and acknowledge that you have the
|
||||
responsibility to obtain such licenses to export, re-export, or import as
|
||||
may be required after delivery to you.
|
||||
|
||||
8. U.S. Government Restricted Rights. If Software is being acquired by or
|
||||
on behalf of the U.S. Government or by a U.S. Government prime contractor or
|
||||
subcontractor (at any tier), then the Government's rights in Software and
|
||||
accompanying documentation will be only as set forth in this Agreement; this
|
||||
is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of
|
||||
Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
|
||||
acquisitions).
|
||||
|
||||
9. Governing Law. Any action related to this Agreement will be governed by
|
||||
California law and controlling U.S. federal law. No choice of law rules of
|
||||
any jurisdiction will apply.
|
||||
|
||||
10. Severability. If any provision of this Agreement is held to be
|
||||
unenforceable, this Agreement will remain in effect with the provision
|
||||
omitted, unless omission would frustrate the intent of the parties, in which
|
||||
case this Agreement will immediately terminate.
|
||||
|
||||
11. Integration. This Agreement is the entire agreement between you and
|
||||
Sun relating to its subject matter. It supersedes all prior or
|
||||
contemporaneous oral or written communications, proposals, representations
|
||||
and warranties and prevails over any conflicting or additional terms of any
|
||||
quote, order, acknowledgment, or other communication between the parties
|
||||
relating to its subject matter during the term of this Agreement. No
|
||||
modification of this Agreement will be binding, unless in writing and signed
|
||||
by an authorized representative of each party.
|
||||
|
||||
|
||||
|
||||
JAVAMAIL, VERSION 1.2
|
||||
SUPPLEMENTAL LICENSE TERMS
|
||||
|
||||
These supplemental license terms ("Supplemental Terms") add to or modify the
|
||||
terms of the Binary Code License Agreement (collectively, the "Agreement").
|
||||
Capitalized terms not defined in these Supplemental Terms shall have the
|
||||
same meanings ascribed to them in the Agreement. These Supplemental Terms
|
||||
shall supersede any inconsistent or conflicting terms in the Agreement, or
|
||||
in any license contained within the Software.
|
||||
|
||||
1. Software Internal Use and Development License Grant. Subject to the
|
||||
terms and conditions of this Agreement, including, but not limited to
|
||||
Section 3 (Java(TM) Technology Restrictions) of these Supplemental Terms,
|
||||
Sun grants you a non-exclusive, non-transferable, limited license to
|
||||
reproduce internally and use internally the binary form of the Software,
|
||||
complete and unmodified, for the sole purpose of designing, developing and
|
||||
testing your Java applets and applications ("Programs").
|
||||
|
||||
2. License to Distribute Software. Subject to the terms and conditions of
|
||||
this Agreement, including, but not limited to Section 3 (Java (TM)
|
||||
Technology Restrictions) of these Supplemental Terms, Sun grants you a
|
||||
non-exclusive, non-transferable, limited license to reproduce and distribute
|
||||
the Software in binary code form only, provided that (i) you distribute the
|
||||
Software complete and unmodified and only bundled as part of, and for the
|
||||
sole purpose of running, your Java applets or applications ("Programs"),
|
||||
(ii) the Programs add significant and primary functionality to the Software,
|
||||
(iii) you do not distribute additional software intended to replace any
|
||||
component(s) of the Software, (iv) you do not remove or alter any
|
||||
proprietary legends or notices contained in the Software, (v) you only
|
||||
distribute the Software subject to a license agreement that protects Sun's
|
||||
interests consistent with the terms contained in this Agreement, and (vi)
|
||||
you agree to defend and indemnify Sun and its licensors from and against any
|
||||
damages, costs, liabilities, settlement amounts and/or expenses (including
|
||||
attorneys' fees) incurred in connection with any claim, lawsuit or action by
|
||||
any third party that arises or results from the use or distribution of any
|
||||
and all Programs and/or Software.
|
||||
|
||||
3. Java Technology Restrictions. You may not modify the Java Platform
|
||||
Interface ("JPI", identified as classes contained within the "java" package
|
||||
or any subpackages of the "java" package), by creating additional classes
|
||||
within the JPI or otherwise causing the addition to or modification of the
|
||||
classes in the JPI. In the event that you create an additional class and
|
||||
associated API(s) which (i) extends the functionality of the Java platform,
|
||||
and (ii) is exposed to third party software developers for the purpose of
|
||||
developing additional software which invokes such additional API, you must
|
||||
promptly publish broadly an accurate specification for such API for free use
|
||||
by all developers. You may not create, or authorize your licensees to
|
||||
create additional classes, interfaces, or subpackages that are in any way
|
||||
identified as "java", "javax", "sun" or similar convention as specified by
|
||||
Sun in any naming convention designation.
|
||||
|
||||
4. Trademarks and Logos. You acknowledge and agree as between you and Sun
|
||||
that Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, STAROFFICE, STARPORTAL
|
||||
and iPLANET trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, STAROFFICE,
|
||||
STARPORTAL and iPLANET-related trademarks, service marks, logos and other
|
||||
brand designations ("Sun Marks"), and you agree to comply with the Sun
|
||||
Trademark and Logo Usage Requirements currently located at
|
||||
http://www.sun.com/policies/trademarks. Any use you make of the Sun Marks
|
||||
inures to Sun's benefit.
|
||||
|
||||
5. Source Code. Software may contain source code that is provided solely for
|
||||
reference purposes pursuant to the terms of this Agreement. Source code may
|
||||
not be redistributed unless expressly provided for in this Agreement.
|
||||
|
||||
6. Termination for Infringement. Either party may terminate this Agreement
|
||||
immediately should any Software become, or in either party's opinion be
|
||||
likely to become, the subject of a claim of infringement of any intellectual
|
||||
property right.
|
||||
|
||||
For inquiries please contact: Sun Microsystems, Inc. 901 San Antonio Road,
|
||||
Palo Alto, California 94303
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>W3C IPR SOFTWARE NOTICE</title>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<h1>
|
||||
W3C IPR SOFTWARE NOTICE
|
||||
</h1>
|
||||
<h3>
|
||||
Copyright © 2000 <loc href="http://www.w3.org/">World Wide Web
|
||||
Consortium</loc>, (<loc href="http://www.lcs.mit.edu/">Massachusetts
|
||||
Institute of Technology</loc>, <loc href="http://www.inria.fr/">Institut
|
||||
National de Recherche en Informatique et en Automatique</loc>, <loc
|
||||
href="http://www.keio.ac.jp/">Keio University</loc>). All Rights
|
||||
Reserved.
|
||||
</h3>
|
||||
<p>
|
||||
The DOM bindings are published under the W3C Software Copyright Notice
|
||||
and License. The software license requires "Notice of any changes or
|
||||
modifications to the W3C files, including the date changes were made."
|
||||
Consequently, modified versions of the DOM bindings must document that
|
||||
they do not conform to the W3C standard; in the case of the IDL binding,
|
||||
the pragma prefix can no longer be 'w3c.org'; in the case of the Java
|
||||
binding, the package names can no longer be in the 'org.w3c' package.
|
||||
</p>
|
||||
<p>
|
||||
<b>Note:</b> The original version of the W3C Software Copyright Notice
|
||||
and License could be found at <a
|
||||
href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a>
|
||||
</p>
|
||||
<h3>
|
||||
Copyright © 1994-2000 <a href="http://www.w3.org/">World Wide Web
|
||||
Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
|
||||
Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
|
||||
National de Recherche en Informatique et en Automatique</a>, <a
|
||||
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
|
||||
Reserved. http://www.w3.org/Consortium/Legal/
|
||||
</h3>
|
||||
<p>
|
||||
This W3C work (including software, documents, or other related items) is
|
||||
being provided by the copyright holders under the following license. By
|
||||
obtaining, using and/or copying this work, you (the licensee) agree that
|
||||
you have read, understood, and will comply with the following terms and
|
||||
conditions:
|
||||
</p>
|
||||
<p>
|
||||
Permission to use, copy, and modify this software and its documentation,
|
||||
with or without modification, for any purpose and without fee or
|
||||
royalty is hereby granted, provided that you include the following on ALL
|
||||
copies of the software and documentation or portions thereof, including
|
||||
modifications, that you make:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
The full text of this NOTICE in a location viewable to users of the
|
||||
redistributed or derivative work.
|
||||
</li>
|
||||
<li>
|
||||
Any pre-existing intellectual property disclaimers, notices, or terms
|
||||
and conditions. If none exist, a short notice of the following form
|
||||
(hypertext is preferred, text is permitted) should be used within the
|
||||
body of any redistributed or derivative code: "Copyright ©
|
||||
[$date-of-software] <a href="http://www.w3.org/">World Wide Web
|
||||
Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts
|
||||
Institute of Technology</a>, <a href="http://www.inria.fr/">Institut
|
||||
National de Recherche en Informatique et en Automatique</a>, <a
|
||||
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
|
||||
Reserved. http://www.w3.org/Consortium/Legal/"
|
||||
</li>
|
||||
<li>
|
||||
Notice of any changes or modifications to the W3C files, including the
|
||||
date changes were made. (We recommend you provide URIs to the location
|
||||
from which the code is derived.)
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
|
||||
HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR
|
||||
DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
|
||||
TRADEMARKS OR OTHER RIGHTS.
|
||||
</p>
|
||||
<p>
|
||||
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
|
||||
DOCUMENTATION.
|
||||
</p>
|
||||
<p>
|
||||
The name and trademarks of copyright holders may NOT be used in
|
||||
advertising or publicity pertaining to the software without specific,
|
||||
written prior permission. Title to copyright in this software and any
|
||||
associated documentation will at all times remain with copyright
|
||||
holders.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -28,9 +28,7 @@
|
|||
* @param {Object} val the value to check
|
||||
* @return {boolean} true if the value is contained
|
||||
*/
|
||||
Array.prototype.contains = function(val) {
|
||||
return this.indexOf(val) > -1;
|
||||
};
|
||||
Array.prototype.contains = Array.prototype.includes
|
||||
|
||||
/**
|
||||
* Retrieve the union set of a bunch of arrays
|
||||
|
@ -40,18 +38,9 @@ Array.prototype.contains = function(val) {
|
|||
* @return {Array} the union set
|
||||
*/
|
||||
Array.union = function() {
|
||||
var result = [];
|
||||
var map = {};
|
||||
for (var i=0; i<arguments.length; i+=1) {
|
||||
for (var n in arguments[i]) {
|
||||
var item = arguments[i][n];
|
||||
if (!map[item]) {
|
||||
result.push(item);
|
||||
map[item] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return Array.from(arguments).reduce((result, array) => {
|
||||
return result.concat(array.filter(element => !result.includes(element)));
|
||||
}, []);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -62,21 +51,9 @@ Array.union = function() {
|
|||
* @return {Array} the intersection set
|
||||
*/
|
||||
Array.intersection = function() {
|
||||
var all = Array.union.apply(this, arguments);
|
||||
var result = [];
|
||||
for (var n in all) {
|
||||
var chksum = 0;
|
||||
var item = all[n];
|
||||
for (var i=0; i<arguments.length; i+=1) {
|
||||
if (arguments[i].contains(item))
|
||||
chksum += 1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (chksum == arguments.length)
|
||||
result.push(item);
|
||||
}
|
||||
return result;
|
||||
return Array.from(arguments).reduce((result, array) => {
|
||||
return result.filter(element => array.includes(element));
|
||||
});
|
||||
};
|
||||
|
||||
// prevent any newly added properties from being enumerated
|
||||
|
|
|
@ -180,7 +180,7 @@ Date.prototype.getExpiry = function(param) {
|
|||
*/
|
||||
Date.prototype.equals = function(date, extend) {
|
||||
if (!extend)
|
||||
var extend = Date.ONEDAY;
|
||||
extend = Date.ONEDAY;
|
||||
switch (extend) {
|
||||
case Date.ONESECOND:
|
||||
if (this.getSeconds() != date.getSeconds())
|
||||
|
|
|
@ -77,3 +77,180 @@ var skin_macro = function(param, name) {
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a string for HTML output and inserts linebreak tags.
|
||||
*
|
||||
* Performs the following string manipulations:
|
||||
* All line breaks (i.e. line feeds) are replaced with <br/> tags.
|
||||
* All special characters are being replaced with their equivalent HTML entity.
|
||||
* Existing markup tags are being encoded.
|
||||
*
|
||||
* @param {string} text
|
||||
* The string to encode for HTML output.
|
||||
* @param {boolean} [encodeNewLine = true]
|
||||
* If or if not to encode line breaks (i.e. line feeds).
|
||||
* @return {string}
|
||||
* The encoded string.
|
||||
*/
|
||||
function encode(text, encodeNewLine) {
|
||||
text = String(text);
|
||||
|
||||
if (text === null || !text.length) return text;
|
||||
var buffer = [];
|
||||
if (typeof encodeNewLine === 'undefined') encodeNewLine = true;
|
||||
|
||||
for (var i = 0, len = text.length; i < len; i += 1) {
|
||||
var char = text.charAt(i);
|
||||
|
||||
switch (char) {
|
||||
case '<':
|
||||
buffer.push('<');
|
||||
break;
|
||||
|
||||
case '>':
|
||||
buffer.push('>');
|
||||
break;
|
||||
|
||||
case '&':
|
||||
buffer.push('&');
|
||||
break;
|
||||
|
||||
case '"':
|
||||
buffer.push('"');
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
if (encodeNewLine) {
|
||||
buffer.push("<br/>");
|
||||
}
|
||||
buffer.push('\n');
|
||||
break;
|
||||
|
||||
default:
|
||||
buffer.push(char);
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a string for XML output.
|
||||
*
|
||||
* Performs the following string manipulations:
|
||||
* All special characters are being replaced with their equivalent HTML entity.
|
||||
* Existing tags, single and double quotes, as well as ampersands are being encoded.
|
||||
* Some invalid XML characters below '0x20' are removed
|
||||
*
|
||||
* @param {string} text
|
||||
* The string to encode for XML output.
|
||||
* @return {string}
|
||||
* The string encoded for XML output.
|
||||
*/
|
||||
function encodeXml(text) {
|
||||
text = String(text);
|
||||
|
||||
if (text === null || !text.length) return text;
|
||||
var buffer = [];
|
||||
|
||||
for (var i = 0, len = text.length; i < len; i += 1) {
|
||||
var char = text.charAt(i);
|
||||
|
||||
switch (char) {
|
||||
case '<':
|
||||
buffer.push('<');
|
||||
break;
|
||||
|
||||
case '>':
|
||||
buffer.push('>');
|
||||
break;
|
||||
|
||||
case '&':
|
||||
buffer.push('&');
|
||||
break;
|
||||
|
||||
case '"':
|
||||
buffer.push('"');
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
buffer.push(''');
|
||||
break;
|
||||
|
||||
default:
|
||||
var charCode = text.charCodeAt(i);
|
||||
if (charCode < 0x20) {
|
||||
// sort out invalid XML characters below 0x20 - all but 0x9, 0xA and 0xD.
|
||||
// The trick is an adaption of java.lang.Character.isSpace().
|
||||
if (((((1 << 0x9) | (1 << 0xA) | (1 << 0xD)) >> charCode) & 1) !== 0) {
|
||||
buffer.push(char);
|
||||
}
|
||||
} else {
|
||||
buffer.push(char);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a string for HTML output, leaving linebreaks untouched.
|
||||
*
|
||||
* Performs the following string manipulations:
|
||||
* Unlike encode, leaves linebreaks untouched. This is what you usually want to do for encoding form content (esp.
|
||||
* with text input values).
|
||||
* All special characters (i.e. non ASCII) are being replaced with their equivalent HTML entity.
|
||||
* Existing markup tags are being encoded.
|
||||
*
|
||||
* @param {string} text
|
||||
* The string to format for HTML output.
|
||||
* @return {string}
|
||||
* The string formatted for HTML output.
|
||||
*/
|
||||
var encodeForm = function(text) {
|
||||
text = String(text);
|
||||
|
||||
if (text === null || !text.length) return text;
|
||||
|
||||
return encode(text, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes any markup tags contained in the passed string, and returns the modified string.
|
||||
*
|
||||
* @param {string} markup
|
||||
* The text that is to be stripped of tags.
|
||||
* @return {string}
|
||||
* The text with the tags stripped out.
|
||||
*/
|
||||
var stripTags = function (markup) {
|
||||
if (!markup) return '';
|
||||
|
||||
var chars = String(markup).split('');
|
||||
var charCounter = 0;
|
||||
var inTag = false;
|
||||
|
||||
for (var i = 0, len = markup.length; i < len; i += 1) {
|
||||
if (chars[i] === '<') inTag = true;
|
||||
|
||||
if (!inTag) {
|
||||
if (i > charCounter) {
|
||||
chars[charCounter] = chars[i];
|
||||
}
|
||||
|
||||
charCounter += 1;
|
||||
}
|
||||
|
||||
if (chars[i] === '>') {
|
||||
inTag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > charCounter) {
|
||||
chars.length = charCounter;
|
||||
return chars.join('');
|
||||
}
|
||||
|
||||
return markup;
|
||||
};
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
* application, for example by calling app.addRepository('modules/core/Object.js')
|
||||
*/
|
||||
|
||||
app.addRepository('modules/core/Global.js');
|
||||
|
||||
/**
|
||||
* Copies the properties of this object into a clone.
|
||||
* @external
|
||||
|
|
|
@ -42,6 +42,8 @@ String.URLPATTERN = /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\
|
|||
* application, for example by calling app.addRepository('modules/core/String.js')
|
||||
*/
|
||||
|
||||
app.addRepository('modules/core/Global.js');
|
||||
|
||||
/**
|
||||
* checks if a date format pattern is correct
|
||||
* @external
|
||||
|
@ -392,54 +394,7 @@ String.prototype.unwrap = function(removeTags, replacement) {
|
|||
* @return String md5 hash of the string
|
||||
*/
|
||||
String.prototype.md5 = function() {
|
||||
return Packages.helma.util.MD5Encoder.encode(this);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* function repeats a string the specified amount of times
|
||||
* @external
|
||||
* @memberof {String}
|
||||
* @param Int amount of repetitions
|
||||
* @return String resulting string
|
||||
*/
|
||||
String.prototype.repeat = function(multiplier) {
|
||||
res.push();
|
||||
for (var i=0; i<multiplier; i++)
|
||||
res.write(this);
|
||||
return res.pop();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* function returns true if the string starts with
|
||||
* the string passed as argument
|
||||
* @external
|
||||
* @memberof {String}
|
||||
* @param String string pattern to search for
|
||||
* @return Boolean true in case it matches the beginning
|
||||
* of the string, false otherwise
|
||||
*/
|
||||
String.prototype.startsWith = function(str, offset) {
|
||||
var javaObj = new java.lang.String(this);
|
||||
if (offset != null)
|
||||
return javaObj.startsWith(str, offset);
|
||||
return javaObj.startsWith(str);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* function returns true if the string ends with
|
||||
* the string passed as argument
|
||||
* @external
|
||||
* @memberof {String}
|
||||
* @param String string pattern to search for
|
||||
* @return Boolean true in case it matches the end of
|
||||
* the string, false otherwise
|
||||
*/
|
||||
String.prototype.endsWith = function(str) {
|
||||
var javaObj = new java.lang.String(this);
|
||||
return javaObj.endsWith(str);
|
||||
return Packages.org.apache.commons.codec.digest.DigestUtils.md5Hex(this);
|
||||
};
|
||||
|
||||
|
||||
|
@ -455,28 +410,21 @@ String.prototype.endsWith = function(str) {
|
|||
* String.BALANCE and String.RIGHT here as well.)
|
||||
* @return String the resulting string
|
||||
*/
|
||||
String.prototype.pad = function(str, len, mode) {
|
||||
if (str == null || len == null)
|
||||
return this;
|
||||
var diff = len - this.length;
|
||||
if (diff == 0)
|
||||
return this;
|
||||
var left, right = 0;
|
||||
if (mode == null || mode == String.RIGHT)
|
||||
right = diff;
|
||||
else if (mode == String.LEFT)
|
||||
left = diff;
|
||||
else if (mode == String.BALANCE) {
|
||||
right = Math.round(diff / 2);
|
||||
left = diff - right;
|
||||
String.prototype.pad = function(str, length, mode) {
|
||||
if (mode === null || mode === String.RIGHT) return this.padEnd(length, str);
|
||||
if (mode === String.LEFT) return this.padStart(length, str);
|
||||
|
||||
if (mode === String.BALANCE && str && length) {
|
||||
const pos = Math.ceil(this.length / 2);
|
||||
const head = this.substr(0, pos);
|
||||
const tail = this.substr(pos);
|
||||
const additionalLength = (length - this.length) / 2;
|
||||
const startLength = head.length + Math.floor(additionalLength);
|
||||
const endLength = tail.length + Math.ceil(additionalLength);
|
||||
return head.padStart(startLength, str) + tail.padEnd(endLength, str);
|
||||
}
|
||||
res.push();
|
||||
for (var i=0; i<left; i++)
|
||||
res.write(str);
|
||||
res.write(this);
|
||||
for (var i=0; i<right; i++)
|
||||
res.write(str);
|
||||
return res.pop();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
@ -490,9 +438,7 @@ String.prototype.pad = function(str, len, mode) {
|
|||
* @param Boolean
|
||||
*/
|
||||
String.prototype.contains = function(str, fromIndex) {
|
||||
if (this.indexOf(str, fromIndex ? fromIndex : 0) > -1)
|
||||
return true;
|
||||
return false;
|
||||
return this.indexOf(str, fromIndex || 0) > -1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -558,17 +504,6 @@ String.prototype.diff = function(mod, separator) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* remove leading and trailing whitespace
|
||||
* @external
|
||||
* @memberof {String}
|
||||
*/
|
||||
String.prototype.trim = function () {
|
||||
var s = new java.lang.String(this);
|
||||
return String(s.trim());
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* returns true if the string looks like an e-mail
|
||||
* @external
|
||||
|
@ -601,8 +536,8 @@ String.prototype.count = function(str) {
|
|||
* @memberof {String}
|
||||
*/
|
||||
String.prototype.enbase64 = function() {
|
||||
var bytes = new java.lang.String(this) . getBytes();
|
||||
return new Packages.sun.misc.BASE64Encoder().encode(bytes);
|
||||
var bytes = java.lang.String(this).getBytes('utf-8');
|
||||
return String(java.lang.String(Packages.org.apache.commons.codec.binary.Base64.encodeBase64(bytes), 'utf-8'));
|
||||
};
|
||||
|
||||
|
||||
|
@ -612,8 +547,8 @@ String.prototype.enbase64 = function() {
|
|||
* @memberof {String}
|
||||
*/
|
||||
String.prototype.debase64 = function() {
|
||||
var bytes = new Packages.sun.misc.BASE64Decoder().decodeBuffer(this);
|
||||
return String(new java.lang.String(bytes));
|
||||
var bytes = Packages.org.apache.commons.codec.binary.Base64.decodeBase64(this);
|
||||
return String(java.lang.String(bytes, 'utf-8'));
|
||||
};
|
||||
|
||||
|
||||
|
|
2
modules/helma/Chart.js
vendored
2
modules/helma/Chart.js
vendored
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
// 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
|
||||
|
|
|
@ -57,15 +57,22 @@ helma.Http = function() {
|
|||
"socket": 0
|
||||
};
|
||||
var maxResponseSize = null;
|
||||
var maxTries = 5;
|
||||
var currentTries = 0;
|
||||
|
||||
var responseHandler = function(connection, result) {
|
||||
var input;
|
||||
var stream;
|
||||
try {
|
||||
if (method !== 'DELETE') {
|
||||
input = new java.io.BufferedInputStream(connection.getInputStream());
|
||||
}
|
||||
stream = connection.getInputStream();
|
||||
} 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) {
|
||||
var body = new java.io.ByteArrayOutputStream();
|
||||
|
@ -84,8 +91,7 @@ helma.Http = function() {
|
|||
} catch (error) {
|
||||
// safe to ignore
|
||||
}
|
||||
if (binaryMode && (result.code >= 200 && result.code < 300)) {
|
||||
// only honor binaryMode if the request succeeded
|
||||
if (binaryMode) {
|
||||
result.content = body.toByteArray();
|
||||
} else {
|
||||
result.content = result.charset ?
|
||||
|
@ -159,8 +165,8 @@ helma.Http = function() {
|
|||
* @param {String} password The password
|
||||
*/
|
||||
this.setCredentials = function(username, password) {
|
||||
var str = new java.lang.String(username + ":" + password);
|
||||
credentials = (new Packages.sun.misc.BASE64Encoder()).encode(str.getBytes());
|
||||
var str = username + ":" + password;
|
||||
credentials = str.enbase64();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -552,6 +558,14 @@ helma.Http = function() {
|
|||
content: null,
|
||||
}
|
||||
|
||||
// java.net.URLConnection does not follow redirects from http to https
|
||||
// See https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4620571
|
||||
if (followRedirects && [301, 303].contains(result.code) && result.location) {
|
||||
currentTries += 1;
|
||||
if (currentTries >= maxTries) throw new Error('Too many redirects');
|
||||
return this.getUrl(result.location, opt);
|
||||
}
|
||||
|
||||
// parse all "Set-Cookie" header fields into an array of
|
||||
// helma.Http.Cookie instances
|
||||
var setCookies = conn.getHeaderFields().get("Set-Cookie");
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
*/
|
||||
|
||||
// take care of any dependencies
|
||||
app.addRepository('modules/helma/lucene-core.jar');
|
||||
app.addRepository('modules/helma/lucene-analyzers.jar');
|
||||
app.addRepository('modules/helma/lucene-core-2.2.0.jar');
|
||||
app.addRepository('modules/helma/lucene-analyzers-2.2.0.jar');
|
||||
|
||||
|
||||
if (!global.helma) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
// take care of any dependencies
|
||||
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
|
||||
if (!global.helma) {
|
||||
|
|
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.
86
modules/helma/licenses/ganymed-ssh2.txt
Normal file
86
modules/helma/licenses/ganymed-ssh2.txt
Normal file
|
@ -0,0 +1,86 @@
|
|||
Copyright (c) 2006 - 2011 Christian Plattner. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
a.) Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
b.) Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
c.) Neither the name of Christian Plattner nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
This software includes work that was released under the following license:
|
||||
|
||||
Copyright (c) 2005 - 2006 Swiss Federal Institute of Technology (ETH Zurich),
|
||||
Department of Computer Science (http://www.inf.ethz.ch),
|
||||
Christian Plattner. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
a.) Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
b.) Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
c.) Neither the name of ETH Zurich nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
The Java implementations of the AES, Blowfish and 3DES ciphers have been
|
||||
taken (and slightly modified) from the cryptography package released by
|
||||
"The Legion Of The Bouncy Castle".
|
||||
|
||||
Their license states the following:
|
||||
|
||||
Copyright (c) 2000 - 2004 The Legion Of The Bouncy Castle
|
||||
(http://www.bouncycastle.org)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
125
modules/helma/licenses/jxl.txt
Normal file
125
modules/helma/licenses/jxl.txt
Normal file
|
@ -0,0 +1,125 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the program's name and an idea of what it does.
|
||||
Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||
type `show w'. This is free software, and you are welcome
|
||||
to redistribute it under certain conditions; type `show c'
|
||||
for details.
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright
|
||||
interest in the program `Gnomovision'
|
||||
(which makes passes at compilers) written
|
||||
by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
@ -199,4 +200,3 @@
|
|||
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.
|
||||
|
202
modules/helma/licenses/lucene-core.txt
Normal file
202
modules/helma/licenses/lucene-core.txt
Normal file
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
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'
|
||||
}
|
|
@ -841,7 +841,7 @@ jala.db.RamDatabase.prototype.copyTables = function(database, tables) {
|
|||
tables = jala.db.metadata.getTableNames(dbMetadata);
|
||||
}
|
||||
|
||||
for each (var tableName in tables) {
|
||||
for (let tableName of tables) {
|
||||
// drop the table if it exists
|
||||
if (this.tableExists(tableName)) {
|
||||
this.dropTable(tableName);
|
||||
|
|
|
@ -123,8 +123,8 @@ jala.XmlRpcRequest = function(url, methodName) {
|
|||
* @param {String} password The password
|
||||
*/
|
||||
this.setCredentials = function(username, password) {
|
||||
var str = new java.lang.String(username + ":" + password);
|
||||
credentials = (new Packages.sun.misc.BASE64Encoder()).encode(str.getBytes());
|
||||
var str = username + ":" + password;
|
||||
credentials = str.enbase64();
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
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.
|
@ -1,7 +1,6 @@
|
|||
//
|
||||
// Jala Project [http://opensvn.csie.org/traccgi/jala]
|
||||
//
|
||||
// Copyright 2004 ORF Online und Teletext GmbH
|
||||
// Copyright 2004 ORF Online und Teletext GmbH.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the ``License'');
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -14,13 +13,6 @@
|
|||
// 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.
|
||||
//
|
||||
// $Revision$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $HeadURL$
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
|
@ -103,7 +95,10 @@ Message.formatId = function(str, wrap) {
|
|||
* was found at
|
||||
*/
|
||||
Message.prototype.addLocation = function(filePath, lineNum) {
|
||||
this.locations.push(filePath + ":" + lineNum);
|
||||
const basePath = java.nio.file.Paths.get(java.io.File(app.dir).getCanonicalPath());
|
||||
const locationPath = java.nio.file.Paths.get(filePath);
|
||||
const relativePath = basePath.relativize(locationPath);
|
||||
this.locations.push(relativePath + ":" + lineNum);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -153,7 +148,8 @@ MessageParser.FUNCTION_NAMES = {
|
|||
"_": true,
|
||||
"gettext": true,
|
||||
"ngettext": true,
|
||||
"markgettext": true
|
||||
"markgettext": true,
|
||||
"cgettext": true
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -219,12 +215,12 @@ MessageParser.prototype.parse = function(file, encoding) {
|
|||
if ((dotIdx = fName.lastIndexOf(".")) > -1) {
|
||||
switch (String(fName.substring(dotIdx+1))) {
|
||||
case "skin":
|
||||
print("Parsing skin file " + file.getAbsolutePath() + "...");
|
||||
print("Parsing skin file " + file.getCanonicalPath() + "...");
|
||||
this.parseSkinFile(file, encoding);
|
||||
break;
|
||||
case "hac":
|
||||
case "js":
|
||||
print("Parsing function file " + file.getAbsolutePath() + "...");
|
||||
print("Parsing function file " + file.getCanonicalPath() + "...");
|
||||
this.parseFunctionFile(file, encoding);
|
||||
break;
|
||||
default:
|
||||
|
@ -287,6 +283,10 @@ MessageParser.prototype.parseFunctionFile = function(file, encoding) {
|
|||
for (var i=0;i<messages.length;i++) {
|
||||
msgParam = messages[i];
|
||||
if (msgParam.args && msgParam.args.length > 0) {
|
||||
if (msgParam.name === "cgettext" || msgParam.name === "markgettext") {
|
||||
msgParam.args[0] = cgettext.getKey(msgParam.args[0], msgParam.args[1]);
|
||||
delete msgParam.args[1];
|
||||
}
|
||||
key = Message.getKey(msgParam.args[0]);
|
||||
if (!(msg = this.messages[key])) {
|
||||
this.messages[key] = msg = new Message(msgParam.args[0], msgParam.args[1]);
|
||||
|
@ -294,7 +294,7 @@ MessageParser.prototype.parseFunctionFile = function(file, encoding) {
|
|||
if (!msg.pluralId && msgParam.args.length > 1) {
|
||||
msg.pluralId = msgParam.args[1];
|
||||
}
|
||||
msg.addLocation(file.getAbsolutePath(), msgParam.lineNr);
|
||||
msg.addLocation(file.getCanonicalPath(), msgParam.lineNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -313,61 +313,111 @@ MessageParser.prototype.parseFunctionFile = function(file, encoding) {
|
|||
* @param {String} encoding The encoding to use
|
||||
*/
|
||||
MessageParser.prototype.parseSkinFile = function(file, encoding) {
|
||||
var content = readFile(file.getAbsolutePath(), encoding || "UTF-8");
|
||||
var macro, id, pluralId, params, key;
|
||||
while (macro = MessageParser.REGEX_MACRO.exec(content)) {
|
||||
while (params = MessageParser.REGEX_PARAM.exec(macro[3])) {
|
||||
if (macro[2] == MessageParser.MACRO_NAME) {
|
||||
if (params[1] == "text") {
|
||||
id = params[2];
|
||||
pluralId = null;
|
||||
} else if (params[1] == "plural") {
|
||||
pluralId = params[2];
|
||||
var self = this;
|
||||
var source = readFile(file.getAbsolutePath(), encoding || "UTF-8");
|
||||
|
||||
var checkNestedMacros = function(iterator) {
|
||||
var macros = [];
|
||||
while (iterator.hasNext()) {
|
||||
macro = iterator.next();
|
||||
if (macro && macro.constructor !== String) {
|
||||
macros.push(macro);
|
||||
}
|
||||
} else {
|
||||
if (params[1] == MessageParser.ATTRIBUTE_NAME) {
|
||||
id = params[2];
|
||||
pluralId = null;
|
||||
} else if (params[1] == "plural") {
|
||||
pluralId = params[2];
|
||||
}
|
||||
processMacros(macros);
|
||||
}
|
||||
|
||||
var processMacros = function(macros) {
|
||||
var re = gettext_macro.REGEX;
|
||||
var id, pluralId, name, args, param, key, msg;
|
||||
for (let macro of macros) {
|
||||
id = pluralId = null;
|
||||
name = macro.getName();
|
||||
param = macro.getNamedParams();
|
||||
if (param) {
|
||||
checkNestedMacros(param.values().iterator());
|
||||
if (name === MessageParser.MACRO_NAME) {
|
||||
id = param.get("text");
|
||||
pluralId = param.get("plural");
|
||||
} else if (param.containsKey("message") === MessageParser.ATTRIBUTE_NAME) {
|
||||
id = param.get("message");
|
||||
pluralId = param.get("plural");
|
||||
}
|
||||
}
|
||||
args = macro.getPositionalParams();
|
||||
if (args) {
|
||||
checkNestedMacros(args.iterator());
|
||||
if (name === "gettext" || name === "markgettext") {
|
||||
id = cgettext.getKey(args.get(0), param && param.get("context"));
|
||||
} else if (name === "ngettext") {
|
||||
id = args.get(0);
|
||||
pluralId = args.get(1);
|
||||
}
|
||||
}
|
||||
if (id != null) {
|
||||
if (id.constructor !== String) {
|
||||
continue;
|
||||
}
|
||||
// create new Message instance or update the existing one
|
||||
id = id.replace(re, String.SPACE);
|
||||
pluralId && (pluralId = pluralId.replace(re, String.SPACE));
|
||||
key = Message.getKey(id);
|
||||
if (!(msg = this.messages[key])) {
|
||||
this.messages[key] = msg = new Message(id, pluralId, file.getAbsolutePath());
|
||||
if (!(msg = self.messages[key])) {
|
||||
self.messages[key] = msg = new Message(id, pluralId, file.getCanonicalPath());
|
||||
}
|
||||
msg.addLocation(file.getAbsolutePath(),
|
||||
MessageParser.getLineNum(content, macro.index));
|
||||
msg.addLocation(file.getCanonicalPath(), MessageParser.getLineNum(source, macro.start));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var skin = createSkin(source);
|
||||
if (skin.hasMainskin()) {
|
||||
processMacros(skin.getMacros());
|
||||
}
|
||||
for (let name of skin.getSubskinNames()) {
|
||||
var subskin = skin.getSubskin(name);
|
||||
processMacros(subskin.getMacros());
|
||||
}
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a standard Header of a .po file
|
||||
* FIXME: Allow custom header (template?)
|
||||
* FIXME: why the hell is Plural-Forms ignored in poEdit?
|
||||
* @see http://drupal.org/node/17564
|
||||
*/
|
||||
MessageParser.prototype.getPotString = function() {
|
||||
var date = new Date;
|
||||
var buf = new java.lang.StringBuffer();
|
||||
buf.append('# SOME DESCRIPTIVE TITLE.\n');
|
||||
buf.append('# Copyright (C) YEAR THE PACKAGE\'S COPYRIGHT HOLDER\n');
|
||||
buf.append('# This file is distributed under the same license as the PACKAGE package.\n');
|
||||
buf.append('# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n');
|
||||
buf.append('#\n');
|
||||
buf.append('# The Antville Project\n');
|
||||
buf.append('# http://code.google.com/p/antville\n');
|
||||
buf.append('#\n');
|
||||
buf.append('# Copyright 2001-' + date.getFullYear() + ' by the Workers of Antville.\n');
|
||||
buf.append('#\n');
|
||||
buf.append("# Licensed under the Apache License, Version 2.0 (the ``License''\n");
|
||||
buf.append('# you may not use this file except in compliance with the License.\n');
|
||||
buf.append('# You may obtain a copy of the License at\n');
|
||||
buf.append('#\n');
|
||||
buf.append('# http://www.apache.org/licenses/LICENSE-2.0\n');
|
||||
buf.append('#\n');
|
||||
buf.append('# Unless required by applicable law or agreed to in writing, software\n');
|
||||
buf.append("# distributed under the License is distributed on an ``AS IS'' BASIS,\n");
|
||||
buf.append('# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n');
|
||||
buf.append('# See the License for the specific language governing permissions and\n');
|
||||
buf.append('# limitations under the License.\n');
|
||||
buf.append('#\n\n');
|
||||
buf.append('#, fuzzy\n');
|
||||
buf.append('msgid ""\n');
|
||||
buf.append('msgstr ""\n');
|
||||
buf.append('"Project-Id-Version: PACKAGE VERSION\\n"\n');
|
||||
buf.append('"Report-Msgid-Bugs-To: \\n"\n');
|
||||
buf.append('"Project-Id-Version: Antville-' + Root.VERSION + '\\n"\n');
|
||||
buf.append('"Report-Msgid-Bugs-To: mail@antville.org\\n"\n');
|
||||
var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mmZ");
|
||||
buf.append('"POT-Creation-Date: ' + sdf.format(new java.util.Date()) + '\\n"\n');
|
||||
buf.append('"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"\n');
|
||||
buf.append('"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"\n');
|
||||
buf.append('"Language-Team: LANGUAGE <LL@li.org>\\n"\n');
|
||||
buf.append('"PO-Revision-Date: ' + sdf.format(new java.util.Date()) + '\\n"\n');
|
||||
//buf.append('"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"\n');
|
||||
buf.append('"Language-Team: The Antville People <mail@antville.org>\\n"\n');
|
||||
buf.append('"MIME-Version: 1.0\\n"\n');
|
||||
buf.append('"Content-Type: text/plain; charset=utf-8\\n"\n');
|
||||
buf.append('"Content-Transfer-Encoding: 8bit\\n"\n');
|
||||
|
@ -384,7 +434,7 @@ MessageParser.prototype.getPotString = function() {
|
|||
for (var i=0;i<keys.length;i++) {
|
||||
this.messages[keys[i]].write(buf);
|
||||
}
|
||||
return buf.toString();
|
||||
return new java.lang.String(buf);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
//
|
||||
// Jala Project [http://opensvn.csie.org/traccgi/jala]
|
||||
//
|
||||
// Copyright 2004 ORF Online und Teletext GmbH
|
||||
// Copyright 2004 ORF Online und Teletext GmbH.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the ``License'');
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
@ -14,13 +13,6 @@
|
|||
// 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.
|
||||
//
|
||||
// $Revision$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $HeadURL$
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
|
@ -228,7 +220,8 @@ PoParser.prototype.writeToFile = function(output) {
|
|||
buf.append('/**\n');
|
||||
buf.append(' * Messages for locale "' + this.localeKey + '"\n');
|
||||
buf.append(' */\n');
|
||||
objPath += "." + this.localeKey;
|
||||
var fname = objPath + "." + this.localeKey + ".js";
|
||||
objPath += "['" + this.localeKey + "']";
|
||||
buf.append('global.' + objPath + ' = {\n');
|
||||
// write messages
|
||||
for (var i=0;i<this.messages.length; i++) {
|
||||
|
@ -238,10 +231,9 @@ PoParser.prototype.writeToFile = function(output) {
|
|||
buf.append('};\n');
|
||||
|
||||
// write the message catalog into the outFile
|
||||
var file = new java.io.File(output, objPath + ".js");
|
||||
var file = new java.io.File(output, fname);
|
||||
var writer = new java.io.FileWriter(file);
|
||||
writer.write(buf.toString());
|
||||
// writer.write(buf.toString().getBytes("UTF-8"));
|
||||
writer.write(new java.lang.String(buf.toString().getBytes("UTF-8")));
|
||||
writer.close();
|
||||
print("generated messages file " + file.getAbsolutePath());
|
||||
return;
|
||||
|
|
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'
|
||||
}
|
|
@ -1336,7 +1336,7 @@ jala.Test.DatabaseMgr.prototype.startDatabase = function(dbSourceName, copyTable
|
|||
// collect the table names of all relational prototypes
|
||||
tables = [];
|
||||
var protos = app.getPrototypes();
|
||||
for each (var proto in protos) {
|
||||
for (let proto of protos) {
|
||||
var dbMap = proto.getDbMapping();
|
||||
if (dbMap.isRelational()) {
|
||||
tables.push(dbMap.getTableName());
|
||||
|
|
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.
|
@ -49,7 +49,7 @@ helma.auth = function(realm) {
|
|||
var accessAllowed = true;
|
||||
if (req.data.username && req.data.password) {
|
||||
if (pw && hostIsAllowed()) {
|
||||
if (pw == Packages.helma.util.MD5Encoder.encode(req.data.username + "-" + req.data.password)) {
|
||||
if (pw == Packages.org.apache.commons.codec.digest.DigestUtils.md5Hex(req.data.username + "-" + req.data.password)) {
|
||||
session.data[realm+'Authenticated'] = true;
|
||||
res.redirect(res.data.href);
|
||||
} else {
|
||||
|
@ -61,7 +61,7 @@ helma.auth = function(realm) {
|
|||
The adminAccess property is not set.<br />\
|
||||
Before proceeding, add the following line to your app.properties or server.properties file:\
|
||||
<br /><br />adminAccess='
|
||||
+ Packages.helma.util.MD5Encoder.encode(req.data.username + "-" + req.data.password);
|
||||
+ Packages.org.apache.commons.codec.digest.DigestUtils.md5Hex(req.data.username + "-" + req.data.password);
|
||||
else param.message += 'The '+ realm +'AccessAllowed property does not match your host.<br />\
|
||||
Before proceeding, remove this property from your app.properties or server.properties file \
|
||||
or include your host as follows:<br /><br />'
|
||||
|
|
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')
|
||||
|
||||
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')
|
||||
|
|
2
src/dist/apps/manage/Global/functions.js
vendored
2
src/dist/apps/manage/Global/functions.js
vendored
|
@ -123,7 +123,7 @@ function checkAuth(appObj) {
|
|||
if (uname == null || uname == "" || pwd == null || pwd == "")
|
||||
return forceAuth();
|
||||
|
||||
var md5key = Packages.helma.util.MD5Encoder.encode(uname + "-" + pwd);
|
||||
var md5key = Packages.org.apache.commons.codec.digest.DigestUtils.md5Hex(uname + "-" + pwd);
|
||||
|
||||
if (md5key == adminAccess)
|
||||
return true;
|
||||
|
|
2
src/dist/apps/manage/Root/actions.js
vendored
2
src/dist/apps/manage/Root/actions.js
vendored
|
@ -75,7 +75,7 @@ function makekey_action() {
|
|||
res.data.body = renderSkinAsString("pwdform", obj);
|
||||
} else {
|
||||
// render the md5-string:
|
||||
obj.propsString = "adminAccess=" + Packages.helma.util.MD5Encoder.encode(req.data.username + "-" + req.data.password) + "<br>\n";
|
||||
obj.propsString = "adminAccess=" + Packages.org.apache.commons.codec.digest.DigestUtils.md5Hex(req.data.username + "-" + req.data.password) + "<br>\n";
|
||||
res.data.body = renderSkinAsString("pwdfeedback", obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ function testOrder(org, pos) {
|
|||
|
||||
function cleanup() {
|
||||
var persons = root.persons.list();
|
||||
for each (var person in persons) {
|
||||
for (let person of persons) {
|
||||
person.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() {
|
||||
var persons = org.generic.list();
|
||||
for each (var person in persons) {
|
||||
for (let person of persons) {
|
||||
person.remove();
|
||||
}
|
||||
org.remove();
|
||||
|
|
2
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
2
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
|
@ -143,7 +143,7 @@ function testGroupTransient() {
|
|||
|
||||
function cleanup() {
|
||||
var orgs = root.organisations.list();
|
||||
for each (var org in orgs) {
|
||||
for (let org of orgs) {
|
||||
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
|
20
src/dist/extras/upstart/helma
vendored
20
src/dist/extras/upstart/helma
vendored
|
@ -6,6 +6,15 @@
|
|||
# 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
|
||||
|
||||
###
|
||||
|
@ -19,22 +28,24 @@ else
|
|||
fi
|
||||
|
||||
# Check for missing files and directories
|
||||
|
||||
if [ ! -x $JAVA_BIN ]; then
|
||||
echo "Config error: JAVA_BIN $JAVA_BIN not found or not executable"
|
||||
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
|
||||
|
||||
# local settins
|
||||
RUN_CMD="sudo -u $HELMA_USER $JAVA_BIN"
|
||||
RUN_ARGS="$JAVA_OPTS -jar $HELMA_INSTALL/launcher.jar -h $HELMA_HOME $HELMA_ARGS"
|
||||
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
|
||||
start)
|
||||
|
@ -46,7 +57,7 @@ start)
|
|||
fi
|
||||
|
||||
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_SERVICE (pid `cat $HELMA_PID`) started."
|
||||
;;
|
||||
|
@ -81,4 +92,5 @@ reload)
|
|||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
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 config file
|
||||
### Author: Hannes Wallnoefer, <hannes@helma.at>
|
||||
### Author: Andreas Bolka
|
||||
###
|
||||
### This file should be placed in /etc/helma.conf.
|
||||
### It is read by the Helma service control script,
|
||||
### usually /etc/init.d/helma.
|
||||
###
|
||||
##############################################################
|
||||
#
|
||||
# Helma Object Publisher configuration file
|
||||
#
|
||||
# Authors:
|
||||
# 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,
|
||||
# usually /etc/init.d/helma.
|
||||
#
|
||||
|
||||
##############################################################
|
||||
### The name of this Helma server/service and the
|
||||
### pid file to be used
|
||||
#############################################################
|
||||
# Full path to Java executable
|
||||
JAVA_HOME=/usr/lib/jvm/default-java
|
||||
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_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
|
||||
|
||||
##############################################################
|
||||
### Full path to Java executable
|
||||
##############################################################
|
||||
JAVA_HOME=/usr/lib/j2sdk1.5-sun
|
||||
JAVA_BIN=$JAVA_HOME/bin/java
|
||||
|
||||
|
||||
##############################################################
|
||||
### Options passed to the Java runtime
|
||||
##############################################################
|
||||
JAVA_OPTS="-Djava.awt.headless=true"
|
||||
|
||||
|
||||
##############################################################
|
||||
### Helma install directory. This is where we look for
|
||||
### the Helma jar files (launcher.jar, lib/* and lib/ext/*)
|
||||
##############################################################
|
||||
HELMA_INSTALL=/usr/local/helma/helma-1.6.x
|
||||
|
||||
|
||||
##############################################################
|
||||
### Helma home directory, in case it is different from the
|
||||
### Helma install dir. This is where Helma will look for
|
||||
### properties files and applications.
|
||||
##############################################################
|
||||
# Helma home 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
|
||||
|
||||
|
||||
##############################################################
|
||||
### The user Helma should be running as
|
||||
##############################################################
|
||||
# The user Helma should be running as
|
||||
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 options. Possible options are:
|
||||
###
|
||||
### -f file Specify server.properties file
|
||||
### -p port Specify RMI port number
|
||||
### -w port Specify port number for embedded Web server
|
||||
### -x port Specify XML-RPC port number
|
||||
### -jk port Specify AJP13 port number
|
||||
###
|
||||
##############################################################
|
||||
# Helma options. Possible options are:
|
||||
# -f file - Location of server.properties file
|
||||
# -p port - RMI port
|
||||
# -w port - Web server port
|
||||
# -x port - XML-RPC port
|
||||
# -jk port - AJP13 port
|
||||
HELMA_ARGS="-w 8080"
|
||||
|
|
|
@ -20,6 +20,8 @@ package helma.extensions;
|
|||
*
|
||||
*/
|
||||
public class ConfigurationException extends RuntimeException {
|
||||
private static final long serialVersionUID = 6428439427909728917L;
|
||||
|
||||
/**
|
||||
* Creates a new ConfigurationException object.
|
||||
*
|
||||
|
|
|
@ -24,4 +24,6 @@ package helma.framework;
|
|||
*/
|
||||
public class AbortException extends Error {
|
||||
|
||||
private static final long serialVersionUID = -7536693051844908815L;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ package helma.framework;
|
|||
* application
|
||||
*/
|
||||
public class ApplicationStoppedException extends RuntimeException {
|
||||
private static final long serialVersionUID = 7125229844095452333L;
|
||||
|
||||
/**
|
||||
* Creates a new ApplicationStoppedException object.
|
||||
*/
|
||||
|
|
|
@ -24,13 +24,13 @@ import javax.servlet.http.Cookie;
|
|||
* of an HTTP cookie.
|
||||
*/
|
||||
public final class CookieTrans implements Serializable {
|
||||
String name;
|
||||
String value;
|
||||
String path;
|
||||
String domain;
|
||||
int days = -1;
|
||||
boolean secure;
|
||||
boolean httpOnly;
|
||||
private String name;
|
||||
private String value;
|
||||
private String path;
|
||||
private String domain;
|
||||
private boolean isHttpOnly = true;
|
||||
private boolean isSecure = false;
|
||||
private int days = -1;
|
||||
|
||||
CookieTrans(String name, String value) {
|
||||
this.name = name;
|
||||
|
@ -53,9 +53,15 @@ public final class CookieTrans implements Serializable {
|
|||
this.domain = domain;
|
||||
}
|
||||
|
||||
void setHttpOnly(boolean isHttpOnly) {
|
||||
this.isHttpOnly = isHttpOnly;
|
||||
}
|
||||
|
||||
void setSecure(boolean isSecure) {
|
||||
this.isSecure = isSecure;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getName() {
|
||||
|
@ -63,8 +69,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getValue() {
|
||||
|
@ -72,8 +76,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public int getDays() {
|
||||
|
@ -81,8 +83,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getPath() {
|
||||
|
@ -90,28 +90,24 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public boolean isSecure() {
|
||||
return secure;
|
||||
/**
|
||||
* @return ...
|
||||
*/
|
||||
public boolean getHttpOnly() {
|
||||
return isHttpOnly;
|
||||
}
|
||||
|
||||
void isSecure(boolean secure) {
|
||||
this.secure = secure;
|
||||
}
|
||||
|
||||
public boolean isHttpOnly() {
|
||||
return httpOnly;
|
||||
}
|
||||
|
||||
void isHttpOnly(boolean httpOnly) {
|
||||
this.httpOnly = httpOnly;
|
||||
/**
|
||||
* @return ...
|
||||
*/
|
||||
public boolean getSecure() {
|
||||
return isSecure;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,8 +141,8 @@ public final class CookieTrans implements Serializable {
|
|||
c.setDomain(defaultDomain);
|
||||
}
|
||||
|
||||
c.setHttpOnly(httpOnly);
|
||||
c.setSecure(secure);
|
||||
c.setHttpOnly(isHttpOnly);
|
||||
c.setSecure(isSecure);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ package helma.framework;
|
|||
* wrong in evaluation of requests.
|
||||
*/
|
||||
public class FrameworkException extends RuntimeException {
|
||||
private static final long serialVersionUID = -8477797850472128617L;
|
||||
|
||||
/**
|
||||
* Creates a new FrameworkException object.
|
||||
*
|
||||
|
|
|
@ -22,6 +22,8 @@ package helma.framework;
|
|||
* wrong in evaluation of requests.
|
||||
*/
|
||||
public class NotFoundException extends RuntimeException {
|
||||
private static final long serialVersionUID = -715022974097617658L;
|
||||
|
||||
/**
|
||||
* Creates a new NotFoundException object.
|
||||
*
|
||||
|
|
|
@ -24,6 +24,8 @@ package helma.framework;
|
|||
* java.lang.ThreadDeath).
|
||||
*/
|
||||
public class RedirectException extends Error {
|
||||
private static final long serialVersionUID = 2362170037476457592L;
|
||||
|
||||
String url;
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,6 +24,8 @@ import java.util.Map;
|
|||
*
|
||||
*/
|
||||
public class RequestBean implements Serializable {
|
||||
private static final long serialVersionUID = -6826881712426326687L;
|
||||
|
||||
RequestTrans req;
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,13 +16,15 @@
|
|||
|
||||
package helma.framework;
|
||||
|
||||
import helma.util.Base64;
|
||||
import helma.util.SystemMap;
|
||||
import helma.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.Cookie;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -601,11 +603,11 @@ public class RequestTrans implements Serializable {
|
|||
|
||||
StringTokenizer tok;
|
||||
|
||||
if (auth.startsWith("Basic ")) {
|
||||
tok = new StringTokenizer(new String(Base64.decode((auth.substring(6)).toCharArray())),
|
||||
":");
|
||||
if (auth.startsWith("Basic ")) { //$NON-NLS-1$
|
||||
tok = new StringTokenizer(new String(Base64.decodeBase64(auth.substring(6))),
|
||||
":"); //$NON-NLS-1$
|
||||
} else {
|
||||
tok = new StringTokenizer(new String(Base64.decode(auth.toCharArray())), ":");
|
||||
tok = new StringTokenizer(new String(Base64.decodeBase64(auth)), ":"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -632,6 +634,8 @@ public class RequestTrans implements Serializable {
|
|||
|
||||
class ParameterMap extends SystemMap {
|
||||
|
||||
private static final long serialVersionUID = 7632860503639617076L;
|
||||
|
||||
public ParameterMap() {
|
||||
super();
|
||||
}
|
||||
|
@ -708,6 +712,8 @@ public class RequestTrans implements Serializable {
|
|||
|
||||
class DataComboMap extends SystemMap {
|
||||
|
||||
private static final long serialVersionUID = 5737810055554406299L;
|
||||
|
||||
public Object get(Object key) {
|
||||
Object value = super.get(key);
|
||||
if (value != null)
|
||||
|
@ -743,6 +749,8 @@ public class RequestTrans implements Serializable {
|
|||
}
|
||||
|
||||
class ParamComboMap extends SystemMap {
|
||||
private static final long serialVersionUID = -9177176570950359431L;
|
||||
|
||||
public Object get(Object key) {
|
||||
Object value;
|
||||
if (postParams != null && (value = postParams.get(key)) != null)
|
||||
|
|
|
@ -30,6 +30,8 @@ import java.util.Map;
|
|||
*
|
||||
*/
|
||||
public class ResponseBean implements Serializable {
|
||||
private static final long serialVersionUID = -6807623667477109800L;
|
||||
|
||||
ResponseTrans res;
|
||||
|
||||
/**
|
||||
|
@ -141,7 +143,7 @@ public class ResponseBean implements Serializable {
|
|||
* @param value the cookie value
|
||||
*/
|
||||
public void setCookie(String key, String value) {
|
||||
res.setCookie(key, value, -1, null, null);
|
||||
res.setCookie(key, value, -1, null, null, true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,7 +156,7 @@ public class ResponseBean implements Serializable {
|
|||
* @param days number of days the cookie should be stored
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -169,7 +171,42 @@ public class ResponseBean implements Serializable {
|
|||
* @param path the URL path to apply the cookie to
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,7 +222,7 @@ public class ResponseBean implements Serializable {
|
|||
* @param domain 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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +232,7 @@ public class ResponseBean implements Serializable {
|
|||
* @param key the name of the cookie to be discarded
|
||||
*/
|
||||
public void unsetCookie(String key) {
|
||||
res.setCookie(key, "", 0, null, null);
|
||||
res.setCookie(key, "", 0, null, null, true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -220,8 +257,10 @@ public class ResponseBean implements Serializable {
|
|||
if (str == null) return;
|
||||
|
||||
for (String s : str) {
|
||||
res.writeln(s + "");
|
||||
res.write(s + "");
|
||||
}
|
||||
|
||||
res.writeln();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,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) {
|
||||
if (messages == null) {
|
||||
|
@ -584,6 +623,7 @@ public class ResponseBean implements Serializable {
|
|||
* Old version for push() kept for compatibility
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public void pushStringBuffer() {
|
||||
res.pushBuffer(null);
|
||||
}
|
||||
|
@ -593,6 +633,7 @@ public class ResponseBean implements Serializable {
|
|||
* @deprecated
|
||||
* @return ...
|
||||
*/
|
||||
@Deprecated
|
||||
public String popStringBuffer() {
|
||||
return res.popString();
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.io.*;
|
|||
import java.security.*;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.xmlrpc.XmlRpcResponseProcessor;
|
||||
|
||||
/**
|
||||
|
@ -383,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.
|
||||
*/
|
||||
public synchronized void encode(Object what) {
|
||||
|
@ -414,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.
|
||||
*/
|
||||
public synchronized void encodeXml(Object what) {
|
||||
|
@ -712,8 +713,8 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
digest = MessageDigest.getInstance("MD5");
|
||||
// if (contentType != null)
|
||||
// digest.update (contentType.getBytes());
|
||||
byte[] b = digest.digest(response);
|
||||
etag = "\"" + new String(helma.util.Base64.encode(b)) + "\"";
|
||||
byte[] b = this.digest.digest(this.response);
|
||||
this.etag = "\"" + new String(Base64.encodeBase64(b)) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// only set response to 304 not modified if no cookies were set
|
||||
if (reqtrans.hasETag(etag) && countCookies() == 0) {
|
||||
response = new byte[0];
|
||||
|
@ -864,7 +865,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
if (what == null) {
|
||||
digest.update(new byte[0]);
|
||||
} else if (what instanceof Date) {
|
||||
digest.update(MD5Encoder.toBytes(((Date) what).getTime()));
|
||||
digest.update(Long.toBinaryString(((Date) what).getTime()).getBytes());
|
||||
} else if (what instanceof byte[]) {
|
||||
digest.update((byte[]) what);
|
||||
} else {
|
||||
|
@ -888,9 +889,9 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
|
||||
// add the application checksum as dependency to make ETag
|
||||
// generation sensitive to changes in the app
|
||||
byte[] b = digest.digest(MD5Encoder.toBytes(app.getChecksum()));
|
||||
byte[] b = digest.digest(Long.toBinaryString((this.app.getChecksum())).getBytes());
|
||||
|
||||
setETag(new String(helma.util.Base64.encode(b)));
|
||||
setETag(new String(Base64.encodeBase64(b)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -973,8 +974,10 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
* @param days the cookie's lifespan in days
|
||||
* @param path the URL path 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;
|
||||
|
||||
if (cookies == null) {
|
||||
|
@ -1000,11 +1003,11 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
c.setDomain(domain);
|
||||
|
||||
if (!"false".equalsIgnoreCase(app.getProperty("cookies.httpOnly"))) {
|
||||
c.isHttpOnly(true);
|
||||
c.setHttpOnly(true);
|
||||
}
|
||||
|
||||
if ("true".equalsIgnoreCase(app.getProperty("cookies.secure"))) {
|
||||
c.isSecure(true);
|
||||
c.setSecure(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ package helma.framework;
|
|||
* not be serviced within the timeout period specified for an application.
|
||||
*/
|
||||
public class TimeoutException extends RuntimeException {
|
||||
private static final long serialVersionUID = 3853135482278393735L;
|
||||
|
||||
/**
|
||||
* Creates a new TimeoutException object.
|
||||
*/
|
||||
|
|
|
@ -20,6 +20,8 @@ import java.io.Serializable;
|
|||
|
||||
public class UploadStatus implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8335579045959177198L;
|
||||
|
||||
long current = 0;
|
||||
long total = 0;
|
||||
int itemsRead = 0;
|
||||
|
|
|
@ -38,6 +38,8 @@ import org.apache.commons.logging.LogFactory;
|
|||
* application specific functionality.
|
||||
*/
|
||||
public class ApplicationBean implements Serializable {
|
||||
private static final long serialVersionUID = -5053315391709405106L;
|
||||
|
||||
transient Application app;
|
||||
WrappedMap properties = null;
|
||||
|
||||
|
|
|
@ -415,6 +415,11 @@ public final class Prototype {
|
|||
* @return an iterator of this prototype's code resources
|
||||
*/
|
||||
public synchronized Iterator getCodeResources() {
|
||||
// if code has never been updated, do so now before returning an empty or incomplete list
|
||||
if (lastCodeUpdate == 0) {
|
||||
checkForUpdates();
|
||||
}
|
||||
|
||||
// we copy over to a new list, because the underlying set may grow
|
||||
// during compilation through use of app.addRepository()
|
||||
return new ArrayList(code).iterator();
|
||||
|
@ -487,6 +492,8 @@ public final class Prototype {
|
|||
* A Map that dynamically expands to all skins in this prototype.
|
||||
*/
|
||||
class SkinMap extends HashMap {
|
||||
private static final long serialVersionUID = -8855785541204100909L;
|
||||
|
||||
volatile long lastSkinmapLoad = -1;
|
||||
Object[] skinpath;
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ public class RequestPath {
|
|||
* @return the index of the element, or -1 if it isn't contained
|
||||
* @deprecated use {@link #indexOf(Object)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public int contains(Object obj) {
|
||||
return objects.indexOf(obj);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.Date;
|
|||
* exposes it to the scripting framework.
|
||||
*/
|
||||
public class SessionBean implements Serializable {
|
||||
private static final long serialVersionUID = 7500231949937123265L;
|
||||
|
||||
// the wrapped session object
|
||||
Session session;
|
||||
|
||||
|
|
|
@ -1190,6 +1190,8 @@ public final class Skin {
|
|||
* Exception type for unhandled, forbidden or failed macros
|
||||
*/
|
||||
class MacroException extends Exception {
|
||||
private static final long serialVersionUID = 396025641010781784L;
|
||||
|
||||
MacroException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ public final class TypeManager {
|
|||
long lastScan = lastRepoScan.containsKey(repository) ?
|
||||
((Long) lastRepoScan.get(repository)).longValue() : 0;
|
||||
if (repository.lastModified() != lastScan) {
|
||||
lastRepoScan.put(repository, new Long(repository.lastModified()));
|
||||
lastRepoScan.put(repository, Long.valueOf(repository.lastModified()));
|
||||
checkRepository(repository, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ public class ImageWrapper {
|
|||
/**
|
||||
* 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) {
|
||||
reduceColors(colors, false);
|
||||
|
@ -523,7 +523,7 @@ public class ImageWrapper {
|
|||
/**
|
||||
* 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 ...
|
||||
*/
|
||||
public void reduceColors(int colors, boolean dither) {
|
||||
|
@ -534,7 +534,7 @@ public class ImageWrapper {
|
|||
* Reduce the colors used in this image. Useful and necessary before saving
|
||||
* 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 alphaToBitmask ...
|
||||
*/
|
||||
|
|
|
@ -7,31 +7,30 @@
|
|||
* http://adele.helma.org/download/helma/license.txt
|
||||
*
|
||||
* Copyright 1998-2003 Helma Software. All Rights Reserved.
|
||||
*
|
||||
* $RCSfile$
|
||||
* $Author$
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
package helma.main;
|
||||
|
||||
import helma.framework.core.*;
|
||||
import helma.framework.repository.Repository;
|
||||
import helma.framework.repository.FileRepository;
|
||||
import helma.util.StringUtils;
|
||||
import org.apache.xmlrpc.XmlRpcHandler;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.xmlrpc.XmlRpcHandler;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.ResourceHandler;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import helma.util.ResourceProperties;
|
||||
import helma.framework.core.Application;
|
||||
import helma.framework.repository.FileRepository;
|
||||
import helma.framework.repository.Repository;
|
||||
import helma.servlet.EmbeddedServletClient;
|
||||
import helma.util.ResourceProperties;
|
||||
import helma.util.StringUtils;
|
||||
|
||||
/**
|
||||
* This class is responsible for starting and stopping Helma applications.
|
||||
|
@ -55,11 +54,11 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
public ApplicationManager(ResourceProperties props, Server server) {
|
||||
this.props = props;
|
||||
this.server = server;
|
||||
descriptors = new Hashtable();
|
||||
applications = new Hashtable();
|
||||
xmlrpcHandlers = new Hashtable();
|
||||
lastModified = 0;
|
||||
jetty = server.jetty;
|
||||
this.descriptors = new Hashtable();
|
||||
this.applications = new Hashtable();
|
||||
this.xmlrpcHandlers = new Hashtable();
|
||||
this.lastModified = 0;
|
||||
this.jetty = server.jetty;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,13 +66,13 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* to create and start new applications.
|
||||
*/
|
||||
protected void checkForChanges() {
|
||||
if (props.lastModified() > lastModified && server.getApplicationsOption() == null) {
|
||||
if (this.props.lastModified() > this.lastModified && this.server.getApplicationsOption() == null) {
|
||||
try {
|
||||
for (Enumeration e = props.keys(); e.hasMoreElements();) {
|
||||
for (Enumeration e = this.props.keys(); e.hasMoreElements();) {
|
||||
String appName = (String) e.nextElement();
|
||||
|
||||
if ((appName.indexOf(".") == -1) &&
|
||||
(applications.get(appName) == null)) {
|
||||
if ((appName.indexOf(".") == -1) && //$NON-NLS-1$
|
||||
(this.applications.get(appName) == null)) {
|
||||
AppDescriptor appDesc = new AppDescriptor(appName);
|
||||
appDesc.start();
|
||||
appDesc.bind();
|
||||
|
@ -81,27 +80,27 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// then stop deleted ones
|
||||
for (Enumeration e = descriptors.elements(); e.hasMoreElements();) {
|
||||
for (Enumeration e = this.descriptors.elements(); e.hasMoreElements();) {
|
||||
AppDescriptor appDesc = (AppDescriptor) e.nextElement();
|
||||
|
||||
// check if application has been removed and should be stopped
|
||||
if (!props.containsKey(appDesc.appName)) {
|
||||
if (!this.props.containsKey(appDesc.appName)) {
|
||||
appDesc.stop();
|
||||
} else if (server.jetty != null) {
|
||||
} else if (this.server.jetty != null) {
|
||||
// If application continues to run, remount
|
||||
// as the mounting options may have changed.
|
||||
AppDescriptor ndesc = new AppDescriptor(appDesc.appName);
|
||||
ndesc.app = appDesc.app;
|
||||
appDesc.unbind();
|
||||
ndesc.bind();
|
||||
descriptors.put(ndesc.appName, ndesc);
|
||||
this.descriptors.put(ndesc.appName, ndesc);
|
||||
}
|
||||
}
|
||||
} catch (Exception mx) {
|
||||
getLogger().error("Error checking applications", mx);
|
||||
}
|
||||
|
||||
lastModified = System.currentTimeMillis();
|
||||
this.lastModified = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +117,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* Bind an application by name
|
||||
*/
|
||||
public void register(String appName) {
|
||||
AppDescriptor desc = (AppDescriptor) descriptors.get(appName);
|
||||
AppDescriptor desc = (AppDescriptor) this.descriptors.get(appName);
|
||||
if (desc != null) {
|
||||
desc.bind();
|
||||
}
|
||||
|
@ -128,7 +127,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* Stop an application by name
|
||||
*/
|
||||
public void stop(String appName) {
|
||||
AppDescriptor desc = (AppDescriptor) descriptors.get(appName);
|
||||
AppDescriptor desc = (AppDescriptor) this.descriptors.get(appName);
|
||||
if (desc != null) {
|
||||
desc.stop();
|
||||
}
|
||||
|
@ -140,18 +139,18 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
*/
|
||||
public void startAll() {
|
||||
try {
|
||||
String[] apps = server.getApplicationsOption();
|
||||
String[] apps = this.server.getApplicationsOption();
|
||||
if (apps != null) {
|
||||
for (int i = 0; i < apps.length; i++) {
|
||||
AppDescriptor desc = new AppDescriptor(apps[i]);
|
||||
desc.start();
|
||||
}
|
||||
} else {
|
||||
for (Enumeration e = props.keys(); e.hasMoreElements();) {
|
||||
for (Enumeration e = this.props.keys(); e.hasMoreElements();) {
|
||||
String appName = (String) e.nextElement();
|
||||
|
||||
if (appName.indexOf(".") == -1) {
|
||||
String appValue = props.getProperty(appName);
|
||||
if (appName.indexOf(".") == -1) { //$NON-NLS-1$
|
||||
String appValue = this.props.getProperty(appName);
|
||||
|
||||
if (appValue != null && appValue.length() > 0) {
|
||||
appName = appValue;
|
||||
|
@ -163,12 +162,12 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
}
|
||||
|
||||
for (Enumeration e = descriptors.elements(); e.hasMoreElements();) {
|
||||
for (Enumeration e = this.descriptors.elements(); e.hasMoreElements();) {
|
||||
AppDescriptor appDesc = (AppDescriptor) e.nextElement();
|
||||
appDesc.bind();
|
||||
}
|
||||
|
||||
lastModified = System.currentTimeMillis();
|
||||
this.lastModified = System.currentTimeMillis();
|
||||
} catch (Exception mx) {
|
||||
getLogger().error("Error starting applications", mx);
|
||||
mx.printStackTrace();
|
||||
|
@ -179,7 +178,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* Stop all running applications.
|
||||
*/
|
||||
public void stopAll() {
|
||||
for (Enumeration en = descriptors.elements(); en.hasMoreElements();) {
|
||||
for (Enumeration en = this.descriptors.elements(); en.hasMoreElements();) {
|
||||
try {
|
||||
AppDescriptor appDesc = (AppDescriptor) en.nextElement();
|
||||
|
||||
|
@ -194,14 +193,14 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* Get an array containing all currently running applications.
|
||||
*/
|
||||
public Object[] getApplications() {
|
||||
return applications.values().toArray();
|
||||
return this.applications.values().toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an application by name.
|
||||
*/
|
||||
public Application getApplication(String name) {
|
||||
return (Application) applications.get(name);
|
||||
return (Application) this.applications.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,7 +208,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
*/
|
||||
public Object execute(String method, Vector params)
|
||||
throws Exception {
|
||||
int dot = method.indexOf(".");
|
||||
int dot = method.indexOf("."); //$NON-NLS-1$
|
||||
|
||||
if (dot == -1) {
|
||||
throw new Exception("Method name \"" + method +
|
||||
|
@ -222,10 +221,10 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
|
||||
String handler = method.substring(0, dot);
|
||||
String method2 = method.substring(dot + 1);
|
||||
Application app = (Application) xmlrpcHandlers.get(handler);
|
||||
Application app = (Application) this.xmlrpcHandlers.get(handler);
|
||||
|
||||
if (app == null) {
|
||||
app = (Application) xmlrpcHandlers.get("*");
|
||||
app = (Application) this.xmlrpcHandlers.get("*"); //$NON-NLS-1$
|
||||
// use the original method name, the handler is resolved within the app.
|
||||
method2 = method;
|
||||
}
|
||||
|
@ -240,33 +239,32 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
private String getMountpoint(String mountpoint) {
|
||||
mountpoint = mountpoint.trim();
|
||||
|
||||
if ("".equals(mountpoint)) {
|
||||
return "/";
|
||||
} else if (!mountpoint.startsWith("/")) {
|
||||
return "/" + mountpoint;
|
||||
if ("".equals(mountpoint)) { //$NON-NLS-1$
|
||||
return "/"; //$NON-NLS-1$
|
||||
} else if (!mountpoint.startsWith("/")) { //$NON-NLS-1$
|
||||
return "/" + mountpoint; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return mountpoint;
|
||||
}
|
||||
|
||||
private String joinMountpoint(String prefix, String suffix) {
|
||||
if (prefix.endsWith("/") || suffix.startsWith("/")) {
|
||||
if (prefix.endsWith("/") || suffix.startsWith("/")) { //$NON-NLS-1$//$NON-NLS-2$
|
||||
return prefix+suffix;
|
||||
} else {
|
||||
return prefix+"/"+suffix;
|
||||
}
|
||||
return prefix+"/"+suffix; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private String getPathPattern(String mountpoint) {
|
||||
if (!mountpoint.startsWith("/")) {
|
||||
mountpoint = "/"+mountpoint;
|
||||
if (!mountpoint.startsWith("/")) { //$NON-NLS-1$
|
||||
mountpoint = "/"+mountpoint; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if ("/".equals(mountpoint)) {
|
||||
return "/";
|
||||
if ("/".equals(mountpoint)) { //$NON-NLS-1$
|
||||
return "/"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (mountpoint.endsWith("/")) {
|
||||
if (mountpoint.endsWith("/")) { //$NON-NLS-1$
|
||||
return mountpoint.substring(0, mountpoint.length()-1);
|
||||
}
|
||||
|
||||
|
@ -279,19 +277,18 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
File file = new File(path);
|
||||
if (file.isAbsolute()) {
|
||||
return file;
|
||||
} else {
|
||||
return file.getAbsoluteFile();
|
||||
}
|
||||
return file.getAbsoluteFile();
|
||||
}
|
||||
|
||||
private Log getLogger() {
|
||||
return server.getLogger();
|
||||
return this.server.getLogger();
|
||||
}
|
||||
|
||||
private String findResource(String path) {
|
||||
File file = new File(path);
|
||||
if (!file.isAbsolute() && !file.exists()) {
|
||||
file = new File(server.getHopHome(), path);
|
||||
file = new File(this.server.getHopHome(), path);
|
||||
}
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
|
@ -336,58 +333,58 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
* @param name the application name
|
||||
*/
|
||||
AppDescriptor(String name) {
|
||||
ResourceProperties conf = props.getSubProperties(name + '.');
|
||||
appName = name;
|
||||
mountpoint = getMountpoint(conf.getProperty("mountpoint", appName));
|
||||
pathPattern = getPathPattern(mountpoint);
|
||||
staticDir = conf.getProperty("static");
|
||||
staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint",
|
||||
joinMountpoint(mountpoint, "static")));
|
||||
staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex"));
|
||||
String home = conf.getProperty("staticHome");
|
||||
ResourceProperties conf = ApplicationManager.this.props.getSubProperties(name + '.');
|
||||
this.appName = name;
|
||||
this.mountpoint = getMountpoint(conf.getProperty("mountpoint", this.appName)); //$NON-NLS-1$
|
||||
this.pathPattern = getPathPattern(this.mountpoint);
|
||||
this.staticDir = conf.getProperty("static"); //$NON-NLS-1$
|
||||
this.staticMountpoint = getPathPattern(conf.getProperty("staticMountpoint", //$NON-NLS-1$
|
||||
joinMountpoint(this.mountpoint, "static"))); //$NON-NLS-1$
|
||||
this.staticIndex = "true".equalsIgnoreCase(conf.getProperty("staticIndex")); //$NON-NLS-1$//$NON-NLS-2$
|
||||
String home = conf.getProperty("staticHome"); //$NON-NLS-1$
|
||||
if (home == null) {
|
||||
staticHome = new String[] {"index.html", "index.htm"};
|
||||
this.staticHome = new String[] {"index.html", "index.htm"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
staticHome = StringUtils.split(home, ",");
|
||||
this.staticHome = StringUtils.split(home, ","); //$NON-NLS-1$
|
||||
}
|
||||
protectedStaticDir = conf.getProperty("protectedStatic");
|
||||
this.protectedStaticDir = conf.getProperty("protectedStatic"); //$NON-NLS-1$
|
||||
|
||||
cookieDomain = conf.getProperty("cookieDomain");
|
||||
sessionCookieName = conf.getProperty("sessionCookieName");
|
||||
protectedSessionCookie = conf.getProperty("protectedSessionCookie");
|
||||
uploadLimit = conf.getProperty("uploadLimit");
|
||||
uploadSoftfail = conf.getProperty("uploadSoftfail");
|
||||
debug = conf.getProperty("debug");
|
||||
String appDirName = conf.getProperty("appdir");
|
||||
appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName);
|
||||
String dbDirName = conf.getProperty("dbdir");
|
||||
dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName);
|
||||
servletClassName = conf.getProperty("servletClass");
|
||||
this.cookieDomain = conf.getProperty("cookieDomain"); //$NON-NLS-1$
|
||||
this.sessionCookieName = conf.getProperty("sessionCookieName"); //$NON-NLS-1$
|
||||
this.protectedSessionCookie = conf.getProperty("protectedSessionCookie"); //$NON-NLS-1$
|
||||
this.uploadLimit = conf.getProperty("uploadLimit"); //$NON-NLS-1$
|
||||
this.uploadSoftfail = conf.getProperty("uploadSoftfail"); //$NON-NLS-1$
|
||||
this.debug = conf.getProperty("debug"); //$NON-NLS-1$
|
||||
String appDirName = conf.getProperty("appdir"); //$NON-NLS-1$
|
||||
this.appDir = (appDirName == null) ? null : getAbsoluteFile(appDirName);
|
||||
String dbDirName = conf.getProperty("dbdir"); //$NON-NLS-1$
|
||||
this.dbDir = (dbDirName == null) ? null : getAbsoluteFile(dbDirName);
|
||||
this.servletClassName = conf.getProperty("servletClass"); //$NON-NLS-1$
|
||||
|
||||
// got ignore dirs
|
||||
ignoreDirs = conf.getProperty("ignore");
|
||||
this.ignoreDirs = conf.getProperty("ignore"); //$NON-NLS-1$
|
||||
|
||||
// read and configure app repositories
|
||||
ArrayList repositoryList = new ArrayList();
|
||||
Class[] parameters = { String.class };
|
||||
for (int i = 0; true; i++) {
|
||||
String repositoryArgs = conf.getProperty("repository." + i);
|
||||
String repositoryArgs = conf.getProperty("repository." + i); //$NON-NLS-1$
|
||||
|
||||
if (repositoryArgs != null) {
|
||||
// lookup repository implementation
|
||||
String repositoryImpl = conf.getProperty("repository." + i +
|
||||
".implementation");
|
||||
String repositoryImpl = conf.getProperty("repository." + i + //$NON-NLS-1$
|
||||
".implementation"); //$NON-NLS-1$
|
||||
if (repositoryImpl == null) {
|
||||
// implementation not set manually, have to guess it
|
||||
if (repositoryArgs.endsWith(".zip")) {
|
||||
if (repositoryArgs.endsWith(".zip")) { //$NON-NLS-1$
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.ZipRepository";
|
||||
} else if (repositoryArgs.endsWith(".js")) {
|
||||
repositoryImpl = "helma.framework.repository.ZipRepository"; //$NON-NLS-1$
|
||||
} else if (repositoryArgs.endsWith(".js")) { //$NON-NLS-1$
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.SingleFileRepository";
|
||||
repositoryImpl = "helma.framework.repository.SingleFileRepository"; //$NON-NLS-1$
|
||||
} else {
|
||||
repositoryArgs = findResource(repositoryArgs);
|
||||
repositoryImpl = "helma.framework.repository.FileRepository";
|
||||
repositoryImpl = "helma.framework.repository.FileRepository"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -408,17 +405,17 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (appDir != null) {
|
||||
FileRepository appRep = new FileRepository(appDir);
|
||||
if (this.appDir != null) {
|
||||
FileRepository appRep = new FileRepository(this.appDir);
|
||||
if (!repositoryList.contains(appRep)) {
|
||||
repositoryList.add(appRep);
|
||||
}
|
||||
} else if (repositoryList.isEmpty()) {
|
||||
repositoryList.add(new FileRepository(
|
||||
new File(server.getAppsHome(), appName)));
|
||||
new File(ApplicationManager.this.server.getAppsHome(), this.appName)));
|
||||
}
|
||||
repositories = new Repository[repositoryList.size()];
|
||||
repositories = (Repository[]) repositoryList.toArray(repositories);
|
||||
|
||||
this.repositories = (Repository[]) repositoryList.toArray(new Repository[repositoryList.size()]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -427,21 +424,21 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
|
||||
try {
|
||||
// create the application instance
|
||||
app = new Application(appName, server, repositories, appDir, dbDir);
|
||||
this.app = new Application(this.appName, ApplicationManager.this.server, this.repositories, this.appDir, this.dbDir);
|
||||
|
||||
// register ourselves
|
||||
descriptors.put(appName, this);
|
||||
applications.put(appName, app);
|
||||
ApplicationManager.this.descriptors.put(this.appName, this);
|
||||
ApplicationManager.this.applications.put(this.appName, this.app);
|
||||
|
||||
// the application is started later in the register method, when it's bound
|
||||
app.init(ignoreDirs);
|
||||
this.app.init(this.ignoreDirs);
|
||||
|
||||
// set application URL prefix if it isn't set in app.properties
|
||||
if (!app.hasExplicitBaseURI()) {
|
||||
app.setBaseURI(mountpoint);
|
||||
if (!this.app.hasExplicitBaseURI()) {
|
||||
this.app.setBaseURI(this.mountpoint);
|
||||
}
|
||||
|
||||
app.start();
|
||||
this.app.start();
|
||||
} catch (Exception x) {
|
||||
getLogger().error("Error creating application " + appName, x);
|
||||
x.printStackTrace();
|
||||
|
@ -462,8 +459,8 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
getLogger().error("Couldn't stop app", x);
|
||||
}
|
||||
|
||||
descriptors.remove(appName);
|
||||
applications.remove(appName);
|
||||
ApplicationManager.this.descriptors.remove(this.appName);
|
||||
ApplicationManager.this.applications.remove(this.appName);
|
||||
}
|
||||
|
||||
void bind() {
|
||||
|
@ -471,8 +468,8 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
getLogger().info("Binding application " + appName + " :: " + app.hashCode() + " :: " + this.hashCode());
|
||||
|
||||
// set application URL prefix if it isn't set in app.properties
|
||||
if (!app.hasExplicitBaseURI()) {
|
||||
app.setBaseURI(mountpoint);
|
||||
if (!this.app.hasExplicitBaseURI()) {
|
||||
this.app.setBaseURI(this.mountpoint);
|
||||
}
|
||||
|
||||
// bind to Jetty HTTP server
|
||||
|
@ -483,9 +480,9 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// if there is a static direcory specified, mount it
|
||||
if (staticDir != null) {
|
||||
if (this.staticDir != null) {
|
||||
|
||||
File staticContent = getAbsoluteFile(staticDir);
|
||||
File staticContent = getAbsoluteFile(this.staticDir);
|
||||
|
||||
getLogger().info("Serving static from " + staticContent.getPath());
|
||||
getLogger().info("Mounting static at " + staticMountpoint);
|
||||
|
@ -494,7 +491,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
rhandler.setResourceBase(staticContent.getPath());
|
||||
rhandler.setWelcomeFiles(staticHome);
|
||||
|
||||
staticContext = context.addContext(staticMountpoint, "");
|
||||
staticContext = ApplicationManager.this.context.addContext(staticMountpoint, ""); //$NON-NLS-1$
|
||||
staticContext.setHandler(rhandler);
|
||||
|
||||
staticContext.start();
|
||||
|
@ -507,28 +504,28 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
holder.setInitParameter("application", appName);
|
||||
appContext.addServlet(holder, "/*");
|
||||
|
||||
if (cookieDomain != null) {
|
||||
holder.setInitParameter("cookieDomain", cookieDomain);
|
||||
if (this.cookieDomain != null) {
|
||||
holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (sessionCookieName != null) {
|
||||
holder.setInitParameter("sessionCookieName", sessionCookieName);
|
||||
if (this.sessionCookieName != null) {
|
||||
holder.setInitParameter("sessionCookieName", this.sessionCookieName); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (protectedSessionCookie != null) {
|
||||
holder.setInitParameter("protectedSessionCookie", protectedSessionCookie);
|
||||
if (this.protectedSessionCookie != null) {
|
||||
holder.setInitParameter("protectedSessionCookie", this.protectedSessionCookie); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (uploadLimit != null) {
|
||||
holder.setInitParameter("uploadLimit", uploadLimit);
|
||||
if (this.uploadLimit != null) {
|
||||
holder.setInitParameter("uploadLimit", this.uploadLimit); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (uploadSoftfail != null) {
|
||||
holder.setInitParameter("uploadSoftfail", uploadSoftfail);
|
||||
if (this.uploadSoftfail != null) {
|
||||
holder.setInitParameter("uploadSoftfail", this.uploadSoftfail); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (debug != null) {
|
||||
holder.setInitParameter("debug", debug);
|
||||
if (this.debug != null) {
|
||||
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (protectedStaticDir != null) {
|
||||
|
@ -539,13 +536,13 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// Remap the context paths and start
|
||||
context.mapContexts();
|
||||
appContext.start();
|
||||
ApplicationManager.this.context.mapContexts();
|
||||
this.appContext.start();
|
||||
}
|
||||
|
||||
// register as XML-RPC handler
|
||||
xmlrpcHandlerName = app.getXmlRpcHandlerName();
|
||||
xmlrpcHandlers.put(xmlrpcHandlerName, app);
|
||||
this.xmlrpcHandlerName = this.app.getXmlRpcHandlerName();
|
||||
ApplicationManager.this.xmlrpcHandlers.put(this.xmlrpcHandlerName, this.app);
|
||||
} catch (Exception x) {
|
||||
getLogger().error("Couldn't bind app", x);
|
||||
x.printStackTrace();
|
||||
|
@ -557,26 +554,26 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
|
||||
try {
|
||||
// unbind from Jetty HTTP server
|
||||
if (jetty != null) {
|
||||
if (appContext != null) {
|
||||
context.removeHandler(appContext);
|
||||
appContext.stop();
|
||||
appContext.destroy();
|
||||
appContext = null;
|
||||
if (ApplicationManager.this.jetty != null) {
|
||||
if (this.appContext != null) {
|
||||
ApplicationManager.this.context.removeHandler(this.appContext);
|
||||
this.appContext.stop();
|
||||
this.appContext.destroy();
|
||||
this.appContext = null;
|
||||
}
|
||||
|
||||
if (staticContext != null) {
|
||||
context.removeHandler(staticContext);
|
||||
staticContext.stop();
|
||||
staticContext.destroy();
|
||||
staticContext = null;
|
||||
if (this.staticContext != null) {
|
||||
ApplicationManager.this.context.removeHandler(this.staticContext);
|
||||
this.staticContext.stop();
|
||||
this.staticContext.destroy();
|
||||
this.staticContext = null;
|
||||
}
|
||||
context.mapContexts();
|
||||
ApplicationManager.this.context.mapContexts();
|
||||
}
|
||||
|
||||
// unregister as XML-RPC handler
|
||||
if (xmlrpcHandlerName != null) {
|
||||
xmlrpcHandlers.remove(xmlrpcHandlerName);
|
||||
if (this.xmlrpcHandlerName != null) {
|
||||
ApplicationManager.this.xmlrpcHandlers.remove(this.xmlrpcHandlerName);
|
||||
}
|
||||
} catch (Exception x) {
|
||||
getLogger().error("Couldn't unbind app", x);
|
||||
|
@ -584,8 +581,9 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[AppDescriptor "+app+"]";
|
||||
return "[AppDescriptor "+this.app+"]"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,15 +216,6 @@ public class HelmaSecurityManager extends SecurityManager {
|
|||
public void checkMulticast(InetAddress addr) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param addr ...
|
||||
* @param ttl ...
|
||||
*/
|
||||
public void checkMulticast(InetAddress addr, byte ttl) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,13 @@ import helma.util.ResourceProperties;
|
|||
*/
|
||||
public class Server implements Runnable {
|
||||
// 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
|
||||
private static Server server;
|
||||
|
@ -143,15 +149,13 @@ public class Server implements Runnable {
|
|||
* check if we are running on a Java 2 VM - otherwise exit with an error message
|
||||
*/
|
||||
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.3")
|
||||
|| javaVersion.startsWith("1.2")
|
||||
|| javaVersion.startsWith("1.1")
|
||||
|| javaVersion.startsWith("1.0")) {
|
||||
System.err.println("This version of Helma requires Java 1.4 or greater.");
|
||||
if (majorVersion < 11) {
|
||||
System.err.println("This version of Helma requires Java 11 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.");
|
||||
} else {
|
||||
System.err.println("Your Java Runtime is version " + javaVersion +
|
||||
|
|
|
@ -22,6 +22,8 @@ package helma.objectmodel;
|
|||
* will normally catch this and try again after a period of time.
|
||||
*/
|
||||
public class ConcurrencyException extends Error {
|
||||
private static final long serialVersionUID = 4031542073544406467L;
|
||||
|
||||
/**
|
||||
* Creates a new ConcurrencyException object.
|
||||
*
|
||||
|
|
|
@ -21,6 +21,8 @@ package helma.objectmodel;
|
|||
* Thrown on any kind of Database-Error
|
||||
*/
|
||||
public class DatabaseException extends RuntimeException {
|
||||
private static final long serialVersionUID = -5715728591015640819L;
|
||||
|
||||
/**
|
||||
* Creates a new DatabaseException object.
|
||||
*
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue