Compare commits
250 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 | |||
|
f1fa050ea5 | ||
|
e82aa34967 | ||
|
65381e7638 | ||
|
21739a54d8 | ||
|
d1fb7d312e | ||
|
81f5e3cd8e | ||
|
75f0245817 | ||
|
021a24a100 | ||
|
390231e8dd | ||
|
b0ff574e95 |
90 changed files with 2288 additions and 2907 deletions
42
.github/actions/ssh/action.yml
vendored
Normal file
42
.github/actions/ssh/action.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
name: SSH setup
|
||||
description: Set up the SSH agent
|
||||
|
||||
inputs:
|
||||
config:
|
||||
description: The SSH configuration
|
||||
required: true
|
||||
key:
|
||||
description: The private SSH key
|
||||
required: true
|
||||
known-hosts:
|
||||
description: The list of known hosts
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
steps:
|
||||
- name: Configure SSH
|
||||
shell: sh
|
||||
env:
|
||||
CONFIG: ${{ inputs.config }}
|
||||
KNOWN_HOSTS: ${{ inputs.known-hosts }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${CONFIG}" > ~/.ssh/config
|
||||
echo "${KNOWN_HOSTS}" > ~/.ssh/known_hosts
|
||||
|
||||
- name: Start SSH agent
|
||||
shell: bash
|
||||
env:
|
||||
SOCKET: /tmp/ssh-agent.sock
|
||||
run: |
|
||||
echo "SSH_AUTH_SOCK=${SOCKET}" >> $GITHUB_ENV
|
||||
ssh-agent -a ${SOCKET} > /dev/null
|
||||
|
||||
- name: Add SSH key
|
||||
shell: bash
|
||||
env:
|
||||
KEY: ${{ inputs.key }}
|
||||
run: |
|
||||
ssh-add - <<< "${KEY}"
|
22
.github/workflows/build.yml
vendored
Normal file
22
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/build.yml
|
||||
- build.gradle
|
||||
- settings.gradle
|
||||
- src/**
|
||||
- launcher/build.gradle
|
||||
- launcher/src/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: antville
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compile with Gradle
|
||||
run: ./gradlew :compileJava
|
15
.github/workflows/deploy.yml
vendored
Normal file
15
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
name: Deploy (Production)
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: antville
|
||||
|
||||
environment:
|
||||
name: antville.org
|
||||
url: https://antville.org
|
||||
|
||||
steps:
|
||||
- name: Copy files to production server
|
||||
run: ssh staging-server deploy-helma
|
59
.github/workflows/release.yml
vendored
Normal file
59
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags: '2*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: antville
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
LC_TIME: en_US.UTF-8
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create release notes
|
||||
id: create_release_notes
|
||||
run: |
|
||||
release_notes=$(npx git-cliff@latest --latest)
|
||||
# Write the release notes as a heredoc to the workflow output
|
||||
# ⚠️ No white space around `<<` is crucial!
|
||||
echo "release_notes<<.eot0x03" >> $GITHUB_OUTPUT
|
||||
echo "$release_notes" >> $GITHUB_OUTPUT
|
||||
echo ".eot0x03" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew assembleDist
|
||||
|
||||
- name: Create release
|
||||
uses: actions/forgejo-release@v2
|
||||
with:
|
||||
direction: upload
|
||||
url: https://code.host.antville.org
|
||||
token: ${{ github.token }}
|
||||
title: Helma ${{ github.ref_name }}
|
||||
release-dir: build/distributions
|
||||
release-notes: ${{ steps.create_release_notes.outputs.release_notes }}
|
||||
verbose: true
|
||||
|
||||
- name: Create release at GitHub
|
||||
run: |
|
||||
gh release create "$GITHUB_REF_NAME" \
|
||||
--repo "$GITHUB_REPOSITORY" \
|
||||
--title "Helma ${{ github.ref_name }}" \
|
||||
--notes "${{ steps.create_release_notes.outputs.release_notes }}"
|
||||
|
||||
- name: Upload release assets to GitHub
|
||||
run: |
|
||||
gh release upload "$GITHUB_REF_NAME" build/distributions/helma-*.* \
|
||||
--repo "$GITHUB_REPOSITORY" \
|
||||
--clobber
|
44
.github/workflows/renovate.yml
vendored
Normal file
44
.github/workflows/renovate.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Run Renovate
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "13 * * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: antville
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run Renovate
|
||||
# See <https://docs.renovatebot.com/troubleshooting/#log-debug-levels>
|
||||
# debug | info | warn | error | fatal
|
||||
run: LOG_LEVEL=info npx renovate
|
||||
env:
|
||||
# Renovate is using this token to retrieve release notes
|
||||
GITHUB_COM_TOKEN: ${{ secrets.renovate_github_com_token }}
|
||||
# Autodiscover is better suited for an extra repo running Renovate on all desired repos
|
||||
#RENOVATE_AUTODISCOVER: 'true'
|
||||
RENOVATE_CONFIG_FILE: renovate.json
|
||||
RENOVATE_ENDPOINT: ${{ github.api_url }}
|
||||
RENOVATE_GIT_AUTHOR: Renovate Bot <mail+renovate@antville.org>
|
||||
#RENOVATE_GIT_IGNORED_AUTHORS:
|
||||
# - 29139614+renovate[bot]@users.noreply.github.com
|
||||
RENOVATE_IGNORE_PR_AUTHOR: 'true'
|
||||
RENOVATE_LOG_FILE: renovate-log.ndjson
|
||||
RENOVATE_LOG_FILE_LEVEL: debug
|
||||
RENOVATE_PLATFORM: gitea
|
||||
RENOVATE_REPOSITORIES: ${{ github.repository }}
|
||||
RENOVATE_REPOSITORY_CACHE: 'enabled'
|
||||
# github.token is not working here, it lacks some permissions required by Renovate
|
||||
RENOVATE_TOKEN: ${{ secrets.renovate_token }}
|
||||
|
||||
- name: Save log file
|
||||
# FIXME: v4 of this action causes an error on Forgejo (“You must configure a GitHub token”)
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: renovate-log.ndjson
|
||||
path: renovate-log.ndjson
|
32
.github/workflows/stage.yml
vendored
Normal file
32
.github/workflows/stage.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Deploy (Staging)
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
stage:
|
||||
runs-on: antville
|
||||
|
||||
environment:
|
||||
name: stage
|
||||
url: ${{ vars.stage_url }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew installDist
|
||||
|
||||
- name: Publish to staging server
|
||||
run: |
|
||||
rsync ./build/install/helma/ staging-server:./ \
|
||||
--verbose --archive --delete --compress \
|
||||
--filter '+ /bin' \
|
||||
--filter '+ /extras' \
|
||||
--filter '+ /launcher.jar' \
|
||||
--filter '- /lib/ext' \
|
||||
--filter '+ /lib' \
|
||||
--filter '+ /modules' \
|
||||
--filter '- /*'
|
||||
|
||||
- name: Restart Helma
|
||||
run: ssh staging-server restart
|
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"
|
||||
}
|
13
CHANGES.md
13
CHANGES.md
|
@ -1,5 +1,17 @@
|
|||
# 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
|
||||
|
@ -7,6 +19,7 @@
|
|||
* 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()
|
||||
|
|
|
@ -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
|
||||
|
|
19
README.md
19
README.md
|
@ -2,8 +2,8 @@
|
|||
|
||||
## TL;DR
|
||||
|
||||
- Make sure you have Java 1.6 or higher installed
|
||||
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
||||
- 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>
|
||||
|
||||
|
@ -21,7 +21,7 @@ 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.
|
||||
|
||||
|
@ -31,7 +31,14 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
|
|||
|
||||
## Development
|
||||
|
||||
Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `y`.
|
||||
### Additional Prerequisites
|
||||
|
||||
* [Node.js](https://nodejs.org) LTS version
|
||||
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
||||
|
||||
Clone this repository to your machine and run Helma with `./gradlew run`.
|
||||
|
||||
To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.
|
||||
|
||||
> ⚠️
|
||||
> Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
|
||||
|
@ -40,7 +47,7 @@ Clone this repository to your machine and start the build process with `./gradle
|
|||
|
||||
After all files are put into place start Helma by invoking `./bin/helma.bat` or `./bin/helma`, depending on whether you are on Windows or Linux / Unix / OS X, respectively. If the `java` command is not found, try setting the `JAVA_HOME` environment variable to the location of your Java installation.
|
||||
|
||||
You can adjust server-wide settings in the `server.properties` file. For example, you could set the `smtp` property to the name of the SMTP server that Helma should use to send e-mail. Applications can be started or stopped by editing the `apps.properties` file through the web interface using the management application that is part of Helma.
|
||||
You can adjust server-wide settings in the `server.properties` file. For example, you could set the `smtp` property to the name of the SMTP server that Helma should use to send e-mail. Applications can be started or stopped by editing the `apps.properties` file, or through the web interface using the management application that is part of Helma.
|
||||
|
||||
If all goes well you should be able to connect your browser to <http://localhost:8080> – port 8080 on the local machine, that is.
|
||||
|
||||
|
@ -55,7 +62,7 @@ Finally, Helma can be plugged into Servlet containers using Servlet classes that
|
|||
After installing and running Helma, you will be able to access introductions to the features of Helma and the various included development tools. Further information you will find on the helma.org website:
|
||||
|
||||
> 😿
|
||||
> 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/)
|
||||
|
|
230
build.gradle
230
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,26 +58,61 @@ configurations {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.sun.activation:javax.activation:1.2.0'
|
||||
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 '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]
|
||||
|
||||
|
@ -87,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) {
|
||||
|
@ -113,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() }
|
||||
|
@ -168,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"
|
||||
|
@ -199,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" "$@"
|
||||
|
|
78
gradlew.bat
vendored
78
gradlew.bat
vendored
|
@ -1,4 +1,22 @@
|
|||
@if "%DEBUG%" == "" @echo off
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
|
@ -9,25 +27,29 @@
|
|||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
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
|
||||
|
|
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>
|
|
@ -225,7 +225,7 @@ var encodeForm = function(text) {
|
|||
* The text with the tags stripped out.
|
||||
*/
|
||||
var stripTags = function (markup) {
|
||||
if (markup === null) return markup;
|
||||
if (!markup) return '';
|
||||
|
||||
var chars = String(markup).split('');
|
||||
var charCounter = 0;
|
||||
|
|
|
@ -536,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'));
|
||||
};
|
||||
|
||||
|
||||
|
@ -547,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'));
|
||||
};
|
||||
|
||||
|
||||
|
|
16
modules/helma/Chart.js
vendored
16
modules/helma/Chart.js
vendored
|
@ -18,12 +18,12 @@
|
|||
/**
|
||||
* @fileoverview Fields and methods of the helma.Chart prototype
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/helma/Chart.js')
|
||||
*/
|
||||
|
||||
// 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
|
||||
|
@ -55,12 +55,12 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
|
||||
var workbook, file;
|
||||
try {
|
||||
file = new java.io.File(fpath);
|
||||
file = new java.io.File(fpath);
|
||||
workbook = JXLPKG.getWorkbook(file);
|
||||
} catch (e) {
|
||||
if (e instanceof TypeError == false)
|
||||
throw(e);
|
||||
throw("helma.Chart needs " + JXLPKGNAME +
|
||||
throw("helma.Chart needs " + JXLPKGNAME +
|
||||
" in lib/ext or application directory " +
|
||||
"[" + JXLPKGURL + "]");
|
||||
}
|
||||
|
@ -98,9 +98,9 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
* Renders the Excel spreadsheet as XHTML table.
|
||||
*/
|
||||
this.render = function() {
|
||||
res.write('<table border="0" cellspacing="1" class="' +
|
||||
res.write('<table border="0" cellspacing="1" class="' +
|
||||
prefix + 'table">\n');
|
||||
|
||||
|
||||
var rowBuf = [];
|
||||
var rows = sheet.getRows();
|
||||
var max = 0;
|
||||
|
@ -110,7 +110,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
max = row.length;
|
||||
rowBuf.push(row);
|
||||
}
|
||||
|
||||
|
||||
for (var i in rowBuf) {
|
||||
res.write('<tr class="' + prefix + 'row">\n');
|
||||
for (var n=0; n<max; n+=1) {
|
||||
|
@ -145,7 +145,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
}
|
||||
res.write('</tr>\n');
|
||||
}
|
||||
|
||||
|
||||
res.write('</table>\n');
|
||||
workbook.close();
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/**
|
||||
* @fileoverview Fields and methods of the helma.Http class.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/helma/Http.js')
|
||||
*/
|
||||
|
||||
|
@ -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();
|
||||
|
@ -82,10 +89,9 @@ helma.Http = function() {
|
|||
try {
|
||||
input.close();
|
||||
} catch (error) {
|
||||
// safe to ignore
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
@ -170,7 +176,7 @@ helma.Http = function() {
|
|||
* can be either a string or an object. In the latter case all properties
|
||||
* and their values are concatenated into a single string.
|
||||
* If a property is an array, then for each value the propertyname and value pair is added.
|
||||
* If the name of an array property ends with "_array" then the _array part is removed.
|
||||
* If the name of an array property ends with "_array" then the _array part is removed.
|
||||
*/
|
||||
this.setContent = function(stringOrObject) {
|
||||
if (stringOrObject != null) {
|
||||
|
@ -180,21 +186,21 @@ helma.Http = function() {
|
|||
for (var key in stringOrObject) {
|
||||
value = stringOrObject[key];
|
||||
if (value instanceof Array) {
|
||||
if (key.substring(key.length - 6) == "_array")
|
||||
key = key.substring(0,key.length - 6);
|
||||
if (key.substring(key.length - 6) == "_array")
|
||||
key = key.substring(0,key.length - 6);
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
res.write(encodeURIComponent(key));
|
||||
res.write("=");
|
||||
res.write(encodeURIComponent(value[i]));
|
||||
res.write("&");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
res.write(encodeURIComponent(key));
|
||||
res.write("=");
|
||||
res.write(encodeURIComponent(value));
|
||||
res.write("&");
|
||||
}
|
||||
}
|
||||
}
|
||||
content = res.pop();
|
||||
content = content.substring(0, content.length-1);
|
||||
} else {
|
||||
|
@ -205,7 +211,7 @@ helma.Http = function() {
|
|||
}
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sets the request method to use.
|
||||
* @param {String} m The method to use (<code>GET</code>, <code>POST</code> ...)
|
||||
|
@ -282,7 +288,7 @@ helma.Http = function() {
|
|||
* Adds the cookies passed as argument to the list of cookies to send
|
||||
* to the remote server.
|
||||
* @param {Array} cookies An array containing objects with the properties
|
||||
* "name" (the name of the cookie) and "value" (the value of the cookie) set.
|
||||
* "name" (the name of the cookie) and "value" (the value of the cookie) set.
|
||||
*/
|
||||
this.setCookies = function(cookies) {
|
||||
if (cookies != null) {
|
||||
|
@ -484,7 +490,7 @@ helma.Http = function() {
|
|||
} else if (!(url instanceof java.net.URL)) {
|
||||
throw new Error("'" + url + "' is not a valid URL.");
|
||||
}
|
||||
|
||||
|
||||
var conn = proxy ? url.openConnection(proxy) : url.openConnection();
|
||||
// Note: we must call setInstanceFollowRedirects() instead of
|
||||
// static method setFollowRedirects(), as the latter will
|
||||
|
@ -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");
|
||||
|
@ -650,7 +664,7 @@ helma.Http.setProxy = function(proxyString) {
|
|||
sys.put("http.prodyPort", "");
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -682,7 +696,7 @@ helma.Http.getProxy = function() {
|
|||
* @type Boolean
|
||||
*/
|
||||
helma.Http.isAuthorized = function(name, pwd) {
|
||||
if (!req.username || !req.password ||
|
||||
if (!req.username || !req.password ||
|
||||
req.username != name || req.password != pwd) {
|
||||
res.reset();
|
||||
res.status = 401;
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
/**
|
||||
* @fileoverview Fields and methods of the helma.Search class
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/helma/Search.js')
|
||||
*/
|
||||
|
||||
// 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) {
|
||||
|
@ -47,7 +47,7 @@ if (!global.helma) {
|
|||
* creating a fulltext search index based on Apache Lucene.
|
||||
* @returns A newly created instance of this prototype.
|
||||
* @constructor
|
||||
* @author Robert Gaggl <robert@nomatic.org>
|
||||
* @author Robert Gaggl <robert@nomatic.org>
|
||||
*/
|
||||
helma.Search = function() {
|
||||
try {
|
||||
|
@ -309,7 +309,7 @@ helma.Search.Index = function(directory, analyzer) {
|
|||
this.getAnalyzer = function() {
|
||||
return analyzer;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns a searcher for querying this index.
|
||||
* @returns A searcher useable for querying the index.
|
||||
|
@ -318,7 +318,7 @@ helma.Search.Index = function(directory, analyzer) {
|
|||
this.getSearcher = function() {
|
||||
return new helma.Search.Searcher(this);
|
||||
};
|
||||
|
||||
|
||||
/** @ignore */
|
||||
this.toString = function() {
|
||||
return ("[Lucene Index " + directory + "]");
|
||||
|
@ -773,7 +773,7 @@ helma.Search.HitCollection = function(hits) {
|
|||
this.length = function() {
|
||||
return this.size();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Executes a provided function once per hit.
|
||||
* @param {Function} fun Function to execute for each element
|
||||
|
@ -793,7 +793,7 @@ helma.Search.HitCollection = function(hits) {
|
|||
}
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ helma.Search.Document.Field = function(name, value, options) {
|
|||
var store = pkg.Store.YES;
|
||||
var index = pkg.Index.TOKENIZED;
|
||||
var termVector = pkg.TermVector.NO;
|
||||
|
||||
|
||||
var opt;
|
||||
if (options != null) {
|
||||
if (options.store != null) {
|
||||
|
|
|
@ -18,20 +18,20 @@
|
|||
/**
|
||||
* @fileoverview Fields and methods of the helma.Ssh class.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/helma/Ssh.js')
|
||||
*/
|
||||
|
||||
// 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) {
|
||||
global.helma = {};
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creates a new instance of helma.Ssh
|
||||
* @class This class provides methods for connecting to a remote
|
||||
* server via secure shell (ssh) and copying files from/to a remote
|
||||
|
@ -43,7 +43,7 @@ if (!global.helma) {
|
|||
* file. This argument is optional.
|
||||
* @constructor
|
||||
* @returns A newly created instance of helma.Ssh
|
||||
* @author Robert Gaggl <robert@nomatic.org>
|
||||
* @author Robert Gaggl <robert@nomatic.org>
|
||||
*/
|
||||
helma.Ssh = function(server, hosts) {
|
||||
var SSHPKG = Packages.ch.ethz.ssh2;
|
||||
|
@ -61,11 +61,11 @@ helma.Ssh = function(server, hosts) {
|
|||
} catch (e) {
|
||||
if (e instanceof TypeError == false)
|
||||
throw(e);
|
||||
throw("helma.Ssh needs " + SSHPKGNAME +
|
||||
throw("helma.Ssh needs " + SSHPKGNAME +
|
||||
" in lib/ext or application directory " +
|
||||
"[" + SSHPKGURL + "]");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A simple verifier for verifying host keys
|
||||
* @private
|
||||
|
@ -96,7 +96,7 @@ helma.Ssh = function(server, hosts) {
|
|||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Converts the argument into an instance of java.io.File
|
||||
* @param {helma.File|java.io.File|String} file Either a file
|
||||
|
@ -131,7 +131,7 @@ helma.Ssh = function(server, hosts) {
|
|||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Private helper method for debugging output using app.logger
|
||||
* @param {String} methodName The name of the method
|
||||
|
@ -175,7 +175,7 @@ helma.Ssh = function(server, hosts) {
|
|||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Connects to a remote host using plain username/password authentication.
|
||||
* @param {String} username The username
|
||||
|
@ -217,7 +217,7 @@ helma.Ssh = function(server, hosts) {
|
|||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Disconnects this client from the remote server.
|
||||
*/
|
||||
|
@ -325,7 +325,7 @@ helma.Ssh = function(server, hosts) {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Toggles paranoid mode. If set to true this client tries to
|
||||
* verify the host key against the its list of known hosts
|
||||
|
@ -346,7 +346,7 @@ helma.Ssh = function(server, hosts) {
|
|||
this.isParanoid = function() {
|
||||
return paranoid;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* main constructor body
|
||||
*/
|
||||
|
|
18
modules/helma/build.gradle
Normal file
18
modules/helma/build.gradle
Normal file
|
@ -0,0 +1,18 @@
|
|||
dependencies {
|
||||
runtimeOnly 'ch.ethz.ganymed:ganymed-ssh2:build209'
|
||||
runtimeOnly 'net.sourceforge.jexcelapi:jxl:2.5.7'
|
||||
runtimeOnly 'org.apache.lucene:lucene-analyzers:2.2.0'
|
||||
runtimeOnly 'org.apache.lucene:lucene-core:2.2.0'
|
||||
}
|
||||
|
||||
jar.enabled = false
|
||||
compileJava.enabled = false
|
||||
compileTestJava.enabled = false
|
||||
processResources.enabled = false
|
||||
processTestResources.enabled = false
|
||||
test.enabled = false
|
||||
|
||||
tasks.register('deps', Copy) {
|
||||
from sourceSets.main.runtimeClasspath
|
||||
into '.'
|
||||
}
|
BIN
modules/helma/jxl-2.5.7.jar
Normal file
BIN
modules/helma/jxl-2.5.7.jar
Normal file
Binary file not shown.
Binary file not shown.
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'
|
||||
}
|
|
@ -518,7 +518,7 @@ jala.db.DataType = function(type, typeName, params) {
|
|||
this.getParams = function() {
|
||||
return params;
|
||||
};
|
||||
|
||||
|
||||
/** @ignore */
|
||||
this.toString = function() {
|
||||
return "[DataType " +
|
||||
|
@ -597,7 +597,7 @@ jala.db.RamDatabase = function(name, username, password) {
|
|||
this.getUsername = function() {
|
||||
return username || "sa";
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the password of this database
|
||||
* @returns The password of this database
|
||||
|
@ -841,7 +841,7 @@ jala.db.RamDatabase.prototype.copyTables = function(database, tables) {
|
|||
tables = jala.db.metadata.getTableNames(dbMetadata);
|
||||
}
|
||||
|
||||
for each (var tableName in tables) {
|
||||
for (let tableName of tables) {
|
||||
// drop the table if it exists
|
||||
if (this.tableExists(tableName)) {
|
||||
this.dropTable(tableName);
|
||||
|
@ -1011,7 +1011,7 @@ jala.db.FileDatabase = function(name, directory, username, password) {
|
|||
this.getUsername = function() {
|
||||
return username || "sa";
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the password of this database
|
||||
* @returns The password of this database
|
||||
|
|
|
@ -123,11 +123,11 @@ 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;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the credentials of this request
|
||||
* @returns The base46 encoded credentials of this request
|
||||
|
|
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,29 +1,21 @@
|
|||
//
|
||||
// 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.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// 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.
|
||||
//
|
||||
// $Revision$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $HeadURL$
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* @fileoverview
|
||||
* MessageParser script that extracts all gettext message macros
|
||||
* out of skin files and all calls of gettext functions
|
||||
* (that is "gettext", "ngettext" and "_") out of function
|
||||
|
@ -39,10 +31,10 @@
|
|||
* @constructor
|
||||
*/
|
||||
var Message = function(id, pluralId) {
|
||||
this.id = id && String(id);
|
||||
this.pluralId = pluralId && String(pluralId);
|
||||
this.locations = [];
|
||||
return this;
|
||||
this.id = id && String(id);
|
||||
this.pluralId = pluralId && String(pluralId);
|
||||
this.locations = [];
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -54,11 +46,11 @@ var Message = function(id, pluralId) {
|
|||
* @type String
|
||||
*/
|
||||
Message.getKey = function(id, pluralId) {
|
||||
if (id && pluralId) {
|
||||
return id + pluralId;
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
if (id && pluralId) {
|
||||
return id + pluralId;
|
||||
} else {
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -71,28 +63,28 @@ Message.getKey = function(id, pluralId) {
|
|||
* @type String
|
||||
*/
|
||||
Message.formatId = function(str, wrap) {
|
||||
var escapeQuotes = function(s) {
|
||||
return s.replace(/(^|[^\\])"/g, '$1\\"');
|
||||
};
|
||||
var escapeQuotes = function(s) {
|
||||
return s.replace(/(^|[^\\])"/g, '$1\\"');
|
||||
};
|
||||
|
||||
var len = 80;
|
||||
var buf = new java.lang.StringBuffer();
|
||||
if (wrap == true && str.length > len) {
|
||||
buf.append('""\n');
|
||||
var offset = 0;
|
||||
while (offset < str.length) {
|
||||
buf.append('"');
|
||||
buf.append(escapeQuotes(str.substring(offset, offset += len)));
|
||||
buf.append('"');
|
||||
buf.append("\n");
|
||||
}
|
||||
return buf.toString();
|
||||
} else {
|
||||
var len = 80;
|
||||
var buf = new java.lang.StringBuffer();
|
||||
if (wrap == true && str.length > len) {
|
||||
buf.append('""\n');
|
||||
var offset = 0;
|
||||
while (offset < str.length) {
|
||||
buf.append('"');
|
||||
buf.append(escapeQuotes(str));
|
||||
buf.append('"\n');
|
||||
}
|
||||
return buf.toString();
|
||||
buf.append(escapeQuotes(str.substring(offset, offset += len)));
|
||||
buf.append('"');
|
||||
buf.append("\n");
|
||||
}
|
||||
return buf.toString();
|
||||
} else {
|
||||
buf.append('"');
|
||||
buf.append(escapeQuotes(str));
|
||||
buf.append('"\n');
|
||||
}
|
||||
return buf.toString();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -113,34 +108,34 @@ Message.prototype.addLocation = function(filePath, lineNum) {
|
|||
* to write into
|
||||
*/
|
||||
Message.prototype.write = function(buf) {
|
||||
for (var i=0;i<this.locations.length;i++) {
|
||||
buf.append("#: ");
|
||||
buf.append(this.locations[i]);
|
||||
buf.append("\n");
|
||||
}
|
||||
if (this.id.indexOf("{") > -1
|
||||
|| (this.pluralId != null && this.pluralId.indexOf("{") > -1)) {
|
||||
buf.append("#, java-format\n");
|
||||
}
|
||||
buf.append('msgid ');
|
||||
buf.append(Message.formatId(this.id));
|
||||
if (this.pluralId != null) {
|
||||
buf.append('msgid_plural ');
|
||||
buf.append(Message.formatId(this.pluralId));
|
||||
buf.append('msgstr[0] ""\nmsgstr[1] ""\n')
|
||||
} else {
|
||||
buf.append('msgstr ""\n')
|
||||
}
|
||||
buf.append("\n");
|
||||
return;
|
||||
for (var i=0;i<this.locations.length;i++) {
|
||||
buf.append("#: ");
|
||||
buf.append(this.locations[i]);
|
||||
buf.append("\n");
|
||||
}
|
||||
if (this.id.indexOf("{") > -1
|
||||
|| (this.pluralId != null && this.pluralId.indexOf("{") > -1)) {
|
||||
buf.append("#, java-format\n");
|
||||
}
|
||||
buf.append('msgid ');
|
||||
buf.append(Message.formatId(this.id));
|
||||
if (this.pluralId != null) {
|
||||
buf.append('msgid_plural ');
|
||||
buf.append(Message.formatId(this.pluralId));
|
||||
buf.append('msgstr[0] ""\nmsgstr[1] ""\n')
|
||||
} else {
|
||||
buf.append('msgstr ""\n')
|
||||
}
|
||||
buf.append("\n");
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var MessageParser = function() {
|
||||
this.messages = {};
|
||||
return this;
|
||||
this.messages = {};
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -150,10 +145,11 @@ var MessageParser = function() {
|
|||
* @type Object
|
||||
*/
|
||||
MessageParser.FUNCTION_NAMES = {
|
||||
"_": true,
|
||||
"gettext": true,
|
||||
"ngettext": true,
|
||||
"markgettext": true
|
||||
"_": true,
|
||||
"gettext": true,
|
||||
"ngettext": true,
|
||||
"markgettext": true,
|
||||
"cgettext": true
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -197,7 +193,7 @@ MessageParser.REGEX_PARAM = /([\w]*)\s*=\s*["'](.*?)["']\s*(?=\w+=|$)/gm;
|
|||
* @type Number
|
||||
*/
|
||||
MessageParser.getLineNum = function(str, idx) {
|
||||
return str.substring(0, idx).split(/.*(?:\r\n|\n\r|\r|\n)/).length;
|
||||
return str.substring(0, idx).split(/.*(?:\r\n|\n\r|\r|\n)/).length;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -208,36 +204,36 @@ MessageParser.getLineNum = function(str, idx) {
|
|||
* @param {String} encoding The encoding to use
|
||||
*/
|
||||
MessageParser.prototype.parse = function(file, encoding) {
|
||||
if (file.isDirectory()) {
|
||||
var list = file.list();
|
||||
for (var i=0;i<list.length;i++) {
|
||||
this.parse(new java.io.File(file, list[i]), encoding);
|
||||
if (file.isDirectory()) {
|
||||
var list = file.list();
|
||||
for (var i=0;i<list.length;i++) {
|
||||
this.parse(new java.io.File(file, list[i]), encoding);
|
||||
}
|
||||
} else {
|
||||
var fName, dotIdx;
|
||||
fName = file.getName();
|
||||
if ((dotIdx = fName.lastIndexOf(".")) > -1) {
|
||||
switch (String(fName.substring(dotIdx+1))) {
|
||||
case "skin":
|
||||
print("Parsing skin file " + file.getCanonicalPath() + "...");
|
||||
this.parseSkinFile(file, encoding);
|
||||
break;
|
||||
case "hac":
|
||||
case "js":
|
||||
print("Parsing function file " + file.getCanonicalPath() + "...");
|
||||
this.parseFunctionFile(file, encoding);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
var fName, dotIdx;
|
||||
fName = file.getName();
|
||||
if ((dotIdx = fName.lastIndexOf(".")) > -1) {
|
||||
switch (String(fName.substring(dotIdx+1))) {
|
||||
case "skin":
|
||||
print("Parsing skin file " + file.getAbsolutePath() + "...");
|
||||
this.parseSkinFile(file, encoding);
|
||||
break;
|
||||
case "hac":
|
||||
case "js":
|
||||
print("Parsing function file " + file.getAbsolutePath() + "...");
|
||||
this.parseFunctionFile(file, encoding);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
/** @ignore */
|
||||
MessageParser.prototype.toString = function() {
|
||||
return "[Jala Message Parser]";
|
||||
return "[Jala Message Parser]";
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -247,61 +243,65 @@ MessageParser.prototype.toString = function() {
|
|||
* @param {String} encoding The encoding to use
|
||||
*/
|
||||
MessageParser.prototype.parseFunctionFile = function(file, encoding) {
|
||||
var fis = new java.io.FileInputStream(file);
|
||||
var isr = new java.io.InputStreamReader(fis, encoding || "UTF-8");
|
||||
var reader = new java.io.BufferedReader(isr);
|
||||
var tokenizer = new java.io.StreamTokenizer(reader);
|
||||
var messages = [], stack = [];
|
||||
var c;
|
||||
while ((c = tokenizer.nextToken()) != java.io.StreamTokenizer.TT_EOF) {
|
||||
switch (c) {
|
||||
case java.io.StreamTokenizer.TT_WORD:
|
||||
if (MessageParser.FUNCTION_NAMES[tokenizer.sval] == true) {
|
||||
stack.push({name: tokenizer.sval, lineNr: tokenizer.lineno()});
|
||||
} else if (stack.length > 0) {
|
||||
// it's something else than a string argument inside a gettext method call
|
||||
// so finalize the argument parsing here as we aren't interested in that
|
||||
messages.push(stack.pop());
|
||||
}
|
||||
break;
|
||||
case java.io.StreamTokenizer.TT_NUMBER:
|
||||
break;
|
||||
default:
|
||||
if (stack.length > 0) {
|
||||
if ("\u0028".charCodeAt(0) == c) {
|
||||
// start of arguments (an opening bracket)
|
||||
stack[stack.length-1].args = [];
|
||||
} else if ("\u0029".charCodeAt(0) == c) {
|
||||
// end of arguments (a closing bracket)
|
||||
messages.push(stack.pop());
|
||||
} else if ("\u0022".charCodeAt(0) == c || "\u0027".charCodeAt(0) == c) {
|
||||
// a quoted string argument
|
||||
stack[stack.length-1].args.push(tokenizer.sval);
|
||||
}
|
||||
}
|
||||
break;
|
||||
var fis = new java.io.FileInputStream(file);
|
||||
var isr = new java.io.InputStreamReader(fis, encoding || "UTF-8");
|
||||
var reader = new java.io.BufferedReader(isr);
|
||||
var tokenizer = new java.io.StreamTokenizer(reader);
|
||||
var messages = [], stack = [];
|
||||
var c;
|
||||
while ((c = tokenizer.nextToken()) != java.io.StreamTokenizer.TT_EOF) {
|
||||
switch (c) {
|
||||
case java.io.StreamTokenizer.TT_WORD:
|
||||
if (MessageParser.FUNCTION_NAMES[tokenizer.sval] == true) {
|
||||
stack.push({name: tokenizer.sval, lineNr: tokenizer.lineno()});
|
||||
} else if (stack.length > 0) {
|
||||
// it's something else than a string argument inside a gettext method call
|
||||
// so finalize the argument parsing here as we aren't interested in that
|
||||
messages.push(stack.pop());
|
||||
}
|
||||
break;
|
||||
case java.io.StreamTokenizer.TT_NUMBER:
|
||||
break;
|
||||
default:
|
||||
if (stack.length > 0) {
|
||||
if ("\u0028".charCodeAt(0) == c) {
|
||||
// start of arguments (an opening bracket)
|
||||
stack[stack.length-1].args = [];
|
||||
} else if ("\u0029".charCodeAt(0) == c) {
|
||||
// end of arguments (a closing bracket)
|
||||
messages.push(stack.pop());
|
||||
} else if ("\u0022".charCodeAt(0) == c || "\u0027".charCodeAt(0) == c) {
|
||||
// a quoted string argument
|
||||
stack[stack.length-1].args.push(tokenizer.sval);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (messages.length > 0) {
|
||||
var msgParam, key, msg;
|
||||
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]);
|
||||
}
|
||||
if (!msg.pluralId && msgParam.args.length > 1) {
|
||||
msg.pluralId = msgParam.args[1];
|
||||
}
|
||||
msg.addLocation(file.getCanonicalPath(), msgParam.lineNr);
|
||||
}
|
||||
}
|
||||
if (messages.length > 0) {
|
||||
var msgParam, key, msg;
|
||||
for (var i=0;i<messages.length;i++) {
|
||||
msgParam = messages[i];
|
||||
if (msgParam.args && msgParam.args.length > 0) {
|
||||
key = Message.getKey(msgParam.args[0]);
|
||||
if (!(msg = this.messages[key])) {
|
||||
this.messages[key] = msg = new Message(msgParam.args[0], msgParam.args[1]);
|
||||
}
|
||||
if (!msg.pluralId && msgParam.args.length > 1) {
|
||||
msg.pluralId = msgParam.args[1];
|
||||
}
|
||||
msg.addLocation(file.getAbsolutePath(), msgParam.lineNr);
|
||||
}
|
||||
}
|
||||
}
|
||||
fis.close();
|
||||
isr.close();
|
||||
reader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
fis.close();
|
||||
isr.close();
|
||||
reader.close();
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -313,78 +313,128 @@ 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];
|
||||
}
|
||||
} else {
|
||||
if (params[1] == MessageParser.ATTRIBUTE_NAME) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
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) {
|
||||
// create new Message instance or update the existing one
|
||||
key = Message.getKey(id);
|
||||
if (!(msg = this.messages[key])) {
|
||||
this.messages[key] = msg = new Message(id, pluralId, file.getAbsolutePath());
|
||||
}
|
||||
msg.addLocation(file.getAbsolutePath(),
|
||||
MessageParser.getLineNum(content, macro.index));
|
||||
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 = self.messages[key])) {
|
||||
self.messages[key] = msg = new Message(id, pluralId, file.getCanonicalPath());
|
||||
}
|
||||
msg.addLocation(file.getCanonicalPath(), MessageParser.getLineNum(source, macro.start));
|
||||
}
|
||||
}
|
||||
return;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
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 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('#, 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');
|
||||
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('"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');
|
||||
buf.append('"Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n');
|
||||
buf.append('\n');
|
||||
var date = new Date;
|
||||
var buf = new java.lang.StringBuffer();
|
||||
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: 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: ' + 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');
|
||||
buf.append('"Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n');
|
||||
buf.append('\n');
|
||||
|
||||
// sort all messages by their singular key
|
||||
var keys = [];
|
||||
for (var i in this.messages) {
|
||||
keys[keys.length] = this.messages[i].id;
|
||||
}
|
||||
keys.sort();
|
||||
// add all the messages
|
||||
for (var i=0;i<keys.length;i++) {
|
||||
this.messages[keys[i]].write(buf);
|
||||
}
|
||||
return buf.toString();
|
||||
// sort all messages by their singular key
|
||||
var keys = [];
|
||||
for (var i in this.messages) {
|
||||
keys[keys.length] = this.messages[i].id;
|
||||
}
|
||||
keys.sort();
|
||||
// add all the messages
|
||||
for (var i=0;i<keys.length;i++) {
|
||||
this.messages[keys[i]].write(buf);
|
||||
}
|
||||
return new java.lang.String(buf);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -392,10 +442,10 @@ MessageParser.prototype.getPotString = function() {
|
|||
* @param {java.io.File} file The file to write to
|
||||
*/
|
||||
MessageParser.prototype.writeToFile = function(file) {
|
||||
var writer = new java.io.FileWriter(file);
|
||||
writer.write(new java.lang.String(this.getPotString().getBytes("UTF-8")));
|
||||
writer.close();
|
||||
return;
|
||||
var writer = new java.io.FileWriter(file);
|
||||
writer.write(new java.lang.String(this.getPotString().getBytes("UTF-8")));
|
||||
writer.close();
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -405,24 +455,24 @@ var toParse = [];
|
|||
var arg, outFile, file, fileEncoding;
|
||||
|
||||
for (var i=0;i<arguments.length;i++) {
|
||||
arg = arguments[i];
|
||||
if (arg.indexOf("-o") === 0 && i < arguments.length -1) {
|
||||
outFile = new java.io.File(arguments[i += 1]);
|
||||
} else if (arg.indexOf("-e") === 0 && i < arguments.length -1) {
|
||||
fileEncoding = arguments[i += 1];
|
||||
} else {
|
||||
// add argument to list of files and directories to parse
|
||||
toParse.push(new java.io.File(arg));
|
||||
}
|
||||
arg = arguments[i];
|
||||
if (arg.indexOf("-o") === 0 && i < arguments.length -1) {
|
||||
outFile = new java.io.File(arguments[i += 1]);
|
||||
} else if (arg.indexOf("-e") === 0 && i < arguments.length -1) {
|
||||
fileEncoding = arguments[i += 1];
|
||||
} else {
|
||||
// add argument to list of files and directories to parse
|
||||
toParse.push(new java.io.File(arg));
|
||||
}
|
||||
}
|
||||
|
||||
// start parsing
|
||||
var parser = new MessageParser();
|
||||
for (var i=0;i<toParse.length;i++) {
|
||||
parser.parse(toParse[i], fileEncoding);
|
||||
parser.parse(toParse[i], fileEncoding);
|
||||
}
|
||||
if (outFile != null) {
|
||||
parser.writeToFile(outFile);
|
||||
parser.writeToFile(outFile);
|
||||
} else {
|
||||
print(parser.getPotString());
|
||||
print(parser.getPotString());
|
||||
}
|
||||
|
|
|
@ -1,34 +1,26 @@
|
|||
//
|
||||
// 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.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// 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.
|
||||
//
|
||||
// $Revision$
|
||||
// $LastChangedBy$
|
||||
// $LastChangedDate$
|
||||
// $HeadURL$
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* @fileoverview
|
||||
* A parser script that converts GNU Gettext .po files into plain JavaScript objects
|
||||
* for use with jala.I18n. To run it either start the build script of HopKit
|
||||
* or call it directly using the JavaScript shell of Rhino:
|
||||
* <code>java -cp rhino.jar org.mozilla.javascript.tools.shell.Main PoParser.js <input> <output> [namespace]</code>
|
||||
*
|
||||
*
|
||||
* The accepted arguments are:
|
||||
* <ul>
|
||||
* <li><code>input</code>: Either a single .po file or a directory containing multiple files</li>
|
||||
|
@ -49,24 +41,24 @@
|
|||
* @constructor
|
||||
*/
|
||||
var PoParser = function(namespace) {
|
||||
/**
|
||||
* An array containing the parsed messages
|
||||
* @type Array
|
||||
*/
|
||||
this.messages = [];
|
||||
/**
|
||||
* An array containing the parsed messages
|
||||
* @type Array
|
||||
*/
|
||||
this.messages = [];
|
||||
|
||||
/**
|
||||
* The locale key string (eg. "de_AT") of the .po file
|
||||
* @type String
|
||||
*/
|
||||
this.localeKey = null;
|
||||
/**
|
||||
* The locale key string (eg. "de_AT") of the .po file
|
||||
* @type String
|
||||
*/
|
||||
this.localeKey = null;
|
||||
|
||||
/**
|
||||
* The namespace (optional) where to store the generated messages
|
||||
* @type String
|
||||
*/
|
||||
this.namespace = namespace;
|
||||
return this;
|
||||
/**
|
||||
* The namespace (optional) where to store the generated messages
|
||||
* @type String
|
||||
*/
|
||||
this.namespace = namespace;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -108,7 +100,7 @@ PoParser.REGEX_MSGSTR = /^\s*msgstr(?:\[(\d)\])?\s+\"(.*)\"\s*$/;
|
|||
PoParser.REGEX_DATA = /^\s*msg/;
|
||||
|
||||
PoParser.isData = function(str) {
|
||||
return PoParser.REGEX_DATA.test(str);
|
||||
return PoParser.REGEX_DATA.test(str);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -118,21 +110,21 @@ PoParser.isData = function(str) {
|
|||
* @type java.lang.String
|
||||
*/
|
||||
PoParser.readFile = function(file) {
|
||||
var inStream = new java.io.InputStreamReader(new java.io.FileInputStream(file), "UTF-8");
|
||||
var buffer = new java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, 2048);
|
||||
var read = 0;
|
||||
var r = 0;
|
||||
while ((r = inStream.read(buffer, read, buffer.length - read)) > -1) {
|
||||
read += r;
|
||||
if (read == buffer.length) {
|
||||
// grow input buffer
|
||||
var newBuffer = new java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, buffer.length * 2);
|
||||
java.lang.System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
}
|
||||
inStream.close();
|
||||
return new java.lang.String(buffer, 0, read);
|
||||
var inStream = new java.io.InputStreamReader(new java.io.FileInputStream(file), "UTF-8");
|
||||
var buffer = new java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, 2048);
|
||||
var read = 0;
|
||||
var r = 0;
|
||||
while ((r = inStream.read(buffer, read, buffer.length - read)) > -1) {
|
||||
read += r;
|
||||
if (read == buffer.length) {
|
||||
// grow input buffer
|
||||
var newBuffer = new java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, buffer.length * 2);
|
||||
java.lang.System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
|
||||
buffer = newBuffer;
|
||||
}
|
||||
}
|
||||
inStream.close();
|
||||
return new java.lang.String(buffer, 0, read);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,63 +133,63 @@ PoParser.readFile = function(file) {
|
|||
* @param {java.io.File} file The .po file to parse
|
||||
*/
|
||||
PoParser.prototype.parse = function(file) {
|
||||
// parse the locale key out of the file name
|
||||
var fileName = file.getName();
|
||||
if (!(this.localeKey = fileName.substring(0, fileName.indexOf(".")))) {
|
||||
throw "Invalid PO file name: " + fileName;
|
||||
}
|
||||
// parse the locale key out of the file name
|
||||
var fileName = file.getName();
|
||||
if (!(this.localeKey = fileName.substring(0, fileName.indexOf(".")))) {
|
||||
throw "Invalid PO file name: " + fileName;
|
||||
}
|
||||
|
||||
// read the PO file content and parse it into messages
|
||||
var content = PoParser.readFile(file);
|
||||
var start = new Date();
|
||||
var lines = content.split(PoParser.REGEX_LINES);
|
||||
var idx = -1;
|
||||
var line = null;
|
||||
var m, value, nr;
|
||||
var msg;
|
||||
// read the PO file content and parse it into messages
|
||||
var content = PoParser.readFile(file);
|
||||
var start = new Date();
|
||||
var lines = content.split(PoParser.REGEX_LINES);
|
||||
var idx = -1;
|
||||
var line = null;
|
||||
var m, value, nr;
|
||||
var msg;
|
||||
|
||||
var hasMoreLines = function() {
|
||||
return idx < lines.length - 1;
|
||||
};
|
||||
var hasMoreLines = function() {
|
||||
return idx < lines.length - 1;
|
||||
};
|
||||
|
||||
var nextLine = function() {
|
||||
return (line = lines[idx += 1]) != null;
|
||||
};
|
||||
var nextLine = function() {
|
||||
return (line = lines[idx += 1]) != null;
|
||||
};
|
||||
|
||||
var getContinuation = function(str) {
|
||||
var nLine;
|
||||
while ((nLine = lines[idx + 1]) != null) {
|
||||
if ((m = nLine.match(PoParser.REGEX_MSG_CONT)) != null) {
|
||||
str += m[1];
|
||||
nextLine();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
var getContinuation = function(str) {
|
||||
var nLine;
|
||||
while ((nLine = lines[idx + 1]) != null) {
|
||||
if ((m = nLine.match(PoParser.REGEX_MSG_CONT)) != null) {
|
||||
str += m[1];
|
||||
nextLine();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
while (nextLine()) {
|
||||
if ((m = line.match(PoParser.REGEX_MSGID)) != null) {
|
||||
value = getContinuation(m[1]);
|
||||
if (value) {
|
||||
msg = this.messages[this.messages.length] = new Message(value);
|
||||
}
|
||||
} else if ((m = line.match(PoParser.REGEX_MSGID_PLURAL)) != null) {
|
||||
value = getContinuation(m[1]);
|
||||
if (value && msg != null) {
|
||||
msg.pluralKey = value;
|
||||
}
|
||||
} else if ((m = line.match(PoParser.REGEX_MSGSTR)) != null) {
|
||||
nr = m[1];
|
||||
value = getContinuation(m[2]);
|
||||
if (value && msg != null) {
|
||||
nr = parseInt(nr, 10);
|
||||
msg.translations[nr || 0] = value;
|
||||
}
|
||||
while (nextLine()) {
|
||||
if ((m = line.match(PoParser.REGEX_MSGID)) != null) {
|
||||
value = getContinuation(m[1]);
|
||||
if (value) {
|
||||
msg = this.messages[this.messages.length] = new Message(value);
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else if ((m = line.match(PoParser.REGEX_MSGID_PLURAL)) != null) {
|
||||
value = getContinuation(m[1]);
|
||||
if (value && msg != null) {
|
||||
msg.pluralKey = value;
|
||||
}
|
||||
} else if ((m = line.match(PoParser.REGEX_MSGSTR)) != null) {
|
||||
nr = m[1];
|
||||
value = getContinuation(m[2]);
|
||||
if (value && msg != null) {
|
||||
nr = parseInt(nr, 10);
|
||||
msg.translations[nr || 0] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -207,44 +199,44 @@ PoParser.prototype.parse = function(file) {
|
|||
* file should be saved
|
||||
*/
|
||||
PoParser.prototype.writeToFile = function(output) {
|
||||
var buf = new java.lang.StringBuffer();
|
||||
// write header
|
||||
buf.append('/**\n');
|
||||
buf.append(' * Instantiate the messages namespace if it\'s not already existing\n');
|
||||
buf.append(' */\n');
|
||||
var buf = new java.lang.StringBuffer();
|
||||
// write header
|
||||
buf.append('/**\n');
|
||||
buf.append(' * Instantiate the messages namespace if it\'s not already existing\n');
|
||||
buf.append(' */\n');
|
||||
var objPath = "";
|
||||
if (this.namespace) {
|
||||
objPath += this.namespace;
|
||||
buf.append('if (!global.' + objPath + ') {\n');
|
||||
buf.append(' global.' + objPath + ' = {};\n');
|
||||
buf.append('}\n');
|
||||
objPath += ".";
|
||||
}
|
||||
objPath += "messages";
|
||||
buf.append('if (!global.' + objPath + ') {\n');
|
||||
buf.append(' global.' + objPath + ' = {};\n');
|
||||
buf.append('}\n\n');
|
||||
if (this.namespace) {
|
||||
objPath += this.namespace;
|
||||
buf.append('if (!global.' + objPath + ') {\n');
|
||||
buf.append(' global.' + objPath + ' = {};\n');
|
||||
buf.append('}\n');
|
||||
objPath += ".";
|
||||
}
|
||||
objPath += "messages";
|
||||
buf.append('if (!global.' + objPath + ') {\n');
|
||||
buf.append(' global.' + objPath + ' = {};\n');
|
||||
buf.append('}\n\n');
|
||||
|
||||
buf.append('/**\n');
|
||||
buf.append(' * Messages for locale "' + this.localeKey + '"\n');
|
||||
buf.append(' */\n');
|
||||
objPath += "." + this.localeKey;
|
||||
buf.append('global.' + objPath + ' = {\n');
|
||||
// write messages
|
||||
for (var i=0;i<this.messages.length; i++) {
|
||||
this.messages[i].write(buf);
|
||||
}
|
||||
// write footer
|
||||
buf.append('};\n');
|
||||
buf.append('/**\n');
|
||||
buf.append(' * Messages for locale "' + this.localeKey + '"\n');
|
||||
buf.append(' */\n');
|
||||
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++) {
|
||||
this.messages[i].write(buf);
|
||||
}
|
||||
// write footer
|
||||
buf.append('};\n');
|
||||
|
||||
// write the message catalog into the outFile
|
||||
var file = new java.io.File(output, objPath + ".js");
|
||||
var writer = new java.io.FileWriter(file);
|
||||
writer.write(buf.toString());
|
||||
// writer.write(buf.toString().getBytes("UTF-8"));
|
||||
writer.close();
|
||||
print("generated messages file " + file.getAbsolutePath());
|
||||
return;
|
||||
// write the message catalog into the outFile
|
||||
var file = new java.io.File(output, fname);
|
||||
var writer = new java.io.FileWriter(file);
|
||||
writer.write(new java.lang.String(buf.toString().getBytes("UTF-8")));
|
||||
writer.close();
|
||||
print("generated messages file " + file.getAbsolutePath());
|
||||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -255,10 +247,10 @@ PoParser.prototype.writeToFile = function(output) {
|
|||
* @constructor
|
||||
*/
|
||||
var Message = function(singularKey) {
|
||||
this.singularKey = singularKey;
|
||||
this.pluralKey = null;
|
||||
this.translations = [];
|
||||
return this;
|
||||
this.singularKey = singularKey;
|
||||
this.pluralKey = null;
|
||||
this.translations = [];
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -267,37 +259,37 @@ var Message = function(singularKey) {
|
|||
* string to
|
||||
*/
|
||||
Message.prototype.write = function(buf) {
|
||||
var writeLine = function(key, value) {
|
||||
buf.append(' "');
|
||||
buf.append(key);
|
||||
buf.append('": "');
|
||||
if (value !== null && value !== undefined) {
|
||||
buf.append(value);
|
||||
}
|
||||
buf.append('",\n');
|
||||
};
|
||||
var writeLine = function(key, value) {
|
||||
buf.append(' "');
|
||||
buf.append(key);
|
||||
buf.append('": "');
|
||||
if (value !== null && value !== undefined) {
|
||||
buf.append(value);
|
||||
}
|
||||
buf.append('",\n');
|
||||
};
|
||||
|
||||
if (this.singularKey != null) {
|
||||
writeLine(this.singularKey, this.translations[0]);
|
||||
if (this.pluralKey != null) {
|
||||
writeLine(this.pluralKey, this.translations[1]);
|
||||
}
|
||||
}
|
||||
return;
|
||||
if (this.singularKey != null) {
|
||||
writeLine(this.singularKey, this.translations[0]);
|
||||
if (this.pluralKey != null) {
|
||||
writeLine(this.pluralKey, this.translations[1]);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main script body
|
||||
*/
|
||||
if (arguments.length < 2) {
|
||||
print("Usage:");
|
||||
print("PoParser.js <input> <output> [namespace]");
|
||||
print("<input>: Either a single .po file or a directory containing .po files");
|
||||
print("<output>: The directory where the generated messages files should be stored");
|
||||
print("[namespace]: An optional global namespace where the messages should be");
|
||||
print(" stored (eg. a namespace like 'jala' will lead to messages");
|
||||
print(" stored in global.jala.messages by their locale.");
|
||||
quit();
|
||||
print("Usage:");
|
||||
print("PoParser.js <input> <output> [namespace]");
|
||||
print("<input>: Either a single .po file or a directory containing .po files");
|
||||
print("<output>: The directory where the generated messages files should be stored");
|
||||
print("[namespace]: An optional global namespace where the messages should be");
|
||||
print(" stored (eg. a namespace like 'jala' will lead to messages");
|
||||
print(" stored in global.jala.messages by their locale.");
|
||||
quit();
|
||||
}
|
||||
|
||||
var input = new java.io.File(arguments[0]);
|
||||
|
@ -306,31 +298,31 @@ var namespace = arguments[2];
|
|||
|
||||
// check if the output destination is a directory
|
||||
if (output.isFile()) {
|
||||
print("Invalid arguments: the output destination must be a directory.");
|
||||
quit();
|
||||
print("Invalid arguments: the output destination must be a directory.");
|
||||
quit();
|
||||
}
|
||||
|
||||
if (namespace && namespace.indexOf(".") != -1) {
|
||||
print("Invalid arguments: Please don't specify complex object paths, as this");
|
||||
print("would corrupt the messages file.");
|
||||
quit();
|
||||
print("Invalid arguments: Please don't specify complex object paths, as this");
|
||||
print("would corrupt the messages file.");
|
||||
quit();
|
||||
}
|
||||
|
||||
// parse the PO file(s) and create the message catalog files
|
||||
var parser;
|
||||
if (input.isDirectory()) {
|
||||
var files = input.listFiles();
|
||||
var file;
|
||||
for (var i=0;i<files.length;i++) {
|
||||
file = files[i];
|
||||
if (file.getName().endsWith(".po")) {
|
||||
parser = new PoParser(namespace);
|
||||
parser.parse(file);
|
||||
parser.writeToFile(output);
|
||||
}
|
||||
}
|
||||
var files = input.listFiles();
|
||||
var file;
|
||||
for (var i=0;i<files.length;i++) {
|
||||
file = files[i];
|
||||
if (file.getName().endsWith(".po")) {
|
||||
parser = new PoParser(namespace);
|
||||
parser.parse(file);
|
||||
parser.writeToFile(output);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
parser = new PoParser(namespace);
|
||||
parser.parse(input);
|
||||
parser.writeToFile(output);
|
||||
parser = new PoParser(namespace);
|
||||
parser.parse(input);
|
||||
parser.writeToFile(output);
|
||||
}
|
||||
|
|
16
modules/jala/util/Test/build.gradle
Normal file
16
modules/jala/util/Test/build.gradle
Normal file
|
@ -0,0 +1,16 @@
|
|||
dependencies {
|
||||
runtimeOnly 'org.subethamail:subethasmtp-smtp:1.2'
|
||||
runtimeOnly 'org.subethamail:subethasmtp-wiser:1.2'
|
||||
}
|
||||
|
||||
jar.enabled = false
|
||||
compileJava.enabled = false
|
||||
compileTestJava.enabled = false
|
||||
processResources.enabled = false
|
||||
processTestResources.enabled = false
|
||||
test.enabled = false
|
||||
|
||||
tasks.register('deps', Copy) {
|
||||
from sourceSets.main.runtimeClasspath
|
||||
into 'code'
|
||||
}
|
|
@ -41,7 +41,7 @@ app.addRepository("modules/helma/Http.js");
|
|||
/**
|
||||
* Jala dependencies
|
||||
*/
|
||||
app.addRepository(getProperty("jala.dir", "modules/jala") +
|
||||
app.addRepository(getProperty("jala.dir", "modules/jala") +
|
||||
"/code/Database.js");
|
||||
|
||||
/**
|
||||
|
@ -573,11 +573,11 @@ jala.Test.prototype.executeTest = function(testFile) {
|
|||
} finally {
|
||||
// exit the js context created above
|
||||
cx.exit();
|
||||
// FIXME (sim) don't polute global in the first place or
|
||||
// FIXME (sim) don't polute global in the first place or
|
||||
// get a fresh global for each testrun
|
||||
global.testFunctionIdents.forEach(function(funcName) {
|
||||
// NOTE won't work on var-defined props
|
||||
// delete global[funcName]]
|
||||
// delete global[funcName]]
|
||||
global[funcName] = "ignoreMe";
|
||||
}, this);
|
||||
global["setup"] = "ignoreMe";
|
||||
|
@ -861,7 +861,7 @@ jala.Test.prototype.assertEqualFile = function assertEqualFile(val, file) {
|
|||
// the last linefeed in a file too
|
||||
var str = value1.replace(/\r?\n$/g, "");
|
||||
equals = str === file.readAll();
|
||||
}
|
||||
}
|
||||
if (!equals) {
|
||||
throw new jala.Test.TestException(comment,
|
||||
"Expected " + jala.Test.valueToString(value1) +
|
||||
|
@ -1155,7 +1155,7 @@ jala.Test.HttpClient = function() {
|
|||
this.getClient = function() {
|
||||
return client;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sets the cookie to use for subsequent requests using this client
|
||||
* @param {Array} arr The cookie object as received from helma.Http.getUrl
|
||||
|
@ -1336,7 +1336,7 @@ jala.Test.DatabaseMgr.prototype.startDatabase = function(dbSourceName, copyTable
|
|||
// collect the table names of all relational prototypes
|
||||
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());
|
||||
|
@ -1401,7 +1401,7 @@ jala.Test.DatabaseMgr.prototype.stopAll = function() {
|
|||
*/
|
||||
jala.Test.SmtpServer = function(port) {
|
||||
var server = null;
|
||||
|
||||
|
||||
var oldSmtpServer = null;
|
||||
|
||||
/**
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
modules/jala/util/Test/code/subethasmtp-wiser-1.2.jar
Normal file
BIN
modules/jala/util/Test/code/subethasmtp-wiser-1.2.jar
Normal file
Binary file not shown.
50
renovate.json
Normal file
50
renovate.json
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
|
||||
"extends": [
|
||||
"config:recommended",
|
||||
"mergeConfidence:all-badges",
|
||||
"npm:unpublishSafe",
|
||||
":disableRateLimiting",
|
||||
":pinVersions",
|
||||
":semanticCommitsDisabled"
|
||||
],
|
||||
|
||||
"osvVulnerabilityAlerts": true,
|
||||
|
||||
"vulnerabilityAlerts": {
|
||||
"labels": ["security", "urgent"],
|
||||
"automerge": true
|
||||
},
|
||||
|
||||
"labels": ["dependency"],
|
||||
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "Label Helma core packages",
|
||||
"matchFiles": ["build.gradle"],
|
||||
"addLabels": ["core"]
|
||||
},
|
||||
{
|
||||
"description": "Label major version bumps",
|
||||
"matchUpdateTypes": ["major"],
|
||||
"addLabels": ["major"]
|
||||
},
|
||||
{
|
||||
"description": "Label packages required at runtime",
|
||||
"matchDepTypes": ["dependencies"],
|
||||
"addLabels": ["runtime"]
|
||||
},
|
||||
{
|
||||
"description": "Group Jetty packages",
|
||||
"matchPackagePrefixes": ["org.eclipse.jetty"],
|
||||
"groupName": "Jetty packages"
|
||||
},
|
||||
{
|
||||
"description": "Group Lucene packages",
|
||||
"matchPackagePrefixes": ["org.apache.lucene"],
|
||||
"groupName": "Lucene packages"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -7,3 +7,12 @@ org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.git/**')
|
|||
org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.gitignore')
|
||||
|
||||
include 'launcher'
|
||||
include 'modules'
|
||||
include 'jala'
|
||||
include 'hopKit'
|
||||
include 'test'
|
||||
|
||||
project(':modules').projectDir = file('modules/helma')
|
||||
project(':jala').projectDir = file('modules/jala')
|
||||
project(':hopKit').projectDir = file('modules/jala/util/HopKit')
|
||||
project(':test').projectDir = file('modules/jala/util/Test')
|
||||
|
|
|
@ -149,7 +149,7 @@ function testOrder(org, pos) {
|
|||
|
||||
function cleanup() {
|
||||
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();
|
||||
|
|
8
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
8
src/dist/apps/test/tests/HopObjectGroupBy.js
vendored
|
@ -68,7 +68,7 @@ function testGroupByAddRemoveNoCommit() {
|
|||
// FIXME HELMABUG: country is still accessible at this point
|
||||
// similar to http://helma.org/bugs/show_bug.cgi?id=551
|
||||
assertNull(root.organisationsByCountry.get(org.country));
|
||||
|
||||
|
||||
assertEqual(countryCount, root.organisationsByCountry.count());
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ function testGroupTransient() {
|
|||
assertNotNull(country);
|
||||
assertEqual(country._prototype, "Country");
|
||||
assertEqual(country.groupname, org.country);
|
||||
|
||||
|
||||
// These don't work as org uses the parent from type.properties
|
||||
// which is root.organisations. Not sure if this is a bug or not.
|
||||
// assertEqual(country, org._parent);
|
||||
|
@ -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
|
66
src/dist/extras/upstart/helma
vendored
66
src/dist/extras/upstart/helma
vendored
|
@ -6,56 +6,67 @@
|
|||
# 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
|
||||
|
||||
###
|
||||
|
||||
# Check for existence of needed config file and source it
|
||||
if [ -r $HELMA_CONFIG ]; then
|
||||
source $HELMA_CONFIG
|
||||
source $HELMA_CONFIG
|
||||
else
|
||||
echo "Can't read config file $HELMA_CONFIG"
|
||||
exit 6
|
||||
echo "Can't read config file $HELMA_CONFIG"
|
||||
exit 6
|
||||
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
|
||||
echo "Config error: JAVA_BIN $JAVA_BIN not found or not executable"
|
||||
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"
|
||||
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
|
||||
|
||||
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)
|
||||
start)
|
||||
echo -n "Starting $HELMA_SERVICE: "
|
||||
|
||||
if [ -f $HELMA_PID ]; then
|
||||
echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) already running"
|
||||
exit 1
|
||||
echo "$HELMA_SERVICE (pid `cat $HELMA_PID`) already running"
|
||||
exit 1
|
||||
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."
|
||||
;;
|
||||
|
||||
stop)
|
||||
stop)
|
||||
echo -n "Shutting down $HELMA_SERVICE: "
|
||||
if [ ! -f $HELMA_PID ]; then
|
||||
echo "$HELMA_SERVICE not running"
|
||||
exit 1
|
||||
echo "$HELMA_SERVICE not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PID=`cat $HELMA_PID 2>/dev/null`
|
||||
|
@ -65,20 +76,21 @@ stop)
|
|||
echo "stopped."
|
||||
;;
|
||||
|
||||
restart)
|
||||
restart)
|
||||
$0 stop && $0 start
|
||||
;;
|
||||
|
||||
reload)
|
||||
reload)
|
||||
echo -n "Reloading $HELMA_SERVICE: $HELMA_SERVICE"
|
||||
touch $HELMA_HOME/server.properties
|
||||
touch $HELMA_HOME/apps.properties
|
||||
echo "."
|
||||
;;
|
||||
|
||||
*)
|
||||
*)
|
||||
echo "Usage: /etc/init.d/helma start|stop|restart|reload"
|
||||
exit 1
|
||||
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"
|
||||
|
|
|
@ -24,15 +24,13 @@ import javax.servlet.http.Cookie;
|
|||
* of an HTTP cookie.
|
||||
*/
|
||||
public final class CookieTrans implements Serializable {
|
||||
private static final long serialVersionUID = 1811202114296536258L;
|
||||
|
||||
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;
|
||||
|
@ -55,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() {
|
||||
|
@ -65,8 +69,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getValue() {
|
||||
|
@ -74,8 +76,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public int getDays() {
|
||||
|
@ -83,8 +83,6 @@ public final class CookieTrans implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String getPath() {
|
||||
|
@ -92,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,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;
|
||||
}
|
||||
|
|
|
@ -143,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -197,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,7 +244,7 @@ public class ResponseBean implements Serializable {
|
|||
if (str == null) return;
|
||||
|
||||
for (String s : str) {
|
||||
res.write(s + " ");
|
||||
res.write(s + "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +257,7 @@ public class ResponseBean implements Serializable {
|
|||
if (str == null) return;
|
||||
|
||||
for (String s : str) {
|
||||
res.write(s + " ");
|
||||
res.write(s + "");
|
||||
}
|
||||
|
||||
res.writeln();
|
||||
|
@ -245,9 +280,9 @@ public class ResponseBean implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* add an HTML formatted debug message to the end of the page.
|
||||
* add HTML formatted debug messages to the end of the page.
|
||||
*
|
||||
* @param message the message
|
||||
* @param messages the list of messages
|
||||
*/
|
||||
public void debug(String... messages) {
|
||||
if (messages == null) {
|
||||
|
|
|
@ -384,7 +384,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Replace special characters with entities, including <, > and ", thus allowing
|
||||
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing
|
||||
* no HTML tags.
|
||||
*/
|
||||
public synchronized void encode(Object what) {
|
||||
|
@ -415,7 +415,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Replace special characters with entities, including <, > and ", thus allowing
|
||||
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing
|
||||
* no HTML tags.
|
||||
*/
|
||||
public synchronized void encodeXml(Object what) {
|
||||
|
@ -974,8 +974,10 @@ public final class ResponseTrans extends Writer implements Serializable {
|
|||
* @param days the cookie's lifespan in days
|
||||
* @param 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) {
|
||||
|
@ -1001,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ public final class TypeManager {
|
|||
protected synchronized void checkRepository(Repository repository, boolean update) throws IOException {
|
||||
Repository[] list = repository.getRepositories();
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
|
||||
|
||||
// ignore dir name found - compare to shortname (= Prototype name)
|
||||
if (ignoreDirs.contains(list[i].getShortName())) {
|
||||
// jump this repository
|
||||
|
@ -140,7 +140,7 @@ public final class TypeManager {
|
|||
}
|
||||
|
||||
if (list[i].isScriptRoot()) {
|
||||
// this is an embedded top-level script repository
|
||||
// this is an embedded top-level script repository
|
||||
if (app.addRepository(list[i], list[i].getParentRepository())) {
|
||||
// repository is new, check it
|
||||
checkRepository(list[i], update);
|
||||
|
@ -153,7 +153,7 @@ public final class TypeManager {
|
|||
// if prototype doesn't exist, create it
|
||||
if (proto == null) {
|
||||
// create new prototype if type name is valid
|
||||
if (isValidTypeName(name))
|
||||
if (isValidTypeName(name))
|
||||
createPrototype(name, list[i], null);
|
||||
} else {
|
||||
proto.addRepository(list[i], update);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ public final class TypeManager {
|
|||
|
||||
if (debug) {
|
||||
System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
|
||||
}
|
||||
}
|
||||
|
||||
// update prototype's type mapping
|
||||
DbMapping dbmap = proto.getDbMapping();
|
||||
|
|
|
@ -16,21 +16,21 @@
|
|||
|
||||
/*
|
||||
* A few explanations:
|
||||
*
|
||||
*
|
||||
* - this.image is either an AWT Image or a BufferedImage.
|
||||
* It depends on the ImageGenerator in what form the Image initially is.
|
||||
* (the ImageIO implementation only uses BufferedImages for example.)
|
||||
*
|
||||
* As soon as some action that needs the graphics object is performed and the
|
||||
*
|
||||
* As soon as some action that needs the graphics object is performed and the
|
||||
* image is still in AWT format, it is converted to a BufferedImage
|
||||
*
|
||||
*
|
||||
* Any internal function that performs graphical actions needs to call
|
||||
* getGraphics, never rely on this.graphics being set correctly!
|
||||
*
|
||||
*
|
||||
* - ImageWrapper objects are created and safed by the ImageGenerator class
|
||||
* all different implementations of Imaging functionallity are implemented
|
||||
* as a ImageGenerator extending class.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
package helma.image;
|
||||
|
@ -52,7 +52,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Creates a new ImageWrapper object.
|
||||
*
|
||||
*
|
||||
* @param image ...
|
||||
* @param width ...
|
||||
* @param height ...
|
||||
|
@ -66,7 +66,7 @@ public class ImageWrapper {
|
|||
// graphics are turned off by default. getGraphics activates it if necessary.
|
||||
this.graphics = null;
|
||||
}
|
||||
|
||||
|
||||
public ImageWrapper(Image image, ImageGenerator generator) {
|
||||
this(image, image.getWidth(null), image.getHeight(null), generator);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class ImageWrapper {
|
|||
* not. By using getBufferedImage, images are only converted to a
|
||||
* getBufferedImage when this is actually needed, which is better than
|
||||
* storing images as BufferedImage in general.
|
||||
*
|
||||
*
|
||||
* @return the Image object as a BufferedImage
|
||||
*/
|
||||
public BufferedImage getBufferedImage() {
|
||||
|
@ -94,9 +94,9 @@ public class ImageWrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the Graphics object to directly paint to this Image. Converts the
|
||||
* Returns the Graphics object to directly paint to this Image. Converts the
|
||||
* internal image to a BufferedImage if necessary.
|
||||
*
|
||||
*
|
||||
* @return the Graphics object for drawing into this image
|
||||
*/
|
||||
public Graphics2D getGraphics() {
|
||||
|
@ -107,7 +107,7 @@ public class ImageWrapper {
|
|||
}
|
||||
return graphics;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the internal image and clears the stored graphics object.
|
||||
* Any code that is changing the internal image should do it through this function
|
||||
|
@ -129,7 +129,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Creates and returns a copy of this image.
|
||||
*
|
||||
*
|
||||
* @return a clone of this image.
|
||||
*/
|
||||
public Object clone() {
|
||||
|
@ -141,7 +141,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Returns the Image object represented by this ImageWrapper.
|
||||
*
|
||||
*
|
||||
* @return the image object
|
||||
*/
|
||||
public Image getImage() {
|
||||
|
@ -150,7 +150,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Returns the ImageProducer of the wrapped image
|
||||
*
|
||||
*
|
||||
* @return the images's ImageProducer
|
||||
*/
|
||||
public ImageProducer getSource() {
|
||||
|
@ -180,7 +180,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Sets the color used to write/paint to this image.
|
||||
*
|
||||
*
|
||||
* @param red ...
|
||||
* @param green ...
|
||||
* @param blue ...
|
||||
|
@ -191,7 +191,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Sets the color used to write/paint to this image.
|
||||
*
|
||||
*
|
||||
* @param color ...
|
||||
*/
|
||||
public void setColor(int color) {
|
||||
|
@ -200,7 +200,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Sets the color used to write/paint to this image.
|
||||
*
|
||||
*
|
||||
* @param color ...
|
||||
*/
|
||||
public void setColor(Color color) {
|
||||
|
@ -209,7 +209,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Sets the color used to write/paint to this image.
|
||||
*
|
||||
*
|
||||
* @param color ...
|
||||
*/
|
||||
public void setColor(String color) {
|
||||
|
@ -217,7 +217,7 @@ public class ImageWrapper {
|
|||
}
|
||||
/**
|
||||
* Draws a string to this image at the given coordinates.
|
||||
*
|
||||
*
|
||||
* @param str ...
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
|
@ -228,7 +228,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Draws a line to this image from x1/y1 to x2/y2.
|
||||
*
|
||||
*
|
||||
* @param x1 ...
|
||||
* @param y1 ...
|
||||
* @param x2 ...
|
||||
|
@ -240,7 +240,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Draws a rectangle to this image.
|
||||
*
|
||||
*
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
* @param w ...
|
||||
|
@ -252,12 +252,12 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Draws another image to this image.
|
||||
*
|
||||
*
|
||||
* @param filename ...
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
*/
|
||||
public void drawImage(String filename, int x, int y)
|
||||
public void drawImage(String filename, int x, int y)
|
||||
throws IOException {
|
||||
Image img = generator.read(filename);
|
||||
if (img != null)
|
||||
|
@ -266,30 +266,30 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Draws another image to this image.
|
||||
*
|
||||
*
|
||||
* @param image ...
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
*/
|
||||
public void drawImage(ImageWrapper image, int x, int y)
|
||||
public void drawImage(ImageWrapper image, int x, int y)
|
||||
throws IOException {
|
||||
getGraphics().drawImage(image.getImage(), x, y, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws another image to this image.
|
||||
*
|
||||
*
|
||||
* @param image ...
|
||||
* @param at ...
|
||||
*/
|
||||
public void drawImage(ImageWrapper image, AffineTransform at)
|
||||
public void drawImage(ImageWrapper image, AffineTransform at)
|
||||
throws IOException {
|
||||
getGraphics().drawImage(image.getImage(), at, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a filled rectangle to this image.
|
||||
*
|
||||
*
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
* @param w ...
|
||||
|
@ -301,7 +301,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Returns the width of this image.
|
||||
*
|
||||
*
|
||||
* @return the width of this image
|
||||
*/
|
||||
public int getWidth() {
|
||||
|
@ -310,7 +310,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Returns the height of this image.
|
||||
*
|
||||
*
|
||||
* @return the height of this image
|
||||
*/
|
||||
public int getHeight() {
|
||||
|
@ -319,7 +319,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Crops the image.
|
||||
*
|
||||
*
|
||||
* @param x ...
|
||||
* @param y ...
|
||||
* @param w ...
|
||||
|
@ -340,21 +340,21 @@ public class ImageWrapper {
|
|||
setImage(buffered);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Trims the image.
|
||||
*
|
||||
*
|
||||
* @param x the x-coordinate of the pixel specifying the background color
|
||||
* @param y the y-coordinate of the pixel specifying the background color
|
||||
*/
|
||||
|
||||
|
||||
public void trim(int x, int y) {
|
||||
trim(x, y, true, true, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trims the image.
|
||||
*
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param trimLeft
|
||||
|
@ -369,7 +369,7 @@ public class ImageWrapper {
|
|||
|
||||
// create a BufferedImage of only 1 pixel height for fetching the rows of the image in the correct format (ARGB)
|
||||
// This speeds up things by more than factor 2, compared to the standard BufferedImage.getRGB solution,
|
||||
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
||||
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
||||
// very optimized code which may even be hardware accelerated.
|
||||
if (trimTop || trimBottom) {
|
||||
BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
|
||||
|
@ -445,7 +445,7 @@ public class ImageWrapper {
|
|||
}
|
||||
crop(left, top, right - left + 1, bottom - top + 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resizes the image using the Graphics2D approach
|
||||
*/
|
||||
|
@ -453,12 +453,12 @@ public class ImageWrapper {
|
|||
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics2D g2d = buffered.createGraphics();
|
||||
|
||||
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||
smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :
|
||||
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
|
||||
);
|
||||
|
||||
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
||||
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
||||
smooth ? RenderingHints.VALUE_RENDER_QUALITY :
|
||||
RenderingHints.VALUE_RENDER_SPEED
|
||||
);
|
||||
|
@ -474,7 +474,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Resizes the image
|
||||
*
|
||||
*
|
||||
* @param w ...
|
||||
* @param h ...
|
||||
*/
|
||||
|
@ -494,7 +494,7 @@ public class ImageWrapper {
|
|||
// Image scaled = ImageWaiter.waitForImage(image.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING));
|
||||
// if (scaled == null)
|
||||
// throw new RuntimeException("Image cannot be resized.");
|
||||
|
||||
|
||||
// This version is up to 4 times faster than getScaledInstance:
|
||||
ImageFilterOp filter = new ImageFilterOp(new AreaAveragingScaleFilter(w, h));
|
||||
setImage(filter.filter(getBufferedImage(), null));
|
||||
|
@ -503,7 +503,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Resize the image, using a fast and cheap algorithm
|
||||
*
|
||||
*
|
||||
* @param w ...
|
||||
* @param h ...
|
||||
*/
|
||||
|
@ -513,8 +513,8 @@ 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);
|
||||
|
@ -522,8 +522,8 @@ 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) {
|
||||
|
@ -533,8 +533,8 @@ 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 ...
|
||||
*/
|
||||
|
@ -546,7 +546,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Save the image. Image format is deduced from filename.
|
||||
*
|
||||
*
|
||||
* @param filename ...
|
||||
* @throws IOException
|
||||
*/
|
||||
|
@ -557,7 +557,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Saves the image. Image format is deduced from filename.
|
||||
*
|
||||
*
|
||||
* @param filename ...
|
||||
* @param quality ...
|
||||
* @throws IOException
|
||||
|
@ -569,7 +569,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Saves the image. Image format is deduced from filename.
|
||||
*
|
||||
*
|
||||
* @param filename ...
|
||||
* @param quality ...
|
||||
* @param alpha ...
|
||||
|
@ -579,10 +579,10 @@ public class ImageWrapper {
|
|||
throws IOException {
|
||||
generator.write(this, checkFilename(filename), quality, alpha);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves the image. Image format is deduced from mimeType.
|
||||
*
|
||||
*
|
||||
* @param out ...
|
||||
* @param mimeType ...
|
||||
* @throws IOException
|
||||
|
@ -591,10 +591,10 @@ public class ImageWrapper {
|
|||
throws IOException {
|
||||
generator.write(this, out, mimeType, -1f, false); // -1 means default quality
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves the image. Image format is deduced from mimeType.
|
||||
*
|
||||
*
|
||||
* @param out ...
|
||||
* @param mimeType ...
|
||||
* @param quality ...
|
||||
|
@ -607,7 +607,7 @@ public class ImageWrapper {
|
|||
|
||||
/**
|
||||
* Saves the image. Image format is deduced from mimeType.
|
||||
*
|
||||
*
|
||||
* @param out ...
|
||||
* @param mimeType ...
|
||||
* @param quality ...
|
||||
|
@ -618,7 +618,7 @@ public class ImageWrapper {
|
|||
throws IOException {
|
||||
generator.write(this, out, mimeType, quality, alpha);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the palette index of the transparent color for Images with an
|
||||
* IndexColorModel. This can be used together with
|
||||
|
@ -648,7 +648,7 @@ public class ImageWrapper {
|
|||
/**
|
||||
* Returns the pixel at x, y. If the image is indexed, it returns the
|
||||
* palette index, otherwise the rgb code of the color is returned.
|
||||
*
|
||||
*
|
||||
* @param x the x coordinate of the pixel
|
||||
* @param y the y coordinate of the pixel
|
||||
* @return the pixel at x, y
|
||||
|
@ -676,4 +676,4 @@ public class ImageWrapper {
|
|||
}
|
||||
return file.getPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -473,10 +473,10 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// bind to Jetty HTTP server
|
||||
if (ApplicationManager.this.jetty != null) {
|
||||
if(ApplicationManager.this.context == null) {
|
||||
ApplicationManager.this.context = new ContextHandlerCollection();
|
||||
ApplicationManager.this.jetty.getHttpServer().setHandler(ApplicationManager.this.context);
|
||||
if (jetty != null) {
|
||||
if (context == null) {
|
||||
context = new ContextHandlerCollection();
|
||||
jetty.getHttpServer().setHandler(context);
|
||||
}
|
||||
|
||||
// if there is a static direcory specified, mount it
|
||||
|
@ -501,9 +501,8 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
Class servletClass = servletClassName == null ?
|
||||
EmbeddedServletClient.class : Class.forName(servletClassName);
|
||||
ServletHolder holder = new ServletHolder(servletClass);
|
||||
appContext.addServlet(holder, "/*"); //$NON-NLS-1$
|
||||
|
||||
holder.setInitParameter("application", appName); //$NON-NLS-1$
|
||||
holder.setInitParameter("application", appName);
|
||||
appContext.addServlet(holder, "/*");
|
||||
|
||||
if (this.cookieDomain != null) {
|
||||
holder.setInitParameter("cookieDomain", this.cookieDomain); //$NON-NLS-1$
|
||||
|
@ -529,9 +528,9 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
holder.setInitParameter("debug", this.debug); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if (this.protectedStaticDir != null) {
|
||||
File protectedContent = getAbsoluteFile(this.protectedStaticDir);
|
||||
this.appContext.setResourceBase(protectedContent.getPath());
|
||||
if (protectedStaticDir != null) {
|
||||
File protectedContent = getAbsoluteFile(protectedStaticDir);
|
||||
appContext.setResourceBase(protectedContent.getPath());
|
||||
getLogger().info("Serving protected static from " +
|
||||
protectedContent.getPath());
|
||||
}
|
||||
|
|
|
@ -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,17 +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.5")
|
||||
|| javaVersion.startsWith("1.4")
|
||||
|| javaVersion.startsWith("1.3")
|
||||
|| javaVersion.startsWith("1.2")
|
||||
|| javaVersion.startsWith("1.1")
|
||||
|| javaVersion.startsWith("1.0")) {
|
||||
System.err.println("This version of Helma requires Java 1.6 or greater.");
|
||||
if (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 +
|
||||
|
|
|
@ -76,13 +76,13 @@ public final class TransientProperty implements IProperty, Serializable {
|
|||
return svalue;
|
||||
|
||||
case BOOLEAN:
|
||||
return new Boolean(bvalue);
|
||||
return Boolean.valueOf(bvalue);
|
||||
|
||||
case INTEGER:
|
||||
return new Long(lvalue);
|
||||
return Long.valueOf(lvalue);
|
||||
|
||||
case FLOAT:
|
||||
return new Double(dvalue);
|
||||
return Double.valueOf(dvalue);
|
||||
|
||||
case DATE:
|
||||
return new Date(lvalue);
|
||||
|
|
|
@ -93,7 +93,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
break;
|
||||
|
||||
case INTEGER:
|
||||
value = new Long(in.readLong());
|
||||
value = Long.valueOf(in.readLong());
|
||||
|
||||
break;
|
||||
|
||||
|
@ -103,7 +103,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
break;
|
||||
|
||||
case FLOAT:
|
||||
value = new Double(in.readDouble());
|
||||
value = Double.valueOf(in.readDouble());
|
||||
|
||||
break;
|
||||
|
||||
|
@ -231,7 +231,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
*/
|
||||
public void setIntegerValue(long l) {
|
||||
type = INTEGER;
|
||||
value = new Long(l);
|
||||
value = Long.valueOf(l);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
*/
|
||||
public void setFloatValue(double d) {
|
||||
type = FLOAT;
|
||||
value = new Double(d);
|
||||
value = Double.valueOf(d);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
|
@ -544,4 +544,4 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
Property p = (Property) obj;
|
||||
return value == null ? p.value == null : value.equals(p.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ public class Transactor {
|
|||
public void registerConnection(DbSource src, Connection con) {
|
||||
sqlConnections.put(src, con);
|
||||
// we assume a freshly created connection is ok.
|
||||
testedConnections.put(src, new Long(System.currentTimeMillis()));
|
||||
testedConnections.put(src, Long.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -262,7 +262,7 @@ public class Transactor {
|
|||
stmt.execute("SELECT 1");
|
||||
}
|
||||
stmt.close();
|
||||
testedConnections.put(src, new Long(now));
|
||||
testedConnections.put(src, Long.valueOf(now));
|
||||
} catch (SQLException sx) {
|
||||
try {
|
||||
con.close();
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Date;
|
|||
import java.util.Hashtable;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class XmlDatabaseReader extends DefaultHandler implements XmlConstants {
|
||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
|
@ -225,9 +225,9 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
|||
prop.setStringValue(charValue);
|
||||
}
|
||||
} else if ("float".equals(elementType)) {
|
||||
prop.setFloatValue((new Double(charValue)).doubleValue());
|
||||
prop.setFloatValue((Double.valueOf(charValue)).doubleValue());
|
||||
} else if ("integer".equals(elementType)) {
|
||||
prop.setIntegerValue((new Long(charValue)).longValue());
|
||||
prop.setIntegerValue((Long.valueOf(charValue)).longValue());
|
||||
} else {
|
||||
prop.setStringValue(charValue);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.HashMap;
|
|||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
|
@ -213,9 +213,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
|||
if (propName == null) {
|
||||
propName = qName;
|
||||
}
|
||||
|
||||
|
||||
if ("hop:parent".equals(qName)) {
|
||||
// FIXME: we ought to set parent here, but we're
|
||||
// FIXME: we ought to set parent here, but we're
|
||||
// dealing with INodes, which don't have a setParent().
|
||||
} else {
|
||||
currentNode.setNode(propName, n);
|
||||
|
@ -299,9 +299,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
|||
currentNode.setString(elementName, charValue);
|
||||
}
|
||||
} else if ("float".equals(elementType)) {
|
||||
currentNode.setFloat(elementName, (new Double(charValue)).doubleValue());
|
||||
currentNode.setFloat(elementName, (Double.valueOf(charValue)).doubleValue());
|
||||
} else if ("integer".equals(elementType)) {
|
||||
currentNode.setInteger(elementName, (new Long(charValue)).longValue());
|
||||
currentNode.setInteger(elementName, (Long.valueOf(charValue)).longValue());
|
||||
} else {
|
||||
currentNode.setString(elementName, charValue);
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
INode node = getNode();
|
||||
|
||||
if (skin != null) {
|
||||
skin.render(engine.reval, node,
|
||||
skin.render(engine.reval, node,
|
||||
(paramobj == Undefined.instance) ? null : paramobj);
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
public int jsFunction_contains(Object obj) {
|
||||
return jsFunction_indexOf(obj);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a property in this HopObject
|
||||
*
|
||||
|
@ -879,7 +879,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
if (d == null) {
|
||||
return null;
|
||||
} else {
|
||||
Object[] args = { new Long(d.getTime()) };
|
||||
Object[] args = { Long.valueOf(d.getTime()) };
|
||||
try {
|
||||
return cx.newObject(core.global, "Date", args);
|
||||
} catch (JavaScriptException nafx) {
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/*
|
||||
* The contents of this file are subject to the terms
|
||||
* of the Common Development and Distribution License
|
||||
* The contents of this file are subject to the terms
|
||||
* of the Common Development and Distribution License
|
||||
* (the License). You may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
*
|
||||
* You can obtain a copy of the license at
|
||||
* https://glassfish.dev.java.net/public/CDDLv1.0.html or
|
||||
* glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||
* See the License for the specific language governing
|
||||
* See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL
|
||||
* Header Notice in each file and include the License file
|
||||
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||
* If applicable, add the following below the CDDL Header,
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL
|
||||
* Header Notice in each file and include the License file
|
||||
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||
* If applicable, add the following below the CDDL Header,
|
||||
* with the fields enclosed by brackets [] replaced by
|
||||
* you own identifying information:
|
||||
* you own identifying information:
|
||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||
*
|
||||
*
|
||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
package helma.scripting.rhino;
|
||||
|
||||
import org.mozilla.javascript.*;
|
||||
|
@ -71,7 +71,7 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
private JSAdapter(Scriptable obj) {
|
||||
setAdaptee(obj);
|
||||
}
|
||||
|
||||
|
||||
// initializer to setup JSAdapter prototype in the given scope
|
||||
public static void init(Context cx, Scriptable scope, boolean sealed)
|
||||
throws RhinoException {
|
||||
|
@ -82,11 +82,11 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
|
||||
ScriptableObject.DONTENUM);
|
||||
}
|
||||
|
||||
|
||||
public String getClassName() {
|
||||
return "JSAdapter";
|
||||
}
|
||||
|
||||
|
||||
public Object get(String name, Scriptable start) {
|
||||
Function func = getAdapteeFunction(GET_PROP);
|
||||
if (func != null) {
|
||||
|
@ -96,17 +96,17 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
return start.get(name, start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Object get(int index, Scriptable start) {
|
||||
Function func = getAdapteeFunction(GET_PROP);
|
||||
if (func != null) {
|
||||
return call(func, new Object[] { new Integer(index) });
|
||||
return call(func, new Object[] { Integer.valueOf(index) });
|
||||
} else {
|
||||
start = getAdaptee();
|
||||
return start.get(index, start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean has(String name, Scriptable start) {
|
||||
Function func = getAdapteeFunction(HAS_PROP);
|
||||
if (func != null) {
|
||||
|
@ -117,18 +117,18 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
return start.has(name, start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean has(int index, Scriptable start) {
|
||||
Function func = getAdapteeFunction(HAS_PROP);
|
||||
if (func != null) {
|
||||
Object res = call(func, new Object[] { new Integer(index) });
|
||||
Object res = call(func, new Object[] { Integer.valueOf(index) });
|
||||
return Context.toBoolean(res);
|
||||
} else {
|
||||
start = getAdaptee();
|
||||
return start.has(index, start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void put(String name, Scriptable start, Object value) {
|
||||
if (start == this) {
|
||||
Function func = getAdapteeFunction(PUT_PROP);
|
||||
|
@ -142,12 +142,12 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
start.put(name, start, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void put(int index, Scriptable start, Object value) {
|
||||
if (start == this) {
|
||||
Function func = getAdapteeFunction(PUT_PROP);
|
||||
if( func != null) {
|
||||
call(func, new Object[] { new Integer(index), value });
|
||||
call(func, new Object[] { Integer.valueOf(index), value });
|
||||
} else {
|
||||
start = getAdaptee();
|
||||
start.put(index, start, value);
|
||||
|
@ -156,7 +156,7 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
start.put(index, start, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void delete(String name) {
|
||||
Function func = getAdapteeFunction(DEL_PROP);
|
||||
if (func != null) {
|
||||
|
@ -165,32 +165,32 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
getAdaptee().delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void delete(int index) {
|
||||
Function func = getAdapteeFunction(DEL_PROP);
|
||||
if (func != null) {
|
||||
call(func, new Object[] { new Integer(index) });
|
||||
call(func, new Object[] { Integer.valueOf(index) });
|
||||
} else {
|
||||
getAdaptee().delete(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Scriptable getPrototype() {
|
||||
return prototype;
|
||||
}
|
||||
|
||||
|
||||
public void setPrototype(Scriptable prototype) {
|
||||
this.prototype = prototype;
|
||||
}
|
||||
|
||||
|
||||
public Scriptable getParentScope() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
|
||||
public void setParentScope(Scriptable parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
public Object[] getIds() {
|
||||
Function func = getAdapteeFunction(GET_PROPIDS);
|
||||
if (func != null) {
|
||||
|
@ -226,7 +226,7 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
return getAdaptee().getIds();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean hasInstance(Scriptable scriptable) {
|
||||
if (scriptable instanceof JSAdapter) {
|
||||
return true;
|
||||
|
@ -239,11 +239,11 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Object getDefaultValue(Class hint) {
|
||||
return ScriptableObject.getDefaultValue(this, hint);
|
||||
}
|
||||
|
||||
|
||||
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
||||
Object[] args)
|
||||
throws RhinoException {
|
||||
|
@ -258,7 +258,7 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
|
||||
throws RhinoException {
|
||||
if (isPrototype) {
|
||||
|
@ -279,38 +279,38 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Scriptable getAdaptee() {
|
||||
return adaptee;
|
||||
}
|
||||
|
||||
|
||||
public void setAdaptee(Scriptable adaptee) {
|
||||
if (adaptee == null) {
|
||||
throw new NullPointerException("adaptee can not be null");
|
||||
}
|
||||
this.adaptee = adaptee;
|
||||
}
|
||||
|
||||
|
||||
//-- internals only below this point
|
||||
|
||||
|
||||
// map a property id. Property id can only be an Integer or String
|
||||
private Object mapToId(Object tmp) {
|
||||
if (tmp instanceof Double) {
|
||||
return new Integer(((Double)tmp).intValue());
|
||||
return Integer.valueOf(((Double)tmp).intValue());
|
||||
} else {
|
||||
return Context.toString(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static Scriptable getFunctionPrototype(Scriptable scope) {
|
||||
return ScriptableObject.getFunctionPrototype(scope);
|
||||
}
|
||||
|
||||
|
||||
private Function getAdapteeFunction(String name) {
|
||||
Object o = ScriptableObject.getProperty(getAdaptee(), name);
|
||||
return (o instanceof Function)? (Function)o : null;
|
||||
}
|
||||
|
||||
|
||||
private Object call(Function func, Object[] args) {
|
||||
Context cx = Context.getCurrentContext();
|
||||
Scriptable thisObj = getAdaptee();
|
||||
|
@ -321,12 +321,12 @@ public final class JSAdapter implements Scriptable, Function {
|
|||
throw Context.reportRuntimeError(re.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Scriptable prototype;
|
||||
private Scriptable parent;
|
||||
private Scriptable adaptee;
|
||||
private boolean isPrototype;
|
||||
|
||||
|
||||
// names of adaptee JavaScript functions
|
||||
private static final String GET_PROP = "__get__";
|
||||
private static final String HAS_PROP = "__has__";
|
||||
|
|
|
@ -106,7 +106,7 @@ public class PathWrapper extends ScriptableObject {
|
|||
Object[] ids = new Object[path.size()];
|
||||
|
||||
for (int i=0; i<ids.length; i++) {
|
||||
ids[i] = new Integer(i);
|
||||
ids[i] = Integer.valueOf(i);
|
||||
}
|
||||
|
||||
return ids;
|
||||
|
|
|
@ -93,8 +93,8 @@ public final class RhinoCore implements ScopeProvider {
|
|||
// optimization level for rhino engine, ranges from -1 to 9
|
||||
int optLevel = 0;
|
||||
|
||||
// language version - default to JS 1.8
|
||||
int languageVersion = 180;
|
||||
// language version - default to ES6
|
||||
int languageVersion = 200;
|
||||
|
||||
// debugger/tracer flags
|
||||
boolean hasDebugger = false;
|
||||
|
@ -569,7 +569,7 @@ public final class RhinoCore implements ScopeProvider {
|
|||
return arg;
|
||||
if (arg instanceof Date) {
|
||||
Date d = (Date) arg;
|
||||
Object[] args = { new Long(d.getTime()) };
|
||||
Object[] args = { Long.valueOf(d.getTime()) };
|
||||
return Context.getCurrentContext().newObject(global, "Date", args);
|
||||
}
|
||||
return Context.toObject(arg, global);
|
||||
|
@ -618,9 +618,9 @@ public final class RhinoCore implements ScopeProvider {
|
|||
} else if (arg instanceof Number) {
|
||||
Number n = (Number) arg;
|
||||
if (arg instanceof Float || arg instanceof Long) {
|
||||
return new Double(n.doubleValue());
|
||||
return Double.valueOf(n.doubleValue());
|
||||
} else if (!(arg instanceof Double)) {
|
||||
return new Integer(n.intValue());
|
||||
return Integer.valueOf(n.intValue());
|
||||
}
|
||||
} else if (arg instanceof INode) {
|
||||
// interpret HopObject as object/dict
|
||||
|
@ -1146,7 +1146,7 @@ public final class RhinoCore implements ScopeProvider {
|
|||
|
||||
// Convert java.util.Date objects to JavaScript Dates
|
||||
if (obj instanceof Date) {
|
||||
Object[] args = { new Long(((Date) obj).getTime()) };
|
||||
Object[] args = { Long.valueOf(((Date) obj).getTime()) };
|
||||
try {
|
||||
return cx.newObject(global, "Date", args);
|
||||
} catch (JavaScriptException nafx) {
|
||||
|
|
|
@ -106,7 +106,7 @@ public class Profiler implements Debugger {
|
|||
Scriptable thisObj, Object[] args) {
|
||||
|
||||
long time = System.nanoTime();
|
||||
timer.push(new Long(time));
|
||||
timer.push(Long.valueOf(time));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -216,6 +216,23 @@ public class DatabaseObject {
|
|||
}
|
||||
}
|
||||
|
||||
public RowSet executePreparedRetrieval(PreparedStatement statement) {
|
||||
ResultSet resultSet = null;
|
||||
|
||||
try {
|
||||
resultSet = statement.executeQuery();
|
||||
return new RowSet(statement.toString(), this, statement, resultSet);
|
||||
} catch (SQLException e) {
|
||||
lastError = e;
|
||||
try {
|
||||
if (statement != null) statement.close();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
statement = null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int executeCommand(String sql) {
|
||||
int count = 0;
|
||||
|
||||
|
@ -439,7 +456,7 @@ public class DatabaseObject {
|
|||
|
||||
// First return system or or prototype properties
|
||||
if (propertyName.equals("length")) {
|
||||
return new Integer(colNames.size());
|
||||
return Integer.valueOf(colNames.size());
|
||||
} else {
|
||||
if (resultSet == null) {
|
||||
lastError = new SQLException("Attempt to access a released result set");
|
||||
|
@ -498,12 +515,12 @@ public class DatabaseObject {
|
|||
case Types.BIGINT:
|
||||
case Types.SMALLINT:
|
||||
case Types.INTEGER:
|
||||
return new Long(resultSet.getLong(index));
|
||||
return Long.valueOf(resultSet.getLong(index));
|
||||
|
||||
case Types.REAL:
|
||||
case Types.FLOAT:
|
||||
case Types.DOUBLE:
|
||||
return new Double(resultSet.getDouble(index));
|
||||
return Double.valueOf(resultSet.getDouble(index));
|
||||
|
||||
case Types.DECIMAL:
|
||||
case Types.NUMERIC:
|
||||
|
@ -513,9 +530,9 @@ public class DatabaseObject {
|
|||
}
|
||||
|
||||
if (num.scale() > 0) {
|
||||
return new Double(num.doubleValue());
|
||||
return Double.valueOf(num.doubleValue());
|
||||
} else {
|
||||
return new Long(num.longValue());
|
||||
return Long.valueOf(num.longValue());
|
||||
}
|
||||
|
||||
case Types.VARBINARY:
|
||||
|
|
|
@ -554,8 +554,13 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
// If protected session cookies are enabled we also force a new session
|
||||
// if the existing session id doesn't match the client's ip address
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
addIPAddress(buffer, request.getRemoteAddr());
|
||||
addIPAddress(buffer, request.getHeader("X-Forwarded-For"));
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
if (ip != null && ip.length() != 0) {
|
||||
addIPAddress(buffer, ip);
|
||||
} else {
|
||||
addIPAddress(buffer, request.getRemoteAddr());
|
||||
}
|
||||
// Not sure, if this line can be removed
|
||||
addIPAddress(buffer, request.getHeader("Client-ip"));
|
||||
if (reqtrans.getSession() == null || !reqtrans.getSession().startsWith(buffer.toString())) {
|
||||
createSession(response, buffer.toString(), reqtrans, domain);
|
||||
|
@ -748,7 +753,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
* <strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed
|
||||
* individually on the parsed name and value elements, rather than on
|
||||
* the entire query string ahead of time, to properly deal with the case
|
||||
* where the name or value includes an encoded "=" or "&" character
|
||||
* where the name or value includes an encoded {@code =} or {@code &} character
|
||||
* that would otherwise be interpreted as a delimiter.
|
||||
*
|
||||
* NOTE: byte array data is modified by this method. Caller beware.
|
||||
|
|
|
@ -10,39 +10,39 @@ package helma.util;
|
|||
/**
|
||||
* The Protomatter Software License, Version 1.0
|
||||
* derived from The Apache Software License, Version 1.1
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. 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.
|
||||
*
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed for the
|
||||
* Protomatter Software Project
|
||||
* (http://protomatter.sourceforge.net/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
*
|
||||
* 4. The names "Protomatter" and "Protomatter Software Project" must
|
||||
* not be used to endorse or promote products derived from this
|
||||
* software without prior written permission. For written
|
||||
* permission, please contact support@protomatter.com.
|
||||
*
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Protomatter",
|
||||
* nor may "Protomatter" appear in their name, without prior written
|
||||
* permission of the Protomatter Software Project
|
||||
* (support@protomatter.com).
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
|
@ -103,7 +103,7 @@ public class CronJob {
|
|||
* cron.name1.minute = minute-list
|
||||
*
|
||||
* cron.name1.timeout = timeout-value
|
||||
*
|
||||
*
|
||||
* </pre></blockquote><p>
|
||||
*
|
||||
* And delivers corresponding <tt>CronJob</tt> objects in a collection.
|
||||
|
@ -450,27 +450,27 @@ public class CronJob {
|
|||
cal.setTime(date);
|
||||
|
||||
// try and short-circuit as fast as possible.
|
||||
Integer theYear = new Integer(cal.get(Calendar.YEAR));
|
||||
Integer theYear = Integer.valueOf(cal.get(Calendar.YEAR));
|
||||
if (!year.contains(ALL_VALUE) && !year.contains(theYear))
|
||||
return false;
|
||||
|
||||
Integer theMonth = new Integer(cal.get(Calendar.MONTH));
|
||||
Integer theMonth = Integer.valueOf(cal.get(Calendar.MONTH));
|
||||
if (!month.contains(ALL_VALUE) && !month.contains(theMonth))
|
||||
return false;
|
||||
|
||||
Integer theDay = new Integer(cal.get(Calendar.DAY_OF_MONTH));
|
||||
Integer theDay = Integer.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||
if (!day.contains(ALL_VALUE) && !day.contains(theDay))
|
||||
return false;
|
||||
|
||||
Integer theWeekDay = new Integer(cal.get(Calendar.DAY_OF_WEEK));
|
||||
Integer theWeekDay = Integer.valueOf(cal.get(Calendar.DAY_OF_WEEK));
|
||||
if (!weekday.contains(ALL_VALUE) && !weekday.contains(theWeekDay))
|
||||
return false;
|
||||
|
||||
Integer theHour = new Integer(cal.get(Calendar.HOUR_OF_DAY));
|
||||
Integer theHour = Integer.valueOf(cal.get(Calendar.HOUR_OF_DAY));
|
||||
if (!hour.contains(ALL_VALUE) && !hour.contains(theHour))
|
||||
return false;
|
||||
|
||||
Integer theMinute = new Integer(cal.get(Calendar.MINUTE));
|
||||
Integer theMinute = Integer.valueOf(cal.get(Calendar.MINUTE));
|
||||
if (!minute.contains(ALL_VALUE) && !minute.contains(theMinute))
|
||||
return false;
|
||||
|
||||
|
@ -484,7 +484,7 @@ public class CronJob {
|
|||
public void addYear(int year)
|
||||
{
|
||||
this.year.remove(ALL_VALUE);
|
||||
this.year.add(new Integer(year));
|
||||
this.year.add(Integer.valueOf(year));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -492,7 +492,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeYear(int year)
|
||||
{
|
||||
this.year.remove(new Integer(year));
|
||||
this.year.remove(Integer.valueOf(year));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -520,7 +520,7 @@ public class CronJob {
|
|||
public void addMonth(int month)
|
||||
{
|
||||
this.month.remove(ALL_VALUE);
|
||||
this.month.add(new Integer(month));
|
||||
this.month.add(Integer.valueOf(month));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -530,7 +530,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeMonth(int month)
|
||||
{
|
||||
this.month.remove(new Integer(month));
|
||||
this.month.remove(Integer.valueOf(month));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -556,7 +556,7 @@ public class CronJob {
|
|||
public void addDay(int day)
|
||||
{
|
||||
this.day.remove(ALL_VALUE);
|
||||
this.day.add(new Integer(day));
|
||||
this.day.add(Integer.valueOf(day));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -564,7 +564,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeDay(int day)
|
||||
{
|
||||
this.day.remove(new Integer(day));
|
||||
this.day.remove(Integer.valueOf(day));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -592,7 +592,7 @@ public class CronJob {
|
|||
public void addWeekday(int weekday)
|
||||
{
|
||||
this.weekday.remove(ALL_VALUE);
|
||||
this.weekday.add(new Integer(weekday));
|
||||
this.weekday.add(Integer.valueOf(weekday));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -602,7 +602,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeWeekday(int weekday)
|
||||
{
|
||||
this.weekday.remove(new Integer(weekday));
|
||||
this.weekday.remove(Integer.valueOf(weekday));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -628,7 +628,7 @@ public class CronJob {
|
|||
public void addHour(int hour)
|
||||
{
|
||||
this.hour.remove(ALL_VALUE);
|
||||
this.hour.add(new Integer(hour));
|
||||
this.hour.add(Integer.valueOf(hour));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -636,7 +636,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeHour(int hour)
|
||||
{
|
||||
this.hour.remove(new Integer(hour));
|
||||
this.hour.remove(Integer.valueOf(hour));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -662,7 +662,7 @@ public class CronJob {
|
|||
public void addMinute(int minute)
|
||||
{
|
||||
this.minute.remove(ALL_VALUE);
|
||||
this.minute.add(new Integer(minute));
|
||||
this.minute.add(Integer.valueOf(minute));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -670,7 +670,7 @@ public class CronJob {
|
|||
*/
|
||||
public void removeMinute(int minute)
|
||||
{
|
||||
this.minute.remove(new Integer(minute));
|
||||
this.minute.remove(Integer.valueOf(minute));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,253 +23,6 @@ import java.util.*;
|
|||
* for HTML output.
|
||||
*/
|
||||
public final class HtmlEncoder {
|
||||
|
||||
// transformation table for characters 128 to 255. These actually fall into two
|
||||
// groups, put together for efficiency: "Windows" chacacters 128-159 such as
|
||||
// "smart quotes", which are encoded to valid Unicode entities, and
|
||||
// valid ISO-8859 caracters 160-255, which are encoded to the symbolic HTML
|
||||
// entity. Everything >= 256 is encoded to a numeric entity.
|
||||
//
|
||||
// for mor on HTML entities see http://www.pemberley.com/janeinfo/latin1.html and
|
||||
// ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
|
||||
//
|
||||
static final String[] transform = {
|
||||
"€", // 128
|
||||
"", // empty string means character is undefined in unicode
|
||||
"‚",
|
||||
"ƒ",
|
||||
"„",
|
||||
"…",
|
||||
"†",
|
||||
"‡",
|
||||
"ˆ",
|
||||
"‰",
|
||||
"Š",
|
||||
"‹",
|
||||
"Œ",
|
||||
"",
|
||||
"Ž",
|
||||
"",
|
||||
"",
|
||||
"‘",
|
||||
"’",
|
||||
"“",
|
||||
"”",
|
||||
"•",
|
||||
"–",
|
||||
"—",
|
||||
"˜",
|
||||
"™",
|
||||
"š",
|
||||
"›",
|
||||
"œ",
|
||||
"",
|
||||
"ž",
|
||||
"Ÿ", // 159
|
||||
" ", // 160
|
||||
"¡",
|
||||
"¢",
|
||||
"£",
|
||||
"¤",
|
||||
"¥",
|
||||
"¦",
|
||||
"§",
|
||||
"¨",
|
||||
"©",
|
||||
"ª",
|
||||
"«",
|
||||
"¬",
|
||||
"­",
|
||||
"®",
|
||||
"¯",
|
||||
"°",
|
||||
"±",
|
||||
"²",
|
||||
"³",
|
||||
"´",
|
||||
"µ",
|
||||
"¶",
|
||||
"·",
|
||||
"¸",
|
||||
"¹",
|
||||
"º",
|
||||
"»",
|
||||
"¼",
|
||||
"½",
|
||||
"¾",
|
||||
"¿",
|
||||
"À",
|
||||
"Á",
|
||||
"Â",
|
||||
"Ã",
|
||||
"Ä",
|
||||
"Å",
|
||||
"Æ",
|
||||
"Ç",
|
||||
"È",
|
||||
"É",
|
||||
"Ê",
|
||||
"Ë",
|
||||
"Ì",
|
||||
"Í",
|
||||
"Î",
|
||||
"Ï",
|
||||
"Ð",
|
||||
"Ñ",
|
||||
"Ò",
|
||||
"Ó",
|
||||
"Ô",
|
||||
"Õ",
|
||||
"Ö",
|
||||
"×",
|
||||
"Ø",
|
||||
"Ù",
|
||||
"Ú",
|
||||
"Û",
|
||||
"Ü",
|
||||
"Ý",
|
||||
"Þ",
|
||||
"ß",
|
||||
"à",
|
||||
"á",
|
||||
"â",
|
||||
"ã",
|
||||
"ä",
|
||||
"å",
|
||||
"æ",
|
||||
"ç",
|
||||
"è",
|
||||
"é",
|
||||
"ê",
|
||||
"ë",
|
||||
"ì",
|
||||
"í",
|
||||
"î",
|
||||
"ï",
|
||||
"ð",
|
||||
"ñ",
|
||||
"ò",
|
||||
"ó",
|
||||
"ô",
|
||||
"õ",
|
||||
"ö",
|
||||
"÷",
|
||||
"ø",
|
||||
"ù",
|
||||
"ú",
|
||||
"û",
|
||||
"ü",
|
||||
"ý",
|
||||
"þ",
|
||||
"ÿ" // 255
|
||||
};
|
||||
|
||||
static final HashSet allTags = new HashSet();
|
||||
|
||||
static {
|
||||
allTags.add("a");
|
||||
allTags.add("abbr");
|
||||
allTags.add("acronym");
|
||||
allTags.add("address");
|
||||
allTags.add("applet");
|
||||
allTags.add("area");
|
||||
allTags.add("b");
|
||||
allTags.add("base");
|
||||
allTags.add("basefont");
|
||||
allTags.add("bdo");
|
||||
allTags.add("bgsound");
|
||||
allTags.add("big");
|
||||
allTags.add("blink");
|
||||
allTags.add("blockquote");
|
||||
allTags.add("bq");
|
||||
allTags.add("body");
|
||||
allTags.add("br");
|
||||
allTags.add("button");
|
||||
allTags.add("caption");
|
||||
allTags.add("center");
|
||||
allTags.add("cite");
|
||||
allTags.add("code");
|
||||
allTags.add("col");
|
||||
allTags.add("colgroup");
|
||||
allTags.add("del");
|
||||
allTags.add("dfn");
|
||||
allTags.add("dir");
|
||||
allTags.add("div");
|
||||
allTags.add("dl");
|
||||
allTags.add("dt");
|
||||
allTags.add("dd");
|
||||
allTags.add("em");
|
||||
allTags.add("embed");
|
||||
allTags.add("fieldset");
|
||||
allTags.add("font");
|
||||
allTags.add("form");
|
||||
allTags.add("frame");
|
||||
allTags.add("frameset");
|
||||
allTags.add("h1");
|
||||
allTags.add("h2");
|
||||
allTags.add("h3");
|
||||
allTags.add("h4");
|
||||
allTags.add("h5");
|
||||
allTags.add("h6");
|
||||
allTags.add("head");
|
||||
allTags.add("html");
|
||||
allTags.add("hr");
|
||||
allTags.add("i");
|
||||
allTags.add("iframe");
|
||||
allTags.add("img");
|
||||
allTags.add("input");
|
||||
allTags.add("ins");
|
||||
allTags.add("isindex");
|
||||
allTags.add("kbd");
|
||||
allTags.add("label");
|
||||
allTags.add("legend");
|
||||
allTags.add("li");
|
||||
allTags.add("link");
|
||||
allTags.add("listing");
|
||||
allTags.add("map");
|
||||
allTags.add("marquee");
|
||||
allTags.add("menu");
|
||||
allTags.add("meta");
|
||||
allTags.add("nobr");
|
||||
allTags.add("noframes");
|
||||
allTags.add("noscript");
|
||||
allTags.add("object");
|
||||
allTags.add("ol");
|
||||
allTags.add("option");
|
||||
allTags.add("optgroup");
|
||||
allTags.add("p");
|
||||
allTags.add("param");
|
||||
allTags.add("plaintext");
|
||||
allTags.add("pre");
|
||||
allTags.add("q");
|
||||
allTags.add("s");
|
||||
allTags.add("samp");
|
||||
allTags.add("script");
|
||||
allTags.add("select");
|
||||
allTags.add("small");
|
||||
allTags.add("span");
|
||||
allTags.add("strike");
|
||||
allTags.add("strong");
|
||||
allTags.add("style");
|
||||
allTags.add("sub");
|
||||
allTags.add("sup");
|
||||
allTags.add("table");
|
||||
allTags.add("tbody");
|
||||
allTags.add("td");
|
||||
allTags.add("textarea");
|
||||
allTags.add("tfoot");
|
||||
allTags.add("th");
|
||||
allTags.add("thead");
|
||||
allTags.add("title");
|
||||
allTags.add("tr");
|
||||
allTags.add("tt");
|
||||
allTags.add("u");
|
||||
allTags.add("ul");
|
||||
allTags.add("var");
|
||||
allTags.add("wbr");
|
||||
allTags.add("xmp");
|
||||
}
|
||||
|
||||
// HTML block tags need to suppress automatic newline to <br>
|
||||
// conversion around them to look good. However, they differ
|
||||
// in how many newlines around them should ignored. These sets
|
||||
|
@ -281,14 +34,19 @@ public final class HtmlEncoder {
|
|||
static {
|
||||
// actual block level elements
|
||||
semiBlockTags.add("address");
|
||||
semiBlockTags.add("dir");
|
||||
semiBlockTags.add("div");
|
||||
semiBlockTags.add("table");
|
||||
|
||||
blockTags.add("article");
|
||||
blockTags.add("aside");
|
||||
blockTags.add("blockquote");
|
||||
blockTags.add("center");
|
||||
blockTags.add("details");
|
||||
blockTags.add("dialog");
|
||||
blockTags.add("dd");
|
||||
semiBlockTags.add("div");
|
||||
blockTags.add("dl");
|
||||
blockTags.add("dt");
|
||||
blockTags.add("fieldset");
|
||||
blockTags.add("figcaption");
|
||||
blockTags.add("figure");
|
||||
blockTags.add("footer");
|
||||
blockTags.add("form");
|
||||
blockTags.add("h1");
|
||||
blockTags.add("h2");
|
||||
|
@ -296,27 +54,31 @@ public final class HtmlEncoder {
|
|||
blockTags.add("h4");
|
||||
blockTags.add("h5");
|
||||
blockTags.add("h6");
|
||||
blockTags.add("header");
|
||||
blockTags.add("hgroup");
|
||||
blockTags.add("hr");
|
||||
blockTags.add("isindex");
|
||||
blockTags.add("li");
|
||||
blockTags.add("main");
|
||||
blockTags.add("nav");
|
||||
blockTags.add("ol");
|
||||
blockTags.add("p");
|
||||
blockTags.add("pre");
|
||||
blockTags.add("section");
|
||||
semiBlockTags.add("table");
|
||||
blockTags.add("ul");
|
||||
|
||||
// additional semi/block elements
|
||||
blockTags.add("br");
|
||||
blockTags.add("center");
|
||||
semiBlockTags.add("dir");
|
||||
blockTags.add("frameset");
|
||||
blockTags.add("isindex");
|
||||
blockTags.add("td");
|
||||
semiBlockTags.add("th");
|
||||
|
||||
internalTags.add("menu");
|
||||
internalTags.add("noframes");
|
||||
internalTags.add("noscript");
|
||||
|
||||
/// to be treated as block level elements
|
||||
semiBlockTags.add("th");
|
||||
|
||||
blockTags.add("br");
|
||||
blockTags.add("dd");
|
||||
blockTags.add("dt");
|
||||
blockTags.add("frameset");
|
||||
blockTags.add("li");
|
||||
blockTags.add("td");
|
||||
|
||||
internalTags.add("tbody");
|
||||
internalTags.add("tfoot");
|
||||
internalTags.add("thead");
|
||||
|
@ -327,19 +89,27 @@ public final class HtmlEncoder {
|
|||
static final HashSet emptyTags = new HashSet();
|
||||
|
||||
static {
|
||||
// actual empty elements
|
||||
emptyTags.add("area");
|
||||
emptyTags.add("base");
|
||||
emptyTags.add("basefont");
|
||||
emptyTags.add("br");
|
||||
emptyTags.add("col");
|
||||
emptyTags.add("frame");
|
||||
emptyTags.add("embed");
|
||||
emptyTags.add("hr");
|
||||
emptyTags.add("img");
|
||||
emptyTags.add("input");
|
||||
emptyTags.add("isindex");
|
||||
emptyTags.add("keygen");
|
||||
emptyTags.add("link");
|
||||
emptyTags.add("meta");
|
||||
emptyTags.add("param");
|
||||
emptyTags.add("source");
|
||||
emptyTags.add("track");
|
||||
emptyTags.add("wbr");
|
||||
|
||||
// Obsolete or deprecated
|
||||
emptyTags.add("basefont");
|
||||
emptyTags.add("frame");
|
||||
emptyTags.add("isindex");
|
||||
}
|
||||
|
||||
static final byte TAG_NAME = 0;
|
||||
|
@ -357,7 +127,7 @@ public final class HtmlEncoder {
|
|||
/**
|
||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||
* Helma macros and HTML comments are passed through unescaped, while
|
||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
||||
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||
*/
|
||||
public final static String encode(String str) {
|
||||
if (str == null) {
|
||||
|
@ -381,7 +151,7 @@ public final class HtmlEncoder {
|
|||
/**
|
||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||
* Helma macros and HTML comments are passed through unescaped, while
|
||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
||||
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||
*/
|
||||
public final static void encode(String str, StringBuffer ret) {
|
||||
encode(str, ret, false, null);
|
||||
|
@ -390,7 +160,7 @@ public final class HtmlEncoder {
|
|||
/**
|
||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||
* Helma macros and HTML comments are passed through unescaped, while
|
||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
||||
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||
*
|
||||
* @param str the string to encode
|
||||
* @param ret the string buffer to encode to
|
||||
|
@ -493,8 +263,7 @@ public final class HtmlEncoder {
|
|||
insideCodeTag = false;
|
||||
}
|
||||
|
||||
if (((allowedTags == null) || allowedTags.contains(tagName)) &&
|
||||
allTags.contains(tagName) && !insideCodeTag) {
|
||||
if (((allowedTags == null) || allowedTags.contains(tagName)) && !insideCodeTag) {
|
||||
insideHtmlTag = insideTag = true;
|
||||
htmlQuoteChar = '\u0000';
|
||||
htmlTagMode = TAG_NAME;
|
||||
|
@ -577,7 +346,7 @@ public final class HtmlEncoder {
|
|||
int _entering = entering == SEMIBLOCK ? TEXT : entering;
|
||||
for (int k = linebreaks-1; k>=0; k--) {
|
||||
if (k >= swallowBreaks && k >= _entering && k >= exiting) {
|
||||
ret.append("<br class='helma-format' />");
|
||||
ret.append("<br class='helma-format'/>");
|
||||
}
|
||||
ret.append(newLine);
|
||||
}
|
||||
|
@ -977,32 +746,6 @@ public final class HtmlEncoder {
|
|||
}
|
||||
}
|
||||
|
||||
// test method
|
||||
public static String printCharRange(int from, int to) {
|
||||
StringBuffer response = new StringBuffer();
|
||||
|
||||
for (int i = from; i < to; i++) {
|
||||
response.append(i);
|
||||
response.append(" ");
|
||||
response.append((char) i);
|
||||
response.append(" ");
|
||||
|
||||
if (i < 128) {
|
||||
response.append((char) i);
|
||||
} else if ((i >= 128) && (i < 256)) {
|
||||
response.append(transform[i - 128]);
|
||||
} else {
|
||||
response.append("&#");
|
||||
response.append(i);
|
||||
response.append(";");
|
||||
}
|
||||
|
||||
response.append("\r\n");
|
||||
}
|
||||
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
// for testing...
|
||||
public static void main(String[] args) {
|
||||
for (int i = 0; i < args.length; i++)
|
||||
|
|
|
@ -161,15 +161,36 @@ public class Logger implements Log {
|
|||
// make sure we have a valid writer
|
||||
ensureOpen();
|
||||
|
||||
String color;
|
||||
int l = entries.size();
|
||||
|
||||
for (int i = 0; i < l; i++) {
|
||||
Entry entry = (Entry) entries.remove(0);
|
||||
|
||||
if (entry.level == "[TRACE] " || entry.level == "[DEBUG] ") {
|
||||
color = "\u001B[0m";
|
||||
} else if (entry.level == "[INFO] ") {
|
||||
color = "\u001B[0m";
|
||||
} else if (entry.level == "[WARN] ") {
|
||||
color = "\u001B[0;33m";
|
||||
} else if (entry.level == "[ERROR] ") {
|
||||
color = "\u001B[0;31m";
|
||||
} else if (entry.level == "[FATAL] ") {
|
||||
color = "\033[1;31m";
|
||||
} else {
|
||||
color = "\u001B[32m";
|
||||
}
|
||||
|
||||
writer.print(color);
|
||||
writer.print(entry.date);
|
||||
writer.print(entry.level);
|
||||
writer.print(entry.threadId);
|
||||
writer.println(entry.message);
|
||||
|
||||
if (entry.exception != null)
|
||||
entry.exception.printStackTrace(writer);
|
||||
|
||||
writer.print("\033[0m");
|
||||
}
|
||||
writer.flush();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue