diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 3d51f7d0..00000000
--- a/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# EditorConfig is awesome: https://EditorConfig.org
-
-root = true
-
-[*]
-end_of_line = lf
-indent_size = 2
-indent_style = spaces
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.java]
-indent_size = 4
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 4e5f4943..00000000
--- a/.eslintrc
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "eslint:recommended",
- "env": {
- "es6": true,
- "commonjs": true
- },
- "globals": {
- "app": "readonly",
- "HopObject": "readonly",
- "java": "readonly",
- "Packages": "readonly",
- "req": "readonly",
- "res": "readonly"
- }
-}
diff --git a/.github/actions/ssh/action.yml b/.github/actions/ssh/action.yml
deleted file mode 100644
index 5c4886ab..00000000
--- a/.github/actions/ssh/action.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-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}"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 69bcdeab..00000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-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
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
deleted file mode 100644
index 9eeb14b0..00000000
--- a/.github/workflows/deploy.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: Deploy
-
-on:
- workflow_dispatch:
- inputs:
- hostname:
- description: Hostname
- type: string
- required: true
- default: antville.org
-
-jobs:
- stage:
- runs-on: antville
-
- environment:
- name: production
- url: ${{ inputs.hostname }}
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Build with Gradle
- run: ./gradlew installDist
-
- - name: Copy build files to server
- run: |
- rsync ./build/install/helma/ ${{ inputs.hostname }}:./ \
- --verbose --archive --delete --compress \
- --filter '+ /bin' \
- --filter '+ /extras' \
- --filter '+ /launcher.jar' \
- --filter '- /lib/ext' \
- --filter '+ /lib' \
- --filter '+ /modules' \
- --filter '- /*'
-
- - name: Restart Helma
- run: ssh ${{ inputs.hostname }} restart
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index ac8a3d1a..00000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-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
diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml
deleted file mode 100644
index e470128c..00000000
--- a/.github/workflows/renovate.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Run Renovate
-
-on:
- schedule:
- - cron: "13 * * * *"
- workflow_dispatch:
-
-jobs:
- renovate:
- runs-on: antville
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Run Renovate
- # See This class provides access to a relational database through JDBC.
- * There are two convenient ways to create instances of this class. The first is to use {@link #getInstance helma.Database.getInstance()}
- * to obtain a connection to a DB that is defined in the application's
- * db.properties and managed by Helma. The second way is to define and create
- * a database connection locally using
- * {@link #createInstance helma.Database.createInstance()} and passing it
- * all necessary parameters. This class provides two ways of interaction:
- * The {@link #query} method allows to issue SQL queries, returning a result set.
- * The {@link #execute} provides a way to issue SQL statements that do not
- * return a result set. Database connections allocated by this class are be managed and eventually
- * disposed by Helma. Some of the parameters support shortcuts for known database products.
- * The helma.main.Server
. This class
- * should be invoked from a jar file in the Helma install directory in order to
- * be able to set up class and install paths.
- */
-public class Main {
- private Class serverClass;
- private Object server;
-
- private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Helma boot method. This retrieves the Helma home directory, creates the
- * classpath and invokes main() in helma.main.Server.
- *
- * @param args command line arguments
- *
- */
- public static void main(String[] args) {
- Main main = new Main();
- main.init(args);
- main.start();
- }
-
- public void init(String[] args) {
- try {
- String installDir = getInstallDir(args);
- ClassLoader loader = createClassLoader(installDir);
- // get the main server class
- serverClass = loader.loadClass("helma.main.Server");
- Class[] cargs = new Class[]{args.getClass()};
- Method loadServer = serverClass.getMethod("loadServer", cargs);
- Object[] nargs = new Object[]{args};
- // and invoke the static loadServer(String[]) method
- server = loadServer.invoke(null, nargs);
- Method init = serverClass.getMethod("init", EMPTY_CLASS_ARRAY);
- init.invoke(server, EMPTY_OBJECT_ARRAY);
- } catch (Exception x) {
- // unable to get Helma installation dir from launcher jar
- System.err.println("Unable to load Helma: ");
- x.printStackTrace();
- System.exit(2);
- }
- }
-
- public void start() {
- try {
- Method start = serverClass.getMethod("start", EMPTY_CLASS_ARRAY);
- start.invoke(server, EMPTY_OBJECT_ARRAY);
- } catch (Exception x) {
- // unable to get Helma installation dir from launcher jar
- System.err.println("Unable to start Helma: ");
- x.printStackTrace();
- System.exit(2);
- }
- }
-
- public void stop() {
- try {
- Method start = serverClass.getMethod("stop", EMPTY_CLASS_ARRAY);
- start.invoke(server, EMPTY_OBJECT_ARRAY);
- } catch (Exception x) {
- // unable to get Helma installation dir from launcher jar
- System.err.println("Unable to stop Helma: ");
- x.printStackTrace();
- System.exit(2);
- }
- }
-
- public void destroy() {
- try {
- Method start = serverClass.getMethod("shutdown", EMPTY_CLASS_ARRAY);
- start.invoke(server, EMPTY_OBJECT_ARRAY);
- } catch (Exception x) {
- // unable to get Helma installation dir from launcher jar
- System.err.println("Unable to shutdown Helma: ");
- x.printStackTrace();
- System.exit(2);
- }
- }
-
- static void addJars(ArrayList jarlist, File dir) throws MalformedURLException {
- File[] files = dir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- String n = name.toLowerCase();
- return n.endsWith(".jar") || n.endsWith(".zip"); //$NON-NLS-1$//$NON-NLS-2$
- }
- });
-
- if (files != null) {
- for (int i = 0; i < files.length; i++) {
- jarlist.add(new URL("file:" + files[i].getAbsolutePath())); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Create a server-wide ClassLoader from our install directory.
- * This will be used as parent ClassLoader for all application
- * ClassLoaders.
- *
- * @param installDir
- * @return the main classloader we'll be using
- * @throws MalformedURLException
- */
- public static ClassLoader createClassLoader(String installDir)
- throws MalformedURLException, UnsupportedEncodingException {
-
- // decode installDir in case it is URL-encoded
- installDir = URLDecoder.decode(installDir, System.getProperty("helma.urlEncoding", "UTF-8"));
-
- // set up the class path
- File libdir = new File(installDir, "lib");
- ArrayList jarlist = new ArrayList();
-
- // add all jar files from the lib directory
- addJars(jarlist, libdir);
-
- // add all jar files from the lib/ext directory
- addJars(jarlist, new File(libdir, "ext")); //$NON-NLS-1$
-
- URL[] urls = new URL[jarlist.size()];
-
- jarlist.toArray(urls);
-
- // find out if system classes should be excluded from class path
- String excludeSystemClasses = System.getProperty("helma.excludeSystemClasses");
-
- ClassLoader loader;
-
- if ("true".equalsIgnoreCase(excludeSystemClasses)) {
- loader = new URLClassLoader(urls, null);
- } else {
- loader = new URLClassLoader(urls);
- }
-
- // set the new class loader as context class loader
- Thread.currentThread().setContextClassLoader(loader);
- return loader;
- }
-
-
- /**
- * Get the Helma install directory from the command line -i argument or
- * from the Jar URL from which this class was loaded. Additionally, the
- * System property "helma.home" is set to the install directory path.
- *
- * @param args
- * @return the base install directory we're running in
- * @throws IOException
- * @throws MalformedURLException
- */
- public static String getInstallDir(String[] args)
- throws IOException, MalformedURLException {
- // check if home directory is set via command line arg. If not,
- // we'll get it from the location of the jar file this class
- // has been loaded from.
- String installDir = null;
-
- // first, try to get helma home dir from command line options
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("-i") && ((i + 1) < args.length)) {
- installDir = args[i + 1];
- }
- }
-
- // try to get Helma installation directory
- if (installDir == null) {
- URL launcherUrl = ClassLoader.getSystemClassLoader()
- .getResource("helma/main/launcher/Main.class"); //$NON-NLS-1$
-
- // this is a JAR URL of the form
- // jar:
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Array.js')
- */
-
-/**
- * Check if this array contains a specific value.
- * @external
- * @memberof {Array}
- * @param {Object} val the value to check
- * @return {boolean} true if the value is contained
- */
-Array.prototype.contains = Array.prototype.includes
-
-/**
- * Retrieve the union set of a bunch of arrays
- * @external
- * @memberof {Array}
- * @param {Array} array1,... the arrays to unify
- * @return {Array} the union set
- */
-Array.union = function() {
- return Array.from(arguments).reduce((result, array) => {
- return result.concat(array.filter(element => !result.includes(element)));
- }, []);
-};
-
-/**
- * Retrieve the intersection set of a bunch of arrays
- * @external
- * @memberof {Array}
- * @param {Array} array1,... the arrays to intersect
- * @return {Array} the intersection set
- */
-Array.intersection = function() {
- return Array.from(arguments).reduce((result, array) => {
- return result.filter(element => array.includes(element));
- });
-};
-
-// prevent any newly added properties from being enumerated
-for (var i in Array)
- Array.dontEnum(i);
-for (var i in Array.prototype)
- Array.prototype.dontEnum(i);
diff --git a/modules/core/Date.js b/modules/core/Date.js
deleted file mode 100644
index 76bc5f36..00000000
--- a/modules/core/Date.js
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2005 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Date.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Adds useful methods to the JavaScript Date type.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Date.js')
- */
-
-Date.ONESECOND = 1000;
-Date.ONEMINUTE = 60 * Date.ONESECOND;
-Date.ONEHOUR = 60 * Date.ONEMINUTE;
-Date.ONEDAY = 24 * Date.ONEHOUR;
-Date.ONEWEEK = 7 * Date.ONEDAY;
-Date.ONEMONTH = 30 * Date.ONEDAY;
-Date.ONEYEAR = 12 * Date.ONEMONTH;
-Date.ISOFORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
-
-
-/**
- * Format a Date to a string.
- * For details on the format pattern, see
- * http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html *
- * @external
- * @memberof {Date}
- *
- * @param String Format pattern
- * @param Object Java Locale Object (optional)
- * @param Object Java TimeZone Object (optional)
- * @return String formatted Date
- * @see http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
- */
-Date.prototype.format = function (format, locale, timezone) {
- if (!format)
- return this.toString();
- var sdf = locale ? new java.text.SimpleDateFormat(format, locale)
- : new java.text.SimpleDateFormat(format);
- if (timezone && timezone != sdf.getTimeZone())
- sdf.setTimeZone(timezone);
- return sdf.format(this);
-};
-
-
-/**
- * set the date/time to UTC by subtracting
- * the timezone offset
- * @external
- * @memberof {Date}
- */
-Date.prototype.toUtc = function() {
- this.setMinutes(this.getMinutes() + this.getTimezoneOffset());
-};
-
-
-/**
- * set the date/time to local time by adding
- * the timezone offset
- * @external
- * @memberof {Date}
- */
-Date.prototype.toLocalTime = function() {
- this.setMinutes(this.getMinutes() - this.getTimezoneOffset());
-};
-
-
-/**
- * returns the difference between this and another
- * date object in milliseconds
- * @external
- * @memberof {Date}
- */
-Date.prototype.diff = function(dateObj) {
- return this.getTime() - dateObj.getTime();
-};
-
-
-/**
- * return the timespan to current date/time or a different Date object
- * @external
- * @memberof {Date}
- * @param Object parameter object containing optional properties:
- * .now = String to use if difference is < 1 minute
- * .day|days = String to use for single|multiple day(s)
- * .hour|hours = String to use for single|multiple hour(s)
- * .minute|minutes = String to use for single|multiple minute(s)
- * .date = Date object to use for calculating the timespan
- * @return Object containing properties:
- * .isFuture = (Boolean)
- * .span = (String) timespan
- * @see Date.prototype.getAge
- * @see Date.prototype.getExpiry
- */
-Date.prototype.getTimespan = function(param) {
- if (!param)
- param = {date: new Date()};
- else if (!param.date)
- param.date = new Date();
-
- var result = {isFuture: this > param.date};
- var diff = Math.abs(param.date.diff(this));
- var age = {days: Math.floor(diff / Date.ONEDAY),
- hours: Math.floor((diff % Date.ONEDAY) / Date.ONEHOUR),
- minutes: Math.floor((diff % Date.ONEHOUR) / Date.ONEMINUTE)};
-
- res.push();
- if (diff < Date.ONEMINUTE)
- res.write(param.now || "now");
- else {
- var arr = [{one: "day", many: "days"},
- {one: "hour", many: "hours"},
- {one: "minute", many: "minutes"}];
- for (var i in arr) {
- var value = age[arr[i].many];
- if (value != 0) {
- var prop = (value == 1 ? arr[i].one : arr[i].many);
- res.write(value);
- res.write(" ");
- res.write(param[prop] || prop);
- if (i < arr.length -1)
- res.write(param.delimiter || ", ");
- }
- }
- }
- result.span = res.pop();
- return result;
-};
-
-
-/**
- * return the past timespan between this Date object and
- * the current Date or a different Date object
- * @see Date.prototype.getTimespan
- * @external
- * @memberof {Date}
- */
-Date.prototype.getAge = function(param) {
- var age = this.getTimespan(param);
- if (!age.isFuture)
- return age.span;
- return null;
-};
-
-
-/**
- * return the future timespan between this Date object and
- * the current Date or a different Date object
- * @see Date.prototype.getTimespan
- * @external
- * @memberof {Date}
- */
-Date.prototype.getExpiry = function(param) {
- var age = this.getTimespan(param);
- if (age.isFuture)
- return age.span;
- return null;
-};
-
-
-/**
- * checks if a date object equals another date object
- * @external
- * @memberof {Date}
- * @param Object Date object to compare
- * @param Int indicating how far the comparison should go
- * @return Boolean
- */
-Date.prototype.equals = function(date, extend) {
- if (!extend)
- extend = Date.ONEDAY;
- switch (extend) {
- case Date.ONESECOND:
- if (this.getSeconds() != date.getSeconds())
- return false;
- case Date.ONEMINUTE:
- if (this.getMinutes() != date.getMinutes())
- return false;
- case Date.ONEHOUR:
- if (this.getHours() != date.getHours())
- return false;
- case Date.ONEDAY:
- if (this.getDate() != date.getDate())
- return false;
- case Date.ONEMONTH:
- if (this.getMonth() != date.getMonth())
- return false;
- case Date.ONEYEAR:
- if (this.getFullYear() != date.getFullYear())
- return false;
- }
- return true;
-};
-
-
-// prevent any newly added properties from being enumerated
-for (var i in Date)
- Date.dontEnum(i);
-for (var i in Date.prototype)
- Date.prototype.dontEnum(i);
diff --git a/modules/core/Filters.js b/modules/core/Filters.js
deleted file mode 100644
index f1b94acf..00000000
--- a/modules/core/Filters.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2007 Helma Software. All Rights Reserved.
- *
- * $RCSfile$
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Implements some useful macro filters.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Filters.js')
- */
-
-app.addRepository('modules/core/String.js');
-
-/**
- * Transforms a string to lowercase.
- *
- * @see String.prototype.toLowerCase
- */
-function lowercase_filter(input) {
- return (input || "").toString().toLowerCase();
-}
-
-
-/**
- * Transforms a string to uppercase.
- *
- * @see String.prototype.toUpperCase
- */
-function uppercase_filter(input) {
- return (input || "").toString().toUpperCase();
-}
-
-
-/**
- * Transforms the first Character of a string to uppercase.
- *
- * @see String.prototype.capitalize
- */
-function capitalize_filter(input) {
- return (input || "").toString().capitalize();
-}
-
-
-/**
- * Transforms the first Character of each word in a string
- * to uppercase.
- *
- * @see String.prototype.titleize
- */
-function titleize_filter(input) {
- return (input || "").toString().titleize();
-}
-
-
-/**
- * Cuts a String at a certain position, and
- * optionally appends a suffix, if truncation
- * has occurred.
- *
- * @see String.prototype.head
- * @param limit Maximum length
- * @param clipping Appended String, default is the empty String
- */
-function truncate_filter(input, param, limit, clipping) {
- var limit = param.limit != null ? param.limit : limit;
- var clipping = param.clipping || clipping || "";
- return (input || "").toString().head(limit, clipping);
-}
-
-
-/**
- * Removes leading and trailing whitespaces.
- *
- * @see String.prototype.trim
- */
-function trim_filter(input) {
- return (input || "").toString().trim();
-}
-
-
-/**
- * Removes all tags from a String.
- * Currently simply wraps Helma's stripTags-method.
- *
- * @see global.stripTags
- */
-function stripTags_filter(input) {
- return stripTags((input || "").toString());
-};
-
-
-/**
- * Escapes the characters in a String using XML entities.
- * Currently simply wraps Helma's encodeXml-method.
- *
- * @see global.encodeXml
- */
-function escapeXml_filter(input) {
- return encodeXml((input || "").toString());
-}
-
-
-/**
- * Escapes the characters in a String using HTML entities.
- *
- * @see http://www.google.com/codesearch?q=escapeHtml
- */
-function escapeHtml_filter(input) {
- var replace = Packages.org.eclipse.jetty.util.StringUtil.replace;
- var str = (input || "").toString();
- return replace(replace(replace(replace(str, '&', '&'), '"', '"'), '>', '>'), '<', '<');
-}
-
-var h_filter = escapeHtml_filter;
-
-
-/**
- * Escapes the characters in a String to be suitable
- * to use as an HTTP parameter value.
- *
- * @see http://www.google.com/codesearch?q=escapeUrl
- * @param charset Optional String. The name of a supported
- * character encoding.
- */
-function escapeUrl_filter(input, param, charset) {
- var charset = param.charset || charset || app.getCharset();
- return java.net.URLEncoder.encode(input || "", charset);
-}
-
-
-/**
- * Escapes a string so it may be used in JavaScript String
- * definitions.
- */
-function escapeJavaScript_filter(input) {
- var replace = Packages.org.eclipse.jetty.util.StringUtil.replace;
- var str = (input || "").toString();
- return replace(replace(replace(replace(replace(str, '"', '\\"'), "'", "\\'"), '\n', '\\n'), '\r', '\\r'), '\t', '\\t');
-}
-
-
-/**
- * Replaces linebreaks with HTML linebreaks.
- */
-function linebreakToHtml_filter(input) {
- var replace = Packages.org.eclipse.jetty.util.StringUtil.replace;
- var str = (input || "").toString();
- return replace(str, '\n', '
');
-}
-
-
-/**
- * Performs a string replacement.
- *
- * @param old
- * @param new
- */
-function replace_filter(input, param, oldString, newString) {
- var str = String(input || '');
- var oldString = param.old || oldString;
- var newString = param['new'] || newString;
- return str.replace(new RegExp(oldString, 'g'), newString);
-}
-
-
-/**
- * Returns a substring. Simply wraps the javascript
- * method 'substring'.
- *
- * @see String.prototype.substring
- * @param from
- * @param to
- */
-function substring_filter(input, param, from, to) {
- var from = param.from != null ? param.from : from;
- var to = param.to != null ? param.to : to;
- var str = (input || "").toString();
- return str.substring(from, to);
-}
-
-
-/**
- * Returns a formatted string representation of a Date.
- * Simply wraps javascripts Date.format-method.
- *
- * @see Date.prototype.format
- * @param format
- */
-function dateFormat_filter(input, param, format) {
- var format = param.format || format;
- if (!input) {
- return;
- } else {
- return input.format(format);
- }
-}
diff --git a/modules/core/Global.js b/modules/core/Global.js
deleted file mode 100644
index 41e32357..00000000
--- a/modules/core/Global.js
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2005 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Global.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Adds useful global macros.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Global.js')
- */
-
-app.addRepository("modules/core/String.js");
-
-
-/**
- * write out a property contained in app.properties
- * @param Object containing the name of the property
- */
-function property_macro(param, name) {
- res.write(getProperty(name || param.name) || String.NULL);
- return;
-}
-
-
-/**
- * wrapper to output a string from within a skin
- * just to be able to use different encodings
- * @param Object containing the string as text property
- */
-function write_macro(param, text) {
- res.write(param.text || text || String.NULL);
- return;
-}
-
-
-/**
- * renders the current datetime
- * @param Object containing a formatting string as format property
- */
-function now_macro(param) {
- var d = new Date();
- if (param.format) {
- try {
- res.write(d.format(param.format));
- } catch (e) {
- res.write('[Invalid date format]');
- }
- } else if (param.as == "timestamp") {
- res.write(d.getTime());
- } else {
- res.write(d);
- }
- return;
-}
-
-
-/**
- * renders a global skin
- */
-var skin_macro = function(param, name) {
- var skinName = name || param.name;
- if (skinName) {
- renderSkin(skinName, param);
- }
- return;
-}
-
-/**
- * Encodes a string for HTML output and inserts linebreak tags.
- *
- * Performs the following string manipulations:
- * All line breaks (i.e. line feeds) are replaced with
tags.
- * All special characters are being replaced with their equivalent HTML entity.
- * Existing markup tags are being encoded.
- *
- * @param {string} text
- * The string to encode for HTML output.
- * @param {boolean} [encodeNewLine = true]
- * If or if not to encode line breaks (i.e. line feeds).
- * @return {string}
- * The encoded string.
- */
-function encode(text, encodeNewLine) {
- text = String(text);
-
- if (text === null || !text.length) return text;
- var buffer = [];
- if (typeof encodeNewLine === 'undefined') encodeNewLine = true;
-
- for (var i = 0, len = text.length; i < len; i += 1) {
- var char = text.charAt(i);
-
- switch (char) {
- case '<':
- buffer.push('<');
- break;
-
- case '>':
- buffer.push('>');
- break;
-
- case '&':
- buffer.push('&');
- break;
-
- case '"':
- buffer.push('"');
- break;
-
- case '\n':
- if (encodeNewLine) {
- buffer.push("
");
- }
- buffer.push('\n');
- break;
-
- default:
- buffer.push(char);
- }
- }
-
- return buffer.join('');
-}
-
-/**
- * Encodes a string for XML output.
- *
- * Performs the following string manipulations:
- * All special characters are being replaced with their equivalent HTML entity.
- * Existing tags, single and double quotes, as well as ampersands are being encoded.
- * Some invalid XML characters below '0x20' are removed
- *
- * @param {string} text
- * The string to encode for XML output.
- * @return {string}
- * The string encoded for XML output.
- */
-function encodeXml(text) {
- text = String(text);
-
- if (text === null || !text.length) return text;
- var buffer = [];
-
- for (var i = 0, len = text.length; i < len; i += 1) {
- var char = text.charAt(i);
-
- switch (char) {
- case '<':
- buffer.push('<');
- break;
-
- case '>':
- buffer.push('>');
- break;
-
- case '&':
- buffer.push('&');
- break;
-
- case '"':
- buffer.push('"');
- break;
-
- case '\'':
- buffer.push(''');
- break;
-
- default:
- var charCode = text.charCodeAt(i);
- if (charCode < 0x20) {
- // sort out invalid XML characters below 0x20 - all but 0x9, 0xA and 0xD.
- // The trick is an adaption of java.lang.Character.isSpace().
- if (((((1 << 0x9) | (1 << 0xA) | (1 << 0xD)) >> charCode) & 1) !== 0) {
- buffer.push(char);
- }
- } else {
- buffer.push(char);
- }
- }
- }
-
- return buffer.join('');
-}
-
-/**
- * Encodes a string for HTML output, leaving linebreaks untouched.
- *
- * Performs the following string manipulations:
- * Unlike encode, leaves linebreaks untouched. This is what you usually want to do for encoding form content (esp.
- * with text input values).
- * All special characters (i.e. non ASCII) are being replaced with their equivalent HTML entity.
- * Existing markup tags are being encoded.
- *
- * @param {string} text
- * The string to format for HTML output.
- * @return {string}
- * The string formatted for HTML output.
- */
-var encodeForm = function(text) {
- text = String(text);
-
- if (text === null || !text.length) return text;
-
- return encode(text, false);
-};
-
-/**
- * Removes any markup tags contained in the passed string, and returns the modified string.
- *
- * @param {string} markup
- * The text that is to be stripped of tags.
- * @return {string}
- * The text with the tags stripped out.
- */
-var stripTags = function (markup) {
- if (!markup) return '';
-
- var chars = String(markup).split('');
- var charCounter = 0;
- var inTag = false;
-
- for (var i = 0, len = markup.length; i < len; i += 1) {
- if (chars[i] === '<') inTag = true;
-
- if (!inTag) {
- if (i > charCounter) {
- chars[charCounter] = chars[i];
- }
-
- charCounter += 1;
- }
-
- if (chars[i] === '>') {
- inTag = false;
- }
- }
-
- if (i > charCounter) {
- chars.length = charCounter;
- return chars.join('');
- }
-
- return markup;
-};
diff --git a/modules/core/HopObject.js b/modules/core/HopObject.js
deleted file mode 100644
index 507177cb..00000000
--- a/modules/core/HopObject.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2005 Helma Software. All Rights Reserved.
- *
- * $RCSfile: HopObject.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Adds useful methods to Helma's built-in HopObject prototype.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/HopObject.js')
- */
-
-app.addRepository("modules/core/Number.js");
-app.addRepository("modules/core/String.js");
-
-
-/**
- * Iterates over each child node of the HopObject.
- * @external
- * @memberof {HopObject}
- * @param {Function} callback The callback function to be
- * called for each child node. On every call the first
- * argument of this function is set to the current value
- * of the counter variable i
.
- */
-HopObject.prototype.forEach = function(callback) {
- if (!callback || callback instanceof Function == false) {
- return;
- }
- for (var i=0; i
- *
- * @external
- * @memberof {HopObject}
- * @param {Object} param The default macro parameter
- * @param {String} name The default name for a child node
- */
-HopObject.prototype.size_macro = function(param, name) {
- var EMPTYSTR = "";
- var n = this.size();
- if (name) {
- var text;
- var plural = name.endsWith("s") ? "es" : "s";
- if (n > 0) {
- if (n > 1) {
- text = n + " " + name + plural;
- } else {
- text = (param.one !== null) ? param.one : "one " + name;
- }
- } else {
- text = (param.none !== null) ? param.none : "no " + name + plural;
- }
- res.write(text);
- } else {
- res.write(n);
- }
- return;
-};
diff --git a/modules/core/JSON.js b/modules/core/JSON.js
deleted file mode 100644
index 56dfb991..00000000
--- a/modules/core/JSON.js
+++ /dev/null
@@ -1,2 +0,0 @@
-// This file intentionally left blank to prevent legacy code from
-// breaking when trying to include the obsolete JSON module.
diff --git a/modules/core/Number.js b/modules/core/Number.js
deleted file mode 100644
index 1f460109..00000000
--- a/modules/core/Number.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Number.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Adds useful methods to the JavaScript Number type.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Number.js')
- */
-
-/**
- * format a Number to a String
- * @external
- * @memberof {Number}
- * @param String Format pattern
- * @param java.util.Locale An optional Locale instance
- * @return String Number formatted to a String
- */
-Number.prototype.format = function(fmt, locale) {
- var symbols;
- if (locale != null) {
- symbols = new java.text.DecimalFormatSymbols(locale);
- } else {
- symbols = new java.text.DecimalFormatSymbols();
- }
- var df = new java.text.DecimalFormat(fmt || "###,##0.##", symbols);
- return df.format(0 + this); // addition with 0 prevents exception
-};
-
-
-/**
- * return the percentage of a Number
- * according to a given total Number
- * @external
- * @memberof {Number}
- * @param Int Total
- * @param String Format Pattern
- * @param java.util.Locale An optional Locale instance
- * @return Int Percentage
- */
-Number.prototype.toPercent = function(total, fmt, locale) {
- if (!total)
- return (0).format(fmt, locale);
- var p = this / (total / 100);
- return p.format(fmt, locale);
-};
-
-
-/**
- * factory to create functions for sorting objects in an array
- * @external
- * @memberof {Number}
- * @param String name of the field each object is compared with
- * @param Number order (ascending or descending)
- * @return Function ready for use in Array.prototype.sort
- */
-Number.Sorter = function(field, order) {
- if (!order)
- order = 1;
- return function(a, b) {
- return (a[field] - b[field]) * order;
- };
-};
-
-Number.Sorter.ASC = 1;
-Number.Sorter.DESC = -1;
-
-
-// prevent any newly added properties from being enumerated
-for (var i in Number)
- Number.dontEnum(i);
-for (var i in Number.prototype)
- Number.prototype.dontEnum(i);
diff --git a/modules/core/Object.js b/modules/core/Object.js
deleted file mode 100644
index 0bf53006..00000000
--- a/modules/core/Object.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Object.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Adds useful methods to the JavaScript Object type.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/Object.js')
- */
-
-app.addRepository('modules/core/Global.js');
-
-/**
- * Copies the properties of this object into a clone.
- * @external
- * @memberof {Object}
- * @param {Object} clone The optional target object
- * @param {Boolean} recursive If true child objects are cloned as well, otherwise
- * the clone contains references to the child objects
- * @returns The resulting object
- */
-Object.prototype.clone = function(clone, recursive) {
-
- var getValue = function(value, recursive) {
- if (recursive !== true || value == null
- || (typeof (value) !== "object" && typeof (value) !== "function")) {
- return value;
- }
- return value.clone(null, recursive);
- };
-
- if (typeof (this) === "object") {
- if (this === null) {
- return null;
- }
- switch (this.constructor) {
- case String:
- case Number:
- case Boolean:
- case Date:
- return new this.constructor(this.valueOf());
-
- case Array:
- return this.map(function(value) {
- return getValue(value, recursive);
- });
-
- default:
- if (clone == null) {
- clone = new this.constructor();
- }
- for ( var propName in this) {
- clone[propName] = getValue(this[propName], recursive);
- }
- return clone;
- }
- } else if (typeof (this) === "function" && this.constructor === RegExp) {
- return new RegExp(this.valueOf());
- }
- return this;
-};
-
-
-/**
- * reduce an extended object (ie. a HopObject)
- * to a generic javascript object
- * @external
- * @memberof {Object}
- * @param HopObject the HopObject to be reduced
- * @return Object the resulting generic object
- */
-Object.prototype.reduce = function(recursive) {
- var result = {};
- for (var i in this) {
- if (this[i] instanceof HopObject == false)
- result[i] = this[i];
- else if (recursive)
- result[i] = this.reduce(true);
- }
- return result;
-};
-
-
-/**
- * print the contents of an object for debugging
- * @external
- * @memberof {Object}
- * @param Object the object to dump
- * @param Boolean recursive flag (if true, dump child objects, too)
- */
-Object.prototype.dump = function(recursive) {
- var beginList = "";
- var endList = "
";
- var beginItem = "
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/core/String.js')
- */
-
-app.addRepository('modules/core/Global.js');
-
-/**
- * checks if a date format pattern is correct
- * @external
- * @memberof {String}
- * @return Boolean true if the pattern is correct
- */
-String.prototype.isDateFormat = function() {
- try {
- new java.text.SimpleDateFormat(this);
- return true;
- } catch (err) {
- return false;
- }
-};
-
-
-/**
- * parse a timestamp into a date object. This is used when users
- * want to set createtime explicitly when creating/editing stories.
- * @external
- * @memberof {String}
- * @param String date format to be applied
- * @param Object Java TimeZone Object (optional)
- * @return Object contains the resulting date
- */
-String.prototype.toDate = function(format, timezone) {
- var sdf = res.data._dateformat;
- if (!sdf) {
- sdf = new java.text.SimpleDateFormat(format);
- res.data._dateformat = sdf;
- } else if (format != sdf.toPattern())
- sdf.applyPattern(format);
- if (timezone && timezone != sdf.getTimeZone())
- sdf.setTimeZone(timezone);
- try {
- return new Date(sdf.parse(this).getTime());
- } catch (err) {
- return null;
- }
-};
-
-
-/**
- * function checks if the string passed contains any characters that
- * are forbidden in URLs and tries to create a java.net.URL from it
- * FIXME: probably deprecated -> helma.Url
- * @external
- * @memberof {String}
- * @return Boolean
- * @see helma.Url.PATTERN
- */
-String.prototype.isUrl = function() {
- return String.URLPATTERN.test(this);
-};
-
-
-/**
- * function checks if the string passed contains any characters
- * that are forbidden in image- or filenames
- * @external
- * @memberof {String}
- * @return Boolean
- */
-String.prototype.isFileName = function() {
- return !String.FILEPATTERN.test(this);
-};
-
-
-/**
- * function cleans the string passed as argument from any characters
- * that are forbidden or shouldn't be used in filenames
- * @external
- * @memberof {String}
- * @return Boolean
- */
-String.prototype.toFileName = function() {
- return this.replace(new RegExp(String.FILEPATTERN.source, "g"), String.NULL);
-};
-
-
-/**
- * function checks a string for a valid color value in hexadecimal format.
- * it may also contain # as first character
- * @external
- * @memberof {String}
- * @returns Boolean false, if string length (without #) > 6 or < 6 or
- * contains any character which is not a valid hex value
- */
-String.prototype.isHexColor = function() {
- var str = this;
- if (this.indexOf("#") == 0)
- str = this.substring(1);
- if (str.length != 6)
- return false;
- return !String.HEXPATTERN.test(str);
-};
-
-
-/**
- * converts a string into a hexadecimal color
- * representation (e.g. "ffcc33"). also knows how to
- * convert a color string like "rgb (255, 204, 51)".
- * @external
- * @memberof {String}
- * @return String the resulting hex color (w/o "#")
- */
-String.prototype.toHexColor = function() {
- if (this.startsWith("rgb")) {
- res.push();
- var col = this.replace(/[^0-9,]/g, String.NULL);
- var parts = col.split(",");
- for (var i in parts) {
- var num = parseInt(parts[i], 10);
- var hex = num.toString(16);
- res.write(hex.pad("0", 2, String.LEFT));
- }
- return res.pop();
- }
- var col = this.replace(new RegExp(String.HEXPATTERN.source), String.NULL);
- return col.toLowerCase().pad("0", 6, String.LEFT);
-};
-
-
-/**
- * function returns true if the string contains
- * only a-z and 0-9 (case insensitive!)
- * @external
- * @memberof {String}
- * @return Boolean true in case string is alpha, false otherwise
- */
-String.prototype.isAlphanumeric = function() {
- if (!this.length)
- return false;
- return !String.ANUMPATTERN.test(this);
-};
-
-
-/**
- * function cleans a string by throwing away all
- * non-alphanumeric characters
- * @external
- * @memberof {String}
- * @return cleaned string
- */
-String.prototype.toAlphanumeric = function() {
- return this.replace(new RegExp(String.ANUMPATTERN.source, "g"), String.NULL);
-};
-
-
-/**
- * function returns true if the string contains
- * only characters a-z
- * @external
- * @memberof {String}
- * @return Boolean true in case string is alpha, false otherwise
- */
-String.prototype.isAlpha = function() {
- if (!this.length)
- return false;
- return !String.APATTERN.test(this);
-};
-
-
-/**
- * function returns true if the string contains
- * only 0-9
- * @external
- * @memberof {String}
- * @return Boolean true in case string is numeric, false otherwise
- */
-String.prototype.isNumeric = function() {
- if (!this.length)
- return false;
- return !String.NUMPATTERN.test(this);
-};
-
-
-/**
- * transforms the first n characters of a string to uppercase
- * @external
- * @memberof {String}
- * @param Number amount of characters to transform
- * @return String the resulting string
- */
-String.prototype.capitalize = function(limit) {
- if (limit == null)
- limit = 1;
- var head = this.substring(0, limit);
- var tail = this.substring(limit, this.length);
- return head.toUpperCase() + tail.toLowerCase();
-};
-
-
-/**
- * transforms the first n characters of each
- * word in a string to uppercase
- * @external
- * @memberof {String}
- * @return String the resulting string
- */
-String.prototype.titleize = function() {
- var parts = this.split(" ");
- res.push();
- for (var i in parts) {
- res.write(parts[i].capitalize());
- if (i < parts.length-1)
- res.write(" ");
- }
- return res.pop();
-};
-
-
-/**
- * translates all characters of a string into HTML entities
- * @external
- * @memberof {String}
- * @return String translated result
- */
-String.prototype.entitize = function() {
- res.push();
- for (var i=0; i
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Aspects.js')
- */
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Library for adding Aspects
- *
- * Provides static methods to wrap existing functions
- * inside a javascript closure in order to add additional
- * behavior without overriding the existing one.
- *
- * Based on code by roman porotnikov,
- * http://www.jroller.com/page/deep/20030701
- *
- * Note: Each prototype that uses aspects must implement a method
- * onCodeUpdate() to prevent aspects being lost when the prototype
- * is re-compiled
- *
- * @constructor
- */
-helma.Aspects = function() {
- return this;
-};
-
-
-/** @ignore */
-helma.Aspects.toString = function() {
- return "[helma.Aspects]";
-};
-
-
-/** @ignore */
-helma.Aspects.prototype.toString = function() {
- return "[helma.Aspects Object]";
-};
-
-
-/**
- * Adds a function to be called before the orginal function.
- *
- * The return value of the added function needs to provide the
- * array of arguments that is passed to the original function.
- * The added function receives an array of the original arguments,
- * the original function and the scope object of the original
- * function as its parameters.
- *
- * @param {Object} obj The object of which the original function is a property
- * @param {String} fname The property name of the original function
- * @param {Function} before The function to be called before the original function
- * @returns Function A new function, wrapping the original function
- * @type Function
- */
-helma.Aspects.prototype.addBefore = function(obj, fname, before) {
- var oldFunc = obj[fname];
- obj[fname] = function() {
- return oldFunc.apply(this, before(arguments, oldFunc, this));
- }
- return;
-};
-
-
-/**
- * Adds a function to be called after an existing function.
- *
- * The return value of the original function is passed to the
- * added function as its first argument. In addition, the added
- * function also receives an array of the original arguments,
- * the original function and the scope object of the original
- * function as additional parameters.
- *
- * @param {Object} obj as Object, the object of which the original function is a property
- * @param {String} fname as String, the property name of the original function
- * @param {Function} after as Function, the function to be called after the original function
- * @returns Function A new function, wrapping the original function
- * @type Function
- */
-helma.Aspects.prototype.addAfter = function(obj, fname, after) {
- var oldFunc = obj[fname];
- obj[fname] = function() {
- return after(oldFunc.apply(this, arguments), arguments, oldFunc, this);
- }
- return;
-};
-
-
-/**
- * Wraps an additional function around the original function.
- *
- * The added function receives as its arguments an array of the original
- * arguments, the original function and the scope object of the original
- * function. The original function is not called directly and needs
- * to be invoked by the added function.
- *
- * @param {Object} obj as Object, the object of which the original function is a property
- * @param {String} fname as String, the property name of the original function
- * @param {Function} around as Function, the function to be called inside the original function
- * @returns Function A new function, wrapping the original function
- * @type Function
- */
-helma.Aspects.prototype.addAround = function(obj, fname, around) {
- var oldFunc = obj[fname];
- obj[fname] = function() {
- return around(arguments, oldFunc, this);
- }
- return;
-};
-
-
-helma.lib = "Aspects";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
-
-
-helma.aspects = new helma.Aspects();
-helma.dontEnum("aspects");
diff --git a/modules/helma/Chart.js b/modules/helma/Chart.js
deleted file mode 100644
index 6f699ebc..00000000
--- a/modules/helma/Chart.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Chart.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-
-/**
- * @fileoverview Fields and methods of the helma.Chart prototype
- *
- * 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-2.5.7.jar');
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Creates a new instance of helma.Chart
- * @class Instances of this class are capable of reading
- * Excel spreadsheets and rendering them as XHTML table. Internally
- * helma.Chart uses the Java Excel API
- * by Andy Khan.
- * @param {String} fpath The path to the spreadsheet file
- * @param {String} prefix An optional prefix to use for all
- * stylesheet classes within the rendered table
- * @param {String} sheetName The name of the sheet within the
- * spreadsheet file to render. If this argument is omitted, the
- * first sheet is rendered.
- * @returns A newly created helma.Chart instance.
- * @constructor
- * @author Tobi Schaefer
- */
-helma.Chart = function(fpath, prefix, sheetName) {
- var JXLPKG = Packages.jxl.Workbook;
- var JXLPKGNAME = "jxl.jar";
- var JXLPKGURL = "http://www.andykhan.com/jexcelapi/";
-
- var workbook, file;
- try {
- file = new java.io.File(fpath);
- workbook = JXLPKG.getWorkbook(file);
- } catch (e) {
- if (e instanceof TypeError == false)
- throw(e);
- throw("helma.Chart needs " + JXLPKGNAME +
- " in lib/ext or application directory " +
- "[" + JXLPKGURL + "]");
- }
-
- var getCellStyle = function(c) {
- if (!c)
- return;
- var result = new Object();
- var format = c.getCellFormat();
- var font = format.getFont();
- if (font.getBoldWeight() > 400)
- result.bold = true;
- result.italic = font.isItalic();
- result.wrap = format.getWrap();
- var type = c.getType();
- var align = format.getAlignment().getDescription();
- if (align == "right" || type == "Number" || type == "Date")
- result.align = "right";
- else if (align == "centre")
- result.align = "center";
- return result;
- }
-
- if (sheetName) {
- var sheet = workbook.getSheet(sheetName);
- } else {
- var sheet = workbook.getSheet(0);
- }
- if (!sheet)
- return;
-
- prefix = prefix ? prefix + "_" : "chart_";
-
- /**
- * Renders the Excel spreadsheet as XHTML table.
- */
- this.render = function() {
- res.write('\n');
-
- var rowBuf = [];
- var rows = sheet.getRows();
- var max = 0;
- for (var i=0; i
\n');
- workbook.close();
- };
-
- /**
- * Returns the spreadsheet as rendered XHTML table.
- * @returns The rendered spreadsheet table
- * @type String
- */
- this.renderAsString = function() {
- res.push();
- this.render();
- return res.pop();
- };
-
- /** @ignore */
- this.toString = function() {
- return "[helma.Chart " + file + "]";
- };
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-}
-
-
-/** @ignore */
-helma.Chart.toString = function() {
- return "[helma.Chart]";
-};
-
-
-/**
- * A simple example for using helma.Chart that renders
- * the passed file as XHTML table to response.
- * @param {String} file The path to the Excel spreadsheet file
- */
-helma.Chart.example = function(file) {
- // var file = "/path/to/file.xls";
- var chart = new helma.Chart(file);
- chart.render();
- return;
-};
-
-
-helma.lib = "Chart";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Color.js b/modules/helma/Color.js
deleted file mode 100644
index 32e011ae..00000000
--- a/modules/helma/Color.js
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Color.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-
-/**
- * @fileoverview Fields and methods of the helma.Chart prototype
- * \n');
- for (var n=0; n \n');
- }
-
- res.write('
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Color.js')
- */
-
-// take care of any dependencies
-app.addRepository("modules/core/String.js");
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Constructs a new instance of helma.Color.
- * @class Instances of this class provide methods for
- * converting HTML color names into their corresponding
- * RGB values and vice versa, or retrieving single RGB color values.
- * @param {Number|String} R Either the red fraction of the color,
- * or the name of the color.
- * @param {Number} G The green fraction
- * @param {Number} B The blue fraction
- * @returns A newly created helma.Color instance
- * @constructor
- */
-helma.Color = function(R, G, B) {
- var value = null;
- var name = null;
- var hex = null;
- var rgb = null;
-
- /**
- * Returns the decimal value of this color, or of a specified
- * color channel.
- * @param {String} channel An optional color channel which
- * decimal value should be returned. Must be either "red",
- * "green" or "blue". If no channel is specified this
- * method returns the decimal value of the color itself.
- * @returns The decimal value of this color or a single channel.
- * @type Number
- */
- this.valueOf = function(channel) {
- if (channel) {
- if (!rgb) {
- var compose = function(n, bits) {
- var div = Math.pow(2, bits);
- remainder = n % div;
- return Math.floor(n/div);
- }
- var remainder = value;
- rgb = {
- red: compose(remainder, 16),
- green: compose(remainder, 8),
- blue: compose(remainder, 0)
- };
- }
- return rgb[channel];
- }
- return value;
- };
-
- /**
- * Returns the hexidecimal value of this color (without
- * a leading hash sign).
- * @returns The hexidecimal value of this color
- * @type String
- */
- this.toString = function() {
- if (!value)
- return null;
- if (!hex)
- hex = value.toString(16).pad("0", 6, String.LEFT);
- return hex;
- };
-
-
- /**
- * Returns the trivial name of this color
- * @returns The trivial name of this color
- * @type String
- */
- this.getName = function() {
- return helma.Color.COLORVALUES[value];
- };
-
- /**
- * Main constructor body
- */
- if (arguments.length % 2 == 0)
- throw("Insufficient arguments for creating Color");
- if (arguments.length == 1) {
- if (R.constructor == Number) {
- value = R;
- } else if (R.constructor == String) {
- R = R.toLowerCase();
- if (helma.Color.COLORNAMES[R]) {
- this.name = R;
- value = helma.Color.COLORNAMES[R];
- } else {
- if (R.startsWith("#")) {
- R = R.substring(1);
- }
- value = parseInt(R, 16);
- this.name = helma.Color.COLORVALUES[value];
- }
- }
- } else {
- value = R * Math.pow(2, 16) + G * Math.pow(2, 8) + B;
- }
-
- if (value == null || isNaN(value))
- throw("helma.Color: invalid argument " + R);
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-};
-
-
-/**
- * Creates a new helma.Color instance based on a color name.
- * @param {String} name The color name (eg. "darkseagreen")
- * @returns An instance of helma.Color representing the color specified
- * @type helma.Color
- */
-helma.Color.fromName = function(name) {
- var value = helma.Color.COLORNAMES[name.toLowerCase()];
- return new helma.Color(value || 0);
-};
-
-
-/**
- * Creates a new helma.Color instance based on a HSL color
- * representation. This method is adapted from the HSLtoRGB
- * conversion method as described at
- * http://www1.tip.nl/~t876506/ColorDesign.html#hr.
- * @param {Number} H The hue fraction of the color definition
- * @param {Number} S The saturation fraction
- * @param {Number} L The lightness fraction
- * @returns An instance of helma.Color representing the corresponding
- * RGB color definition.
- * @type helma.Color
- */
-helma.Color.fromHsl = function(H,S,L) {
- function H1(H,S,L) {
- var R = 1; var G = 6*H; var B = 0;
- G = G*S + 1 - S; B = B*S + 1 - S;
- R = R*L; G = G*L; B = B*L;
- return [R,G,B];
- }
-
- function H2(H,S,L) {
- var R = 1-6*(H - 1/6); var G = 1; var B = 0;
- R = R*S + 1 - S; B = B*S + 1 - S;
- R = R*L; G = G*L; B = B*L;
- return [R,G,B];
- }
-
- function H3(H,S,L) {
- var R = 0; var G = 1; var B = 6*(H - 1/3);
- R = R*S + 1 - S; B = B*S + 1 - S;
- R = R*L; G = G*L; B = B*L
- return [R,G,B];
- }
-
- function H4(H,S,L) {
- var R = 0; var G = 1-6*(H - 1/2); var B = 1;
- R = R*S + 1 - S; G = G*S + 1 - S;
- R = R*L; G = G*L; B = B*L;
- return [R,G,B];
- }
-
- function H5(H,S,L) {
- var R = 6*(H - 2/3); var G = 0; var B = 1;
- R = R*S + 1 - S; G = G*S + 1 - S;
- R = R*L; G = G*L; B = B*L;
- return [R,G,B];
- }
-
- function H6(H,S,L) {
- var R = 1; var G = 0; var B = 1-6*(H - 5/6);
- G = G*S + 1 - S; B = B*S + 1 - S;
- R = R*L; G = G*L; B = B*L;
- return [R,G,B];
- }
-
- // H [0-1] is divided into 6 equal sectors.
- // From within each sector the proper conversion function is called.
- var rgb;
- if (H < 1/6) rgb = H1(H,S,L);
- else if (H < 1/3) rgb = H2(H,S,L);
- else if (H < 1/2) rgb = H3(H,S,L);
- else if (H < 2/3) rgb = H4(H,S,L);
- else if (H < 5/6) rgb = H5(H,S,L);
- else rgb = H6(H,S,L);
-
- return new helma.Color(
- Math.round(rgb[0]*255),
- Math.round(rgb[1]*255),
- Math.round(rgb[2]*255)
- );
-};
-
-
-/**
- * Contains the hexadecimal values of named colors.
- * @type Object
- * @final
- */
-helma.Color.COLORNAMES = {
- black: 0x000000,
- maroon: 0x800000,
- green: 0x008000,
- olive: 0x808000,
- navy: 0x000080,
- purple: 0x800080,
- teal: 0x008080,
- silver: 0xc0c0c0,
- gray: 0x808080,
- red: 0xff0000,
- lime: 0x00ff00,
- yellow: 0xffff00,
- blue: 0x0000ff,
- fuchsia: 0xff00ff,
- aqua: 0x00ffff,
- white: 0xffffff,
- aliceblue: 0xf0f8ff,
- antiquewhite: 0xfaebd7,
- aquamarine: 0x7fffd4,
- azure: 0xf0ffff,
- beige: 0xf5f5dc,
- blueviolet: 0x8a2be2,
- brown: 0xa52a2a,
- burlywood: 0xdeb887,
- cadetblue: 0x5f9ea0,
- chartreuse: 0x7fff00,
- chocolate: 0xd2691e,
- coral: 0xff7f50,
- cornflowerblue: 0x6495ed,
- cornsilk: 0xfff8dc,
- crimson: 0xdc143c,
- darkblue: 0x00008b,
- darkcyan: 0x008b8b,
- darkgoldenrod: 0xb8860b,
- darkgray: 0xa9a9a9,
- darkgreen: 0x006400,
- darkkhaki: 0xbdb76b,
- darkmagenta: 0x8b008b,
- darkolivegreen: 0x556b2f,
- darkorange: 0xff8c00,
- darkorchid: 0x9932cc,
- darkred: 0x8b0000,
- darksalmon: 0xe9967a,
- darkseagreen: 0x8fbc8f,
- darkslateblue: 0x483d8b,
- darkslategray: 0x2f4f4f,
- darkturquoise: 0x00ced1,
- darkviolet: 0x9400d3,
- deeppink: 0xff1493,
- deepskyblue: 0x00bfff,
- dimgray: 0x696969,
- dodgerblue: 0x1e90ff,
- firebrick: 0xb22222,
- floralwhite: 0xfffaf0,
- forestgreen: 0x228b22,
- gainsboro: 0xdcdcdc,
- ghostwhite: 0xf8f8ff,
- gold: 0xffd700,
- goldenrod: 0xdaa520,
- greenyellow: 0xadff2f,
- honeydew: 0xf0fff0,
- hotpink: 0xff69b4,
- indianred: 0xcd5c5c,
- indigo: 0x4b0082,
- ivory: 0xfffff0,
- khaki: 0xf0e68c,
- lavender: 0xe6e6fa,
- lavenderblush: 0xfff0f5,
- lawngreen: 0x7cfc00,
- lemonchiffon: 0xfffacd,
- lightblue: 0xadd8e6,
- lightcoral: 0xf08080,
- lightcyan: 0xe0ffff,
- lightgoldenrodyellow: 0xfafad2,
- lightgreen: 0x90ee90,
- lightgrey: 0xd3d3d3,
- lightpink: 0xffb6c1,
- lightsalmon: 0xffa07a,
- lightseagreen: 0x20b2aa,
- lightskyblue: 0x87cefa,
- lightslategray: 0x778899,
- lightsteelblue: 0xb0c4de,
- lightyellow: 0xffffe0,
- limegreen: 0x32cd32,
- linen: 0xfaf0e6,
- mediumaquamarine: 0x66cdaa,
- mediumblue: 0x0000cd,
- mediumorchid: 0xba55d3,
- mediumpurple: 0x9370db,
- mediumseagreen: 0x3cb371,
- mediumslateblue: 0x7b68ee,
- mediumspringgreen: 0x00fa9a,
- mediumturquoise: 0x48d1cc,
- mediumvioletred: 0xc71585,
- midnightblue: 0x191970,
- mintcream: 0xf5fffa,
- mistyrose: 0xffe4e1,
- moccasin: 0xffe4b5,
- navajowhite: 0xffdead,
- oldlace: 0xfdf5e6,
- olivedrab: 0x6b8e23,
- orange: 0xffa500,
- orangered: 0xff4500,
- orchid: 0xda70d6,
- palegoldenrod: 0xeee8aa,
- palegreen: 0x98fb98,
- paleturquoise: 0xafeeee,
- palevioletred: 0xdb7093,
- papayawhip: 0xffefd5,
- peachpuff: 0xffdab9,
- peru: 0xcd853f,
- pink: 0xffc0cb,
- plum: 0xdda0dd,
- powderblue: 0xb0e0e6,
- rosybrown: 0xbc8f8f,
- royalblue: 0x4169e1,
- saddlebrown: 0x8b4513,
- salmon: 0xfa8072,
- sandybrown: 0xf4a460,
- seagreen: 0x2e8b57,
- seashell: 0xfff5ee,
- sienna: 0xa0522d,
- skyblue: 0x87ceeb,
- slateblue: 0x6a5acd,
- slategray: 0x708090,
- snow: 0xfffafa,
- springgreen: 0x00ff7f,
- steelblue: 0x4682b4,
- tan: 0xd2b48c,
- thistle: 0xd8bfd8,
- tomato: 0xff6347,
- turquoise: 0x40e0d0,
- violet: 0xee82ee,
- wheat: 0xf5deb3,
- whitesmoke: 0xf5f5f5,
- yellowgreen: 0x9acd32
-};
-
-
-/**
- * Contains the color names for specific hex values
- * @type Object
- * @final
- */
-helma.Color.COLORVALUES = {};
-
-for (var i in helma.Color.COLORNAMES) {
- helma.Color.COLORVALUES[helma.Color.COLORNAMES[i]] = i;
-}
-
-
-/** @ignore */
-helma.Color.toString = function() {
- return "[helma.Color]";
-};
-
-
-helma.lib = "Color";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Database.js b/modules/helma/Database.js
deleted file mode 100644
index 23fb8150..00000000
--- a/modules/helma/Database.js
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Database.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Properties and methods of the helma.Database prototype.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Database.js')
- */
-
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Constructor for Database objects, providing access through relational
- * databases through JDBC. It is usually simpler to use one of the factory
- * methods {@link #createInstance} or {@link #getInstance}.
- * @class url
parameter recognizes the values "mysql", "oracle" and
- * "postgresql". For those databases, it is also possible to pass just
- * hostname
or hostname:port
as url
- * parameters instead of the full JDBC URL.
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/File.js')
- */
-
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-
-/**
- * Constructor for File objects, providing read and
- * write access to the file system.
- * @class This class represents a local file or directory
- * @param {String} path as String, can be either absolute or relative to the helma home directory
- * @constructor
- */
-helma.File = function(path) {
- var BufferedReader = java.io.BufferedReader;
- var File = java.io.File;
- var Writer = java.io.Writer;
- var FileReader = java.io.FileReader;
- var PrintWriter = java.io.PrintWriter;
- var FileOutputStream = java.io.FileOutputStream;
- var OutputStreamWriter = java.io.OutputStreamWriter;
- var FileInputStream = java.io.FileInputStream;
- var InputStreamReader = java.io.InputStreamReader;
- var EOFException = java.io.EOFException;
- var IllegalStateException = java.lang.IllegalStateException;
- var IllegalArgumentException = java.lang.IllegalArgumentException
-
- var self = this;
-
- var file;
- try {
- // immediately convert to absolute path - java.io.File is
- // incredibly stupid when dealing with relative file names
- if (arguments.length > 1)
- file = new File(path, arguments[1]).getAbsoluteFile();
- else
- file = new File(path).getAbsoluteFile();
- } catch (e) {
- throw(e);
- }
-
- var readerWriter;
- var atEOF = false;
- var lastLine = null;
-
- var setError = function(e) {
- self.lastError = e;
- };
-
- this.lastError = null;
-
- /** @ignore */
- this.toString = function() {
- return file.toString();
- };
-
- /**
- * Returns the name of the file or directory represented by this File object.
- *
- * This is just the last name in the pathname's name sequence.
- * If the pathname's name sequence is empty, then the empty
- * string is returned.
- *
- * @returns String containing the name of the file or directory
- * @type String
- */
- this.getName = function() {
- var name = file.getName();
- return (name == null ? "" : name);
- };
-
- /**
- * Returns true if the file represented by this File object
- * is currently open.
- *
- * @returns Boolean
- * @type Boolean
- */
- this.isOpened = function() {
- return (readerWriter != null);
- };
-
- /**
- * Opens the file represented by this File object. If the file exists,
- * it is used for reading, otherwise it is opened for writing.
- * If the encoding argument is specified, it is used to read or write
- * the file. Otherwise, the platform's default encoding is used.
- *
- * @param {Object} options an optional argument holder object.
- * The following options are supported:
- *
- * @returns Boolean true if the operation succeeded
- * @type Boolean
- */
- this.open = function(options) {
- if (self.isOpened()) {
- setError(new IllegalStateException("File already open"));
- return false;
- }
- // We assume that the BufferedReader and PrintWriter creation
- // cannot fail except if the FileReader/FileWriter fails.
- // Otherwise we have an open file until the reader/writer
- // get garbage collected.
- var charset = options && options.charset;
- var append = options && options.append;
- try {
- if (file.exists() && !append) {
- if (charset) {
- readerWriter = new BufferedReader(
- new InputStreamReader(new FileInputStream(file), charset));
- } else {
- readerWriter = new BufferedReader(new FileReader(file));
- }
- } else {
- if (append && charset) {
- readerWriter = new PrintWriter(
- new OutputStreamWriter(new FileOutputStream(file, true), charset));
- } else if (append) {
- readerWriter = new PrintWriter(
- new OutputStreamWriter(new FileOutputStream(file, true)));
- } else if (charset) {
- readerWriter = new PrintWriter(file, charset);
- } else {
- readerWriter = new PrintWriter(file);
- }
- }
- return true;
- } catch (e) {
- setError(e);
- return false;
- }
- return;
- };
-
- /**
- * Tests whether the file or directory represented by this File object exists.
- *
- * @returns Boolean true if the file or directory exists; false otherwise
- * @type Boolean
- */
- this.exists = function() {
- return file.exists();
- };
-
- /**
- * Returns the pathname string of this File object's parent directory.
- *
- * @returns String containing the pathname of the parent directory
- * @type String
- */
- this.getParent = function() {
- if (!file.getParent())
- return null;
- return new helma.File(file.getParent());
- };
-
- /**
- * This methods reads characters until an end of line/file is encountered
- * then returns the string for these characters (without any end of line
- * character).
- *
- * @returns String of the next unread line in the file
- * @type String
- */
- this.readln = function() {
- if (!self.isOpened()) {
- setError(new IllegalStateException("File not opened"));
- return null;
- }
- if (!(readerWriter instanceof BufferedReader)) {
- setError(new IllegalStateException("File not opened for reading"));
- return null;
- }
- if (atEOF) {
- setError(new EOFException());
- return null;
- }
- if (lastLine != null) {
- var line = lastLine;
- lastLine = null;
- return line;
- }
- var reader = readerWriter;
- // Here lastLine is null, return a new line
- try {
- var line = readerWriter.readLine();
- if (line == null) {
- atEOF = true;
- setError(new EOFException());
- }
- return line;
- } catch (e) {
- setError(e);
- return null;
- }
- return;
- };
-
- /**
- * Appends a string to the file represented by this File object.
- *
- * @param {String} what as String, to be written to the file
- * @returns Boolean
- * @type Boolean
- * @see #writeln
- */
- this.write = function(what) {
- if (!self.isOpened()) {
- setError(new IllegalStateException("File not opened"));
- return false;
- }
- if (!(readerWriter instanceof PrintWriter)) {
- setError(new IllegalStateException("File not opened for writing"));
- return false;
- }
- if (what != null) {
- readerWriter.print(what.toString());
- }
- return true;
- };
-
- /**
- * Appends a string with a platform specific end of
- * line to the file represented by this File object.
- *
- * @param {String} what as String, to be written to the file
- * @returns Boolean
- * @type Boolean
- * @see #write
- */
- this.writeln = function(what) {
- if (self.write(what)) {
- readerWriter.println();
- return true;
- }
- return false;
- };
-
- /**
- * Tests whether this File object's pathname is absolute.
- *
- * The definition of absolute pathname is system dependent.
- * On UNIX systems, a pathname is absolute if its prefix is "/".
- * On Microsoft Windows systems, a pathname is absolute if its prefix
- * is a drive specifier followed by "\\", or if its prefix is "\\".
- *
- * @returns Boolean if this abstract pathname is absolute, false otherwise
- * @type Boolean
- */
- this.isAbsolute = function() {
- return file.isAbsolute();
- };
-
- /**
- * Deletes the file or directory represented by this File object.
- *
- * @returns Boolean
- * @type Boolean
- */
- this.remove = function() {
- if (self.isOpened()) {
- setError(new IllegalStateException("An openened file cannot be removed"));
- return false;
- }
- return file["delete"]();
- };
-
- /**
- * List of all files within the directory represented by this File object.
- *
- * You may pass a RegExp Pattern to return just files matching this pattern.
- *
- * Example: var xmlFiles = dir.list(/.*\.xml/);
- *
- * @param {RegExp} pattern as RegExp, optional pattern to test each file name against
- * @returns Array the list of file names
- * @type Array
- */
- this.list = function(pattern) {
- if (self.isOpened())
- return null;
- if (!file.isDirectory())
- return null;
- if (pattern) {
- var fileList = file.list();
- var result = [];
- for (var i in fileList) {
- if (pattern.test(fileList[i]))
- result.push(fileList[i]);
- }
- return result;
- }
- return file.list();
- };
-
- /**
- * Purges the content of the file represented by this File object.
- *
- * @returns Boolean
- * @type Boolean
- */
- this.flush = function() {
- if (!self.isOpened()) {
- setError(new IllegalStateException("File not opened"));
- return false;
- }
- if (readerWriter instanceof Writer) {
- try {
- readerWriter.flush();
- } catch (e) {
- setError(e);
- return false;
- }
- } else {
- setError(new IllegalStateException("File not opened for write"));
- return false; // not supported by reader
- }
- return true;
- };
-
- /**
- * Closes the file represented by this File object.
- *
- * @returns Boolean
- * @type Boolean
- */
- this.close = function() {
- if (!self.isOpened())
- return false;
- try {
- atEOF = false;
- lastLine = null;
- readerWriter.close();
- readerWriter = null;
- return true;
- } catch (e) {
- setError(e);
- readerWriter = null;
- return false;
- }
- };
-
- /**
- * Returns the pathname string of this File object.
- *
- * The resulting string uses the default name-separator character
- * to separate the names in the name sequence.
- *
- * @returns String of this file's pathname
- * @type String
- */
- this.getPath = function() {
- var path = file.getPath();
- return (path == null ? "" : path);
- };
-
- /**
- * Contains the last error that occured, if any.
- * @returns String
- * @type String
- * @see #clearError
- */
- this.error = function() {
- if (this.lastError == null) {
- return "";
- } else {
- var exceptionName = this.lastError.getClass().getName();
- var l = exceptionName.lastIndexOf(".");
- if (l > 0)
- exceptionName = exceptionName.substring(l + 1);
- return exceptionName + ": " + this.lastError.getMessage();
- }
- };
-
- /**
- * Clears any error message that may otherwise be returned by the error method.
- *
- * @see #error
- */
- this.clearError = function() {
- this.lastError = null;
- return;
- };
-
- /**
- * Tests whether the application can read the file
- * represented by this File object.
- *
- * @returns Boolean true if the file exists and can be read; false otherwise
- * @type Boolean
- */
- this.canRead = function() {
- return file.canRead();
- };
-
- /**
- * Tests whether the file represented by this File object is writable.
- *
- * @returns Boolean true if the file exists and can be modified; false otherwise.
- * @type Boolean
- */
- this.canWrite = function() {
- return file.canWrite();
- };
-
- /**
- * Returns the absolute pathname string of this file.
- *
- * If this File object's pathname is already absolute, then the pathname
- * string is simply returned as if by the getPath() method. If this
- * abstract pathname is the empty abstract pathname then the pathname
- * string of the current user directory, which is named by the system
- * property user.dir, is returned. Otherwise this pathname is resolved
- * in a system-dependent way. On UNIX systems, a relative pathname is
- * made absolute by resolving it against the current user directory.
- * On Microsoft Windows systems, a relative pathname is made absolute
- * by resolving it against the current directory of the drive named by
- * the pathname, if any; if not, it is resolved against the current user
- * directory.
- *
- * @returns String The absolute pathname string
- * @type String
- */
- this.getAbsolutePath = function() {
- var absolutPath = file.getAbsolutePath();
- return (absolutPath == null ? "" : absolutPath);
- };
-
- /**
- * Returns the length of the file represented by this File object.
- *
- * The return value is unspecified if this pathname denotes a directory.
- *
- * @returns Number The length, in bytes, of the file, or 0L if the file does not exist
- * @type Number
- */
- this.getLength = function() {
- return file.length();
- };
-
- /**
- * Tests whether the file represented by this File object is a directory.
- *
- * @returns Boolean true if this File object is a directory and exists; false otherwise
- * @type Boolean
- */
- this.isDirectory = function() {
- return file.isDirectory();
- };
-
- /**
- * Tests whether the file represented by this File object is a normal file.
- *
- * A file is normal if it is not a directory and, in addition, satisfies
- * other system-dependent criteria. Any non-directory file created by a
- * Java application is guaranteed to be a normal file.
- *
- * @returns Boolean true if this File object is a normal file and exists; false otherwise
- * @type Boolean
- */
- this.isFile = function() {
- return file.isFile();
- };
-
- /**
- * Returns the time when the file represented by this File object was last modified.
- *
- * A number representing the time the file was last modified,
- * measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970),
- * or 0L if the file does not exist or if an I/O error occurs.
- *
- * @returns Number in milliseconds since 00:00:00 GMT, January 1, 1970
- * @type Number
- */
- this.lastModified = function() {
- return file.lastModified();
- };
-
- /**
- * Creates the directory represented by this File object.
- *
- * @returns Boolean true if the directory was created; false otherwise
- * @type Boolean
- */
- this.makeDirectory = function() {
- if (self.isOpened())
- return false;
- // don't do anything if file exists or use multi directory version
- return (file.exists() || file.mkdirs());
- };
-
- /**
- * Renames the file represented by this File object.
- *
- * Whether or not this method can move a file from one
- * filesystem to another is platform-dependent. The return
- * value should always be checked to make sure that the
- * rename operation was successful.
- *
- * @param {FileObject} toFile as FileObject of the new path
- * @returns true if the renaming succeeded; false otherwise
- * @type Boolean
- */
- this.renameTo = function(toFile) {
- if (toFile == null) {
- setError(new IllegalArgumentException("Uninitialized target File object"));
- return false;
- }
- if (self.isOpened()) {
- setError(new IllegalStateException("An openened file cannot be renamed"));
- return false;
- }
- if (toFile.isOpened()) {
- setError(new IllegalStateException("You cannot rename to an openened file"));
- return false;
- }
- return file.renameTo(new java.io.File(toFile.getAbsolutePath()));
- };
-
- /**
- * Returns true if the file represented by this File object
- * has been read entirely and the end of file has been reached.
- *
- * @returns Boolean
- * @type Boolean
- */
- this.eof = function() {
- if (!self.isOpened()) {
- setError(new IllegalStateException("File not opened"));
- return true;
- }
- if (!(readerWriter instanceof BufferedReader)) {
- setError(new IllegalStateException("File not opened for read"));
- return true;
- }
- if (atEOF)
- return true;
- if (lastLine != null)
- return false;
- try {
- lastLine = readerWriter.readLine();
- if (lastLine == null)
- atEOF = true;
- return atEOF;
- } catch (e) {
- setError(e);
- return true;
- }
- };
-
- /**
- * This methods reads all the lines contained in the
- * file and returns them.
- *
- * @return String of all the lines in the file
- * @type String
- */
- this.readAll = function() {
- // Open the file for readAll
- if (self.isOpened()) {
- setError(new IllegalStateException("File already open"));
- return null;
- }
- try {
- if (file.exists()) {
- readerWriter = new BufferedReader(new FileReader(file));
- } else {
- setError(new IllegalStateException("File does not exist"));
- return null;
- }
- if (!file.isFile()) {
- setError(new IllegalStateException("File is not a regular file"));
- return null;
- }
-
- // read content line by line to setup proper eol
- var buffer = new java.lang.StringBuffer(file.length() * 1.10);
- while (true) {
- var line = readerWriter.readLine();
- if (line == null)
- break;
- if (buffer.length() > 0)
- buffer.append("\n"); // EcmaScript EOL
- buffer.append(line);
- }
-
- // Close the file
- readerWriter.close();
- readerWriter = null;
- return buffer.toString();
- } catch (e) {
- readerWriter = null;
- setError(e);
- return null;
- }
- };
-
-
- /**
- * This method removes a directory recursively .
- *
- * DANGER! DANGER! HIGH VOLTAGE!
- * The directory is deleted recursively without
- * any warning or precautious measures.
- */
- this.removeDirectory = function() {
- if (!file.isDirectory())
- return false;
- var arr = file.list();
- for (var i=0; i
- * Useful for passing it to a function instead of an request object.
- */
- this.toByteArray = function() {
- if (!this.exists())
- return null;
- var body = new java.io.ByteArrayOutputStream();
- var stream = new java.io.BufferedInputStream(
- new java.io.FileInputStream(this.getAbsolutePath())
- );
- var buf = java.lang.reflect.Array.newInstance(
- java.lang.Byte.TYPE, 1024
- );
- var read;
- while ((read = stream.read(buf)) > -1)
- body.write(buf, 0, read);
- stream.close();
- return body.toByteArray();
- };
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-}
-
-
-/** @ignore */
-helma.File.toString = function() {
- return "[helma.File]";
-};
-
-
-helma.File.separator = java.io.File.separator;
-
-
-helma.lib = "File";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Ftp.js b/modules/helma/Ftp.js
deleted file mode 100644
index 67296bfa..00000000
--- a/modules/helma/Ftp.js
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2007 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Ftp.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-
-/**
- * @fileoverview Default properties and methods of the FTP prototype.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Ftp.js')
- */
-
-// requires helma.File
-app.addRepository("modules/helma/File.js");
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Constructor for FTP client objects, to send and receive files from an FTP server.
- *
- * @class This class represents a FTP client, providing
- * access to an FTP server.
- *
- * @example var ftp = new helma.Ftp("ftp.mydomain.com");
- * @param {String} server as String, the address of the FTP Server to connect to
- * @constructor
- */
-helma.Ftp = function(server) {
- var OK = 0;
- var SOCKET = 1;
- var TIMEOUT = 2;
- var LOGIN = 10;
- var LOGOUT = 11;
- var BINARY = 20;
- var ASCII = 21;
- var ACTIVE = 22;
- var PASSIVE = 23;
- var CD = 30;
- var LCD = 31;
- var PWD = 32;
- var DIR = 33;
- var MKDIR = 34;
- var RMDIR = 35;
- var GET = 40;
- var PUT = 41;
- var DELETE = 42;
- var RENAME = 43;
-
- var FTP = Packages.org.apache.commons.net.ftp.FTP;
- var FtpClient = Packages.org.apache.commons.net.ftp.FTPClient;
- var BufferedInputStream = java.io.BufferedInputStream;
- var BufferedOutputStream = java.io.BufferedOutputStream;
- var FileInputStream = java.io.FileInputStream;
- var FileOutputStream = java.io.FileOutputStream;
- var ByteArrayInputStream = java.io.ByteArrayInputStream;
- var ByteArrayOutputStream = java.io.ByteArrayOutputStream;
-
- var self = this;
- var className = "helma.Ftp";
-
- var ftpclient = new FtpClient();
- var localDir;
-
- var error = function(methName, errMsg) {
- var tx = java.lang.Thread.currentThread();
- tx.dumpStack();
- app.log("Error in " + className + ":" + methName + ": " + errMsg);
- return;
- };
-
- var debug = function(methName, msg) {
- msg = msg ? " " + msg : "";
- app.debug(className + ":" + methName + msg);
- return;
- };
-
- var setStatus = function(status) {
- if (self.status === OK) {
- self.status = status;
- }
- return;
- };
-
- var getStatus = function() {
- return self.status;
- };
-
- this.server = server;
- this.status = OK;
-
- /** @ignore */
- this.toString = function() {
- return "[helma.Ftp " + server + "]";
- };
-
- /**
- * Set the default timeout in milliseconds to use when opening a socket.
- */
- this.setReadTimeout = function(timeout) {
- try {
- ftpclient.setDefaultTimeout(timeout);
- debug("setReadTimeout", timeout);
- return true;
- } catch(x) {
- error("setReadTimeout", x);
- setStatus(SOCKET);
- }
- return false;
- };
-
- /**
- * Sets the timeout in milliseconds to use when reading from the data connection.
- */
- this.setTimeout = function(timeout) {
- try {
- ftpclient.setDataTimeout(timeout);
- debug("setTimeout", timeout);
- return true;
- } catch(x) {
- error("setTimeout", x);
- setStatus(TIMEOUT);
- }
- return false;
- };
-
- /**
- * Logs in to the FTP server.
- *
- * @param {String} username as String
- * @param {String} password as String
- * @return Boolean true if the login was successful, otherwise false
- * @type Boolean
- */
- this.login = function(username, password) {
- try {
- ftpclient.connect(this.server);
- var result = ftpclient.login(username, password);
- debug("login", username + "@" + server);
- return result;
- } catch(x) {
- error("login", x);
- setStatus(LOGIN);
- }
- return false;
- };
-
- /**
- * Sets transfer mode to binary for transmitting images and other non-text files.
- *
- * @example ftp.binary();
- */
- this.binary = function() {
- try {
- var result = ftpclient.setFileType(FTP.BINARY_FILE_TYPE);
- debug("binary");
- return result;
- } catch(x) {
- error("binary", x);
- setStatus(BINARY);
- }
- return false;
- };
-
- /**
- * Sets transfer mode to ascii for transmitting text-based data.
- *
- * @example ftp.ascii();
- */
- this.ascii = function() {
- try {
- var result = ftpclient.setFileType(FTP.ASCII_FILE_TYPE);
- debug("ascii");
- return result;
- } catch(x) {
- error("ascii", x);
- setStatus(ASCII);
- }
- return false;
- };
-
- /**
- * Switches the connection to use active mode.
- *
- * @example ftp.active();
- */
- this.active = function() {
- try {
- ftpclient.enterLocalActiveMode();
- debug("active");
- return true;
- } catch(x) {
- error("active", x);
- setStatus(ACTIVE);
- }
- return false;
- };
-
- /**
- * Switches the connection to use passive mode.
- *
- * @example ftp.passive();
- */
- this.passive = function() {
- try {
- ftpclient.enterLocalPassiveMode();
- debug("passive");
- return true;
- } catch(x) {
- error("passive", x);
- setStatus(PASSIVE);
- }
- return false;
- };
-
- /**
- * Returns the path of the current working directory.
- *
- * @example var remotepath = ftp.pwd();
- * @type String
- * @return String containing the current working directory path
- */
- this.pwd = function() {
- try {
- debug("pwd");
- return ftpclient.printWorkingDirectory();
- } catch(x) {
- error("pwd", x);
- setStatus(PWD);
- }
- return;
- };
-
- /**
- * Returns a listing of the files contained in a directory on the FTP server.
- *
- * Lists the files contained in the current working
- * directory or, if an alternative path is specified, the
- * files contained in the specified directory.
- *
- * @example var filelist = ftp.dir();
- * @param {String} path as String, optional alternative directory
- * @return Array containing the list of files in that directory
- * @type Array
- */
- this.dir = function(path) {
- try {
- debug("dir", path);
- return ftpclient.listNames(path ? path : ".");
- } catch(x) {
- error("dir", x);
- setStatus(DIR);
- }
- return;
- };
-
- /**
- * Creates a new directory on the server.
- *
- * The name of the directory is determined as the function's
- * string parameter. Returns false when an error occured
- * (e.g. due to access restrictions, directory already
- * exists etc.), otherwise true.
- *
- * @param {String} dir as String, the name of the directory to be created
- * @return Boolean true if the directory was successfully created, false if there was an error
- * @type Boolean
- */
- this.mkdir = function(dir) {
- try {
- var result = ftpclient.makeDirectory(dir);
- debug("mkdir", dir);
- return result;
- } catch(x) {
- error("mkdir", x);
- setStatus(MKDIR);
- }
- return false;
- };
-
- /**
- * Deletes a directory on the FTP server.
- *
- * @param {String} dir as String, the name of the directory to be deleted
- * @return Boolean true if the deletion was successful, false otherwise
- * @type Boolean
- */
- this.rmdir = function(dir) {
- try {
- var result = ftpclient.removeDirectory(dir);
- debug("rmdir", dir);
- return result;
- } catch(x) {
- error("rmdir", x);
- setStatus(RMDIR);
- }
- return false;
- };
-
- /**
- * Changes the working directory on the FTP server.
- *
- * @example ftp.cd("/home/users/fred/www"); // use absolute pathname
- * @example ftp.cd(".."); // change to parent directory
- * @example ftp.cd("images"); // use relative pathname
- * @param {String} dir as String, the path that the remote working directory should be changed to
- */
- this.cd = function(path) {
- try {
- var result = ftpclient.changeWorkingDirectory(path);
- debug("cd", path);
- return result;
- } catch(x) {
- error("cd", x);
- setStatus(CD);
- }
- return false;
- };
-
- /**
- * Changes the working directory of the local machine when being connected to an FTP server.
- *
- * @example ftp.lcd("/home/users/fred/www"); // use absolute pathname
- * @example ftp.lcd(".."); // change to parent directory
- * @example ftp.lcd("images"); // use relative pathname
- * @param {String} dir as String, the path that the local working directory should be changed to
- */
- this.lcd = function(dir) {
- try {
- localDir = new helma.File(dir);
- if (!localDir.exists()) {
- localDir.mkdir();
- debug("lcd", dir);
- }
- return true;
- } catch(x) {
- error("lcd", x);
- setStatus(LCD);
- }
- return false;
- };
-
- /**
- * Transfers a file from the local file system to the remote server.
- *
- * Returns true if the transmission was successful, otherwise false.
- *
- * @param {String} localFile as String, the name of the file to be uploaded
- * @param {String} remoteFile as String, the name of the remote destination file
- * @return Boolean true if the file was successfully uploaded, false if there was an error
- * @type Boolean
- */
- this.putFile = function(localFile, remoteFile) {
- try {
- if (localFile instanceof File || localFile instanceof helma.File) {
- var f = localFile;
- } else if (typeof localFile == "string") {
- if (localDir == null)
- var f = new helma.File(localFile);
- else
- var f = new helma.File(localDir, localFile);
- }
- var stream = new BufferedInputStream(
- new FileInputStream(f.getPath())
- );
- if (!remoteFile) {
- remoteFile = f.getName();
- }
- var result = ftpclient.storeFile(remoteFile, stream);
- stream.close();
- debug("putFile", remoteFile);
- return result;
- } catch(x) {
- error("putFile", x);
- setStatus(PUT);
- }
- return false;
- };
-
- /**
- * Transfers text from a string to a file on the FTP server.
- *
- * @example ftp.putString("Hello, World!", "message.txt");
- * @param {String} str as String, the text content that should be uploaded
- * @param {String} remoteFile as String, the name of the remote destination file
- * @param {String} charset as String, optional
- * @return Boolean true if the file was successfully uploaded, false if there was an error
- * @type Boolean
- */
- this.putString = function(str, remoteFile, charset) {
- try {
- str = new java.lang.String(str);
- var bytes = charset ? str.getBytes(charset) : str.getBytes();
- var stream = ByteArrayInputStream(bytes);
- var result = ftpclient.storeFile(remoteFile, stream);
- debug("putString", remoteFile);
- return result;
- } catch(x) {
- error("putString", x);
- setStatus(PUT);
- }
- return false;
- };
-
- /**
- * Transfers a byte array to a file on the FTP server.
- * @param {Array} bytes The byte array that should be uploaded
- * @param {String} remoteFile The name of the remote destination file
- * @return Boolean True if the file was successfully uploaded, false if there was an error
- * @type Boolean
- */
- this.putBytes = function(bytes, remoteFile) {
- try {
- var stream = ByteArrayInputStream(bytes);
- var result = ftpclient.storeFile(remoteFile, stream);
- debug("putBytes", remoteFile);
- return result;
- } catch(x) {
- error("putBytes", x);
- setStatus(PUT);
- }
- return false;
- };
-
- /**
- * Transfers a file from the FTP server to the local file system.
- *
- * @example ftp.getFile(".htaccess", "htaccess.txt");
- * @param {String} remoteFile as String, the name of the file that should be downloaded
- * @param {String} localFile as String, the name which the file should be stored under
- * @see #cd
- * @see #lcd
- */
- this.getFile = function(remoteFile, localFile) {
- try {
- if (localDir == null)
- var f = new helma.File(localFile);
- else
- var f = new helma.File(localDir, localFile);
- var stream = new BufferedOutputStream(
- new FileOutputStream(f.getPath())
- );
- var result = ftpclient.retrieveFile(remoteFile, stream);
- stream.close();
- debug("getFile", remoteFile);
- return result;
- } catch(x) {
- error("getFile", x);
- setStatus(GET);
- }
- return false;
- };
-
- /**
- * Retrieves a file from the FTP server and returns it as string.
- *
- * @example var str = ftp.getString("messages.txt");
- * @param {String} remoteFile as String, the name of the file that should be downloaded
- * @return String containing the data of the downloaded file
- * @type String
- * @see #cd
- */
- this.getString = function(remoteFile) {
- try {
- var stream = ByteArrayOutputStream();
- ftpclient.retrieveFile(remoteFile, stream);
- debug("getString", remoteFile);
- return stream.toString();
- } catch(x) {
- error("getString", x);
- setStatus(GET);
- }
- return;
- };
-
- /**
- * Deletes a file on the FTP server.
- *
- * @example var str = ftp.deleteFile("messages.txt");
- * @param {String} remoteFile as String, the name of the file to be deleted
- * @return Boolean true if the deletion was successful, false otherwise
- * @type Boolean
- */
- this.deleteFile = function(remoteFile) {
- try {
- var result = ftpclient.deleteFile(remoteFile);
- debug("deleteFile", remoteFile);
- return result;
- } catch(x) {
- error("deleteFile", x);
- setStatus(DELETE);
- }
- return false;
- };
-
- /**
- * Renames a file on the FTP server.
- *
- * @example var success = ftp.renameFile("messages.tmp", "messages.txt");
- * @param {String} from the name of the original file
- * @param {String} to the new name the original file should get
- * @return Boolean true if renaming the remote file was successful, false otherwise
- * @type Boolean
- */
- this.renameFile = function(from, to) {
- try {
- var result = ftpclient.rename(from, to);
- debug("renameFile", from + "->" + to);
- return result;
- } catch(x) {
- error("renameFile", x);
- setStatus(RENAME);
- }
- return false;
- };
-
- /**
- * Terminates the current FTP session.
- */
- this.logout = function() {
- try {
- var result = ftpclient.logout();
- ftpclient.disconnect();
- debug("logout");
- return result;
- } catch(x) {
- error("logout", x);
- setStatus(LOGOUT);
- }
- return false;
- };
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-}
-
-
-/** @ignore */
-helma.Ftp.toString = function() {
- return "[helma.Ftp]";
-};
-
-
-helma.lib = "Ftp";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Group.js b/modules/helma/Group.js
deleted file mode 100644
index a15081dc..00000000
--- a/modules/helma/Group.js
+++ /dev/null
@@ -1,875 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Group.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview A JavaScript library wrapping
- * Packages.helma.extensions.helmagroups
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Group.js')
- */
-
-// Define the global namespace if not existing
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Constructs a new helma.Group Object.
- * @class This is what is retrieved through groups.get(groupName),
- * wrapping the root object of each group tree.
- * @param {FIXME} javaGroup FIXME
- * @constructor
- */
-helma.Group = function(javaGroup) {
- // private variable containing the wrapper object
- var groupRoot = new helma.Group.GroupObject(javaGroup.getRoot());
-
- /**
- * @returns the wrapped java object Group
- */
- this.getJavaObject = function() {
- return javaGroup;
- };
-
- /**
- * sets a key/value pair on the group's root,
- * wraps the function of the wrapper object
- */
- this.set = function(key, val, sendMode) {
- groupRoot.set(key, val, sendMode);
- return;
- };
-
- /**
- * removes a key from the group's root,
- * wraps the function of the root GroupObject
- */
- this.remove = function(key, sendMode) {
- return groupRoot.remove(key, sendMode);
- };
-
- /**
- * retrieves a key from the group's root,
- * wraps the function of the root GroupObject
- */
- this.get = function(key) {
- return groupRoot.get(key);
- };
-
- /**
- * @see helma.Group.GroupObject.listChildren
- */
- this.listChildren = function() {
- return groupRoot.listChildren();
- };
-
- /**
- * @see helma.Group.GroupObject.listProperties
- */
- this.listProperties = function() {
- return groupRoot.listProperties();
- };
-
- /**
- * @see helma.Group.GroupObject.countChildren
- */
- this.countChildren = function() {
- return groupRoot.countChildren();
- };
-
- /**
- * @see helma.Group.GroupObject.countProperties
- */
- this.countProperties = function() {
- return groupRoot.countProperties();
- };
-
- /**
- * calls a function in all connected applications
- * (to be specific: in all registered localClients).
- * @param method name of the method in xmlrpc-style: test
- * is called as root.test(), stories.137.render
- * is called as root.stories.get("137").render() etc etc.
- * @param argArr array of arguments to the remote method
- * @param sendMode as defined for helma.Group.GroupObject
- * @returns array of result objects
- */
- this.callFunction = function(method, argArr, sendMode) {
- groups.checkWriteAccess(javaGroup);
- if (sendMode == null) {
- sendMode = helma.Group.GroupObject.DEFAULT_GET;
- }
- var argVec = new java.util.Vector();
- for (var i=0; i
- *
- * @param {Number} The mode to use when committing the change to
- * the helma.Group
- */
- this.remove = function(key, sendMode) {
- checkWriteAccess();
- if (sendMode == null) {
- sendMode = helma.Group.GroupObject.DEFAULT_GET;
- }
- if (keyIsPath(key)) {
- var obj = walkPath(this, key);
- if (obj != null) {
- obj.remove(getLastKeyElement(key));
- }
- } else {
- javaGroupObject.remove(key, sendMode);
- }
- return;
- };
-
-
- /**
- * Returns either a property or a child GroupObject from
- * this GroupObject instance. The key passed as argument
- * may be a String, an Array containing Strings or a
- * String containing separator characters ("/"). In the latter
- * two cases the argument is considered a path and
- * the function walks down that path to find the requested
- * GroupObject.
- * @param {Object} key Either
- *
- *
- * @return Depending on the argument either the appropriate property
- * value or a helma.Group.GroupObject
- * @type Object
- */
- this.get = function(key) {
- if (key == null) {
- return null;
- }
- if (keyIsPath(key)) {
- var obj = walkPath(this, key);
- if (obj != null) {
- return obj.get(getLastKeyElement(key));
- } else {
- return null;
- }
- } else if (javaGroupObject.hasProperty(key)) {
- // we got a primitive property
- var val = javaGroupObject.getProperty(key);
- if (val instanceof java.util.Date) {
- // convert java dates to javascript dates
- val = new Date(val);
- }
- return val;
- } else if (javaGroupObject.hasChild(key)) {
- // we got a child object
- return new helma.Group.GroupObject(javaGroupObject.getChild(key));
- }
- return null;
- };
-
-
- /**
- * Gets a property from this GroupObject. The key passed as argument
- * is always considered a property even if it contains a slash.
- * This is actually a workaround for the fact that other
- * instances of the group not using the javascript extension aren't forbidden
- * to add properties containing a slash in the property's name.
- * So, using this extension we can at least read the property.
- * @param {String} key The name of the property to return
- * @returns The value of the property
- * @type Object
- */
- this.getProperty = function(key) {
- if (key == null) {
- return null;
- } else if (javaGroupObject.hasProperty(key)) {
- // we got a primitive property
- var val = javaGroupObject.getProperty(key);
- if (val instanceof java.util.Date) {
- // convert java dates to javascript dates
- val = new Date(val);
- }
- return val;
- }
- return null;
- }
-
-
- /**
- * Exchanges this GroupObject with the one passed
- * as argument. This is done by exchanging the wrapped
- * instance of helma.extensions.helmagroups.GroupObject
- * @param {GroupObject} The GroupObject to use
- * @returns The GroupObject with the exchanged wrapped java object
- * @type GroupObject
- */
- this.wrap = function(newGroupObject) {
- checkWriteAccess();
- if (javaGroupObject.getState() != helmagroups.GroupObject.REPLICATED) {
- throw "helma.Group.GroupObject.wrap() may only be called on replicated GroupObjects";
- }
- if (newGroupObject == null || !(newGroupObject instanceof helma.Group.GroupObject)) {
- throw "helma.Group.GroupObject.wrap() requires a helma.Group.GroupObject as an argument";
- }
- javaGroupObject.wrap(newGroupObject.getJavaObject());
- return this;
- };
-
- /**
- * Clones this GroupObject and returns it.
- * This method should be considered if many properties
- * of a GroupObject must be set or modified since every
- * change to an already replicated GroupObject will
- * result in immediate network traffic. Using unwrap
- * one can modify several properties and then commit
- * the GroupObject at once using {@link #wrap).
- * @returns A clone of this GroupObject
- * @type GroupObject
- */
- this.unwrap = function() {
- var javaGroupObjectClone = javaGroupObject.clone();
- javaGroupObjectClone.setChildren(new java.util.Hashtable());
- javaGroupObjectClone.setState(helmagroups.GroupObject.LOCAL);
- javaGroupObjectClone.setPath(null);
- return new helma.Group.GroupObject(javaGroupObjectClone);
- };
-
- /**
- * Converts this GroupObject into a vanilla Object
- * @returns An Object containing all properties of this GroupObject
- * @type Object
- */
- this.toJSObject = function() {
- var key;
- var obj = {};
- var e = javaGroupObject.properties();
- while(e.hasMoreElements()) {
- obj[key = e.nextElement()] = javaGroupObject.getProperty(key);
- }
- return obj;
- };
-
- /**
- * Returns an Array containing all child GroupObjects
- * @returns An Array containing GroupObjects
- * @type Array
- */
- this.listChildren = function() {
- var arr = [];
- var e = javaGroupObject.children();
- while(e.hasMoreElements()) {
- arr.push(e.nextElement());
- }
- return arr;
- };
-
- /**
- * Returns an Array containing all property
- * names of this GroupObject instance
- * @returns An Array containing property names
- * @type Array
- */
- this.listProperties = function() {
- var arr = [];
- var e = javaGroupObject.properties();
- while(e.hasMoreElements()) {
- arr.push(e.nextElement());
- }
- return arr;
- };
-
- /**
- * Returns the number of child GroupObjects
- * @returns The number of child GroupObjects of this
- * helma.Group.GroupObject instance
- * @type Number
- */
- this.countChildren = function() {
- var ht = javaGroupObject.getChildren();
- if (ht == null) {
- return 0;
- } else {
- return ht.size();
- }
- };
-
- /**
- * Returns the number of properties of this GroupObject
- * @return The number of properties
- * @type Number
- */
- this.countProperties = function() {
- var ht = javaGroupObject.getProperties();
- return (ht == null) ? 0 : ht.size();
- };
-
- /**
- * Returns true if the GroupObject is not replicated
- * @returns True if this GroupObject is still local
- * @type Boolean
- */
- this.isLocal = function() {
- return (javaGroupObject.getState()
- == helmagroups.GroupObject.LOCAL);
- };
-
- /** @ignore */
- this.toString = function() {
- return javaGroupObject.toString();
- };
-
- return this;
-};
-
-/**
- * Static properties of GroupObject constructor function.
- * These values determine if and for how many confirmation of the
- * group members this instance waits after a modification.
- * These values are passed through to org.jgroups.blocks.GroupRequest,
- * for further comments see the sourcecode of that class
- */
-// wait just for the first response
-helma.Group.GroupObject.GET_FIRST = 1;
-// wait until all members have responded
-helma.Group.GroupObject.GET_ALL = 2;
-// wait for majority (50% + 1) to respond
-helma.Group.GroupObject.GET_MAJORITY = 3;
-// wait for majority of all members (may block!)
-helma.Group.GroupObject.GET_ABS_MAJORITY = 4;
-// don't wait for any response (fire & forget)
-helma.Group.GroupObject.GET_NONE = 6;
-// default: wait for all responses
-helma.Group.GroupObject.DEFAULT_GET = helma.Group.GroupObject.GET_ALL;
-
-/**
- * This is mounted as "groups".
- * @class The root for all groups started in this application
- * @constructor
- */
-helma.Group.Manager = function() {
- var helmagroups = Packages.helma.extensions.helmagroups;
- var extension = helmagroups.GroupExtension.self;
-
- if (extension == null) {
- throw("helma.Group.Manager requires the HelmaGroups Extension \
- located in lib/ext or the application's top-level directory \
- [http://adele.helma.org/download/helma/contrib/helmagroups/]");
- }
-
-
- /**
- * get a java object Group for a groupname.
- * object is fetched regardless of connection status
- * @returns null if group is not defined
- */
- var getJavaGroup = function(name) {
- return extension.checkAppLink(app.name).get(name);
- };
-
-
- /**
- * visible to scripting env: get a group, wrapped as a javascript helma.Group object.
- * the group must be defined in app.properties: group.nameXX =
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Html.js')
- */
-
-// take care of any dependencies
-app.addRepository('modules/core/String.js');
-app.addRepository('modules/core/Object.js');
-app.addRepository('modules/core/Array.js');
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Creates a new instance of helma.Html
- * @class This class provides various methods for rendering
- * X/Html tags.
- * @returns A newly created instance of helma.Html
- * @constructor
- */
-helma.Html = function() {
- return this;
-};
-
-/**
- * Static helper method that renders an arbitrary markup part.
- * @param {String} name The element's name
- * @param {String} start Prefix of each rendered element
- * @param {String} end Suffix of each rendered element
- * @param {Object} attr Optional element attributes
- */
-helma.Html.renderMarkupPart = function(name, start, end, attr) {
- res.write(start);
- res.write(name);
- if (attr) {
- for (var i in attr) {
- if (i == "prefix" || i == "suffix" ||
- i == "default" || attr[i] == null) {
- continue;
- }
- res.write(" ");
- res.write(i);
- res.write("=\"");
- res.write(attr[i]);
- res.write("\"");
- }
- }
- res.write(end);
- return;
-};
-
-/**
- * Static helper method used in helma.Html.checkBox
- * and helma.Html.dropDown to check if a current value
- * matches against one or more selected values passed
- * as argument
- * @param {String} value The current value to check
- * @param {String|Array} selectedValue Either a single
- * value to check against the current value, or an array
- * containing values.
- * @returns True in case the value is among the selected
- * values, false otherwise
- * @type Boolean
- */
-helma.Html.isSelected = function(value, selectedValue) {
- if (selectedValue == null || value == null)
- return false;
- if (selectedValue instanceof Array)
- return selectedValue.contains(value);
- return value == selectedValue;
-};
-
-
-/** @ignore */
-helma.Html.prototype.toString = function() {
- return "[helma.Html]";
-};
-
-/**
- * Renders the opening tag of an arbitrary x/html tag
- * @param {String} name The tag name
- * @param {Object} attr An optional object containing element attributes
- */
-helma.Html.prototype.openTag = function(name, attr) {
- helma.Html.renderMarkupPart(name, "<", ">", attr);
- return;
-};
-
-/**
- * Returns the opening tag of an arbitrary x/html tag
- * @param {String} name The tag name
- * @param {Object} attr An optional object containing element attributes
- * @returns The rendered x/html opening tag
- * @type String
- * @see #openTag
- */
-helma.Html.prototype.openTagAsString = function(name, attr) {
- res.push();
- helma.Html.renderMarkupPart(name, "<", ">", attr);
- return res.pop();
-};
-
-/**
- * Renders the closing tag of an arbitrary x/html tag
- * @param {String} name The tag name
- */
-helma.Html.prototype.closeTag = function(name) {
- helma.Html.renderMarkupPart(name, "", ">", null);
- return;
-};
-
-/**
- * Returns the closing tag of an arbitray x/html element
- * @param {String} name The tag name
- * @returns The rendered closing tag
- * @type String
- * @see #closeTag
- */
-helma.Html.prototype.closeTagAsString = function(name) {
- res.push();
- helma.Html.renderMarkupPart(name, "", ">", null);
- return res.pop();
-};
-
-/**
- * Renders an empty arbitrary x/html tag ("contentless tag")
- * @param {String} name The tag name
- * @param {Object} attr An optional object containing tag attributes
- */
-helma.Html.prototype.tag = function(name, attr) {
- helma.Html.renderMarkupPart(name, "<", " />", attr);
- return;
-};
-
-/**
- * Returns an empty arbitrary x/html tag ("contentless tag")
- * @param {String} name The tag name
- * @param {Object} attr An optional object containing tag attributes
- * @returns The rendered element
- * @type String
- * @see #tag
- */
-helma.Html.prototype.tagAsString = function(name, attr) {
- res.push();
- helma.Html.renderMarkupPart(name, "<", " />", attr);
- return res.pop();
-};
-
-/**
- * Renders an arbitrary x/html element
- * @param {String} name The element name
- * @param {String} str The content of the element
- * @param {Object} attr An optional object containing element attributes
- */
-helma.Html.prototype.element = function(name, str, attr) {
- helma.Html.renderMarkupPart(name, "<", ">", attr);
- res.write(str);
- helma.Html.renderMarkupPart(name, "", ">");
- return;
-};
-
-/**
- * Return an arbitrary x/html element
- * @param {String} name The element name
- * @param {String} str The content of the element
- * @param {Object} attr An optional object containing element attributes
- * @returns The rendered element
- * @type String
- * @see #element
- */
-helma.Html.prototype.elementAsString = function(name, str, attr) {
- res.push();
- this.element(name, str, attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html link tag
- * @param {Object} attr An object containing the link attributes
- * @param {String} text The text to appear as link
- */
-helma.Html.prototype.link = function(attr, text) {
- if (!attr) {
- res.write("[Html.link: insufficient arguments]");
- return;
- }
- this.openTag("a", attr);
- res.write(text);
- this.closeTag("a");
- return;
-};
-
-/**
- * Returns a rendered x/html link tag
- * @param {Object} attr An object containing the link attributes
- * @param {String} text The text to appear as link
- * @returns The rendered link tag
- * @type String
- * @see #link
- */
-helma.Html.prototype.linkAsString = function(attr, text) {
- res.push();
- this.link(attr, text);
- return res.pop();
-};
-
-/**
- * Renders an x/html input tag of type "hidden"
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.hidden = function(param) {
- if (!param) {
- res.write("[Html.hidden: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = "hidden";
- attr.value = (attr.value != null) ? encodeForm(attr.value) : "";
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html input tag of type "hidden"
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered input element
- * @type String
- * @see #hidden
- */
-helma.Html.prototype.hiddenAsString = function(attr) {
- res.push();
- this.hidden(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html text input tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.input = function(param) {
- if (!param) {
- res.write("[Html.input: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = param.type || "text";
- attr.value = (attr.value != null) ? encodeForm(attr.value) : "";
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html text input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered text input tag
- * @type String
- * @see #input
- */
-helma.Html.prototype.inputAsString = function(attr) {
- res.push();
- this.input(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html textarea tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.textArea = function(param) {
- if (!param) {
- res.write("[Html.textArea: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- var value = (attr.value != null) ? encodeForm(attr.value) : "";
- delete attr.value;
- this.openTag("textarea", attr);
- res.write(value);
- this.closeTag("textarea");
- return;
-};
-
-/**
- * Returns a rendered x/html textarea tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered textarea tag
- * @type String
- * @see #textArea
- */
-helma.Html.prototype.textAreaAsString = function(attr) {
- res.push();
- this.textArea(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html checkbox input tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.checkBox = function(param) {
- if (!param) {
- res.write("[Html.checkBox: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = "checkbox";
- if (attr.selectedValue != null) {
- if (helma.Html.isSelected(param.value, param.selectedValue))
- attr.checked = "checked";
- else
- delete attr.checked;
- delete attr.selectedValue;
- }
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html checkbox input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered checkbox tag
- * @type String
- * @see #checkBox
- */
-helma.Html.prototype.checkBoxAsString = function(attr) {
- res.push();
- this.checkBox(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html radiobutton input tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.radioButton = function(param) {
- if (!param) {
- res.write("[Html.radioButton: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = "radio";
- if (attr.selectedValue != null) {
- if (attr.value == attr.selectedValue)
- attr.checked = "checked";
- else
- delete attr.checked;
- delete attr.selectedValue;
- }
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html radio input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered element
- * @type String
- * @see #radioButton
- */
-helma.Html.prototype.radioButtonAsString = function(attr) {
- res.push();
- this.radioButton(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html submit input tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.submit = function(param) {
- if (!param) {
- res.write("[Html.submit: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = "submit";
- if (!attr.name)
- attr.name = attr.type;
- attr.value = (attr.value != null) ? encodeForm(attr.value) : attr.type;
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html submit input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered submit input tag
- * @type String
- * @see #submit
- */
-helma.Html.prototype.submitAsString = function(attr) {
- res.push();
- this.submit(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html button input tag
- * @param {Object} param An object containing the tag attributes
- */
-helma.Html.prototype.button = function(param) {
- if (!param) {
- res.write("[Html.button: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- attr.type = "button";
- if (!attr.name)
- attr.name = attr.type;
- attr.value = (attr.value != null) ? encodeForm(attr.value) : attr.type;
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html button input tag
- * @param {Object} param An object containing the tag attributes
- * @returns The rendered button input tag
- * @type String
- * @see #button
- */
-helma.Html.prototype.buttonAsString = function(attr) {
- res.push();
- this.button(attr);
- return res.pop();
-};
-
-/**
- * Renders a x/html drop down select box
- * @param {Object} param An object containing the tag attributes
- * @param {Array} options Either an array of strings, an array with
- * several {value: v, display: d}
objects, or a collection
- * of ["value", "display"]
arrays in an array
- * @param {String} selectedValue The value to pre-select
- * @param {String} firstOption An optional first option to display in the
- * select box (this option will always have no value)
- */
-helma.Html.prototype.dropDown = function(param, options, selectedValue, firstOption) {
- if (!param) {
- res.write("[Html.dropDown: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- this.openTag("select", attr);
- res.write("\n ");
- if (firstOption) {
- this.openTag("option", {value: ""});
- res.write(firstOption);
- this.closeTag("option");
- res.write("\n ");
- }
- var hasOpenGroup = false;
- for (var i in options) {
- if (options[i].group) {
- hasOpenGroup && html.closeTag("optgroup");
- html.openTag("optgroup", {label: options[i].group});
- hasOpenGroup = true;
- }
- var attr = new Object();
- var display = "";
- if ((options[i] instanceof Array) && options[i].length > 0) {
- // option is an array
- attr.value = options[i][0];
- display = options[i][1];
- } else if (options[i].value != null && options[i].display != null) {
- // option is an object
- attr.value = options[i].value;
- if (options[i]["class"] != null) {
- attr["class"] = options[i]["class"];
- }
- display = options[i].display;
- } else {
- // assume option is a string
- attr.value = i;
- display = options[i];
- }
- if (helma.Html.isSelected(attr.value, selectedValue))
- attr.selected = "selected";
- this.openTag("option", attr);
- res.write(display);
- this.closeTag("option");
- res.write("\n ");
- }
- hasOpenGroup && html.closeTag("optgroup");
- this.closeTag("select");
- res.write("\n ");
- return;
-};
-
-/**
- * Returns a rendered x/html drop down select box
- * @param {Object} param An object containing the tag attributes
- * @param {Array} options Either an array of strings, an array with
- * several {value: v, display: d}
objects, or a collection
- * of ["value", "display"]
arrays in an array
- * @param {String} selectedValue The value to pre-select
- * @param {String} firstOption An optional first option to display in the
- * select box (this option will always have no value)
- * @returns The rendered drop down select box
- * @type String
- * @see #dropDown
- */
-helma.Html.prototype.dropDownAsString = function(attr, options, selectedValue, firstOption) {
- res.push();
- this.dropDown(attr, options, selectedValue, firstOption);
- return res.pop();
-};
-
-/**
- * Renders an image map based on an array containing the map parameters.
- * @param {String} name The name of the image map
- * @param {Array} param An array containing objects, where each of them
- * contains the attributes for a single image map entry
- */
-helma.Html.prototype.map = function(name, param) {
- if (!name || !param) {
- res.write("[Html.map: insufficient arguments]");
- return;
- }
- this.openTag("map", {name: name});
- var attr = Object.prototype.reduce.call(param);
- for (var i in areas) {
- if (!areas[i].alt)
- areas[i].alt = "";
- if (!areas[i].shape)
- areas[i].shape = "rect";
- this.openTag("area", areas[i]);
- }
- this.closeTag("map");
- return;
-};
-
-/**
- * Returns a rendered image map based on an array containing the map parameters.
- * @param {String} name The name of the image map
- * @param {Array} areas An array containing objects, where each of them
- * contains the attributes for a single image map entry
- * @returns The rendered image map
- * @type String
- * @see #map
- */
-helma.Html.prototype.mapAsString = function(name, areas) {
- res.push();
- this.map(name, areas);
- return res.pop();
-};
-
-/**
- * Renders a complete x/html table.
- * @param {Array} headers An array containing table headers
- * @param {Array} data A two-dimensional array containing the table data
- * @param {Object} param An object containing the following properties:
- *
- *
- */
-helma.Html.prototype.table = function(headers, data, param) {
- if (!param) {
- res.write("[Html.table: insufficient arguments]");
- return;
- }
- var attr = Object.prototype.reduce.call(param);
- if (!attr.trHead) attr.trHead = attr.tr;
- if (!attr.trEven) attr.trEven = attr.tr;
- if (!attr.trOdd) attr.trOdd = attr.tr;
- if (!attr.tdEven) attr.tdEven = attr.td;
- if (!attr.tdOdd) attr.tdOdd = attr.td;
- if (!attr.thEven) attr.thEven = attr.th;
- if (!attr.thOdd) attr.thOdd = attr.th;
- this.openTag("table", attr.table);
- if (headers) {
- this.openTag("tr", attr.trHead);
- for (var i in headers) {
- var evenOdd = i % 2 == 0 ? "Even" : "Odd";
- this.openTag("th", attr["th"+evenOdd]);
- res.write(headers[i]);
- this.closeTag("th");
- }
- this.closeTag("tr");
- }
- for (var i in data) {
- var evenOdd = i % 2 == 0 ? "Even" : "Odd";
- this.openTag("tr", attr["tr"+evenOdd]);
- for (var j in data[i]) {
- var evenOddCell = j % 2 == 0 ? "Even" : "Odd";
- this.openTag("td", attr["td"+evenOddCell]);
- res.write(data[i][j]);
- this.closeTag("td");
- }
- this.closeTag("tr");
- }
- this.closeTag("table");
- return;
-};
-
-/**
- * Returns a rendered x/html table
- * @param {Array} headers An array containing table headers
- * @param {Array} data A two-dimensional array containing the table data
- * @param {Object} attr For a description see {@link #table}
- * @returns The rendered table
- * @type String
- * @see #table
- */
-helma.Html.prototype.tableAsString = function(headers, data, attr) {
- res.push();
- this.table(headers, data, attr);
- return res.pop();
-};
-
-/*********************************************************************/
-/* */
-/* the following functions should be deliberately altered or removed */
-/* (most of these can easily be replaced by the methods they call) */
-/* */
-/*********************************************************************/
-
-/**
- * Renders an x/html opening link tag
- * @param {Object} attr An object containing the tag attributes
- */
-helma.Html.prototype.openLink = function(attr) {
- this.openTag("a", attr);
- return;
-};
-
-/**
- * Returns an x/html opening link tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered open link tag
- * @type String
- * @see #openTag
- */
-helma.Html.prototype.openLinkAsString = function(attr) {
- return this.openTagAsString("a", attr);
-};
-
-/**
- * Renders an x/html closing link tag
- */
-helma.Html.prototype.closeLink = function() {
- this.closeTag("a");
- return;
-};
-
-/**
- * Returns a rendered x/html closing link tag
- * @returns Rhe rendered closing link tag
- * @type String
- * @see #closeLink
- */
-helma.Html.prototype.closeLinkAsString = function() {
- return this.closeTagAsString("a");
-};
-
-/**
- * Renders a color definition string. If the string passed as
- * argument contains only hex characters it will be prefixed with a
- * hash sign if necessary, otherwise this method assumes that the
- * value is a named color (eg. "yellow").
- * @param {String} c The color definintion
- * @deprecated
- */
-helma.Html.prototype.color = function(c) {
- if (c) {
- var nonhex = /[^0-9,a-f]/gi;
- if (!c.match(nonhex)) {
- c = c.pad("0", 6);
- res.write("#");
- }
- }
- res.write(c);
- return;
-};
-
-/**
- * Returns a color definition.
- * @param {String} c The color definintion
- * @returns The rendered color definition
- * @type String
- * @see #color
- * @deprecated
- */
-helma.Html.prototype.colorAsString = function(c) {
- res.push();
- this.color(c);
- return res.pop();
-};
-
-/**
- * Renders an x/html opening form tag
- * @param {Object} attr An object containing the tag attributes
- */
-helma.Html.prototype.form = function(attr) {
- this.openTag("form", attr);
- return;
-};
-
-/**
- * Returns an x/html opening form tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered opening form tag
- * @type String
- * @see #form
- */
-helma.Html.prototype.formAsString = function(attr) {
- res.push();
- this.form(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html password input tag
- * @param {Object} attr An object containing the tag attributes
- */
-helma.Html.prototype.password = function(attr) {
- if (!attr) {
- res.write("[Html.password: insufficient arguments]");
- return;
- }
- attr.type = "password";
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html password input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered password input tag
- * @type String
- * @see #password
- */
-helma.Html.prototype.passwordAsString = function(attr) {
- res.push();
- this.password(attr);
- return res.pop();
-};
-
-/**
- * Renders an x/html file input tag
- * @param {Object} attr An object containing the tag attributes
- */
-helma.Html.prototype.file = function(attr) {
- if (!attr) {
- res.write("[Html.file: insufficient arguments]");
- return;
- }
- attr.type = "file";
- this.tag("input", attr);
- return;
-};
-
-/**
- * Returns a rendered x/html file input tag
- * @param {Object} attr An object containing the tag attributes
- * @returns The rendered file input tag
- * @type String
- * @see #file
- */
-helma.Html.prototype.fileAsString = function(attr) {
- res.push();
- this.file(attr);
- return res.pop();
-};
-
-/**
- * Parses the string passed as argument and converts any
- * URL in it into a link tag
- * @param {String} str The string wherein URLs should be
- * converted into link tags
- * @returns The string containing URLs converted into link tags
- * @type String
- */
-helma.Html.prototype.activateUrls = function(str) {
- var re = /(^|\/>|\s+)([fhtpsr]+:\/\/[^\s]+?)([\.,;:\)\]\"]?)(?=[\s<]|$)/gim;
- var func = function(str, p1, p2, p3) {
- res.push();
- res.write(p1);
- res.write('');
- res.write(p2.clip(50, "...", true));
- res.write('');
- res.write(p3);
- return res.pop();
- };
- return str.replace(re, func);
-};
-
-/**
- * Creates a new TableWriter instance
- * @class This class provides various methods for
- * programmatically creating an x/html table.
- * @param {Number} numberOfColumns The number of columns in the table
- * @param {Object} attr An object containing attributes to use when
- * rendering the single table elements. For a description see {@link #table}.
- * @returns An instance of TableWriter
- * @constructor
- */
-helma.Html.TableWriter = function(numberOfColumns, attr) {
- if (isNaN(numberOfColumns))
- throw "Illegal argument in TableWriter(): first argument must be a number";
- if (numberOfColumns < 1)
- throw "Illegal argument in TableWriter(): first argument must be > 1";
- /** @private */
- this.ncols = numberOfColumns;
- /** @private */
- this.written = 0;
- // if no attributes object given, create an empty one
- if (!attr)
- attr = {};
- if (!attr.trEven) attr.trEven = attr.tr;
- if (!attr.trOdd) attr.trOdd = attr.tr;
- if (!attr.trHead) attr.trHead = attr.trEven;
- if (!attr.tdEven) attr.tdEven = attr.td;
- if (!attr.tdOdd) attr.tdOdd = attr.td;
- if (!attr.thEven) attr.thEven = attr.th;
- if (!attr.thOdd) attr.thOdd = attr.th;
- /** @private */
- this.attr = attr;
-
- /**
- * If set to true the first row of the table data is rendered
- * using table
: Attributes to render within the opening <table>
tagtr
: Attributes to render within each <tr>
tagtd
: Attributes to render within each <td>
tagth
: Attributes to render within each <th>
tagtrHead
: Attributes to render within each <tr>
tag
- in the header area of the tabletrEven
: Attributes to render within each even <tr>
tagtrOdd
: Attributes to render within each odd <tr>
tagtdEven
: Attributes to render within each even <td>
tagtdOdd
: Attributes to render within each odd <td>
tagthEven
: Attributes to render within each even <th>
tagthOdd
: Attributes to render within each odd <th>
tag<th>
tags (defaults to false).
- * @type Boolean
- */
- this.writeHeader = false;
-
- /**
- * If set to true the TableWriter returns the rendered table
- * as string, otherwise the table is written directly to response,
- * which is the default.
- * @type Boolean
- */
- this.writeString = false;
-
- this.dontEnum("ncols", "written", "attr", "writeHeader", "writeString");
-
- return this;
-};
-
-/** @ignore */
-helma.Html.TableWriter.prototype.toString = function() {
- return "[helma.Html.TableWriter]";
-}
-
-/**
- * Writes a single table cell to response.
- * @param {String} text The content of the table cess
- * @param {Object} attr An optional object containig attributes
- * to render for this table cell
- */
-helma.Html.TableWriter.prototype.write = function(text, attr) {
- // set up some variables
- var isHeaderRow = (this.writeHeader && this.written < this.ncols);
- var isNewRow = (this.written % this.ncols == 0);
- var isEvenRow = ((this.written / this.ncols) % 2 == 0);
- var isEvenCol = ((this.written % this.ncols) % 2 == 0);
- // write out table and table row tags
- if (this.written == 0) {
- if (this.writeString)
- res.push();
- helma.Html.prototype.openTag.call(this, "table", this.attr.table);
- helma.Html.prototype.openTag.call(this, "tr", this.attr.trHead);
- } else if (isNewRow) {
- helma.Html.prototype.closeTag.call(this, "tr");
- if (isEvenRow)
- helma.Html.prototype.openTag.call(this, "tr", this.attr.trEven);
- else
- helma.Html.prototype.openTag.call(this, "tr", this.attr.trOdd);
- }
- // get the attribute object for the table cell
- if (!attr) {
- // no explicit attribute given
- if (isEvenCol) {
- attr = isHeaderRow ? this.attr.thEven : this.attr.tdEven;
- } else {
- attr = isHeaderRow ? this.attr.thOdd : this.attr.tdOdd;
- }
- }
- // write out table cell tag
- helma.Html.prototype.openTag.call(this, isHeaderRow ? "th" : "td", attr);
- // write out table cell contents
- if (text) {
- res.write(text);
- }
- // close table cell
- helma.Html.prototype.closeTag.call(this, isHeaderRow ? "th" : "td");
- if (attr && !isNaN(attr.colspan)) {
- this.written += attr.colspan;
- } else {
- this.written += 1;
- }
- return;
-};
-
-/**
- * Closes all open table tags. If {@link #writeString} is set to
- * true, this method returns the rendered table.
- * @returns The rendered table, if {@link #writeString} is set to
- * true, otherwise void.
- * @type String
- */
-helma.Html.TableWriter.prototype.close = function() {
- if (this.written > 0) {
- while (this.written++ % this.ncols != 0)
- res.write("");
- res.write("");
- this.written = 0;
- }
- if (this.writeString)
- return res.pop();
- return;
-};
-
-
-
-helma.lib = "Html";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-for (var i in helma[helma.lib].TableWriter.prototype)
- helma[helma.lib].TableWriter.prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Http.js b/modules/helma/Http.js
deleted file mode 100644
index f1cab23d..00000000
--- a/modules/helma/Http.js
+++ /dev/null
@@ -1,833 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Http.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-
-/**
- * @fileoverview Fields and methods of the helma.Http class.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Http.js')
- */
-
-// take care of any dependencies
-app.addRepository('modules/core/Date.js');
-
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Creates a new instance of helma.Http
- * @class This class provides functionality to programatically issue
- * an Http request based on java.net.HttpUrlConnection.
- * By default the request will use method GET
.
- * @returns A newly created helma.Http instance
- * @constructor
- */
-helma.Http = function() {
- var self = this;
- var proxy = null;
- var content = "";
- var userAgent = "Helma Http Client";
- var method = "GET";
- var cookies = null;
- var credentials = null;
- var followRedirects = true;
- var binaryMode = false;
- var headers = {};
- var timeout = {
- "connect": 0,
- "socket": 0
- };
- var maxResponseSize = null;
- var maxTries = 5;
- var currentTries = 0;
-
- var responseHandler = function(connection, result) {
- var input;
- var stream;
- try {
- stream = connection.getInputStream();
- } catch (error) {
- 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();
- var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
- var len;
- var currentSize = 0;
- while ((len = input.read(buf)) > -1) {
- body.write(buf, 0, len);
- currentSize += len;
- if (maxResponseSize && currentSize > maxResponseSize) {
- throw new Error("Maximum allowed response size is exceeded");
- }
- }
- try {
- input.close();
- } catch (error) {
- // safe to ignore
- }
- if (binaryMode) {
- result.content = body.toByteArray();
- } else {
- result.content = result.charset ?
- body.toString(result.charset) :
- body.toString();
- }
- // adjust content length
- if (result.content) {
- result.length = result.content.length;
- }
- }
- };
-
- /** @private */
- var setTimeout = function(type, value) {
- var v = java.lang.System.getProperty("java.specification.version");
- if (parseFloat(v, 10) >= 1.5) {
- timeout[type] = value;
- } else {
- app.logger.warn("helma.Http: Timeouts can only be set with Java Runtime version >= 1.5");
- }
- return true;
- }
-
- /**
- * Sets the proxy host and port for later use. The argument must
- * be in host:port
format (eg. "proxy.example.com:3128").
- * @param {String} proxyString The proxy to use for this request
- * @see #getProxy
- */
- this.setProxy = function(proxyString) {
- var idx = proxyString.indexOf(":");
- var host = proxyString.substring(0, idx);
- var port = proxyString.substring(idx+1);
- if (java.lang.Class.forName("java.net.Proxy") != null) {
- // construct a proxy instance
- var socket = new java.net.InetSocketAddress(host, port);
- proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, socket);
- } else {
- // the pre jdk1.5 way: set the system properties
- var sys = java.lang.System.getProperties();
- if (host) {
- app.logger.warn("[Helma Http Client] WARNING: setting system http proxy to " + host + ":" + port);
- sys.put("http.proxySet", "true");
- sys.put("http.proxyHost", host);
- sys.put("http.proxyPort", port);
- }
- }
- return;
- };
-
- /**
- * Returns the proxy in host:port
format
- * @return The proxy defined for this request
- * @type String
- * @see #setProxy
- */
- this.getProxy = function() {
- if (proxy != null) {
- return proxy.address().getHostName() + ":" + proxy.address().getPort();
- } else if (sys.get("http.proxySet") == "true") {
- return sys.get("http.proxyHost") + ":" + sys.get("http.proxyPort");
- } else {
- return null;
- }
- };
-
- /**
- * Sets the credentials for basic http authentication
- * @param {String} username The username
- * @param {String} password The password
- */
- this.setCredentials = function(username, password) {
- var str = username + ":" + password;
- credentials = str.enbase64();
- return;
- }
-
- /**
- * Sets the content to send to the remote server within this request.
- * @param {String|Object} stringOrObject The content of the request, which
- * 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.
- */
- this.setContent = function(stringOrObject) {
- if (stringOrObject != null) {
- if (stringOrObject.constructor == Object) {
- res.push();
- var value;
- 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);
- 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 {
- content = stringOrObject.toString();
- }
- } else {
- content = null;
- }
- return;
- };
-
- /**
- * Sets the request method to use.
- * @param {String} m The method to use (GET
, POST
...)
- * @see #getMethod
- */
- this.setMethod = function(m) {
- method = m;
- return;
- };
-
- /**
- * Returns the currently defined request method.
- * @returns The method used
- * @type String
- * @see #setMethod
- */
- this.getMethod = function() {
- return method;
- };
-
- /**
- * Sets a single HTTP request header field
- * @param {String} name The name of the header field
- * @param {String} value The value of the header field
- * @see #getHeader
- */
- this.setHeader = function(name, value) {
- headers[name] = value;
- return;
- };
-
- /**
- * Returns the value of the request header field with the given name
- * @param {String} name The name of the request header field
- * @returns The value of the request header field
- * @type String
- * @see #setHeader
- */
- this.getHeader = function(name) {
- return headers[name];
- };
-
- /**
- * Adds a cookie with the name and value passed as arguments
- * to the list of cookies to send to the remote server.
- * @param {String} name The name of the cookie
- * @param {String} value The value of the cookie
- * @see #getCookie
- * @see #getCookies
- */
- this.setCookie = function(name, value) {
- if (name != null && value != null) {
- // store the cookie in the cookies map
- if (!cookies) {
- cookies = {};
- }
- cookies[name] = new helma.Http.Cookie(name, value);
- }
- return;
- };
-
- /**
- * Returns the value of the cookie with the given name
- * @param {String} name The name of the cookie
- * @returns The value of the cookie
- * @type String
- * @see #setCookie
- */
- this.getCookie = function(name) {
- return (cookies != null) ? cookies[name] : null;
- };
-
- /**
- * 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.
- */
- this.setCookies = function(cookies) {
- if (cookies != null) {
- for (var i=0; iurl
: (String) The Url of the requestlocation
: (String) The value of the location header fieldcode
: (Number) The HTTP response codemessage
: (String) An optional HTTP response messagelength
: (Number) The content length of the responsetype
: (String) The mimetype of the responsecharset
: (String) The character set of the responseencoding
: (String) An optional encoding to use with the responselastModified
: (String) The value of the lastModified response header fieldeTag
: (String) The eTag as received from the remote servercookie
: (helma.Http.Cookie) An object containing the cookie parameters, if the remote
- server has set the "Set-Cookie" header fieldheaders
: (java.util.Map) A map object containing the headers, access them using get("headername")
- * content
: (String|ByteArray) The response received from the server. Can be either
- a string or a byte array (see #setBinaryMode)http.proxySet
, http.proxyHost
and
- * http.proxyPort
. Keep in mind that this is valid for
- * the whole Java Virtual Machine, therefor using this method
- * can potentially influence other running Helma applications too!
- * @param {String} proxyString A proxy definition in host:port
- * format (eg. "proxy.example.com:3128");
- * @member helma.Http
- */
-helma.Http.setProxy = function(proxyString) {
- var sys = java.lang.System.getProperties();
- if (proxyString) {
- var idx = proxyString.indexOf(":");
- var host = proxyString.substring(0, idx);
- var port = proxyString.substring(idx+1);
- if (!port)
- port = "3128";
- else if (typeof port == "number")
- port = port.toString();
- app.logger.info("helma.Http.setProxy " + proxyString);
- sys.put("http.proxySet", "true");
- sys.put("http.proxyHost", host);
- sys.put("http.proxyPort", port);
- } else {
- sys.put("http.proxySet", "false");
- sys.put("http.proxyHost", "");
- sys.put("http.prodyPort", "");
- }
- return;
-
-};
-
-
-/**
- * Returns the proxy setting of the Java Virtual Machine
- * the Helma application server is running in. If no
- * proxy is set, this method returns boolean false.
- * @returns The global proxy setting in host:port
- * format (eg. "proxy.example.com:3128"), or boolean false.
- * @type String|Boolean
- * @member helma.Http
- */
-helma.Http.getProxy = function() {
- var sys = java.lang.System.getProperties();
- if (sys.get("http.proxySet") == "true")
- return sys.get("http.proxyHost") + ":" + sys.get("http.proxyPort");
- return false;
-};
-
-
-/**
- * Static helper method to check if a request issued agains a
- * Helma application is authorized or not.
- * @param {String} name The username to check req.username against
- * @param {String} pwd The password to check req.password against
- * @return True if the request is authorized, false otherwise. In
- * the latter case the current response is reset and the response code
- * is set to "401" ("Authentication required").
- * @type Boolean
- */
-helma.Http.isAuthorized = function(name, pwd) {
- if (!req.username || !req.password ||
- req.username != name || req.password != pwd) {
- res.reset();
- res.status = 401;
- res.realm = "Helma Http Authorization";
- res.write("Authorization required.");
- return false;
- } else {
- return true;
- }
-};
-
-/** @ignore */
-helma.Http.toString = function() {
- return "[helma.Http]";
-};
-
-/**
- * Creates a new instance of helma.Http.Cookie
- * @class Instances of this object represent a HTTP cookie
- * @param {String} name The name of the cookie
- * @param {String} value The value of the cookie
- * @returns A newly created Cookie instance
- * @constructor
- */
-helma.Http.Cookie = function(name, value) {
- /**
- * The name of the Cookie
- * @type String
- */
- this.name = name;
-
- /**
- * The value of the Cookie
- * @type String
- */
- this.value = value;
-
- /**
- * An optional date defining the lifetime of this cookie
- * @type Date
- */
- this.expires = null;
-
- /**
- * An optional path where this cookie is valid
- * @type String
- */
- this.path = null;
-
- /**
- * An optional domain where this cookie is valid
- * @type String
- */
- this.domain = null;
-
- return this;
-}
-
-/**
- * An instance of java.text.SimpleDateFormat used for both parsing
- * an "expires" string into a date and vice versa
- * @type java.text.SimpleDateFormat
- * @final
- */
-helma.Http.Cookie.DATEFORMAT = new java.text.SimpleDateFormat("EEE, dd-MMM-yy HH:mm:ss z");
-
-
-/**
- * A regular expression used for parsing cookie strings
- * @type RegExp
- * @final
- */
-helma.Http.Cookie.PATTERN = /([^=;]+)=?([^;]*)(?:;\s*|$)/g;
-
-
-/**
- * Parses the cookie string passed as argument into an instance of helma.Http
- * @param {String} cookieStr The cookie string as received from the remote server
- * @returns An instance of helma.Http.Cookie containing the cookie parameters
- * @type helma.Http.Cookie
- */
-helma.Http.Cookie.parse = function(cookieStr) {
- if (cookieStr != null) {
- var cookie = new helma.Http.Cookie;
- var m = helma.Http.Cookie.PATTERN.exec(cookieStr);
- if (m) {
- cookie.name = m[1].trim();
- cookie.value = m[2] ? m[2].trim() : "";
- }
- while ((m = helma.Http.Cookie.PATTERN.exec(cookieStr)) != null) {
- var key = m[1].trim();
- var value = m[2] ? m[2].trim() : "";
- switch (key.toLowerCase()) {
- case "expires":
- // try to parse the expires date string into a date object
- try {
- cookie.expires = helma.Http.Cookie.DATEFORMAT.parse(value);
- } catch (e) {
- // ignore
- }
- break;
- default:
- cookie[key.toLowerCase()] = value;
- break;
- }
- }
- return cookie;
- }
- return null;
-};
-
-/**
- * Returns this cookie in a format useable to set the HTTP header field "Cookie"
- * @return This cookie formatted as HTTP header field value
- * @type String
- */
-helma.Http.Cookie.prototype.getFieldValue = function() {
- return this.name + "=" + this.value;
-};
-
-/** @ignore */
-helma.Http.Cookie.prototype.toString = function() {
- return "[helma.Http.Cookie " + this.name + " " + this.value + "]";
-};
-
-helma.lib = "Http";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-for (var i in helma[helma.lib].Cookie.prototype)
- helma[helma.lib].Cookie.prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Image.js b/modules/helma/Image.js
deleted file mode 100644
index 0d82691b..00000000
--- a/modules/helma/Image.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Image.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Methods of the helma.Image module.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Image.js')
- */
-
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Returns an Image object, generated from the specified source.
- *
- * If the JIMI package is installed, an instance of
- * helma.image.jimi.JimiGenerator will be returned. Otherwise,
- * if the javax.imageio package is available, an instance of
- * helma.image.imageio.ImageIOGenerator is returned.
- * Additionally, the class of the ImageGenerator implementation
- * to be used can be set using the imageGenerator
- * property in either the app.properties or server.properties
- * file.
- *
- *
- * @param {helma.File|java.io.File|String} arg image source, filename or url
- * @return a new Image object
- * @singleton
- * @see Packages.helma.image.ImageGenerator
- * @see Packages.helma.image.jimi.JimiGenerator
- * @see Packages.helma.image.imageio.ImageIOGenerator
- */
-helma.Image = function(arg) {
- // according to
- // http://grazia.helma.org/pipermail/helma-dev/2004-June/001253.html
- var generator = Packages.helma.image.ImageGenerator.getInstance();
- return generator.createImage(arg);
-}
-
-/** @ignore */
-helma.Image.toString = function() {
- return "[helma.Image]";
-};
-
-
-/**
- * Returns an ImageInfo object for the specified image file.
- *
- * @param {helma.File|java.io.File|String} arg image source, filename or url
- * @returns an ImageInfo object
- * @memberof helma.Image
- * @see Packages.helma.image.ImageInfo
- */
-helma.Image.getInfo = function(arg) {
- if (arguments.length != 1) {
- throw new java.lang.IllegalArgumentException(
- "Image.getInfo() expects one argument"
- );
- }
-
- var inp, result;
- var info = new Packages.helma.image.ImageInfo();
- // FIXME: we need a byte array for class comparison
- var b = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 0);
-
- try {
- if (arg instanceof java.io.InputStream) {
- inp = new java.io.InputStream(arg);
- // FIXME: here comes a dirty hack to check for a byte array
- } else if (arg.getClass && arg.getClass() == b.getClass()) {
- inp = new java.io.ByteArrayInputStream(arg);
- } else if (arg instanceof java.io.File) {
- inp = new java.io.FileInputStream(arg);
- } else if (arg instanceof helma.File) {
- inp = new java.io.FileInputStream(arg.getFile());
- } else if (typeof arg == "string") {
- var str = arg;
- // try to interpret argument as URL if it contains a colon,
- // otherwise or if URL is malformed interpret as file name.
- if (str.indexOf(":") > -1) {
- try {
- var url = new java.net.URL(str);
- inp = url.openStream();
- } catch (mux) {
- inp = new java.io.FileInputStream(str);
- }
- } else {
- inp = new java.io.FileInputStream(str);
- }
- }
- if (inp == null) {
- var msg = "Unrecognized argument in Image.getInfo(): ";
- msg += (arg == null ? "null" : arg.getClass().toString());
- throw new java.lang.IllegalArgumentException(msg);
- }
- info.setInput(inp);
- if (info.check()) {
- result = info;
- }
- } catch (e) {
- // do nothing, returns null later
- } finally {
- if (inp != null) {
- try {
- inp.close();
- } catch (e) {}
- }
- }
-
- return result;
-};
-
-
-/**
- * Writes a 1x1 pixel transparent spacer GIF image to the
- * response buffer and sets the content type to image/gif.
- *
- * @memberof helma.Image
- */
-helma.Image.spacer = function() {
- res.contentType = "image/gif";
- res.writeBinary([71,73,70,56,57,97,2,0,2,0,-128,-1,0,-64,-64,-64,0,0,0,33,-7,4,1,0,0,0,0,44,0,0,0,0,1,0,1,0,64,2,2,68,1,0,59]);
- return;
-};
-
-helma.lib = "Image";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
-
-
-
diff --git a/modules/helma/Mail.js b/modules/helma/Mail.js
deleted file mode 100644
index 5ea1a3b3..00000000
--- a/modules/helma/Mail.js
+++ /dev/null
@@ -1,705 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2007 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Mail.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Fields and methods of the helma.Mail class.
- *
- * To use this optional module, its repository needs to be added to the
- * application, for example by calling app.addRepository('modules/helma/Mail.js')
- */
-
-// take care of any dependencies
-app.addRepository('modules/helma/File.js');
-
-/**
- * Define the global namespace if not existing
- */
-if (!global.helma) {
- global.helma = {};
-}
-
-/**
- * Mail client enabling you to send e-mail via SMTP using Packages.javax.mail.
- *
- * @class This class provides functionality to sending
- * Email messages.
- * A mail client object is created by using the helma.Mail()
- * constructor. The mail object then can be manipulated and sent
- * using the methods listed below.
- *
- * You will either need to set your mail server via the smtp
- * property in the app.properties or server.properties file
- * or pass the hostname of the mail server you want to use as a
- * parameter to the constructor.
- *
- * Note: Make sure that the SMTP server itself is well-configured,
- * so that it accepts e-mails coming from your server and does
- * not deny relaying. Best and fastest configuration is of course
- * if you run your own SMTP server (e.g. postfix) which might be
- * a bit tricky to set up, however.
0
unless
- * an error occurred. See {@link helma.Mail Mail.js} source code for a list of
- * possible error codes.
- */
- this.status = OK;
-
- /**
- * Sets the sender of an e-mail message.
- * addTerm("fieldname", "querystring") - * addTerm("fieldname", "querystring", "and") - * addTerm("fieldname", "querystring", helma.Search.getAnalyzer("de")) - * addTerm("fieldname", "querystring", "not", helma.Search.getAnalyzer("simple"))- * @param {String|Array} field Either a String or an Array containing Strings - * that determine the index field(s) to match - * @param {String} str Query string to match - * @param {String} clause Boolean clause ("or", "not" or "and", default is "and") - * @param {org.apache.lucene.analysis.Analyzer} analyzer An analyzer to use - */ -helma.Search.BooleanQuery.prototype.addTerm = function(field, str, clause, analyzer) { - var pkg = Packages.org.apache.lucene; - if (arguments.length == 3 && arguments[2] instanceof pkg.analysis.Analyzer) { - analyzer = arguments[2]; - clause = "or"; - } - if (!analyzer) { - analyzer = helma.Search.getAnalyzer(); - } - - var fields = (field instanceof Array) ? field : [field]; - var parser = new pkg.queryParser.MultiFieldQueryParser(fields, analyzer); - this.addQuery(parser.parse(str), clause); - return; -}; - -/** - * Adds an additional query clause to this query. - * @param {helma.Search.Query} q The query to add - * @param {String} clause Boolean clause ("or", "not", or "and", default is "and") - */ -helma.Search.BooleanQuery.prototype.addQuery = function(q, clause) { - var pkg = Packages.org.apache.lucene; - var booleanClause; - if (q instanceof helma.Search.Query) { - q = q.getQuery(); - } - switch (clause) { - case "and": - booleanClause = pkg.search.BooleanClause.Occur.MUST; - break; - case "not": - booleanClause = pkg.search.BooleanClause.Occur.MUST_NOT; - break; - default: - booleanClause = pkg.search.BooleanClause.Occur.SHOULD; - break; - } - this.getQuery().add(q, booleanClause); - return; -}; - -/** - * Constructs a new helma.Search.PhraseQuery instance that wraps - * a Lucene Phrase Query object. - * @class Instances of this class represent a phrase query. - * @param {String} field The name of the field - * @param {String} str The phrase query string - * @returns A newly created PhraseQuery instance - * @constructor - * @extends helma.Search.Query - */ -helma.Search.PhraseQuery = function(field, str) { - /** - * Contains the wrapped PhraseQuery instance - * @type org.apache.lucene.search.PhraseQuery - */ - this.query = new Packages.org.apache.lucene.search.PhraseQuery(); - - /** - * add a term to the end of the phrase query - */ - this.addTerm = function(field, str) { - var t = new Packages.org.apache.lucene.index.Term(field, str); - this.query.add(t); - return; - }; - - if (field && str) - this.addTerm(field, str); - delete this.base; - return this; -}; -helma.Search.PhraseQuery.prototype = new helma.Search.Query; - -/** - * Constructs a new helma.Search.RangeQuery instance. - * @class Instances of this class represent a range - * query, wrapping a Lucene RangeQuery instance. - * @param {String} field The name of the field - * @param {String} from The minimum value to match (can be null) - * @param {String} to The maximum value to match (can be null) - * @param {Boolean} inclusive If true the given min/max values are included - * @returns A newly created RangeQuery instance - * @constructor - * @extends helma.Search.Query - */ -helma.Search.RangeQuery = function(field, from, to, inclusive) { - if (!field) - throw "Missing field name in RangeQuery()"; - if (arguments.length < 4) - inclusive = true; - var t1 = from ? new Packages.org.apache.lucene.index.Term(field, from) : null; - var t2 = to ? new Packages.org.apache.lucene.index.Term(field, to) : null; - /** - * Contains the wrapped RangeQuery instance - * @type org.apache.lucene.search.RangeQuery - */ - this.query = new Packages.org.apache.lucene.search.RangeQuery(t1, t2, inclusive); - return this; -}; -helma.Search.RangeQuery.prototype = new helma.Search.Query; - -/** - * Constructs a new helma.Search.FuzzyQuery instance. - * @class Instances of this class represent a fuzzy query - * @param {String} field The name of the field - * @param {String} str The query string to match - * @returns A newly created FuzzyQuery instance - * @constructor - * @extends helma.Search.Query - */ -helma.Search.FuzzyQuery = function(field, str) { - var t = new Packages.org.apache.lucene.index.Term(field, str); - /** - * Contains the wrapped FuzzyQuery instance - * @type org.apache.lucene.search.FuzzyQuery - */ - this.query = new Packages.org.apache.lucene.search.FuzzyQuery(t); - return this; -}; -helma.Search.FuzzyQuery.prototype = new helma.Search.Query; - -/** - * Constructs a new helma.Search.PrefixQuery instance. - * @class Instances of this class represent a prefix query - * @param {String} field The name of the field - * @param {String} str The query string to match - * @returns A newly created PrefixQuery instance - * @constructor - * @extends helma.Search.Query - */ -helma.Search.PrefixQuery = function(field, str) { - var t = new Packages.org.apache.lucene.index.Term(field, str); - /** - * Contains the wrapped PrefixQuery instance - * @type org.apache.lucene.search.PrefixQuery - */ - this.query = new Packages.org.apache.lucene.search.PrefixQuery(t); - return this; -}; -helma.Search.PrefixQuery.prototype = new helma.Search.Query; - -/** - * Constructs a new helma.Search.WildcardQuery instance. - * @class Instances of this class represent a wildcard query. - * @param {String} field The name of the field - * @param {String} str The query string to match - * @returns A newly created WildcardQuery instance - * @constructor - * @extends helma.Search.Query - */ -helma.Search.WildcardQuery = function(field, str) { - var t = new Packages.org.apache.lucene.index.Term(field, str); - /** - * Contains the wrapped WildcardQuery instance - * @type org.apache.lucene.search.WildcardQuery - */ - this.query = new Packages.org.apache.lucene.search.WildcardQuery(t); - return this; -}; -helma.Search.WildcardQuery.prototype = new helma.Search.Query; - - - -/*************************** - ***** D O C U M E N T ***** - ***************************/ - - -/** - * Creates a new instance of helma.Search.Document. - * @class Instances of this class represent a single - * index document. This class provides various methods for - * adding content to such documents. - * @param {org.apache.lucene.document.Document} document Optional Lucene Document object - * that should be wrapped by this Document instance. - * @constructor - */ -helma.Search.Document = function(document) { - if (!document) { - document = new Packages.org.apache.lucene.document.Document(); - } - - /** - * Returns the wrapped Lucene Document object - * @returns The wrapped Document object - * @type org.apache.lucene.document.Document - */ - this.getDocument = function() { - return document; - }; - - return this; -}; - -/** - * Adds a field to this document. - * @param {String|helma.Search.Document.Field} name The name of the field, or - * an instance of {@link helma.Search.Document.Field}, in which case the other - * arguments are ignored. - * @param {String} value The value of the field - * @param {Object} options Optional object containing the following properties - * (each of them is optional too): - *
store
(String) Defines whether and how the value is stored
- * in the field. Accepted values are "no", "yes" and "compress" (defaults to "yes")index
(String) Defines whether and how the value is indexed
- * in the field. Accepted values are "no", "tokenized", "unTokenized" and
- * "noNorms" (defaults to "tokenized")termVector
(String) Defines if and how the fiels should have
- * term vectors. Accepted values are "no", "yes", "withOffsets", "withPositions"
- * and "withPositionsAndOffsets" (defaults to "no")store
(String) Defines whether and how the value is stored
- * in the field. Accepted values are "no", "yes" and "compress" (defaults to "yes")index
(String) Defines whether and how the value is indexed
- * in the field. Accepted values are "no", "tokenized", "unTokenized" and
- * "noNorms" (defaults to "tokenized")termVector
(String) Defines if and how the fiels should have
- * term vectors. Accepted values are "no", "yes", "withOffsets", "withPositions"
- * and "withPositionsAndOffsets" (defaults to "no")0755
);
- * @returns True in case the operation was successful, false otherwise.
- * @type Boolean
- */
- this.put = function(localFile, remoteDir, mode) {
- if (!localFile || !remoteDir) {
- error("put", "Insufficient arguments.");
- } else if (!this.isConnected()) {
- error("put", "Not connected. Please establish a connection first.");
- } else {
- try {
- var scp = connection.createSCPClient();
- if (mode != null)
- scp.put(localFile, remoteDir, mode);
- else
- scp.put(localFile, remoteDir);
- debug("put", "copied '" + localFile + "' to '" + remoteDir + "'");
- return true;
- } catch (e) {
- error("put", e);
- }
- }
- return false;
- };
-
- /**
- * Retrieves a file from the remote server and stores it locally.
- * @param {String|Array} remoteFile Either the path to a single remote
- * file or an array containing multiple file paths that should be
- * copied onto the local disk.
- * @param {String} targetDir The path to the local destination directory
- * @returns True if the copy process was successful, false otherwise.
- * @type Boolean
- */
- this.get = function(remoteFile, targetDir) {
- if (!remoteFile || !targetDir) {
- error("get", "Insufficient arguments.");
- } else if (!this.isConnected()) {
- error("get", "Not connected. Please establish a connection first.");
- } else {
- try {
- var scp = connection.createSCPClient();
- scp.get(remoteFile, targetDir);
- debug("get", "copied '" + remoteFile + "' to '" + targetDir + "'");
- return true;
- } catch (e) {
- error("get", e);
- }
- }
- return false;
- };
-
- /**
- * Executes a single command on the remote server.
- * @param {String} cmd The command to execute on the remote server.
- * @return The result of the command execution
- * @type String
- */
- this.execCommand = function(cmd) {
- if (!this.isConnected()) {
- error("execCommand", "Not connected. Please establish a connection first.");
- } else {
- var session = connection.openSession();
- try {
- session.execCommand(cmd);
- var stdout = new SSHPKG.StreamGobbler(session.getStdout());
- var br = new java.io.BufferedReader(new java.io.InputStreamReader(stdout));
- res.push();
- while (true) {
- if (!(line = br.readLine()))
- break;
- res.writeln(line);
- }
- debug("execCommand", "executed command '" + cmd + "'");
- return res.pop();
- } catch (e) {
- error("execCommand", e);
- } finally {
- session.close();
- }
- }
- };
-
- /**
- * Toggles paranoid mode. If set to true this client tries to
- * verify the host key against the its list of known hosts
- * during connection and rejects if the host key is not found
- * therein or is different.
- * @param {Boolean} p Either true or false
- */
- this.setParanoid = function(p) {
- paranoid = (p === true);
- return;
- };
-
- /**
- * Returns true if this client is in paranoid mode.
- * @return Boolean
- * @see #setParanoid
- */
- this.isParanoid = function() {
- return paranoid;
- };
-
- /**
- * main constructor body
- */
- if (hosts) {
- this.addKnownHosts(hosts);
- }
-
- for (var i in this)
- this.dontEnum(i);
- return this;
-};
-
-
-/** @ignore */
-helma.Ssh.toString = function() {
- return "[helma.Ssh]";
-};
-
-
-helma.lib = "Ssh";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/Url.js b/modules/helma/Url.js
deleted file mode 100644
index 081f765d..00000000
--- a/modules/helma/Url.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2007 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Url.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-/**
- * @fileoverview Fields and methods of the helma.Url class.
- * data
.
- * @param {String} name The name of the file to extract
- * @param {String} destPath An optional destination path where
- * the extracted file should be stored.
- * @returns An object containing the entry's properties
- * @type helma.Zip.Entry
- * @see helma.Zip.Entry
- */
- this.extract = function(name, destPath) {
- var zFile = new java.util.zip.ZipFile(file);
- var entry = zFile.getEntry(name);
- if (!entry)
- return null;
- var result = new helma.Zip.Entry(entry);
- result.data = extractEntry(zFile, entry, destPath);
- zFile.close();
- return result;
- };
-
- /**
- * Extracts all files within the zip archive represented by
- * this helma.Zip instance. If a destination path is given it
- * stores the files directly on disk, while preserving any directory
- * structure within the archive. If no destination path is given,
- * the resulting entry objects will contain the extracted data
- * in their property data
.
- * @param {String} destPath An optional destination path where the
- * files in the zip archive should be stored.
- * @returns An object containing the extracted entries.
- * @type helma.Zip.Content
- * @see helma.Zip.Entry
- */
- this.extractAll = function(destPath) {
- var result = new helma.Zip.Content();
- var zFile = new java.util.zip.ZipFile(file);
- var entries = zFile.entries();
- while (entries.hasMoreElements()) {
- var entry = entries.nextElement();
- var e = new helma.Zip.Entry(entry);
- e.data = extractEntry(zFile, entry, destPath);
- result.add(e);
- }
- zFile.close();
- return result;
- };
-
- /**
- * Adds a single file or a whole directory (recursive!) to the zip archive
- * @param {helma.File|java.io.File|String} f Either a file object
- * or the path to a file or directory on disk that should be added to the
- * archive. If the argument represents a directory, its contents will be added
- * recursively to the archive.
- * @param {Number} level An optional compression level to use. The argument
- * must be between zero and 9 (default: 9 = best compression).
- * @param {String} pathPrefix An optional path prefix to use within the archive.
- */
- this.add = function (f, level, pathPrefix) {
- var f = evalFile(f);
-
- // evaluate arguments
- if (arguments.length == 2) {
- if (typeof arguments[1] == "string") {
- pathPrefix = arguments[1];
- level = 9;
- } else {
- level = parseInt(arguments[1], 10);
- pathPrefix = null;
- }
- } else if (level == null || isNaN(level)) {
- level = 9;
- }
- // only levels between 0 and 9 are allowed
- level = Math.max(0, Math.min(9, level));
-
- if (f.isDirectory()) {
- // add a whole directory to the zip file (recursive!)
- var files = (new helma.File(f.getAbsolutePath())).listRecursive();
- for (var i in files) {
- var fAdd = new java.io.File(files[i]);
- if (!fAdd.isDirectory()) {
- var p = fAdd.getPath().substring(f.getAbsolutePath().length, fAdd.getParent().length);
- if (pathPrefix)
- p = pathPrefix + p;
- addFile(zOutStream, fAdd, level, p);
- }
- }
- } else {
- addFile(zOutStream, f, level, pathPrefix);
- }
- return;
- };
-
- /**
- * Adds a new entry to the zip file.
- * @param {ByteArray} buf A byte array containing the data to add
- * to the archive.
- * @param {String} name The name of the file to add, containing
- * an optional path prefix
- * @param {Number} level The compression level to use (0-9, defaults to 9).
- */
- this.addData = function(buf, name, level) {
- var entry = new java.util.zip.ZipEntry(name);
- entry.setSize(buf.length);
- entry.setTime(new Date());
- if (level == null || isNaN(level)) {
- zOutStream.setLevel(9);
- } else {
- zOutStream.setLevel(Math.max(0, Math.min(9, parseInt(level, 10))));
- }
- zOutStream.putNextEntry(entry);
- zOutStream.write(buf, 0, buf.length);
- zOutStream.closeEntry();
- return;
- };
-
- /**
- * Closes the zip archive. This method should be called when
- * all operations have been finished, to ensure that no open
- * file handles are left.
- */
- this.close = function() {
- zOutStream.close();
- return;
- };
-
- /**
- * Returns the binary data of the zip archive.
- * @returns A ByteArray containing the binary data of the zip archive
- * @type ByteArray
- */
- this.getData = function() {
- zOutStream.close();
- fOutStream.close();
- var inputStream = new java.io.FileInputStream(tempFile);
- var bOutStream = new java.io.ByteArrayOutputStream();
- var buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8192);
- try {
- var chunk;
- while ((chunk = inputStream.read(buffer)) !== -1) {
- bOutStream.write(buffer, 0, chunk);
- }
- bOutStream.flush();
- } catch (ex) {
- app.log(ex);
- } finally {
- if (inputStream) inputStream.close();
- if (bOutStream) bOutStream.close();
- }
- return bOutStream.toByteArray();
- };
-
- /**
- * Saves the archive.
- * @param {String} dest The full destination path including the name
- * where the zip archive should be saved.
- */
- this.save = function(dest) {
- if (!dest)
- throw new Error("no destination for ZipFile given");
- // first of all, close the ZipOutputStream
- zOutStream.close();
- fOutStream.close();
- var destFile = new java.io.File(dest);
- try {
- if (destFile.exists()) destFile['delete']();
- java.nio.file.Files.move(tempFile.toPath(), destFile.toPath());
- } catch (ex) {
- app.log(ex);
- }
- return;
- };
-
- /** @ignore */
- this.toString = function() {
- if (file) {
- return "[helma.Zip " + file.getAbsolutePath() + "]";
- } else {
- return "[helma.Zip]";
- }
- };
-
- /**
- * constructor body
- */
- var tempFile = new java.io.File.createTempFile('zip-', '');
- var fOutStream = new java.io.FileOutputStream(tempFile);
- var zOutStream = new java.util.zip.ZipOutputStream(fOutStream);
-
- if (file) {
- file = evalFile(file);
- }
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-}
-
-/**
- * Creates a new helma.Zip.Content instance
- * @class Instances of this class represent the content
- * of a zip archive.
- * @constructor
- * @returns A newly created instance of helma.Zip.Content
- */
-helma.Zip.Content = function() {
- /**
- * The table of contents of the archive
- * @type Array
- */
- this.toc = [];
-
- /**
- * The files contained in the zip archive, where
- * each directory level is a separate object containing
- * the entries (files and directories) as properties.
- */
- this.files = {};
-
- /**
- * Adds a zip entry object to the table of contents
- * and the files collection
- * @param {helma.Zip.Entry} entry The entry to add to the
- * zip archive
- */
- this.add = function(entry) {
- // add the file to the table of contents array
- this.toc[this.toc.length] = entry;
- // plus add it to the files tree
- var arr = entry.name.split(/[\\\/]/);
- var cnt = 0;
- var curr = this.files;
- var propName;
- while (cnt < arr.length-1) {
- propName = arr[cnt++];
- if (!curr[propName]) {
- curr[propName] = {};
- }
- curr = curr[propName];
- }
- curr[arr[cnt]] = entry;
- return;
- };
-
- for (var i in this)
- this.dontEnum(i);
-
- return this;
-};
-
-
-/** @ignore */
-helma.Zip.Content.prototype.toString = function() {
- return "[helma.Zip.Content]";
-}
-
-
-/**
- * Creates a new instance of helma.Zip.Entry
- * @class Instances of this class represent a single zip archive entry,
- * containing the (meta)data of the entry.
- * @param {java.util.zip.ZipEntry} entry The zip entry object whose metadata
- * should be stored in this instance
- * @constructor
- * @returns A newly created helma.Zip.Entry instance.
- */
-helma.Zip.Entry = function(entry) {
- /**
- * The name of the zip archive entry
- * @type String
- */
- this.name = entry.getName();
-
- /**
- * The size of the entry in bytes
- * @type Number
- */
- this.size = entry.getSize();
-
- /**
- * The file date of the entry
- * @type Date
- */
- this.time = entry.getTime() ? new Date(entry.getTime()) : null;
-
- /**
- * True if the entry is a directory, false otherwise
- * @type Boolean
- */
- this.isDirectory = entry.isDirectory();
-
- /**
- * The data of the zip entry
- * @type ByteArray
- */
- this.data = null;
-
- for (var i in this)
- this.dontEnum(i);
- return this;
-};
-
-
-/** @ignore */
-helma.Zip.Entry.prototype.toString = function() {
- return "[helma.Zip.Entry]";
-}
-
-
-/**
- * Extracts all files in the zip archive data passed as argument
- * and returns them.
- * @param {ByteArray} zipData A ByteArray containing the data of the zip archive
- * @returns The entries of the zip archive
- * @type helma.Zip.Content
- */
-helma.Zip.extractData = function(zipData) {
- var zInStream = new java.util.zip.ZipInputStream(new java.io.ByteArrayInputStream(zipData));
- var result = new helma.Zip.Content();
-
- var entry;
- while ((entry = zInStream.getNextEntry()) != null) {
- var eParam = new helma.Zip.Entry(entry);
- if (eParam.isDirectory)
- continue;
- if (eParam.size == -1)
- eParam.size = 16384;
- var bos = new java.io.ByteArrayOutputStream(eParam.size);
- var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8192);
- var count;
- while ((count = zInStream.read(buf)) != -1)
- bos.write(buf, 0, count);
- eParam.data = bos.toByteArray();
- eParam.size = bos.size();
- result.add(eParam);
- }
- zInStream.close();
- return result;
-};
-
-
-helma.lib = "Zip";
-helma.dontEnum(helma.lib);
-for (var i in helma[helma.lib])
- helma[helma.lib].dontEnum(i);
-for (var i in helma[helma.lib].prototype)
- helma[helma.lib].prototype.dontEnum(i);
-delete helma.lib;
diff --git a/modules/helma/all.js b/modules/helma/all.js
deleted file mode 100644
index 3b3dfd0e..00000000
--- a/modules/helma/all.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Helma License Notice
- *
- * The contents of this file are subject to the Helma License
- * Version 2.0 (the "License"). You may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://adele.helma.org/download/helma/license.txt
- *
- * Copyright 1998-2006 Helma Software. All Rights Reserved.
- *
- * $RCSfile: Aspects.js,v $
- * $Author$
- * $Revision$
- * $Date$
- */
-
-// convenience SingleFileRepository to load all the
-// Javascript library files in ./modules/helma
-
-/** @namespace helma */
-
-app.addRepository('modules/helma/Aspects.js');
-app.addRepository('modules/helma/Chart.js');
-app.addRepository('modules/helma/Color.js');
-app.addRepository('modules/helma/Database.js');
-app.addRepository('modules/helma/File.js');
-app.addRepository('modules/helma/Ftp.js');
-app.addRepository('modules/helma/Html.js');
-app.addRepository('modules/helma/Http.js');
-app.addRepository('modules/helma/Image.js');
-app.addRepository('modules/helma/Mail.js');
-app.addRepository('modules/helma/Search.js');
-app.addRepository('modules/helma/Skin.js');
-app.addRepository('modules/helma/Ssh.js');
-app.addRepository('modules/helma/Url.js');
-app.addRepository('modules/helma/Zip.js');
diff --git a/modules/helma/build.gradle b/modules/helma/build.gradle
deleted file mode 100644
index 401dd406..00000000
--- a/modules/helma/build.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-dependencies {
- runtimeOnly 'ch.ethz.ganymed:ganymed-ssh2:build209'
- runtimeOnly 'net.sourceforge.jexcelapi:jxl:2.5.7'
- runtimeOnly 'org.apache.lucene:lucene-analyzers:2.2.0'
- runtimeOnly 'org.apache.lucene:lucene-core:2.2.0'
-}
-
-jar.enabled = false
-compileJava.enabled = false
-compileTestJava.enabled = false
-processResources.enabled = false
-processTestResources.enabled = false
-test.enabled = false
-
-tasks.register('deps', Copy) {
- from sourceSets.main.runtimeClasspath
- into '.'
-}
diff --git a/modules/helma/ganymed-ssh2-build208.jar b/modules/helma/ganymed-ssh2-build208.jar
deleted file mode 100644
index 8ca7bd74..00000000
Binary files a/modules/helma/ganymed-ssh2-build208.jar and /dev/null differ
diff --git a/modules/helma/jxl-2.5.7.jar b/modules/helma/jxl-2.5.7.jar
deleted file mode 100644
index fc1a5a55..00000000
Binary files a/modules/helma/jxl-2.5.7.jar and /dev/null differ
diff --git a/modules/helma/licenses/ganymed-ssh2.txt b/modules/helma/licenses/ganymed-ssh2.txt
deleted file mode 100644
index 8a1a974a..00000000
--- a/modules/helma/licenses/ganymed-ssh2.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-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.
diff --git a/modules/helma/licenses/jxl.txt b/modules/helma/licenses/jxl.txt
deleted file mode 100644
index a47ada12..00000000
--- a/modules/helma/licenses/jxl.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-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.
diff --git a/modules/helma/licenses/lucene-analyzers.txt b/modules/helma/licenses/lucene-analyzers.txt
deleted file mode 100644
index d6456956..00000000
--- a/modules/helma/licenses/lucene-analyzers.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- 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.
diff --git a/modules/helma/licenses/lucene-core.txt b/modules/helma/licenses/lucene-core.txt
deleted file mode 100644
index d6456956..00000000
--- a/modules/helma/licenses/lucene-core.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- 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.
diff --git a/modules/helma/lucene-analyzers-2.2.0.jar b/modules/helma/lucene-analyzers-2.2.0.jar
deleted file mode 100644
index 86226042..00000000
Binary files a/modules/helma/lucene-analyzers-2.2.0.jar and /dev/null differ
diff --git a/modules/helma/lucene-core-2.2.0.jar b/modules/helma/lucene-core-2.2.0.jar
deleted file mode 100644
index 2469481c..00000000
Binary files a/modules/helma/lucene-core-2.2.0.jar and /dev/null differ
diff --git a/modules/jala/README.md b/modules/jala/README.md
deleted file mode 100644
index 331e0c87..00000000
--- a/modules/jala/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# About Jala
-
-Jala is an open-source collection of JavaScript modules for Helma Object Publisher. Copyright 2004 ORF Online und Teletext GmbH, Vienna (Austria). You can find more information about each module in the API Documentation located in the `docs` directory.
-
-## Licensing
-
-Jala itself is licensed under the Apache 2.0 License, but parts of Jala require third party libraries coming with different licenses. You can find all necessary information in the `licenses` directory.
-
-## Installation
-
-Move the Jala folder into the `modules` directory of your Helma installation. To include a certain Jala module simply add the following line to your Helma application's source code (replace `[name]` with the desired module name):
-
- app.addRepository("./modules/jala/code/[name].js");
-
-If you want to include the whole Jala package at once, you can use the `all` module for convenience:
-
- app.addRepository("./modules/jala/code/all.js");
-
-Alternatively, you can import the Jala module from within Helma's
-`apps.properties` file (replace `[appName]` with the name of your Helma application, `[n]` with a number between 0 and 9 and `[moduleName]` with the desired module
-name):
-
- [appName].respository.[n] = ./modules/jala/code/[moduleName].js
-
-More information about the `addRepository()` method and generally including repositories in a Helma application is available at
-http://helma.org/stories/77712/.
-
-## Contact, Bugs and Feedback
-
-The Jala Project is hosted at https://dev.orf.at/jala/ providing all necessary information about Subversion access, Ticketing, Releases etc.
-
-Although we encourage you to post your questions and comments as ticket, we also provide a mailing list for convenience (details at
-https://dev.orf.at/trac/jala/wiki/MailingList).
-
-For immediate contact you can reach the developers via jaladev AT gmail.com.
diff --git a/modules/jala/build.gradle b/modules/jala/build.gradle
deleted file mode 100644
index 3b9b6684..00000000
--- a/modules/jala/build.gradle
+++ /dev/null
@@ -1,21 +0,0 @@
-dependencies {
- runtimeOnly 'dom4j:dom4j:1.1.3'
- runtimeOnly 'jaxen:jaxen:1.1-beta-8'
- runtimeOnly 'net.sf.javamusictag:jid3lib:0.5.4'
-
- // FIXME: Did not find these two or appropriate replacements for them
- //runtime 'id3:de.ueberdosis.mp3info:1.6.0d9'
- //runtime 'javadns:org.wonderly:?'
-}
-
-jar.enabled = false
-compileJava.enabled = false
-compileTestJava.enabled = false
-processResources.enabled = false
-processTestResources.enabled = false
-test.enabled = false
-
-tasks.register('deps', Copy) {
- from sourceSets.main.runtimeClasspath
- into 'lib'
-}
diff --git a/modules/jala/build.properties b/modules/jala/build.properties
deleted file mode 100644
index 387dc22a..00000000
--- a/modules/jala/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-## build properties for jsdoc api documentation
-## all paths *must* be relative to the directory where
-## this file is located
-
-docs.source = ./code
-docs.destination = ./docs
-docs.projectName = Jala 1.3
diff --git a/modules/jala/code/.jsdoc/summary.html b/modules/jala/code/.jsdoc/summary.html
deleted file mode 100644
index 3474c714..00000000
--- a/modules/jala/code/.jsdoc/summary.html
+++ /dev/null
@@ -1 +0,0 @@
-Jala is a Helma-based library and utility project initially developed to ease the work at ORF.at's software development department.
diff --git a/modules/jala/code/AsyncRequest.js b/modules/jala/code/AsyncRequest.js
deleted file mode 100644
index 40c19c7a..00000000
--- a/modules/jala/code/AsyncRequest.js
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// Jala Project [http://opensvn.csie.org/traccgi/jala]
-//
-// 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
-//
-// 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 Fields and methods of the jala.AsyncRequest class.
- */
-
-
-// Define the global namespace for Jala modules
-if (!global.jala) {
- global.jala = {};
-}
-
-
-/**
- * Creates a new AsyncRequest instance.
- * @class This class is used to create requests of type "INTERNAL"
- * (like cron-jobs) that are processed in a separate thread and
- * therefor asynchronous.
- * @param {Object} obj Object in whose context the method should be called
- * @param {String} funcName Name of the function to call
- * @param {Array} args Array containing the arguments that should be passed
- * to the function (optional). This option is deprecated, instead
- * pass the arguments directly to the {@link #run} method.
- * @constructor
- * @returns A new instance of AsyncRequest
- * @type AsyncRequest
- * @deprecated Use the {@link http://helma.zumbrunn.net/reference/core/app.html#invokeAsync
- * app.invokeAsync} method instead (built-in into Helma as
- * of version 1.6)
- */
-jala.AsyncRequest = function(obj, funcName, args) {
- app.logger.warn("Use of jala.AsyncRequest is deprecated in this version.");
- app.logger.warn("This module will probably be removed in a " +
- "future version of Jala.");
-
- /**
- * Contains a reference to the thread started by this AsyncRequest
- * @type java.lang.Thread
- * @private
- */
- var thread;
-
- /**
- * Contains the timeout defined for this AsyncRequest (in milliseconds)
- * @type Number
- * @private
- */
- var timeout;
-
- /**
- * Contains the number of milliseconds to wait before starting
- * the asynchronous request.
- * @type Number
- * @private
- */
- var delay;
-
- /**
- * Run method necessary to implement java.lang.Runnable.
- * @private
- */
- var runner = function() {
- // evaluator that will handle the request
- var ev = app.__app__.getEvaluator();
-
- if (delay != null) {
- java.lang.Thread.sleep(delay);
- }
- try {
- if (args === undefined || args === null || args.constructor != Array) {
- args = [];
- }
- if (timeout != null) {
- ev.invokeInternal(obj, funcName, args, timeout);
- } else {
- ev.invokeInternal(obj, funcName, args);
- }
- } catch (e) {
- // ignore it, but log it
- app.log("[Runner] Caught Exception: " + e);
- } finally {
- // release the ev in any case
- app.__app__.releaseEvaluator(ev);
- // remove reference to underlying thread
- thread = null;
- }
- return;
- };
-
- /**
- * Sets the timeout of this asynchronous request.
- * @param {Number} seconds Thread-timeout.
- */
- this.setTimeout = function(seconds) {
- timeout = seconds * 1000;
- return;
- };
-
- /**
- * Defines the delay to wait before evaluating this asynchronous request.
- * @param {Number} millis Milliseconds to wait
- */
- this.setDelay = function(millis) {
- delay = millis;
- return;
- };
-
- /**
- * Starts this asynchronous request. Any arguments passed to
- * this method will be passed to the method executed by
- * this AsyncRequest instance.
- */
- this.run = function() {
- if (arguments.length > 0) {
- // convert arguments object into array
- args = Array.prototype.slice.call(arguments, 0, arguments.length);
- }
- thread = (new java.lang.Thread(new java.lang.Runnable({"run": runner})));
- thread.start();
- return;
- };
-
- /**
- * Starts this asynchronous request.
- * @deprecated Use {@link #run} instead
- */
- this.evaluate = function() {
- this.run.apply(this, arguments);
- return;
- };
-
- /**
- * Returns true if the underlying thread is alive
- * @returns True if the underlying thread is alive,
- * false otherwise.
- * @type Boolean
- */
- this.isAlive = function() {
- return thread != null && thread.isAlive();
- }
-
- /** @ignore */
- this.toString = function() {
- return "[jala.AsyncRequest]";
- };
-
- /**
- * Main constructor body
- */
- if (!obj || !funcName)
- throw "jala.AsyncRequest: insufficient arguments.";
- return this;
-}
diff --git a/modules/jala/code/BitTorrent.js b/modules/jala/code/BitTorrent.js
deleted file mode 100644
index 05ad1311..00000000
--- a/modules/jala/code/BitTorrent.js
+++ /dev/null
@@ -1,429 +0,0 @@
-//
-// Jala Project [http://opensvn.csie.org/traccgi/jala]
-//
-// 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
-//
-// 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 Fields and methods of the jala.BitTorrent class.
- */
-
-
-// Define the global namespace for Jala modules
-if (!global.jala) {
- global.jala = {};
-}
-
-
-/**
- * Module dependencies
- */
-app.addRepository("modules/core/String.js");
-app.addRepository("modules/helma/File.js");
-
-
-/**
- * Constructs a new BitTorrent file.
- * @class This class provides methods to create a BitTorrent
- * metadata file from any desired file.
- * @param {String} trackerUrl The URL string of the tracker.
- * @param {String} filePath The path to the original file.
- * @returns A new BitTorrent file.
- * @constructor
- */
-jala.BitTorrent = function(filePath, trackerUrl) {
- var self = this;
- self.arguments = arguments;
-
- // FIXME: Add support for multitracker mode as specified in
- // http://www.bittornado.com/docs/multitracker-spec.txt
-
- var torrent, sourceFile, torrentFile;
- var pieceLength = 256;
-
- var updateTorrent = function() {
- if (torrent.info) {
- return torrent;
- }
-
- var file = new java.io.File(filePath);
- if (!file.exists()) {
- throw Error("File " + file + " does not exist!");
- }
-
- var md5 = java.security.MessageDigest.getInstance("MD5");
- var sha1 = java.security.MessageDigest.getInstance("SHA-1");
-
- var fis = new java.io.FileInputStream(file);
- var bis = new java.io.BufferedInputStream(fis);
- var cache = new java.io.ByteArrayOutputStream();
-
- var pieces = [];
- var length = pieceLength * 1024;
- var buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, length);
-
- while (bis.read(buffer, 0, buffer.length) > -1) {
- app.debug("Updating SHA-1 hash with " + buffer.length + " bytes");
- sha1.reset();
- sha1["update(byte[])"](buffer);
- cache["write(byte[])"](buffer);
- pieces.push(new java.lang.String(sha1.digest()));
- }
-
- bis.close();
- fis.close();
-
- torrent.info = {
- //md5sum: new java.lang.String(md5.digest(cache.toByteArray())),
- length: cache.size(),
- name: file.getName(),
- "piece length": length,
- pieces: pieces.join("")
- };
-
- return torrent;
- };
-
- /**
- * Get all available property names.
- * @returns The list of property names.
- * @type Array
- */
- this.keys = function() {
- var keys = [];
- for (var i in torrent) {
- keys.push(i);
- }
- keys.sort();
- return keys;
- };
-
- /**
- * Get a torrent property.
- * @param {String} name The name of the property.
- * @returns The value of the property.
- */
- this.get = function(name) {
- return torrent[name];
- };
-
- /**
- * Set a torrent property.
- * @param {String} name The name of the property.
- * @param {Object} value The property's value.
- */
- this.set = function(name, value) {
- if (typeof torrent[name] == "undefined") {
- throw Error("Cannot set torrent property " + name);
- }
- torrent[name] = value;
- delete torrent.info;
- return;
- };
-
- /**
- * Get the creation date of the torrent.
- * @returns The torrent's creation date.
- * @type Date
- */
- this.getCreationDate = function() {
- return new Date(torrent["creation date"] * 1000);
- };
-
- /**
- * Set the creation date of the torrent.
- * @param {Date} date The desired creation date.
- */
- this.setCreationDate = function(date) {
- this.set("creation date", Math.round((date || new Date()).getTime() / 1000));
- return;
- };
-
- /**
- * Get the piece length of the torrent.
- * @returns The torrent's piece length.
- * @type Number
- */
- this.getPieceLength = function() {
- return pieceLength;
- };
-
- /**
- * Set the piece length of the torrent.
- * @param {Number} length The desired piece length.
- */
- this.setPieceLength = function(length) {
- pieceLength = length;
- delete torrent.info;
- return;
- };
-
- /**
- * Returns the underlying torrent file.
- * @returns The torrent file.
- * @type helma.File
- */
- this.getTorrentFile = function() {
- return torrentFile;
- };
-
- /**
- * Returns the underlying source file.
- * @returns The source file.
- * @type helma.File
- */
- this.getSourceFile = function() {
- return sourceFile;
- };
-
- /**
- * Saves the torrent as file.
- * @param {String} filename An optional name for the torrent file.
- * If no name is given it will be composed from name of source
- * file as defined in the torrent plus the ending ".torrent".
- */
- this.save = function(filename) {
- updateTorrent();
- if (!filename) {
- filename = torrent.info.name + ".torrent";
- }
- torrentFile = new helma.File(sourceFile.getParent(), filename);
- torrentFile.remove();
- torrentFile.open();
- torrentFile.write(jala.BitTorrent.bencode(torrent));
- torrentFile.close();
- return;
- };
-
- /**
- * Get a string representation of the torrent.
- * @returns The torrent as string.
- * @type String
- */
- this.toString = function() {
- return "[jala.BitTorrent " + filePath + "]";
- };
-
- if (String(filePath).endsWith(".torrent")) {
- torrentFile = new helma.File(filePath);
- torrent = jala.BitTorrent.bdecode(torrentFile.readAll());
- sourceFile = new helma.File(torrent.info.name);
- } else {
- torrent = {
- announce: trackerUrl || null,
- "announce-list": null,
- "creation date": null,
- comment: null,
- "created by": null,
- };
- this.setCreationDate();
- sourceFile = new helma.File(filePath);
- }
-
- return this;
-};
-
-
-/**
- * The bencode method. Turns an arbitrary JavaScript
- * object structure into a corresponding encoded
- * string.
- * @param {Object} obj The target JavaScript object.
- * @returns The encoded string.
- * @type String
- */
-jala.BitTorrent.bencode = function(obj) {
- var bencode = arguments.callee;
- var str = obj.toString();
- res.push();
- switch (obj.constructor) {
- case Array:
- res.write("l");
- for (var i in obj) {
- if (obj[i])
- res.write(bencode(obj[i]));
- }
- res.write("e");
- break;
-
- case Number:
- res.write("i" + str + "e");
- break;
-
- case Object:
- res.write("d");
- var keys = [];
- for (var i in obj) {
- keys.push(i);
- }
- keys.sort();
- var key;
- for (var i in keys) {
- key = keys[i];
- if (obj[key]) {
- res.write(bencode(key));
- res.write(bencode(obj[key]));
- }
- }
- res.write("e");
- break;
-
- default:
- res.write(str.length + ":" + str);
- }
- return res.pop();
-};
-
-
-/**
- * The bdecode method. Turns an encoded string into
- * a corresponding JavaScript object structure.
- * FIXME: Handle with caution...
- * @param {String} code The encoded string.
- * @returns The decoded JavaScript structure.
- * @type Object
- */
-jala.BitTorrent.bdecode = function(code) {
- var DICTIONARY = "d";
- var LIST = "l";
- var INTEGER = "i";
- var STRING = "s";
- var END = "e";
-
- var stack = [];
- var overflowCounter = 0;
-
- var position = -1, current;
-
- function getResult() {
- update();
- var result;
- switch (current) {
- case DICTIONARY:
- result = bdecodeDictionary();
- break;
- case LIST:
- result = bdecodeList();
- break;
- case INTEGER:
- result = bdecodeInteger();
- break;
- case END:
- case null:
- //res.debug("*** end detected in getResult()");
- result = null;
- break;
- default:
- result = bdecodeString();
- }
- return result;
- }
-
- function update() {
- position += 1;
- current = code.charAt(position);
- /* res.debug("stack: " + stack);
- res.debug("position: " + position);
- res.debug("current: " + current);
- res.debug("remains: " + code.substr(position)); */
- return;
- }
-
- function overflow() {
- if (overflowCounter++ > 100)
- throw Error("Error parsing bdecoded string");
- return false;
- }
-
- function bdecodeDictionary() {
- stack.push(DICTIONARY);
- var dictionary = {}, key, value;
- while (current && !overflow()) {
- key = getResult();
- if (key === null)
- break;
- value = getResult();
- if (key && value)
- dictionary[key] = value;
- else
- break;
- }
- stack.pop();
- return dictionary;
- }
-
- function bdecodeList() {
- stack.push(LIST);
- var list = [], value;
- while (current && !overflow()) {
- var value = getResult();
- if (value)
- list.push(value);
- else
- break;
- }
- stack.pop();
- return list;
- }
-
- function bdecodeInteger() {
- var integer = "";
- stack.push(integer);
- while (current && !overflow()) {
- update();
- if (current == "e")
- break;
- integer += current;
- }
- if (isNaN(integer))
- throw("Error in bdecoded integer: " + integer + " is not a number");
- //res.debug("integer = " + integer);
- stack.pop();
- return parseInt(integer);
- }
-
- function bdecodeString() {
- var length = current, string = "";
- stack.push(string);
- update();
- while (current && current != ":" && !overflow()) {
- length += current;
- update();
- }
- if (isNaN(length))
- throw("Error in bdecoded string: invalid length " + length);
- //res.debug("length = " + length);
- length = parseInt(length);
- if (length > code.length - position)
- throw Error("Error parsing bdecoded string");
- for (var i=0; i[ [val, display], [val, display], .. ]
[ {value:val, display:display}, .. ]
[ display, display, .. ]
In this case,
- * the index position of the string will be the value.language
- * is a valid ISO Language Code (eg. "de"), COUNTRY
a valid ISO
- * Country Code (eg. "AT"), and variant an identifier for the variant to use.
- * @returns The locale for the given id
- * @type java.util.Locale
- */
-jala.I18n.prototype.getLocale = function(localeId) {
- if (localeId) {
- if (localeId.indexOf("_") > -1) {
- var arr = localeId.split("_");
- if (arr.length == 3) {
- return new java.util.Locale(arr[0], arr[1], arr[2]);
- } else {
- return new java.util.Locale(arr[0], arr[1]);
- }
- } else {
- return new java.util.Locale(localeId);
- }
- }
- return java.util.Locale.getDefault();
-}
-
-/**
- * Tries to "translate" the given message key into a localized
- * message.
- * @param {String} key The message to translate (required)
- * @param {String} plural The plural form of the message to translate
- * @param {Number} amount A number to determine whether to use the
- * singular or plural form of the message
- * @returns The localized message or the appropriate key if no
- * localized message was found
- * @type String
- */
-jala.I18n.prototype.translate = function(singularKey, pluralKey, amount) {
- var translation = null;
- if (singularKey) {
- // use the getter method for retrieving the locale
- var locale = this.getLocaleGetter()();
- var catalog, key;
- if ((catalog = jala.i18n.getCatalog(locale))) {
- if (arguments.length == 3 && amount != 1) { // is plural
- key = pluralKey;
- } else {
- key = singularKey;
- }
- if (!(translation = catalog[key])) {
- translation = key;
- app.logger.debug("jala.i18n.translate(): Can't find message '" +
- key + "' for locale '" + locale + "'");
- }
- } else {
- app.logger.debug("jala.i18n.translate(): Can't find message catalog for locale '" + locale + "'");
- if (!pluralKey || amount == 1) {
- translation = singularKey;
- } else {
- translation = pluralKey;
- }
- }
- }
- return translation;
-};
-
-/**
- * Helper method to get the message catalog
- * corresponding to the actual locale.
- * @params {java.util.Locale} locale
- * @returns The message catalog.
- */
-jala.I18n.prototype.getCatalog = function(locale) {
- if (!jala.I18n.catalogs) {
- jala.I18n.catalogs = {};
- }
-
- var catalog = jala.I18n.catalogs[locale];
-
- if (catalog) return catalog;
-
- var messages = this.getMessages();
-
- if (locale && messages) {
- catalog = messages[locale.toLanguageTag()];
- jala.I18n.catalogs[locale] = catalog;
- }
-
- return catalog;
-};
-
-/**
- * Converts the message passed as argument into an instance
- * of java.text.MessageFormat, and formats it using the
- * replacement values passed.
- * @param {String} message The message to format
- * @param {Array} values An optional array containing replacement values
- * @returns The formatted message or, if the formatting fails, the
- * message passed as argument.
- * @type String
- * @see http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
- */
-jala.I18n.prototype.formatMessage = function(message, values) {
- if (message) {
- var args = null;
- if (values != null && values.length > 0) {
- args = java.lang.reflect.Array.newInstance(java.lang.Object, values.length);
- var arg;
- for (var i=0;inumber
must
- * match the number of the additional argument (starting with zero).
- * @param {String} singularKey The singular message to localize
- * @param {String} pluralKey The plural form of the message to localize
- * @param {Number} amount The amount which is used to determine
- * whether the singular or plural form of the message should be returned.
- * @returns The translated message
- * @type String
- * @see #translate
- * @see #formatMessage
- */
-jala.I18n.prototype.ngettext = function(singularKey, pluralKey, amount /** [value 0][, value 1][, ...] */) {
- return this.formatMessage(this.translate(singularKey, pluralKey, amount || 0),
- Array.prototype.splice.call(arguments, 2));
-};
-
-/**
- * A simple proxy method which is used to mark a message string
- * for the i18n parser as to be translated.
- * @param {String} key The message that should be seen by the
- * i18n parser as to be translated.
- * @returns The message in unmodified form
- * @type String
- */
-jala.I18n.prototype.markgettext = function(key) {
- return key;
-};
-
-/**
- * Returns a translated message. The following macro attributes
- * are accepted:
- * " + this.getJavaObject().toString() + ""; -}; - - -/** @ignore */ -jala.Mp3.Id3v2.toString = function() { - return "[jala.Mp3.Id3v2]"; -}; - -/** @ignore */ -jala.Mp3.Id3v2.prototype.toString = jala.Mp3.Id3v2.toString; - - -// FIXME: report bug in JavaMusicTag: -// if you delete a v2 tag and call save() JMT calls the delete method of an ID3v2_4 tag. -// this way a 2_2 or 2_3 tag in the file isn't found and not deleted. -// Mp3.save() has a workaround for this. - diff --git a/modules/jala/code/PodcastWriter.js b/modules/jala/code/PodcastWriter.js deleted file mode 100644 index ba7b173a..00000000 --- a/modules/jala/code/PodcastWriter.js +++ /dev/null @@ -1,130 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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 Fields and methods of the jala.PodcastWriter class. - */ - - -// Define the global namespace for Jala modules -if (!global.jala) { - global.jala = {}; -} - - -/** - * Jala dependencies - */ -app.addRepository(getProperty("jala.dir", "modules/jala") + - "/code/Rss20Writer.js"); - -/** - * @class Class to create, modify and render standard-compliant - * RSS 2.0 feeds including support for Apple's Podcast specification. - * @constructor - * @extends jala.Rss20Writer - * @param {String} header Optional XML header. - */ -jala.PodcastWriter = function(header) { - jala.Rss20Writer.apply(this, arguments); - - var CATEGORY = { - name: "itunes:category", - attributes: { - name: "text" - } - }; - - var OWNER = { - name: "itunes:owner", - value: [{ - name: "itunes:name" - }, { - name: "itunes:email" - }] - }; - - this.addNamespace("itunes", "http://www.itunes.com/dtds/podcast-1.0.dtd"); - - this.extendChannel([{ - name: "itunes:author" - }, { - name: "itunes:subtitle" - }, { - name: "itunes:summary" - }, { - name: "itunes:new-feed-url" - }, { - name: "itunes:image", - attributes: [{ - name: "href" - }] - }, { - name: "itunes:link", - attributes: [{ - name: "rel" - }, { - name: "type" - }, { - name: "href" - }] - }]); - - this.getChannel().setValue(this.createElement(OWNER)); - - this.extendItem([{ - name: "itunes:duration" - }, { - name: "itunes:subtitle" - }]); - - /** - * Add an iTunes Podcast category. - * @param {String} name The category's name. - * @param {String} subName The (optional) sub-category's name. - * @param {jala.XmlWriter.XmlElement} parent Optional parent - * element to add the category to. - */ - this.addItunesCategory = function(name, subName, parent) { - if (!parent) - parent = this.getChannel(); - var cat = this.createElement(CATEGORY); - cat.populate({attributes: {text: name}}); - if (subName) { - var subCat = this.createElement(CATEGORY); - subCat.populate({attributes: {text: subName}}); - cat.addValue(subCat); - } - parent.addValue(cat); - return; - }; - - return this; -}; - - -/** A typical XML header as default. - @type {String} - @final */ -jala.PodcastWriter.XMLHEADER = ''; diff --git a/modules/jala/code/RemoteContent.js b/modules/jala/code/RemoteContent.js deleted file mode 100644 index 6106413d..00000000 --- a/modules/jala/code/RemoteContent.js +++ /dev/null @@ -1,307 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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 Fields and methods of the jala.RemoteContent class. - */ - -// HelmaLib dependencies -app.addRepository("modules/core/String.js"); -app.addRepository("modules/core/Object.js"); -app.addRepository("modules/core/Date.js"); -app.addRepository("modules/helma/Http.js"); - -// Define the global namespace for Jala modules -if (!global.jala) { - global.jala = {}; -} - -/** - * Construct a new remote content handler. - * @class API to define, fetch and update content - * from a remote site. - * @param {String} url The URL string of the remote site. - * @param {Integer} method The method to retrieve the remote content. - * @param {File} storage The cache directory. - * @returns A new remote content handler. - * @extends helma.Http - * @constructor - */ -jala.RemoteContent = function(url, method, storage) { - if (typeof PropertyMgr == "undefined") - var PropertyMgr = {}; - - var NULLSTR = ""; - var key = url.md5(); - var fname = key + jala.RemoteContent.SUFFIX; - var cache; - method = (method != null ? method.toLowerCase() : null); - - // depending on the method argument the instance - // becomes extent of the appropriate remote client - switch (method) { - case jala.RemoteContent.XMLRPC: - break; - default: - helma.Http.call(this); - break; - } - - if (!storage) { - storage = jala.RemoteContent.CACHEDIR; - if (!storage.exists() || !storage.isDirectory()) - storage.mkdir(storage.getAbsolutePath()); - } - - var getCache = function() { - switch (storage.constructor) { - case HopObject: - cache = storage; - break; - - case PropertyMgr: - cache = storage.getAll(); - break; - - default: - var f = new File(storage, fname); - cache = f.exists() ? Xml.read(f) : new HopObject(); - } - return cache; - }; - - var setCache = function() { - cache.url = url; - cache.method = method; - if (!cache.interval) { - cache.interval = Date.ONEHOUR; - } - cache.lastUpdate = new Date(); - cache = cache.clone(new HopObject()); - - switch (storage.constructor) { - case HopObject: - for (var i in cache) - storage[i] = cache[i]; - break; - - case PropertyMgr: - storage.setAll(cache); - break; - - default: - var f = new File(storage, fname); - Xml.write(cache, f); - } - return; - }; - - cache = getCache(); - - /** - * Set the interval the remote content's - * cache is bound to be updated. - * @param {Number} interval The interval value in milliseconds. - */ - this.setInterval = function(interval) { - cache.interval = parseInt(interval, 10); - return; - }; - - /** - * Get an arbitrary property of the remote content. - * @param {String} key The name of the property. - * @returns The value of the property. - */ - this.get = function(key) { - return cache[key]; - } - - /** - * Get all available property names. - * @returns The list of property names. - * @type Array - */ - this.getKeys = function() { - var keys = []; - for (var i in cache) { - keys.push(i); - } - return keys.sort(); - }; - - /** - * Tests whether the remote content needs to be updated. - * @returns True if the remote content needs to be updated. - * @type Boolean - */ - this.needsUpdate = function() { - if (!cache.lastUpdate) { - return true; - } else { - var max = new Date() - cache.interval; - if (max - cache.lastUpdate > 0) { - return true; - } - } - return false; - }; - - /** - * Get the updated and cached remote content. - * @returns The content as retrieved from the remote site. - * @type String - */ - this.update = function() { - app.debug("[jala.RemoteContent] Retrieving " + url); - var result; - switch (method) { - case jala.RemoteContent.XMLRPC: - break; - default: - result = this.getUrl(url, cache.lastModified || cache.eTag); - if (result.code != 200 && cache.content) { - // preserve the content received before - result.content = cache.content; - } - result.interval = cache.interval; - cache = result; - } - setCache(); - return cache.content; - }; - - /** - * Flushes (empties) the cached remote content. - */ - this.clear = function() { - switch (storage.constructor) { - case HopObject: - for (var i in storage) - delete storage[i]; - break; - - case PropertyMgr: - storage.reset(); - break; - - default: - var f = new File(storage, fname); - f.remove(); - } - return; - }; - - /** - * Get a string representation of the remote content. - * @returns The remote content as string. - * @type String - */ - this.toString = function() { - return cache.content || NULLSTR; - }; - - /** - * Get the value of the remote content. - * @returns The remote content including response header data. - * @type Object - */ - this.valueOf = function() { - return cache; - }; - - return this; -}; - -/** - * A constant representing the HTTP retrieval method. - * @type int - * @final - */ -jala.RemoteContent.HTTP = 1; - -/** - * A constant representing the XML-RPC retrieval method. - * @type int - * @final - */ -jala.RemoteContent.XMLRPC = 2; - -/** - * The default name of the cache directory. - * @type String - * @final - */ -jala.RemoteContent.SUFFIX = ".cache"; - -/** - * The default cache directory. - * @type File - * @final - */ -jala.RemoteContent.CACHEDIR = new File(app.dir, jala.RemoteContent.SUFFIX); - -/** - * Remove all remote content from a file-based cache. - * @param {File} cache An optional target directory. - */ -jala.RemoteContent.flush = function(cache) { - jala.RemoteContent.forEach(function(rc) { - rc.clear(); - return; - }); - return; -}; - -/** - * Apply a custom method on all remote content in a file-based cache. - * @param {Function} callback The callback method to be executed - * for each remote content file. - * @param {File} cache An optional target directory. - */ -jala.RemoteContent.forEach = function(callback, cache) { - if (!cache) - cache = jala.RemoteContent.CACHEDIR; - var f, rc; - var files = cache.list(); - for (var i in files) { - f = new File(cache, files[i]); - if (!files[i].endsWith(jala.RemoteContent.SUFFIX)) - continue; - rc = new jala.RemoteContent(Xml.read(f).url); - if (callback && callback.constructor == Function) - callback(rc); - } - return; -}; - -/** - * Apply a custom method on all remote content in a file-based cache. - * @param {Function} callback The callback method to be executed - * for each remote content file. - * @param {File} cache An optional target directory. - * @deprecated Use {@link #forEach} instead. - */ -jala.RemoteContent.exec = function() { - jala.RemoteContent.forEach.apply(this, arguments); -}; diff --git a/modules/jala/code/Rss20Writer.js b/modules/jala/code/Rss20Writer.js deleted file mode 100644 index 6edc0137..00000000 --- a/modules/jala/code/Rss20Writer.js +++ /dev/null @@ -1,334 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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 Fields and methods of the jala.Rss20Writer class. - */ - - -// Define the global namespace for Jala modules -if (!global.jala) { - global.jala = {}; -} - - -/** - * Jala dependencies - */ -app.addRepository(getProperty("jala.dir", "modules/jala") + - "/code/XmlWriter.js"); - -/** - * @class Class to create, modify and render standard-compliant - * RSS 2.0 feeds. - * @constructor - * @extends jala.XmlWriter - * @param {String} header Optional XML header. - */ -jala.Rss20Writer = function(header) { - // defines the prototype of this constructor - jala.XmlWriter.apply(this, arguments); - - // this should do the same but alas, helma throws - // an error the very first time it is executed: - //arguments.callee.prototype = new jala.XmlWriterInterface(); - - var DATEFMT = "EEE, dd MMM yyyy HH:mm:ss Z"; - - var CATEGORY = { - name: "category", - amount: Infinity, - attributes: { - name: "domain", - } - }; - - var ITEM = { - name: "item", - amount: Infinity, - value: [{ - name: "title", - required: true - }, { - name: "link", - }, { - name: "description", - }, { - name: "author", - }, { - name: "comments", - }, { - name: "enclosure", - attributes: [{ - name: "url", - required: true - }, { - name: "length", - required: true - }, { - name: "type", - required: true - }] - }, { - name: "guid", - attributes: [{ - name: "isPermaLink", - type: Boolean - }] - }, { - name: "pubDate", - type: Date, - format: DATEFMT - }, { - name: "source", - attributes: [{ - name: "url", - required: true - }] - }] - }; - - var CHANNEL = { - name: "channel", - value: [{ - name: "title", - required: true - }, { - name: "link", - required: true - }, { - name: "description", - required: true - }, { - name: "language", - }, { - name: "copyright", - }, { - name: "managingEditor", - }, { - name: "webMaster", - }, { - name: "pubDate", - type: Date, - format: DATEFMT - }, { - name: "lastBuildDate", - type: Date, - format: DATEFMT - }, { - name: "generator", - }, { - name: "docs", - }, { - name: "cloud", - attributes: [{ - name: "domain", - }, { - name: "port", - type: Number, - format: "#" - }, { - name: "path", - }, { - name: "registerProcedure", - }, { - name: "protocol", - }] - }, { - name: "ttl", - type: Number, - format: "#" - }, { - name: "rating", - }, { - name: "skipHours", - }, { - name: "skipDays", - }] - }; - - var IMAGE = { - name: "image", - value: [{ - name: "url", - required: true - }, { - name: "title", - required: true - }, { - name: "link", - required: true - }, { - name: "width", - type: Number, - format: "#" - }, { - name: "height", - type: Number, - format: "#" - }, { - name: "description", - }] - }; - - var TEXTINPUT = { - name: "textinput", - value: [{ - name: "title", - required: true - }, { - name: "description", - required: true - }, { - name: "name", - required: true - }, { - name: "link", - required: true - }] - }; - - var ROOT = { - name: "rss", - attributes: [{ - name: "version", - value: "2.0" - }] - }; - - var xmlroot = this.createElement(ROOT); - var channel = this.createElement(CHANNEL); - xmlroot.setValue(channel); - - /** - * Get the writer's root element. - * @returns The writer's root element. - * @type jala.XmlWriter.XmlElement - */ - this.getRoot = function() { - return xmlroot; - }; - - /** - * Add child elements to the channel template. - * @param {Array} ext List of additional child elements. - */ - this.extendChannel = function(ext) { - this.extend(CHANNEL, ext); - channel = this.createElement(CHANNEL); - xmlroot.setValue(channel); - return; - }; - - /** - * Get the writer's channel element. - * @returns The writer's channel element. - * @type jala.XmlWriter.XmlElement - */ - this.getChannel = function() { - return channel; - }; - - /** - * Populate the channel element with data. - * @param {Object} data An XmlWriter-compliant object structure. - * @returns The populated channel element. - * @type jala.XmlWriter.XmlElement - */ - this.setChannel = function(data) { - return channel.populate(data); - }; - - /** - * Add child elements to the item template. - * @param {Array} ext List of additional child elements. - */ - this.extendItem = function(ext) { - this.extend(ITEM, ext); - return; - }; - - /** - * Get a new and innocent item element. - * @param {Object} data An XmlWriter-compliant object structure. - * @returns A new and innocent item element. - * @type jala.XmlWriter.XmlElement - */ - this.createItem = function(data) { - var item = this.createElement(ITEM); - item.populate(data); - return item; - }; - - /** - * Add an item element to the channel element. - * @param {jala.XmlWriter.XmlElement} item The item element to add. - */ - this.addItem = function(item) { - channel.addValue(item); - return; - }; - - /** - * Add a category element to an arbitrary element. - * @param {String} name The name of the category. - * @param {String} domain The domain of the category. - * @param {jala.XmlWriter.XmlElement} parent The optional parent element. - */ - this.addCategory = function(name, domain, parent) { - if (!parent) - parent = channel; - var cat = this.createElement(CATEGORY); - cat.populate({ - value: name, - attributes: {domain: domain} - }); - parent.addValue(cat); - return; - }; - - /** - * Populate the image element with data. - * @param {Object} data An XmlWriter-compliant object structure. - */ - this.setImage = function(data) { - var image = this.createElement(IMAGE); - image.populate(data); - channel.setValue(image); - return; - }; - - /** - * Populate the textInput element with data. - * @param {Object} data An XmlWriter-compliant object structure. - */ - this.setTextInput = function(data) { - var textInput = this.createElement(TEXTINPUT); - textInput.populate(data); - channel.setValue(textInput); - return; - }; - - return this; -}; diff --git a/modules/jala/code/Utilities.js b/modules/jala/code/Utilities.js deleted file mode 100644 index cd6bd706..00000000 --- a/modules/jala/code/Utilities.js +++ /dev/null @@ -1,246 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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 Fields and methods of the jala.Utilities class. - */ - -// Define the global namespace for Jala modules -if (!global.jala) { - global.jala = {}; -} - -/** - * HelmaLib dependencies - */ -app.addRepository("modules/core/Number.js"); - -/** - * Construct a utility object. - * @class This class contains various convenience methods - * which do not fit in any other class. - * @returns A new utitilty object. - * @constructor - */ -jala.Utilities = function() { - return this; -}; - -/** - * Return a string representation of the utitility class. - * @returns [jala.Utilities] - * @type String - */ -jala.Utilities.toString = function() { - return "[jala.Utilities]"; -}; - -/** - * Return a string representation of the utitility object. - * @returns [jala.Utilities Object] - * @type String - */ -jala.Utilities.prototype.toString = function() { - return "[jala.Utilities Object]"; -}; - -/** - * Default utility class instance. - * @type jala.Utilities - * @final - */ -jala.util = new jala.Utilities(); - -/** - * Creates a random password with different levels of security. - * @param {Number} len The length of the password (default: 8) - * @param {Number} level The security level - *
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--Global -- - -
-Method Summary | -|
-
- <static> Boolean
-
- |
-
-
-
- isArray(<Object> val)
-
- - - Returns true if the value passed as argument is an array. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isBoolean(<Object> val)
-
- - - Returns true if the value passed as argument is either a boolean - literal or an instance of Boolean. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isDate(<Object> val)
-
- - - Returns true if the value passed as argument is either a Javascript date - or an instance of java.util.Date. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isFunction(<Object> val)
-
- - - Returns true if the value passed as argument is a function. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isNull(<Object> val)
-
- - - Returns true if the value passed as argument is null. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isNumber(<Object> val)
-
- - - Returns true if the value passed as argument is either a number, - an instance of Number or of java.lang.Number. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isObject(<Object> val)
-
- - - Returns true if the value passed as argument is either a Javascript - object or an instance of java.lang.Object. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isString(<Object> val)
-
- - - Returns true if the value passed as argument is either a string literal, - an instance of String or of java.lang.String. - |
-
-
- <static> Boolean
-
- |
-
-
-
- isUndefined(<Object> val)
-
- - - Returns true if the value passed as argument is undefined. - |
-
- - - - - - - - - - - - - - - - - -
- Method Detail - | -
<static> Boolean isArray(<Object> val)- -
val
- The value to test
- <static> Boolean isBoolean(<Object> val)- -
val
- The value to test
- <static> Boolean isDate(<Object> val)- -
val
- The value to test
- <static> Boolean isFunction(<Object> val)- -
val
- The value to test
- <static> Boolean isNull(<Object> val)- -
val
- The value to test
- <static> Boolean isNumber(<Object> val)- -
val
- The value to test
- <static> Boolean isObject(<Object> val)- -
val
- The value to test
- <static> Boolean isString(<Object> val)- -
val
- The value to test
- <static> Boolean isUndefined(<Object> val)- -
val
- The value to test
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--HopObject -- - -
-Method Summary | -|
-
- String
-
- |
-
-
-
- getAccessName(<Object> obj, <Number> maxLength)
-
- - - Constructs a name from an object which - is unique in the underlying HopObject collection. - |
-
-
- Boolean
-
- |
-
-
-
- isClean()
-
- - - Returns true if the internal state of this HopObject is CLEAN. - |
-
-
- Boolean
-
- |
-
-
-
- isDeleted()
-
- - - Returns true if the internal state of this HopObject is DELETED. - |
-
-
- Boolean
-
- |
-
-
-
- isInvalid()
-
- - - Returns true if the internal state of this HopObject is INVALID. - |
-
-
- Boolean
-
- |
-
-
-
- isModified()
-
- - - Returns true if the internal state of this HopObject is MODIFIED. - |
-
-
- Boolean
-
- |
-
-
-
- isNew()
-
- - - Returns true if the internal state of this HopObject is NEW. - |
-
-
- Boolean
-
- |
-
-
-
- isTransient()
-
- - - Returns true if the internal state of this HopObject is TRANSIENT. - |
-
-
- Boolean
-
- |
-
-
-
- isVirtual()
-
- - - Returns true if the internal state of this HopObject is VIRTUAL. - |
-
- - - - - - - - - - - - - - - - - -
- Method Detail - | -
String getAccessName(<Object> obj, <Number> maxLength)- -
obj
- The object representing or containing the alias name. Possible object types include: maxLength
- The maximum length of the alias
- Boolean isClean()- -
Boolean isDeleted()- -
Boolean isInvalid()- -
Boolean isModified()- -
Boolean isNew()- -
Boolean isTransient()- -
Boolean isVirtual()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
- jala.Form - | -|
MINLENGTH |
- "minlength" |
-
MAXLENGTH |
- "maxlength" |
-
REQUIRE |
- "require" |
-
CHECKOPTIONS |
- "checkoptions" |
-
CONTENTTYPE |
- "contenttype" |
-
MAXWIDTH |
- "maxwidth" |
-
MINWIDTH |
- "minwidth" |
-
MAXHEIGHT |
- "maxheight" |
-
MINHEIGHT |
- "minheight" |
-
- -
- jala.IndexManager - | -|
MAXTRIES |
- 10 |
-
NORMAL |
- 1 |
-
REBUILDING |
- 2 |
-
- -
- jala.IndexManager.Job - | -|
ADD |
- "add" |
-
REMOVE |
- "remove" |
-
OPTIMIZE |
- "optimize" |
-
- -
- jala.PodcastWriter - | -|
XMLHEADER |
- '' |
-
- -
- jala.RemoteContent - | -|
HTTP |
- 1 |
-
XMLRPC |
- 2 |
-
SUFFIX |
- ".cache" |
-
- -
- jala.Utilities - | -|
VALUE_ADDED |
- 1 |
-
VALUE_MODIFIED |
- 2 |
-
- -
- - -
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
- -- - --Each class has its own separate page. Each of these pages has three sections consisting of a class description, summary tables, and detailed member descriptions:
-
-Each summary entry contains the first sentence from the detailed description for that item.- Class inheritance diagram
- Direct Subclasses
- Class declaration
- Class description -
-
- Field Summary
- Constructor Summary
- Method Summary -
-
- Field Detail
- Constructor Detail
- Method Detail
-The Index contains an alphabetic list of all classes, constructors, methods, and fields.-
-
-
-This help file applies to API documentation generated using the standard doclet.
-
-
-
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
--Jala 1.3 - - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
-
-Link to Non-frame version.
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.AsyncRequest -- - -
-
This class is used to create requests of type "INTERNAL"
- (like cron-jobs) that are processed in a separate thread and
- therefor asynchronous.
-
Deprecated Use the app.invokeAsync method instead (built-in into Helma as of version 1.6)
Defined in AsyncRequest.js
-
-Constructor Summary | -|
-
-
- jala.AsyncRequest
-
- (<Object> obj, <String> funcName, <Array> args)
-
- - - Creates a new AsyncRequest instance. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- evaluate()
-
- - - Starts this asynchronous request. - |
-
-
- Boolean
-
- |
-
-
-
- isAlive()
-
- - - Returns true if the underlying thread is alive - |
-
-
- void
-
- |
-
-
-
- run()
-
- - - Starts this asynchronous request. - |
-
-
- void
-
- |
-
-
-
- setDelay(<Number> millis)
-
- - - Defines the delay to wait before evaluating this asynchronous request. - |
-
-
- void
-
- |
-
-
-
- setTimeout(<Number> seconds)
-
- - - Sets the timeout of this asynchronous request. - |
-
- Constructor Detail - | -
jala.AsyncRequest(<Object> obj, <String> funcName, <Array> args)- - -
obj
- Object in whose context the method should be called
- funcName
- Name of the function to call
- args
- Array containing the arguments that should be passed to the function (optional). This option is deprecated, instead pass the arguments directly to the run() method.
- - Method Detail - | -
void evaluate()- -
Boolean isAlive()- -
void run()- -
void setDelay(<Number> millis)- -
millis
- Milliseconds to wait
- void setTimeout(<Number> seconds)- -
seconds
- Thread-timeout.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.BitTorrent -- - -
-
This class provides methods to create a BitTorrent
- metadata file from any desired file.
-
Defined in BitTorrent.js
-
-Constructor Summary | -|
-
-
- jala.BitTorrent
-
- (<String> filePath, <String> trackerUrl)
-
- - - Constructs a new BitTorrent file. - |
-
-Method Summary | -|
-
- Object
-
- |
-
-
-
- get(<String> name)
-
- - - Get a torrent property. - |
-
-
- Date
-
- |
-
-
-
- getCreationDate()
-
- - - Get the creation date of the torrent. - |
-
-
- Number
-
- |
-
-
-
- getPieceLength()
-
- - - Get the piece length of the torrent. - |
-
-
- helma.File
-
- |
-
-
-
- getSourceFile()
-
- - - Returns the underlying source file. - |
-
-
- helma.File
-
- |
-
-
-
- getTorrentFile()
-
- - - Returns the underlying torrent file. - |
-
-
- Array
-
- |
-
-
-
- keys()
-
- - - Get all available property names. - |
-
-
- void
-
- |
-
-
-
- save(<String> filename)
-
- - - Saves the torrent as file. - |
-
-
- void
-
- |
-
-
-
- set(<String> name, <Object> value)
-
- - - Set a torrent property. - |
-
-
- void
-
- |
-
-
-
- setCreationDate(<Date> date)
-
- - - Set the creation date of the torrent. - |
-
-
- void
-
- |
-
-
-
- setPieceLength(<Number> length)
-
- - - Set the piece length of the torrent. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Get a string representation of the torrent. - |
-
-
- <static> Object
-
- |
-
-
-
- bdecode(<String> code)
-
- - - The bdecode method. - |
-
-
- <static> String
-
- |
-
-
-
- bencode(<Object> obj)
-
- - - The bencode method. - |
-
- Constructor Detail - | -
jala.BitTorrent(<String> filePath, <String> trackerUrl)- - -
filePath
- The path to the original file.
- trackerUrl
- The URL string of the tracker.
- - Method Detail - | -
Object get(<String> name)- -
name
- The name of the property.
- Date getCreationDate()- -
Number getPieceLength()- -
helma.File getSourceFile()- -
helma.File getTorrentFile()- -
Array keys()- -
void save(<String> filename)- -
filename
- An optional name for the torrent file. If no name is given it will be composed from name of source file as defined in the torrent plus the ending ".torrent".
- void set(<String> name, <Object> value)- -
name
- The name of the property.
- value
- The property's value.
- void setCreationDate(<Date> date)- -
date
- The desired creation date.
- void setPieceLength(<Number> length)- -
length
- The desired piece length.
- String toString()- -
<static> Object bdecode(<String> code)- -
code
- The encoded string.
- <static> String bencode(<Object> obj)- -
obj
- The target JavaScript object.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Captcha -- - -
-
Wrapper class for the
- JCaptcha library.
- A captcha (an acronym for "completely automated public
- Turing test to tell computers and humans apart") is a
- type of challenge-response test used in computing to
- determine whether or not the user is human.
-
Defined in Captcha.js
-
-Constructor Summary | -|
-
-
- jala.Captcha
-
- ()
-
- - - Construct a new captcha. - |
-
-Method Summary | -|
-
- com.octo.captcha.Captcha
-
- |
-
-
-
- getCaptcha()
-
- - - Get a new captcha object. - |
-
-
- void
-
- |
-
-
-
- renderImage()
-
- - - Render a new captcha image. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Get a string representation of the captcha object. - |
-
-
- Boolean
-
- |
-
-
-
- validate(<String> input)
-
- - - Validate a user's input with the prompted captcha. - |
-
- Constructor Detail - | -
jala.Captcha()- - -
- Method Detail - | -
com.octo.captcha.Captcha getCaptcha()- -
void renderImage()- -
String toString()- -
Boolean validate(<String> input)- -
input
- The user's input.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Date.Calendar.Renderer -- - -
-
A default renderer to use in conjunction with jala.Date.Calendar
-
Defined in Date.js
-
- Field Summary | -|
- jala.Date.Calendar |
- calendar
- - The calendar utilizing this renderer instance |
-
- helma.Html |
- html
- - An instance of helma.Html used for rendering the calendar |
-
-Constructor Summary | -|
-
-
- jala.Date.Calendar.Renderer
-
- (<jala.Date.Calendar> calendar)
-
- - - Returns a new instance of the default calendar renderer. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- renderCalendar(<Date> date, <String> body, <Date> prevMonth, <Date> nextMonth)
-
- - - Renders the calendar directly to response. - |
-
-
- void
-
- |
-
-
-
- renderDay(<Date> date, <Boolean> isExisting, <Boolean> isSelected)
-
- - - Renders a single day within the calendar directly to response. - |
-
-
- void
-
- |
-
-
-
- renderDayHeader(<String> text)
-
- - - Renders a single cell in the calendar day header row directly to response. - |
-
-
- void
-
- |
-
-
-
- renderPrevNextLink(<Date> date)
-
- - - Renders a link to the previous or next month's calendar directly to response. - |
-
-
- void
-
- |
-
-
-
- renderRow(<String> row)
-
- - - Renders a single calendar row directly to response. - |
-
Field Detail | -
jala.Date.Calendar calendar-
helma.Html html-
- Constructor Detail - | -
jala.Date.Calendar.Renderer(<jala.Date.Calendar> calendar)- - -
calendar
- The calendar utilizing this renderer
- - Method Detail - | -
void renderCalendar(<Date> date, <String> body, <Date> prevMonth, <Date> nextMonth)- -
date
- A date object representing this calendar's month and year. Please mind that the day will be set to the last date in this month.
- body
- The rendered calendar weeks including the day header (basically the whole kernel of the table).
- prevMonth
- A date object set to the last available date of the previous month. This can be used to render a navigation link to the previous month.
- nextMonth
- A date object set to the first available date of the next month. This can be used to render a navigation link to the next month.
- void renderDay(<Date> date, <Boolean> isExisting, <Boolean> isSelected)- -
date
- A date instance representing the day within the calendar.
- isExisting
- True if there is a child object in the calendar's collection to which the date cell should link to
- isSelected
- True if this calendar day should be rendered as selected day.
- void renderDayHeader(<String> text)- -
text
- The text to display in the header field.
- void renderPrevNextLink(<Date> date)- -
date
- A date object set to the previous or next available month. This can be null in case there is no previous or next month.
- void renderRow(<String> row)- -
row
- The body of the calendar row.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Date.Calendar -- - -
-
This class represents a calendar based based on a grouped
- collection of HopObjects. It provides several methods for rendering
- the calendar plus defining locale and timezone settings.
-
Defined in Date.js
-
-Nested Class Summary | -|
- <static class> |
- jala.Date.Calendar.Renderer |
-
-Constructor Summary | -|
-
-
- jala.Date.Calendar
-
- (<HopObject> collection)
-
- - - Creates a new instance of jala.Data.Calendar - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- getAccessNameFormat()
-
- - - Returns the format of the access name used by this calendar to access - child group objects of the collection this calendar is operating on. - |
-
-
- String
-
- |
-
-
-
- getCalendar(today)
-
- - - Returns a rendered calendar - |
-
-
- HopObject
-
- |
-
-
-
- getCollection()
-
- - - Returns the collection this calendar object works on - |
-
-
- String
-
- |
-
-
-
- getHrefFormat()
-
- - - Returns the date formatting pattern used to render hrefs. - |
-
-
- java.util.Locale
-
- |
-
-
-
- getLocale()
-
- - - Returns the locale used within this calendar instance. - |
-
-
- Object
-
- |
-
-
-
- getRenderer()
-
- - - Returns the renderer used by this calendar. - |
-
-
- java.util.Locale
-
- |
-
-
-
- getTimeZone()
-
- - - Returns the locale used within this calendar instance. - |
-
-
- void
-
- |
-
-
-
- render(today)
-
- - - Renders the calendar using either a custom renderer defined - using setRenderer() or the default one. - |
-
-
- void
-
- |
-
-
-
- setAccessNameFormat(<String> fmt)
-
- - - Sets the format of the group name to use when trying to access - child objects of the collection this calendar is operating on. - |
-
-
- void
-
- |
-
-
-
- setHrefFormat(<String> fmt)
-
- - - Sets the format of the hrefs to render by this calendar - to the format pattern passed as argument. - |
-
-
- void
-
- |
-
-
-
- setLocale(<java.util.Locale> loc)
-
- - - Sets the locale to use within this calendar object - |
-
-
- void
-
- |
-
-
-
- setRenderer(<Object> r)
-
- - - Sets the renderer to use. - |
-
-
- void
-
- |
-
-
-
- setTimeZone(tz)
-
- - - Sets the locale to use within this calendar object - |
-
- Constructor Detail - | -
jala.Date.Calendar(<HopObject> collection)- - -
collection
- A grouped HopObject collection to work on
- - Method Detail - | -
String getAccessNameFormat()- -
String getCalendar(today)- -
HopObject getCollection()- -
String getHrefFormat()- -
java.util.Locale getLocale()- -
Object getRenderer()- -
java.util.Locale getTimeZone()- -
void render(today)- -
void setAccessNameFormat(<String> fmt)- -
fmt
- The date format pattern to use for accessing child objects
- void setHrefFormat(<String> fmt)- -
fmt
- The date format pattern to use for rendering the href
- void setLocale(<java.util.Locale> loc)- -
loc
- The locale to use
- void setRenderer(<Object> r)- -
r
- The renderer to use
- void setTimeZone(tz)- -
loc
- The locale to use
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Date -- - -
-
This class provides various convenience
- methods for rendering purposes.
-
Defined in Date.js
-
-Nested Class Summary | -|
- <static class> |
- jala.Date.Calendar |
-
-Constructor Summary | -|
-
-
- jala.Date
-
- ()
-
- - - Constructs a new Renderings object. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- renderEditor(<String> prefix, <Date> date, <Object> fmt)
-
- - - Renders a timestamp as set of DropDown boxes, following the - format passed as argument. - |
-
-
- String
-
- |
-
-
-
- renderEditorAsString(prefix, date, pattern)
-
- - - Returns a timestamp as set of dropdown-boxes - |
-
- Constructor Detail - | -
jala.Date()- - -
- Method Detail - | -
void renderEditor(<String> prefix, <Date> date, <Object> fmt)- -
prefix
- The prefix to use for all dropdown boxes, eg. "postdate"
- date
- A Date object to use as preselection (optional)
- fmt
- Array containing one parameter object for every single select box that should be rendered, with the following properties set: String renderEditorAsString(prefix, date, pattern)- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.DnsClient.Record -- - -
-
Instances of this class wrap record data as received
- from the nameserver.
-
Defined in DnsClient.js
-
- Field Summary | -|
- String |
- cname
- - The CNAME of this record. |
-
- String |
- email
- - The email address responsible for a name server. |
-
- String |
- host
- - The name of the host. |
-
- String |
- ipAddress
- - The IP address of the host. |
-
- String |
- mx
- - The name of the mail exchanging server. |
-
- String |
- text
- - Descriptive text as received from the nameserver. |
-
- Number |
- type
- - The type of the nameserver record represented by this Answer instance. |
-
-Constructor Summary | -|
-
-
- jala.DnsClient.Record
-
- (<org.wonderly.net.dns.RR> data)
-
- - - Constructs a new instance of jala.DnsClient.Record. - |
-
-Method Summary | -|
-
- org.wonderly.net.dns.RR
-
- |
-
-
-
- getData()
-
- - - Returns the wrapped nameserver record data - |
-
Field Detail | -
String cname-
String email-
String host-
String ipAddress-
String mx-
String text-
Number type-
- Constructor Detail - | -
jala.DnsClient.Record(<org.wonderly.net.dns.RR> data)- - -
data
- The data as received from the nameserver
- - Method Detail - | -
org.wonderly.net.dns.RR getData()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.DnsClient -- - -
-
This is a wrapper around the Dns Client by wonderly.org
- providing methods for querying Dns servers. For more information
- about the Java DNS client visit
- https://javadns.dev.java.net/.
- Please mind that the nameserver specified must accept queries on port
- 53 TCP (the Java DNS client used doesn't support UDP nameserver queries),
- and that reverse lookups are not supported.
-
Defined in DnsClient.js
-
-Nested Class Summary | -|
- <static class> |
- jala.DnsClient.Record |
-
- Field Summary | -|
- String |
- nameServer
- - Contains the IP Adress/FQDN of the name server to query. |
-
- <static> <final> Number |
- TYPE_A
- - The "A" record/query type. |
-
- <static> <final> Number |
- TYPE_CNAME
- - The "CNAME" record/query type. |
-
- <static> <final> Number |
- TYPE_MX
- - The "MX" record/query type. |
-
- <static> <final> Number |
- TYPE_NS
- - The "NS" record/query type. |
-
- <static> <final> Number |
- TYPE_PTR
- - The "PTR" record/query type. |
-
- <static> <final> Number |
- TYPE_SOA
- - The "SOA" record/query type. |
-
- <static> <final> Number |
- TYPE_TXT
- - The "TXT" record/query type. |
-
- <static> <final> Number |
- TYPE_WKS
- - The "WKS" record/query type. |
-
-Constructor Summary | -|
-
-
- jala.DnsClient
-
- (<String> nameServer)
-
- - - Constructs a new DnsClient object. - |
-
-Method Summary | -|
-
- org.wonderly.net.dns.RR
-
- |
-
-
-
- query(<String> dName, <Number> queryType)
-
- - - Queries the nameserver for a specific domain - and the given type of record. - |
-
-
- org.wonderly.net.dns.RR
-
- |
-
-
-
- queryMailHost(<String> dName)
-
- - - Convenience method to query for the MX-records - of the domain passed as argument. - |
-
Field Detail | -
String nameServer-
<static> <final> Number TYPE_A-
<static> <final> Number TYPE_CNAME-
<static> <final> Number TYPE_MX-
<static> <final> Number TYPE_NS-
<static> <final> Number TYPE_PTR-
<static> <final> Number TYPE_SOA-
<static> <final> Number TYPE_TXT-
<static> <final> Number TYPE_WKS-
- Constructor Detail - | -
jala.DnsClient(<String> nameServer)- - -
nameServer
- IP-Address or FQDN of nameserver to query
- - Method Detail - | -
org.wonderly.net.dns.RR query(<String> dName, <Number> queryType)- -
dName
- The domain name to query for
- queryType
- The type of records to retrieve
- org.wonderly.net.dns.RR queryMailHost(<String> dName)- -
dName
- The domain name to query for
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Button -- -
-
Subclass of jala.Form.Component.Input which renders a button.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Button
-
- (<String> name)
-
- - - Creates a new Button component instance - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- render(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a button to the response. - |
-
-
- Object
-
- |
-
-
-
- renderControls(attr, value)
-
- - - Creates a new attribute object for this button. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, checkRequirements, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Button(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
void render(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
- Object renderControls(attr, value)- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Checkbox -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- checkbox.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Checkbox
-
- (<String> name)
-
- - - Creates a new Checkbox component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates user input from checkbox. - |
-
-
- Number
-
- |
-
-
-
- parseValue(<Object> reqData)
-
- - - Parses the string input from the form. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, reqData)
-
- - - Renders an checkbox to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength
- |
-
- Constructor Detail - | -
jala.Form.Component.Checkbox(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkRequirements(<Object> reqData)- -
reqData
- request data
- Number parseValue(<Object> reqData)- -
reqData
- request data
- void renderControls(<Object> attr, <Object> value, reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Date -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- date editor.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Date
-
- (<String> name)
-
- - - Constructs a new Date component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates user input from a date editor. - |
-
-
- Date
-
- |
-
-
-
- parseValue(<Object> reqData)
-
- - - Parses the string input from the form and converts it to a date object. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a textarea tag to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength
- |
-
- Constructor Detail - | -
jala.Form.Component.Date(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkRequirements(<Object> reqData)- -
reqData
- request data
- Date parseValue(<Object> reqData)- -
reqData
- request data
- void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Fieldset -- - -
-
Instances of this class represent a form fieldset containing
- numerous form components
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Fieldset
-
- (<String> name)
-
- - - Constructs a new Fieldset instance - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- render()
-
- - - Renders all components within the fieldset. - |
-
-
- void
-
- |
-
-
-
- save(<jala.Form.Tracker> tracker, <Object> destObj)
-
- - - Saves all components within the fieldset. - |
-
-
- void
-
- |
-
-
-
- validate(<jala.Form.Tracker> tracker)
-
- - - Validates all components within the fieldset. - |
-
- Constructor Detail - | -
jala.Form.Component.Fieldset(<String> name)- - -
name
- The name of the fieldset
- - Method Detail - | -
void render()- -
void save(<jala.Form.Tracker> tracker, <Object> destObj)- -
tracker
-
- destObj
-
- void validate(<jala.Form.Tracker> tracker)- -
tracker
-
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.File -- -
-
Subclass of jala.Form.Component.Input which renders and validates a
- file upload.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.File
-
- (<String> name)
-
- - - Creates a new File component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates a file upload by making sure it's there (if REQUIRE is set), - checking the file size, the content type and by trying to construct an image. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a file input tag to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.File(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkRequirements(<Object> reqData)- -
reqData
- request data
- tracker
- jala.Form.Tracker object storing possible error messages
- void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Hidden -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- hidden input tag.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Hidden
-
- (<String> name)
-
- - - Constructs a newly created Hidden component instance - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- render()
-
- - - Renders this component directly to response. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a hidden input tag to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, checkRequirements, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Hidden(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
void render()- -
void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.File - | - +--jala.Form.Component.Image -- - -
-
Subclass of jala.Form.Component.File which renders a file upload
- and validates uploaded files as images.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Image
-
- ()
-
- - - Creates a new Image component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates an image upload by making sure it's there (if REQUIRE is set), - checking the file size, the content type and by trying to construct an image. - |
-
Methods inherited from class jala.Form.Component.File | -
-
-renderControls
- |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Image()- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkRequirements(<Object> reqData)- -
reqData
- request data
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input -- -
-
Instances of this class represent a single form input field.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Input
-
- (<String> name)
-
- - - Creates a new input component instance. - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkLength(<Object> reqData)
-
- - - Checks user input for maximum length, minimum length and require - if the corresponding options have been set using the require method. - |
-
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Checks user input against options set using the require method. - |
-
-
- void
-
- |
-
-
-
- class_macro()
-
- - - Renders this component's class name. - |
-
-
- void
-
- |
-
-
-
- controls_macro()
-
- - - Renders the control(s) of this component - |
-
-
- void
-
- |
-
-
-
- error_macro()
-
- - - Renders this component's error message (if set) directly to response - |
-
-
- Object
-
- |
-
-
-
- getControlAttributes()
-
- - - Creates a new attribute object for this element. - |
-
-
- String|Number|Date
-
- |
-
-
-
- getValue()
-
- - - Retrieves the property which is edited by this component. - |
-
-
- void
-
- |
-
-
-
- help_macro()
-
- - - Renders this component's help text, if set. - |
-
-
- void
-
- |
-
-
-
- id_macro()
-
- - - Renders this component's id - |
-
-
- void
-
- |
-
-
-
- label_macro()
-
- - - Renders this component's label. - |
-
-
- void
-
- |
-
-
-
- name_macro()
-
- - - Renders this component's name - |
-
-
- Object
-
- |
-
-
-
- parseValue(<Object> reqData)
-
- - - Parses the string input from the form and creates the datatype that - is edited with this component. - |
-
-
- void
-
- |
-
-
-
- render()
-
- - - Renders this component including label, error and help messages directly - to response. - |
-
-
- void
-
- |
-
-
-
- render_macro()
-
- - - Renders this component including label, error and help messages - directly to response - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders the html form elements to the response. - |
-
-
- String
-
- |
-
-
-
- renderError()
-
- - - If the error tracker holds an error message for this component, - it is wrapped in a div-tag and returned as a string. - |
-
-
- String
-
- |
-
-
-
- renderHelp()
-
- - - If this component contains a help message, it is wrapped in - a div-tag and returned as a string. - |
-
-
- String
-
- |
-
-
-
- renderLabel()
-
- - - Returns the rendered label of this component - |
-
-
- void
-
- |
-
-
-
- save(<jala.Form.Tracker> tracker, <Object> destObj)
-
- - - Saves the parsed value using setValue. - |
-
-
- Object
-
- |
-
-
-
- setValue(<Object> destObj, <Object> value)
-
- - - Sets a property of the object passed as argument to the given value. - |
-
-
- void
-
- |
-
-
-
- type_macro()
-
- - - Renders this component's type - |
-
-
- void
-
- |
-
-
-
- validate(<jala.Form.Tracker> tracker)
-
- - - Validates the input provided to this component. - |
-
- Constructor Detail - | -
jala.Form.Component.Input(<String> name)- - -
name
- Name of the component, used as name of the html control.
- - Method Detail - | -
String checkLength(<Object> reqData)- -
reqData
- request data
- String checkRequirements(<Object> reqData)- -
reqData
- request data
- void class_macro()- -
void controls_macro()- -
void error_macro()- -
Object getControlAttributes()- -
String|Number|Date getValue()- -
void help_macro()- -
void id_macro()- -
void label_macro()- -
void name_macro()- -
Object parseValue(<Object> reqData)- -
reqData
- request data
- void render()- -
void render_macro()- -
void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for the html form elements.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
- String renderError()- -
String renderHelp()- -
String renderLabel()- -
void save(<jala.Form.Tracker> tracker, <Object> destObj)- -
tracker
- Tracker object collecting request data, error messages and parsed values.
- destObj
- (optional) object whose values will be changed.
- Object setValue(<Object> destObj, <Object> value)- -
destObj
- (optional) object whose values will be changed.
- value
- The value to set the property to
- void type_macro()- -
void validate(<jala.Form.Tracker> tracker)- -
tracker
- Tracker object collecting request data, error messages and parsed values.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Password -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- password input tag.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Password
-
- (<String> name)
-
- - - Constructs a newly created Password component instance - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a password input tag to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, checkRequirements, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Password(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Select - | - +--jala.Form.Component.Radio -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- set of radio buttons.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Radio
-
- (<String> name)
-
- - - Creates a new Radio component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates user input from a set of radio buttons and makes sure that - option value list contains the user input. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value)
-
- - - Renders a set of radio buttons to the response. - |
-
Methods inherited from class jala.Form.Component.Select | -
-
-parseOptions, checkOptions
- |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Radio(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkRequirements(<Object> reqData)- -
reqData
- request data
- void renderControls(<Object> attr, <Object> value)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Select -- -
-
Subclass of jala.Form.Component.Input which renders and validates a
- dropdown element.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Select
-
- (<String> name)
-
- - - Constructs a new Select component instance - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- checkOptions(<Object> reqData)
-
- - - Checks user input for optiongroups: Unless require("checkoptions") - has ben set to false, the user input must exist in the option array. - |
-
-
- String
-
- |
-
-
-
- checkRequirements(<Object> reqData)
-
- - - Validates user input from a dropdown element by making sure that - the option value list contains the user input. - |
-
-
- Array
-
- |
-
-
-
- parseOptions()
-
- - - Creates an array of options for a dropdown element or a - group of radiobuttons. - |
-
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a dropdown element to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Select(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
String checkOptions(<Object> reqData)- -
reqData
- request data
- String checkRequirements(<Object> reqData)- -
reqData
- request data
- Array parseOptions()- -
void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component - | - +--jala.Form.Component.Skin -- - -
-
Subclass of jala.Form.Component that allows rendering a skin
- within a form.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Skin
-
- (<String> name)
-
- - - - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- render()
-
- - - Renders the skin named by this component to the response. - |
-
Methods inherited from class jala.Form.Component | -
-
-createDomId, validate, save
- |
-
- Constructor Detail - | -
jala.Form.Component.Skin(<String> name)- - - - -
name
- The name of the component, used as the name of the skin
- - Method Detail - | -
void render()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Button - | - +--jala.Form.Component.Submit -- - -
-
Subclass of jala.Form.Component.Button which renders a submit button.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Submit
-
- (<String> name)
-
- - - Creates a new Submit component instance - |
-
-Method Summary | -|
-
- Object
-
- |
-
-
-
- renderControls(attr, value)
-
- - - Creates a new attribute object for this button. - |
-
Methods inherited from class jala.Form.Component.Button | -
-
-render
- |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, checkRequirements, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Submit(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
Object renderControls(attr, value)- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component.Input - | - +--jala.Form.Component.Textarea -- - -
-
Subclass of jala.Form.Component.Input which renders and validates a
- textarea input field.
-
Defined in Form.js
-
-Constructor Summary | -|
-
-
- jala.Form.Component.Textarea
-
- (<String> name)
-
- - - Constructs a new Textarea component. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- renderControls(<Object> attr, <Object> value, <Object> reqData)
-
- - - Renders a textarea input field to the response. - |
-
Methods inherited from class jala.Form.Component.Input | -
-
-validate, save, getValue, setValue, render, renderError, renderLabel, renderHelp, render_macro, controls_macro, error_macro, label_macro, help_macro, id_macro, name_macro, type_macro, class_macro, getControlAttributes, checkLength, checkRequirements, parseValue
- |
-
- Constructor Detail - | -
jala.Form.Component.Textarea(<String> name)- - -
name
- Name of the component, used as name of the html controls.
- - Method Detail - | -
void renderControls(<Object> attr, <Object> value, <Object> reqData)- -
attr
- Basic attributes for this element.
- value
- Value to be used for rendering this element.
- reqData
- Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Component -- -
- Defined in Form.js
-
-Nested Class Summary | -|
- <static class> |
- jala.Form.Component.Fieldset |
-
- <static class> |
- jala.Form.Component.Skin |
-
- <static class> |
- jala.Form.Component.Input |
-
- <static class> |
- jala.Form.Component.Password |
-
- <static class> |
- jala.Form.Component.Hidden |
-
- <static class> |
- jala.Form.Component.Textarea |
-
- <static class> |
- jala.Form.Component.Date |
-
- <static class> |
- jala.Form.Component.Select |
-
- <static class> |
- jala.Form.Component.Radio |
-
- <static class> |
- jala.Form.Component.Checkbox |
-
- <static class> |
- jala.Form.Component.File |
-
- <static class> |
- jala.Form.Component.Image |
-
- <static class> |
- jala.Form.Component.Button |
-
- <static class> |
- jala.Form.Component.Submit |
-
-Constructor Summary | -|
-
-
- jala.Form.Component
-
- (name)
-
- - - The abstract base class for all components. - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- createDomId(<String> idPart)
-
- - - Creates a DOM identifier based on the name of the form, - the name of the component and an additional string. - |
-
-
- void
-
- |
-
-
-
- render()
-
- - - Function to render a component. - |
-
-
- void
-
- |
-
-
-
- save(destObj, val)
-
- - - Function to save the data of a component. - |
-
-
- Object
-
- |
-
-
-
- validate(<jala.Form.Tracker> tracker)
-
- - - Function to validate a component. - |
-
- Constructor Detail - | -
jala.Form.Component(name)- - -
- Method Detail - | -
String createDomId(<String> idPart)- -
idPart
- Optional string appended to component's id.
- void render()- -
void save(destObj, val)- -
Object validate(<jala.Form.Tracker> tracker)- -
tracker
- object tracking errors and holding parsed values and request data.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form.Tracker -- - -
-
Instances of this class can contain error-messages and values
-
Defined in Form.js
-
- Field Summary | -|
- Object |
- errors
- - A map containing error messages |
-
- Object |
- reqData
- - A map containing input from request data |
-
- Object |
- values
- - A map containing parsed values (only for those fields that didn't - fail during checkRequirements method). |
-
-Constructor Summary | -|
-
-
- jala.Form.Tracker
-
- (reqData)
-
- - - A generic container for error-messages and values - |
-
-Method Summary | -|
-
- Number
-
- |
-
-
-
- countErrors()
-
- - - Returns the number of components for which this instance has - tracked an error. - |
-
-
- Boolean
-
- |
-
-
-
- hasError()
-
- - - Returns true if an error has been set for at least one component. - |
-
Field Detail | -
Object errors-
Object reqData-
Object values-
- Constructor Detail - | -
jala.Form.Tracker(reqData)- - -
- Method Detail - | -
Number countErrors()- -
Boolean hasError()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Form -- - -
-
A class that renders forms, validates submitted form data and
- stores the data in a specified object.
-
Defined in Form.js
-
-Nested Class Summary | -|
- <static class> |
- jala.Form.Component |
-
- <static class> |
- jala.Form.Tracker |
-
- Field Summary | -|
- Skin |
- componentSkin
- - Contains the default component skin |
-
- String |
- name
- - Readonly reference to the name of the form |
-
- <static> <final> String |
- CHECKOPTIONS
- - Constant used by require function to define that a select or - radio component should validate only if the user input is contained - in the list of options provided. |
-
- <static> <final> String |
- CONTENTTYPE
- - Constant used by require function to define that a file upload - component should validate only if the file's content type is - in the list of allowed content types provided. |
-
- <static> helma.Html |
- html
- - The HTML renderer used by jala.Form |
-
- <static> <final> String |
- MAXHEIGHT
- - Constant used by require function to define that an image upload - component should validate only if the image's height is less than - the value provided. |
-
- <static> <final> String |
- MAXLENGTH
- - Constant used by require function to define that a component - should not validate if userinput exceeds a maximum length. |
-
- <static> <final> String |
- MAXWIDTH
- - Constant used by require function to define that an image upload - component should validate only if the image's width is less than - the value provided. |
-
- <static> <final> String |
- MINHEIGHT
- - Constant used by require function to define that an image upload - component should validate only if the image's height is more than - the value provided. |
-
- <static> <final> String |
- MINLENGTH
- - Constant used by require function to define that a component - should not validate if userinput is shorter than a given length. |
-
- <static> <final> String |
- MINWIDTH
- - Constant used by require function to define that an image upload - component should validate only if the image's width is more than - the value provided. |
-
- <static> <final> String |
- REQUIRE
- - Constant used by require function to define that a component - should validate only if the user did provide input. |
-
-Constructor Summary | -|
-
-
- jala.Form
-
- (<String> name, <Object> dataObj)
-
- - - Constructs a new Form instance - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- addComponent(<jala.Form.Component.Input> component)
-
- - - Adds a component to this jala.Form instance - |
-
-
- String
-
- |
-
-
-
- class_macro()
-
- - - Returns the class name of the form - |
-
-
- void
-
- |
-
-
-
- close_macro()
-
- - - Writes the form closing tag to response - |
-
-
- Boolean
-
- |
-
-
-
- containsFileUpload()
-
- - - Returns true if this instance of jala.Form contains at least - one component doing a file upload. - |
-
-
- Number
-
- |
-
-
-
- countErrors()
-
- - - If this instance of jala.Form holds a jala.Form.Tracker - instance it returns the number of components that didn't - validate. - |
-
-
- String
-
- |
-
-
-
- createDomId()
-
- - - Creates a DOM identifier based on the arguments passed. - |
-
-
- String
-
- |
-
-
-
- getClassName()
-
- - - Returns the class name set for this form instance. - |
-
-
- Object
-
- |
-
-
-
- getDataObject()
-
- - - Returns the data object containing the values used - for rendering the form. - |
-
-
- String
-
- |
-
-
-
- getErrorMessage()
-
- - - Returns the general error message printed above the form - if any of the components didn't validate. - |
-
-
- jala.Form.Tracker
-
- |
-
-
-
- getTracker()
-
- - - Returns the tracker object this form instance uses for collecting - error messages and parsed values. - |
-
-
- Boolean
-
- |
-
-
-
- handle(<Object> reqData, <Object> destObj)
-
- - - Parses form input, applies check functions and stores the values - if the form does validate. - |
-
-
- Boolean
-
- |
-
-
-
- hasError()
-
- - - Returns true if this instance of jala.Form holds a jala.Form.Tracker - instance and at least one error has been set on this tracker. - |
-
-
- String
-
- |
-
-
-
- id_macro()
-
- - - Returns the id (equal to the name) of the form - |
-
-
- Array
-
- |
-
-
-
- listComponents()
-
- - - Returns an array containing the components - of this jala.Form instance. - |
-
-
- String
-
- |
-
-
-
- name_macro()
-
- - - Returns the name (equal to the id) of the form - |
-
-
- void
-
- |
-
-
-
- open_macro()
-
- - - Writes the form opening tag to response - |
-
-
- void
-
- |
-
-
-
- render()
-
- - - Renders this form including all components to response. - |
-
-
- void
-
- |
-
-
-
- render_macro()
-
- - - Renders the whole form to response - |
-
-
- String
-
- |
-
-
-
- renderAsString(param)
-
- - - renders the form as a string - |
-
-
- void
-
- |
-
-
-
- save(<jala.Form.Tracker> tracker, <Object> destObj)
-
- - - Sets the parsed values on an object. - |
-
-
- void
-
- |
-
-
-
- setClassName(<String> newClassName)
-
- - - Sets an extra classname for this form instance - |
-
-
- void
-
- |
-
-
-
- setDataObject(newDataObj)
-
- - - Sets the data object which is being edited by this form. - |
-
-
- void
-
- |
-
-
-
- setErrorMessage(<String> newErrorMessage)
-
- - - Sets the general error message printed above the form if any - of the components didn't validate. - |
-
-
- void
-
- |
-
-
-
- setTracker(<jala.Form.Tracker> newTracker)
-
- - - Sets the tracker object this form instance uses for collecting - error messages and parsed values. - |
-
-
- jala.Form.Tracker
-
- |
-
-
-
- validate(<Object> reqData)
-
- - - Validates user input from a submitted form by calling each - component's validate method. - |
-
-
- <static> jala.Form
-
- |
-
-
-
- create(<Object> config, dataObj)
-
- - - Parses a plain javascript object tree and configures a - new jala.Form instance according to the properties. - |
-
-
- <static> void
-
- |
-
-
-
- extend(<Function> subClass, <Function> superClass)
-
- - - Utility to set up the prototype, constructor, superclass and superconstructor - properties to support an inheritance strategy that can chain constructors and methods. - |
-
-
- <static> String
-
- |
-
-
-
- isEmail(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)
-
- - - Static validator function to test values for being a valid email address. - |
-
-
- <static> String
-
- |
-
-
-
- isUrl(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)
-
- - - Static validator function to test values for being a valid url. - |
-
-
- <static> Object
-
- |
-
-
-
- propertyGetter(<String> name, value)
-
- - - static default getter function used to return a field - from the data object. - |
-
-
- <static> void
-
- |
-
-
-
- propertySetter(<String> name, <Object> value)
-
- - - static default setter function used to change a field - of the data object. - |
-
Field Detail | -
Skin componentSkin-
String name-
<static> <final> String CHECKOPTIONS-
-
<static> <final> String CONTENTTYPE-
-
<static> helma.Html html-
<static> <final> String MAXHEIGHT-
-
<static> <final> String MAXLENGTH-
-
<static> <final> String MAXWIDTH-
-
<static> <final> String MINHEIGHT-
-
<static> <final> String MINLENGTH-
-
<static> <final> String MINWIDTH-
-
<static> <final> String REQUIRE-
-
- Constructor Detail - | -
jala.Form(<String> name, <Object> dataObj)- - -
name
- The name of the form
- dataObj
- An optional object used to retrieve values to display in the form input fields contained in this Form instance.
- - Method Detail - | -
void addComponent(<jala.Form.Component.Input> component)- -
component
-
- String class_macro()- -
void close_macro()- -
Boolean containsFileUpload()- -
Number countErrors()- -
String createDomId()- -
String getClassName()- -
Object getDataObject()- -
String getErrorMessage()- -
jala.Form.Tracker getTracker()- -
Boolean handle(<Object> reqData, <Object> destObj)- -
reqData
- input from form
- destObj
- object whose values should be chanegd
- Boolean hasError()- -
String id_macro()- -
Array listComponents()- -
String name_macro()- -
void open_macro()- -
void render()- -
void render_macro()- -
String renderAsString(param)- -
void save(<jala.Form.Tracker> tracker, <Object> destObj)- -
tracker
- (optional) tracker object holding parsed data from form input.
- destObj
- (optional) object whose values will be changed. By default the dataObj passed to the constructor or to setDataObject is used.
- void setClassName(<String> newClassName)- -
newClassName
- new classname
- void setDataObject(newDataObj)- -
dataObj
- The object which is being edited by this form.
- void setErrorMessage(<String> newErrorMessage)- -
newErrorMessage
- error message
- void setTracker(<jala.Form.Tracker> newTracker)- -
newTracker
-
- jala.Form.Tracker validate(<Object> reqData)- -
reqData
- Optional submitted form data. If not specified req.data is used.
- <static> jala.Form create(<Object> config, dataObj)- -
config
- object tree containing config
- <static> void extend(<Function> subClass, <Function> superClass)- -
subClass
- the object which inherits superClass' functions
- superClass
- the object to inherit
- <static> String isEmail(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)- -
name
- name of the property being validated.
- value
- value in form input
- reqData
- the whole request-data-object, in case properties depend on each other
- formObj
- instance of jala.Form
- <static> String isUrl(<String> name, <String> value, <Object> reqData, <jala.Form> formObj)- -
name
- name of the property being validated.
- value
- value in form input
- reqData
- the whole request-data-object, in case properties depend on each other
- formObj
- instance of jala.Form
- <static> Object propertyGetter(<String> name, value)- -
name
- Name of the property.
- <static> void propertySetter(<String> name, <Object> value)- -
name
- Name of the property.
- value
- New value of the property.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.History -- - -
-
This class is an implementation of a Browser-like history
- stack suitable to use in any Helma application. The difference
- to a Browser's history is that this implementation ignores
- POST requests and checks if Urls in the stack are still valid to
- prevent eg. redirections to a HopObject's url that has been deleted.
- Plus it is capable to create new "intermediate" history-stacks
- and this way maintain a "history of histories" which is needed for
- eg. editing sessions in a popup window that should use their own
- request history without interfering with the history of the
- main window.
-
Defined in History.js
-
-Constructor Summary | -|
-
-
- jala.History
-
- ()
-
- - - Constructs a new History object. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- add()
-
- - - Initializes a new history stack, adds - it to the array of stacks (which makes it - the default one to use for further requests) - and records the current request Url. - |
-
-
- void
-
- |
-
-
-
- clear()
-
- - - Clears the currently active history stack - |
-
-
- String
-
- |
-
-
-
- dump()
-
- - - Returns the contents of all history stacks - as string - |
-
-
- String
-
- |
-
-
-
- peek(<Number> offset)
-
- - - Retrieves the request Url at the given position - in the current history stack. - |
-
-
- String
-
- |
-
-
-
- pop(<Number> offset)
-
- - - Retrieves the first valid request Url in history - stack starting with a given offset. - |
-
-
- void
-
- |
-
-
-
- push()
-
- - - Records a request Url in the currently active - history stack. - |
-
-
- void
-
- |
-
-
-
- redirect(<Number> offset)
-
- - - Redirects the client back to the first valid - request in history. - |
-
-
- void
-
- |
-
-
-
- remove()
-
- - - Removes the current history stack - |
-
- Constructor Detail - | -
jala.History()- - -
- Method Detail - | -
void add()- -
void clear()- -
String dump()- -
String peek(<Number> offset)- -
offset
- The index position in history stack to start searching at
- String pop(<Number> offset)- -
offset
- The index position in history stack to start searching at
- void push()- -
void redirect(<Number> offset)- -
offset
- The index position in the stack to start searching at
- void remove()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.HtmlDocument -- - -
-
This class provides easy access to the elements of
- an arbitrary HTML document. By using TagSoup, Dom4J and Jaxen
- even invalid HTML can be parsed, turned into an object tree
- and easily be processed with XPath expressions.
-
Defined in HtmlDocument.js
-
-Constructor Summary | -|
-
-
- jala.HtmlDocument
-
- (<String> source)
-
- - - Construct a new HTML document. - |
-
-Method Summary | -|
-
- Array
-
- |
-
-
-
- getAll(<String> elementName)
-
- - - Retrieves all elements by name from the document. - |
-
-
- Array
-
- |
-
-
-
- getLinks()
-
- - - Get all link elements of the HTML document. - |
-
-
- org.dom4j.tree.DefaultElement
-
- |
-
-
-
- scrape(<String> xpathExpr)
-
- - - Get all document nodes from an XPath expression. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Get a string representation of the HTML document. - |
-
- Constructor Detail - | -
jala.HtmlDocument(<String> source)- - -
source
- The HTML source code.
- - Method Detail - | -
Array getAll(<String> elementName)- -
elementName
- The name of the desired element
- Array getLinks()- -
org.dom4j.tree.DefaultElement scrape(<String> xpathExpr)- -
xpathExpr
- An XPath expression.
- String toString()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.I18n -- - -
-
This class provides various functions and macros for
- internationalization of Helma applications.
-
Defined in I18n.js
-
-Constructor Summary | -|
-
-
- jala.I18n
-
- ()
-
- - - Constructs a new instance of jala.I18n - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- formatMessage(<String> message, <Array> values)
-
- - - Converts the message passed as argument into an instance - of java.text.MessageFormat, and formats it using the - replacement values passed. - |
-
-
- Object
-
- |
-
-
-
- getCatalog(locale)
-
- - - Helper method to get the message catalog - corresponding to the actual locale. - |
-
-
- java.util.Locale
-
- |
-
-
-
- getLocale(localeId)
-
- - - Returns the locale for the given id, which is expected to follow - the form language[_COUNTRY][_variant] , where language
- is a valid ISO Language Code (eg.
- |
-
-
- Function
-
- |
-
-
-
- getLocaleGetter()
-
- - - Get the method for retrieving the locale. - |
-
-
- Object
-
- |
-
-
-
- getMessages()
-
- - - Get the message object. - |
-
-
- String
-
- |
-
-
-
- gettext(<String> key )
-
- - - Returns a localized message for the message key passed as - argument. - |
-
-
- String
-
- |
-
-
-
- markgettext(<String> key)
-
- - - A simple proxy method which is used to mark a message string - for the i18n parser as to be translated. - |
-
-
- String
-
- |
-
-
-
- message_macro(param)
-
- - - Returns a translated message. - |
-
-
- String
-
- |
-
-
-
- ngettext(<String> singularKey, <String> pluralKey, <Number> amount )
-
- - - Returns a localized message for the message key passed as - argument. - |
-
-
- void
-
- |
-
-
-
- setHandler(<Object> handler)
-
- - - Set (overwrite) the default handler containing - the messages (ie. - |
-
-
- void
-
- |
-
-
-
- setLocaleGetter(<Function> func)
-
- - - Set the method for retrieving the locale. - |
-
-
- void
-
- |
-
-
-
- setMessages(<Object> msgObject)
-
- - - Overwrite the default object containing - the messages (ie. - |
-
-
- String
-
- |
-
-
-
- translate(singularKey, pluralKey, <Number> amount)
-
- - - Tries to "translate" the given message key into a localized - message. - |
-
- Constructor Detail - | -
jala.I18n()- - -
- Method Detail - | -
String formatMessage(<String> message, <Array> values)- -
message
- The message to format
- values
- An optional array containing replacement values
- Object getCatalog(locale)- -
java.util.Locale getLocale(localeId)- -
language[_COUNTRY][_variant]
, where language
- is a valid ISO Language Code (eg. "de"), COUNTRY
a valid ISO
- Country Code (eg. "AT"), and variant an identifier for the variant to use.Function getLocaleGetter()- -
Object getMessages()- -
String gettext(<String> key )- -
number
must
- match the number of the additional argument (starting with zero).key
- The message to localize
- String markgettext(<String> key)- -
key
- The message that should be seen by the i18n parser as to be translated.
- String message_macro(param)- -
String ngettext(<String> singularKey, <String> pluralKey, <Number> amount )- -
number
must
- match the number of the additional argument (starting with zero).singularKey
- The singular message to localize
- pluralKey
- The plural form of the message to localize
- amount
- The amount which is used to determine whether the singular or plural form of the message should be returned.
- void setHandler(<Object> handler)- -
handler
- The handler containing the message object
- void setLocaleGetter(<Function> func)- -
func
- The getter method
- void setMessages(<Object> msgObject)- -
msgObject
- The object containing the messages
- String translate(singularKey, pluralKey, <Number> amount)- -
amount
- A number to determine whether to use the singular or plural form of the message
- key
- The message to translate (required)
- plural
- The plural form of the message to translate
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.ImageFilter -- - -
-
This class provides several image manipulating
- methods. Most of this filter library is based on filters created
- by Janne Kipin for JAlbum. For more information have a look
- at http://www.ratol.fi/~jakipina/java/
-
Defined in ImageFilter.js
-
-Constructor Summary | -|
-
-
- jala.ImageFilter
-
- (<Object> img)
-
- - - Constructs a new ImageFilter object - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- gaussianBlur(<Number> radius, <Number> amount)
-
- - - Performs a gaussian blur operation on the image - |
-
-
- byte[]
-
- |
-
-
-
- getBytes()
-
- - - Returns the wrapped image as byte array, to use eg. - |
-
-
- helma.image.ImageWrapper
-
- |
-
-
-
- getImage()
-
- - - Returns the image that has been worked on - |
-
-
- void
-
- |
-
-
-
- sharpen(<Number> amount)
-
- - - Sharpens the image using a plain sharpening kernel. - |
-
-
- void
-
- |
-
-
-
- unsharpMask(<Number> radius, <Number> amount)
-
- - - Performs an unsharp mask operation on the image - |
-
- Constructor Detail - | -
jala.ImageFilter(<Object> img)- - -
img
- Either - Method Detail - | -
void gaussianBlur(<Number> radius, <Number> amount)- -
radius
- The radius
- amount
- The amount
- byte[] getBytes()- -
helma.image.ImageWrapper getImage()- -
void sharpen(<Number> amount)- -
amount
- The amount of sharpening to apply
- void unsharpMask(<Number> radius, <Number> amount)- -
radius
- The radius
- amount
- The amount
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.IndexManager.Job -- - -
-
Instances of this class represent a single index
- manipulation job to be processed by the index manager.
-
Defined in IndexManager.js
See:
- Field Summary | -|
- Object |
- callback
- - The data needed to process this job. |
-
- Date |
- createtime
- - The date and time at which this job was created. |
-
- Number |
- errors
- - An internal error counter which is increased whenever processing - the job failed. |
-
- Number |
- type
- - The type of the job |
-
- <static> <final> Number |
- ADD
- - Constant defining an add job |
-
- <static> <final> Number |
- OPTIMIZE
- - Constant defining an optimizing job |
-
- <static> <final> Number |
- REMOVE
- - Constant defining a removal job |
-
-Constructor Summary | -|
-
-
- jala.IndexManager.Job
-
- (<Number> type, callback)
-
- - - Creates a new Job instance. - |
-
Field Detail | -
Object callback-
Date createtime-
Number errors-
Number type-
<static> <final> Number ADD-
-
<static> <final> Number OPTIMIZE-
-
<static> <final> Number REMOVE-
-
- Constructor Detail - | -
jala.IndexManager.Job(<Number> type, callback)- - -
type
- The type of job, which can be either jala.IndexManager.Job.ADD, jala.IndexManager.Job.REMOVE or jala.IndexManager.Job.OPTIMIZE.
- id
- The Id of the job
- data
- The data needed to process the job.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.IndexManager -- - -
-
This class basically sits on top of a helma.Search.Index instance
- and provides methods for adding, removing and optimizing the underlying index.
- All methods generate jobs that are put into an internal queue which is
- processed asynchronously by a separate worker thread. This means all calls
- to add(), remove() and optimize() will return immediately, but the changes to
- the index will be done within a short delay. Please keep in mind to change the
- status of this IndexManager instance to REBUILDING before starting to rebuild
- the index, as this ensures that all add/remove/optimize jobs will stay in the
- queue and will only be processed after switching the status back to NORMAL.
- This ensures that objects that have been modified during a rebuilding process
- are re-indexed properly afterwards.
-
Defined in IndexManager.js
See:
-Nested Class Summary | -|
- <static class> |
- jala.IndexManager.Job |
-
- Field Summary | -|
- <static> <final> Number |
- MAXTRIES
- - Constant defining the maximum number of tries to add/remove - an object to/from the underlying index. |
-
- <static> <final> Number |
- NORMAL
- - Constant defining normal mode of this index manager. |
-
- <static> <final> Number |
- REBUILDING
- - Constant defining rebuilding mode of this index manager. |
-
-Constructor Summary | -|
-
-
- jala.IndexManager
-
- (<String> name, <helma.File> dir, <String> lang)
-
- - - Constructs a new IndexManager object. - |
-
-Method Summary | -|
-
- Boolean
-
- |
-
-
-
- add(<helma.Search.Document> doc)
-
- - - Queues the document object passed as argument for addition to the underlying - index. - |
-
-
- void
-
- |
-
-
-
- log()
-
- - - Helper function that prefixes every log message with - the name of the IndexManager. - |
-
-
- Boolean
-
- |
-
-
-
- optimize()
-
- - - Queues the optimization of the underlying index. - |
-
-
- Boolean
-
- |
-
-
-
- remove(<Number> id)
-
- - - Queues the removal of all index documents whose identifier value ("id" by default) - matches the number passed as argument. - |
-
Field Detail | -
<static> <final> Number MAXTRIES-
-
<static> <final> Number NORMAL-
-
<static> <final> Number REBUILDING-
-
- Constructor Detail - | -
jala.IndexManager(<String> name, <helma.File> dir, <String> lang)- - -
name
- The name of the index, which is the name of the directory the index already resides or will be created in.
- dir
- The base directory where this index's directory is already existing or will be created in.
- lang
- The language of the documents in this index. This leads to the proper Lucene analyzer being used for indexing documents.
- - Method Detail - | -
Boolean add(<helma.Search.Document> doc)- -
doc
- The document object that should be added to the underlying index.
- void log()- -
level
- An optional logging level. Accepted values
- msg
- The log message are "debug", "info", "warn" and "error".
- Boolean optimize()- -
Boolean remove(<Number> id)- -
id
- The identifier value
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.ListRenderer.ArrayList -- - -
-
A simple wrapper around an array to use in conjunction
- with jala.ListRenderer. This wrapper can either handle complete arrays
- or subsections of an array. In the latter case the wrapper needs offset
- and total size information as argument to mimick a complete array.
-
Defined in ListRenderer.js
-
- Field Summary | -|
- Number |
- length
- - The length of this ArrayList instance. |
-
- Number |
- offset
- - The offset of this ArrayList instance. |
-
-Constructor Summary | -|
-
-
- jala.ListRenderer.ArrayList
-
- (<Array> arr, <Number> offset, <Number> total)
-
- - - Creates a new ArrayList instance. - |
-
-Method Summary | -|
-
- Object
-
- |
-
-
-
- get(<Number> idx)
-
- - - Returns the element at the index position passed - as argument. - |
-
-
- Boolean
-
- |
-
-
-
- isSubset()
-
- - - Returns true if this ArrayList is a subsection of a bigger array - |
-
-
- Number
-
- |
-
-
-
- size()
-
- - - Returns the size of this ArrayList, which is either - the length of the wrapped array or the total size - passed as argument to the constructor (in case the wrapped - array is just a subsection). - |
-
-
- Number
-
- |
-
-
-
- subsetSize()
-
- - - Returns the actual size of this ArrayList's wrapped array. - |
-
Field Detail | -
Number length-
Number offset-
- Constructor Detail - | -
jala.ListRenderer.ArrayList(<Array> arr, <Number> offset, <Number> total)- - -
arr
- The array (or a subsection of an array) to wrap
- offset
- An optional offset to use (mandatory if the array is just a subsection).
- total
- An optional total size of the array. This argument is mandatory if the wrapped array is just a subsection.
- - Method Detail - | -
Object get(<Number> idx)- -
idx
- The index position of the element to return
- Boolean isSubset()- -
Number size()- -
Number subsetSize()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.ListRenderer -- - -
-
Defined in ListRenderer.js
-
-Nested Class Summary | -|
- <static class> |
- jala.ListRenderer.ArrayList |
-
- Field Summary | -|
- <static> <final> Object |
- defaultRenderer
- - Default Renderer object containing functions - used for rendering different list items (eg. |
-
-Constructor Summary | -|
-
-
- jala.ListRenderer
-
- (<HopObject|ArrayList|Array> coll, <Object> renderer)
-
- - - - |
-
-Method Summary | -|
-
- Number
-
- |
-
-
-
- currentEnd_macro()
-
- - - Returns the end item number in the current page - |
-
-
- Number
-
- |
-
-
-
- currentPage_macro()
-
- - - Returns the current page number - |
-
-
- Number
-
- |
-
-
-
- currentStart_macro()
-
- - - Returns the start item number in the current page - |
-
-
- String
-
- |
-
-
-
- getBaseHref()
-
- - - Returns the base href of this ListRenderer instance - |
-
-
- HopObject|Array
-
- |
-
-
-
- getCollection()
-
- - - Returns the collection this ListRenderer instance operates on - |
-
-
- Number
-
- |
-
-
-
- getCurrentPage()
-
- - - Returns the current page index. - |
-
-
- Number
-
- |
-
-
-
- getEndIndex()
-
- - - Returns the zero-based index position of the last item of the current page - in the collection this ListRenderer operates on. - |
-
-
- Number
-
- |
-
-
-
- getItemSkin()
-
- - - Returns the name of the skin rendered for a single list item - |
-
-
- String
-
- |
-
-
-
- getList(<Object> param)
-
- - - Returns the rendered list of collection items as string - |
-
-
- Number
-
- |
-
-
-
- getMaxPages()
-
- - - Returns the maximum number of pages handled by this ListRenderer instance - |
-
-
- String
-
- |
-
-
-
- getNextLink(<Object> param)
-
- - - Returns a rendered link to the previous page as string. - |
-
-
- String
-
- |
-
-
-
- getPageHref(<Number> page)
-
- - - Returns the href of a page. - |
-
-
- String
-
- |
-
-
-
- getPageNavigation(<Object> param)
-
- - - Returns the rendered page navigation bar as string - |
-
-
- Number
-
- |
-
-
-
- getPageSize()
-
- - - Returns the number of items displayed on one page - |
-
-
- String
-
- |
-
-
-
- getPrevLink(<Object> param)
-
- - - Returns a rendered link to the previous page as string. - |
-
-
- Object
-
- |
-
-
-
- getRenderer()
-
- - - Returns the renderer used by this ListRenderer instance - |
-
-
- Number
-
- |
-
-
-
- getStartIndex()
-
- - - Returns the zero-based index position of the first item of the current page - in the collection this ListRenderer operates on. - |
-
-
- Number
-
- |
-
-
-
- getTotalPages()
-
- - - Returns the total number of pages handled by this ListRenderer instance - (which is the collection size divided by the page size). - |
-
-
- String
-
- |
-
-
-
- getUrlParameterName()
-
- - - Returns the name of the URL parameter name containing the index - of the page to display - |
-
-
- String
-
- |
-
-
-
- getUrlParameters()
-
- - - Returns any additional URL parameters included in every navigation link - rendered by this ListRenderer instance. - |
-
-
- Number
-
- |
-
-
-
- limit_macro(<Object> param)
-
- - - Either renders the maximum number of items per page, or - sets the limit to a given number. - |
-
-
- String
-
- |
-
-
-
- nextLink_macro(<Object> param)
-
- - - Returns a rendered link to the next page. - |
-
-
- String
-
- |
-
-
-
- pageNavigation_macro(<Object> param)
-
- - - Returns the rendered page navigation bar. - |
-
-
- String
-
- |
-
-
-
- prevLink_macro(<Object> param)
-
- - - Returns a rendered link to the previous page. - |
-
-
- void
-
- |
-
-
-
- render_macro(<Object> param)
-
- - - Renders the current page of this list. - |
-
-
- void
-
- |
-
-
-
- renderList(<Object> param)
-
- - - Renders the list of items for one page directly to response. - |
-
-
- String
-
- |
-
-
-
- renderListAsString(<Object> param)
-
- - - Returns the rendered list of collection items as string - |
-
-
- void
-
- |
-
-
-
- renderNextLink(<Object> param)
-
- - - Renders a link to the next page directly to response. - |
-
-
- String
-
- |
-
-
-
- renderNextLinkAsString(param)
-
- - - Returns a rendered link to the previous page as string - |
-
-
- Object
-
- |
-
-
-
- renderPageNavigation(<Object> param)
-
- - - Renders the page navigation bar directly to response. - |
-
-
- String
-
- |
-
-
-
- renderPageNavigationAsString(param)
-
- - - Returns the rendered page navigation bar as string - |
-
-
- void
-
- |
-
-
-
- renderPrevLink(<Object> param)
-
- - - Renders a link to the previous page directly to response. - |
-
-
- String
-
- |
-
-
-
- renderPrevLinkAsString(<Object> param)
-
- - - Returns a rendered link to the previous page as string - |
-
-
- void
-
- |
-
-
-
- setBaseHref(<String> href)
-
- - - Sets the base href of this ListRenderer instance. - |
-
-
- void
-
- |
-
-
-
- setCollection(<HopObject|ArrayList|Array> coll)
-
- - - Sets the collection of this ListRenderer - |
-
-
- void
-
- |
-
-
-
- setItemSkin(<String> name)
-
- - - Sets the name of the skin to render for every list item - |
-
-
- void
-
- |
-
-
-
- setMaxPages(<Number> pages)
-
- - - Sets the maximum number of pages to display - |
-
-
- void
-
- |
-
-
-
- setPageSize(<Number> size)
-
- - - Sets the number of items to display on a single page - |
-
-
- void
-
- |
-
-
-
- setRenderer(<Object> r)
-
- - - Sets the renderer to be used by this ListRenderer instance - |
-
-
- void
-
- |
-
-
-
- setUrlParameterName(<String> name)
-
- - - Sets the name of the URL parameter name containing the index of the page - to display - |
-
-
- void
-
- |
-
-
-
- setUrlParameters(<String> params)
-
- - - Sets additional parameters to include in every navigation link - |
-
-
- Number
-
- |
-
-
-
- size_macro()
-
- - - Returns the total number of items - |
-
-
- Number
-
- |
-
-
-
- totalPages_macro()
-
- - - Returns the total number of pages - |
-
Field Detail | -
<static> <final> Object defaultRenderer-
- Constructor Detail - | -
jala.ListRenderer(<HopObject|ArrayList|Array> coll, <Object> renderer)- - - - -
coll
- The collection this ListRenderer operates on, or - for backwards compatibility only - a parameter object containing the collection and any other optional configuration parameters.
- renderer
- An optional renderer to use. If this is set, any rendering method defined in this renderer overrides the default renderer.
- - Method Detail - | -
Number currentEnd_macro()- -
Number currentPage_macro()- -
Number currentStart_macro()- -
String getBaseHref()- -
HopObject|Array getCollection()- -
Number getCurrentPage()- -
Number getEndIndex()- -
Number getItemSkin()- -
String getList(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- Number getMaxPages()- -
String getNextLink(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- String getPageHref(<Number> page)- -
page
- The optional page number to include in the href.
- String getPageNavigation(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- Number getPageSize()- -
String getPrevLink(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- Object getRenderer()- -
Number getStartIndex()- -
Number getTotalPages()- -
String getUrlParameterName()- -
String getUrlParameters()- -
Number limit_macro(<Object> param)- -
param
- Extra macro parameters: String nextLink_macro(<Object> param)- -
param
- Extra macro parameters: String pageNavigation_macro(<Object> param)- -
param
- Extra macro parameters: String prevLink_macro(<Object> param)- -
param
- Extra macro parameters: void render_macro(<Object> param)- -
param
- Extra macro parameters: void renderList(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- String renderListAsString(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- void renderNextLink(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- String renderNextLinkAsString(param)- -
Object renderPageNavigation(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- String renderPageNavigationAsString(param)- -
void renderPrevLink(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- String renderPrevLinkAsString(<Object> param)- -
param
- Object containing extra parameters (e.g. from a macro call).
- void setBaseHref(<String> href)- -
href
- The base href to use for rendering links
- void setCollection(<HopObject|ArrayList|Array> coll)- -
coll
- The collection this ListRenderer instance should operate on
- void setItemSkin(<String> name)- -
name
- The name of the skin to render for every list item
- void setMaxPages(<Number> pages)- -
pages
- The maximum number of pages to display
- void setPageSize(<Number> size)- -
size
- The number of items to display on one page
- void setRenderer(<Object> r)- -
r
- The renderer to use
- void setUrlParameterName(<String> name)- -
name
- The name of the page URL parameter
- void setUrlParameters(<String> params)- -
params
- A string to append to every navigation URL
- Number size_macro()- -
Number totalPages_macro()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Mp3.Id3v1 -- - -
-
This class represents an Id3v1 tag.
-
Defined in Mp3.js
-
-Constructor Summary | -|
-
-
- jala.Mp3.Id3v1
-
- (audioObj)
-
- - - Constructs a new Id3v1 tag from an Mp3 file - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- copyFrom(tag)
-
- - - Copies standard fields from another tag. - |
-
-
- String
-
- |
-
-
-
- getAlbum()
-
- - - Returns the album information of the tag. - |
-
-
- String
-
- |
-
-
-
- getArtist()
-
- - - Returns the artist information of the tag. - |
-
-
- jala.Mp3
-
- |
-
-
-
- getAudio()
-
- - - Returns the wrapper for the underlying audio file. - |
-
-
- String
-
- |
-
-
-
- getComment()
-
- - - Returns the comment information of the tag. - |
-
-
- String
-
- |
-
-
-
- getGenre()
-
- - - Returns the genre information of the tag. - |
-
-
- org.farng.mp3.id3.AbstractID3v1
-
- |
-
-
-
- getJavaObject()
-
- - - Returns the java representation of the tag, - class depends on the actual library used. - |
-
-
- Object
-
- |
-
-
-
- getTextContent(<String> id)
-
- - - This method could be used to retrieve an arbitrary field - of the underlying tag. - |
-
-
- String
-
- |
-
-
-
- getTitle()
-
- - - Returns the title information of the tag. - |
-
-
- String
-
- |
-
-
-
- getTrackNumber()
-
- - - Returns the track number information of the tag. - |
-
-
- String
-
- |
-
-
-
- getYear()
-
- - - Returns the year information of the tag. - |
-
-
- void
-
- |
-
-
-
- setAlbum(<String> album)
-
- - - Sets the album information. - |
-
-
- void
-
- |
-
-
-
- setArtist(<String> artist)
-
- - - Sets the artist information. - |
-
-
- void
-
- |
-
-
-
- setComment(<String> comment)
-
- - - Sets the comment - |
-
-
- void
-
- |
-
-
-
- setGenre(<String> genre)
-
- - - Sets the genre information. - |
-
-
- void
-
- |
-
-
-
- setTextContent(<String> id, val)
-
- - - This method could be used to set an arbitrary field - of the underlying tag. - |
-
-
- void
-
- |
-
-
-
- setTitle(<String> title)
-
- - - Sets the title information - |
-
-
- void
-
- |
-
-
-
- setTrackNumber(<Number> trackNumber)
-
- - - Sets the track number information. - |
-
-
- void
-
- |
-
-
-
- setYear(<Number> year)
-
- - - Sets the year information. - |
-
- Constructor Detail - | -
jala.Mp3.Id3v1(audioObj)- - -
mp3File
-
- - Method Detail - | -
void copyFrom(tag)- -
src
- object with getter methods for fields album, artist, comment, title, trackNumber, genre and year.
- String getAlbum()- -
String getArtist()- -
jala.Mp3 getAudio()- -
String getComment()- -
String getGenre()- -
org.farng.mp3.id3.AbstractID3v1 getJavaObject()- -
Object getTextContent(<String> id)- -
id
-
- String getTitle()- -
String getTrackNumber()- -
String getYear()- -
void setAlbum(<String> album)- -
album
-
- void setArtist(<String> artist)- -
artist
-
- void setComment(<String> comment)- -
comment
-
- void setGenre(<String> genre)- -
genre
-
- void setTextContent(<String> id, val)- -
id
-
- value
-
- void setTitle(<String> title)- -
title
-
- void setTrackNumber(<Number> trackNumber)- -
trackNumber
-
- void setYear(<Number> year)- -
year
-
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Mp3.Id3v2 -- - -
-
This class represents an Id3v2 tag.
-
Defined in Mp3.js
-
-Constructor Summary | -|
-
-
- jala.Mp3.Id3v2
-
- (audioObj)
-
- - - Constructs a new Id3v2 tag from an Mp3 file - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- copyFrom(tag)
-
- - - Copies standard fields from another tag. - |
-
-
- String
-
- |
-
-
-
- getAlbum()
-
- - - Returns the album information of the tag. - |
-
-
- String
-
- |
-
-
-
- getArtist()
-
- - - Returns the artist information of the tag. - |
-
-
- jala.Mp3
-
- |
-
-
-
- getAudio()
-
- - - Returns the wrapper for the underlying audio file. - |
-
-
- String
-
- |
-
-
-
- getAuthor()
-
- - - Returns the author information of the tag. - |
-
-
- String
-
- |
-
-
-
- getComment()
-
- - - Returns the comment information of the tag. - |
-
-
- String
-
- |
-
-
-
- getCopyright()
-
- - - Returns the copyright information of the tag. - |
-
-
- String
-
- |
-
-
-
- getGenre()
-
- - - Returns the genre information of the tag. - |
-
-
- helma.util.MimePart
-
- |
-
-
-
- getImage(<String> pictureType)
-
- - - Extracts the image from the tag - |
-
-
- org.farng.mp3.id3.AbstractID3v2
-
- |
-
-
-
- getJavaObject()
-
- - - returns the java representation of the tag, - class depends on the actual library used. - |
-
-
- String
-
- |
-
-
-
- getSubtitle()
-
- - - Returns the subtitle information of the tag. - |
-
-
- Number
-
- |
-
-
-
- getSubtype()
-
- - - Returns the version number of this id3v2 (values 2 to 4 for id3v2.2 to id3v2.4) - |
-
-
- String
-
- |
-
-
-
- getTextContent(idStr)
-
- - - This method can be used to retrieve an arbitrary text frame - of the underlying tag. - |
-
-
- Number
-
- |
-
-
-
- getTextEncoding()
-
- - - Returns the text encoding used when setting values. - |
-
-
- String
-
- |
-
-
-
- getTitle()
-
- - - Returns the title information of the tag. - |
-
-
- String
-
- |
-
-
-
- getTrackNumber()
-
- - - Returns the track number information of the tag. - |
-
-
- String
-
- |
-
-
-
- getUrl()
-
- - - Returns the Url stored in this tag - |
-
-
- String
-
- |
-
-
-
- getYear()
-
- - - Returns the year information of the tag. - |
-
-
- void
-
- |
-
-
-
- removeFromAudio()
-
- - - Removes the tag from the audio file and - nulls out the wrapper. - |
-
-
- void
-
- |
-
-
-
- setAlbum(<String> album)
-
- - - Sets the album information. - |
-
-
- void
-
- |
-
-
-
- setArtist(<String> artist)
-
- - - Sets the artist information. - |
-
-
- void
-
- |
-
-
-
- setAuthor(<String> author)
-
- - - Sets the author information in this tag - |
-
-
- void
-
- |
-
-
-
- setComment(<String> comment)
-
- - - Sets the comment - |
-
-
- void
-
- |
-
-
-
- setCopyright(<String> copyright)
-
- - - Sets the copyright information in this tag - |
-
-
- void
-
- |
-
-
-
- setGenre(<String> genre)
-
- - - Sets the genre information. - |
-
-
- void
-
- |
-
-
-
- setImage(<Number> pictureType, <String> mimeType, <Array> byteArray)
-
- - - adds an image to the file. - |
-
-
- void
-
- |
-
-
-
- setSubtitle(<String> title)
-
- - - Sets the subtitle information - |
-
-
- String
-
- |
-
-
-
- setTextContent(idStr, val)
-
- - - This method can be used to set an arbitrary field - of the underlying tag. - |
-
-
- void
-
- |
-
-
-
- setTextEncoding(<Number|String> encType)
-
- - - sets the text encoding used when creating new frames - (the encoding type of old frames can't be changed with - JavaMusicTag) - |
-
-
- void
-
- |
-
-
-
- setTitle(<String> title)
-
- - - Sets the title information - |
-
-
- void
-
- |
-
-
-
- setTrackNumber(<Number> trackNumber)
-
- - - Sets the track number information. - |
-
-
- void
-
- |
-
-
-
- setUrl(<String> url, <String> desc)
-
- - - Stores the Url passed as argument in this tag. - |
-
-
- void
-
- |
-
-
-
- setYear(<Number> year)
-
- - - Sets the year information. - |
-
- Constructor Detail - | -
jala.Mp3.Id3v2(audioObj)- - -
mp3File
-
- - Method Detail - | -
void copyFrom(tag)- -
src
- object with getter methods for fields album, artist, comment, title, trackNumber, genre and year.
- String getAlbum()- -
String getArtist()- -
jala.Mp3 getAudio()- -
String getAuthor()- -
String getComment()- -
String getCopyright()- -
String getGenre()- -
helma.util.MimePart getImage(<String> pictureType)- -
pictureType
- number describing picture type (default is 3, describing a front cover).
- org.farng.mp3.id3.AbstractID3v2 getJavaObject()- -
String getSubtitle()- -
Number getSubtype()- -
String getTextContent(idStr)- -
id
- Frame identifier according to Id3v2 specification or shortcut as defined in jala.Mp3.FIELD_MAPPING.
- Number getTextEncoding()- -
String getTitle()- -
String getTrackNumber()- -
String getUrl()- -
String getYear()- -
void removeFromAudio()- -
void setAlbum(<String> album)- -
album
-
- void setArtist(<String> artist)- -
artist
-
- void setAuthor(<String> author)- -
author
- The author information to set
- void setComment(<String> comment)- -
comment
-
- void setCopyright(<String> copyright)- -
copyright
- The copyright information to set
- void setGenre(<String> genre)- -
genre
-
- void setImage(<Number> pictureType, <String> mimeType, <Array> byteArray)- -
pictureType
- number determining picture type
- mimeType
- mime type of image
- byteArray
- image binary data
- desc
- optional description
- void setSubtitle(<String> title)- -
title
-
- String setTextContent(idStr, val)- -
id
- Frame identifier according to Id3v2 specification
- value
-
- void setTextEncoding(<Number|String> encType)- -
encType
- the new encoding type as number or string
- void setTitle(<String> title)- -
title
-
- void setTrackNumber(<Number> trackNumber)- -
trackNumber
-
- void setUrl(<String> url, <String> desc)- -
url
- The url to store in this tag
- desc
- An optiona description of the Url
- void setYear(<Number> year)- -
year
-
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Mp3 -- - -
-
This is a class representing an MP3 file
- providing methods to access its metadata.
-
-
Defined in Mp3.js
-
-Nested Class Summary | -|
- <static class> |
- jala.Mp3.Id3v1 |
-
- <static class> |
- jala.Mp3.Id3v2 |
-
- Field Summary | -|
- Object |
- album
- - |
-
- Object |
- artist
- - |
-
- Object |
- comment
- - |
-
- Object |
- genre
- - |
-
- Object |
- title
- - |
-
- Object |
- trackNumber
- - |
-
- Object |
- year
- - |
-
- <static> <final> Array |
- GENRES
- - Array defining valid genres in ID3v1 |
-
- <static> <final> Array |
- MODES
- - Array defining mp3 modes. |
-
- <static> <final> Array |
- PICTURE_TYPES
- - Array defining valid picture types. |
-
- <static> <final> Array |
- TEXT_ENCODINGS
- - Array defining valid text encodings. |
-
-Constructor Summary | -|
-
-
- jala.Mp3
-
- (<String|File> file)
-
- - - Constructs a new jala.Mp3 wrapper and - parses the header data of the MP3 file. - |
-
-Method Summary | -|
-
- Object
-
- |
-
-
-
- createTag(<Object> tagClass, <Object> tagObject)
-
- - - This method creates a new tag object, attaches it - to the file (thereby replacing an existing tag of - this type) and returns it. - |
-
-
- jala.Mp3.Id3v1
-
- |
-
-
-
- createV1Tag(<Object> tagObject)
-
- - - If the file doesn't contain an ID3v1 tag, this method - creates a new ID3v1 tag object, attaches it to the file - and returns it. - |
-
-
- jala.Mp3.Id3v2
-
- |
-
-
-
- createV2Tag(<Object> tagObject)
-
- - - If the file doesn't contain an ID3v2 tag, this method - creates a new ID3v2 tag object, attaches it to the file - and returns it. - |
-
-
- Number
-
- |
-
-
-
- getBitRate()
-
- - - Returns the bit rate the file was encoded with. - |
-
-
- String
-
- |
-
-
-
- getChannelMode()
-
- - - Returns the channel mode the file was encoded with. - |
-
-
- Number
-
- |
-
-
-
- getDuration()
-
- - - The audio length of the file in seconds at best estimate - from the file info (method returns immediately). - |
-
-
- helma.File
-
- |
-
-
-
- getFile()
-
- - - Returns a helma.File reference to the wrapped file. - |
-
-
- Number
-
- |
-
-
-
- getFrequency()
-
- - - Returns the frequency the file was encoded with. - |
-
-
- org.farng.mp3.MP3File
-
- |
-
-
-
- getJavaObject()
-
- - - Returns the underlying java object - |
-
-
- Object
-
- |
-
-
-
- getMetadata()
-
- - - Returns a plain JavaScript object containing the values of - all fields stored in either the Id3 V1 or V2 tag - |
-
-
- Number
-
- |
-
-
-
- getSize()
-
- - - Returns the file size in bytes. - |
-
-
- Object
-
- |
-
-
-
- getTag(tagClass)
-
- - - Returns a tag object, type is specified using the class name - in jala.Mp3.*. - |
-
-
- jala.Mp3.Id3v1
-
- |
-
-
-
- getV1Tag()
-
- - - - |
-
-
- jala.Mp3.Id3v2
-
- |
-
-
-
- getV2Tag()
-
- - - - |
-
-
- Object
-
- |
-
-
-
- hasTag(tagClass)
-
- - - Tells if the file contains a certain tag, type is specified - using the class name in jala.Mp3. - |
-
-
- Boolean
-
- |
-
-
-
- hasV1Tag()
-
- - - Returns true if the file contains a ID3v1 tag. - |
-
-
- Boolean
-
- |
-
-
-
- hasV2Tag()
-
- - - Returns true if the file contains a ID3v2 tag. - |
-
-
- Boolean
-
- |
-
-
-
- isVariableBitRate()
-
- - - Returns true if the file is (or seems to be) encoded with - variable bit rate. - |
-
-
- Number
-
- |
-
-
-
- parseDuration()
-
- - - Parses the audio file to extract the precise duration of the audio. - |
-
-
- void
-
- |
-
-
-
- removeTag(tagClass)
-
- - - Removes a tag from the file, type is specified using the - class name in jala.Mp3.* - |
-
-
- void
-
- |
-
-
-
- removeV1Tag()
-
- - - Removes the ID3v1 tag from the file. - |
-
-
- Object
-
- |
-
-
-
- removeV2Tag()
-
- - - Removes the ID3v2 tag from the file. - |
-
-
- Boolean
-
- |
-
-
-
- save(<String|helma.File> outFile)
-
- - - Writes changed metadata back to the source file or to a new file. - |
-
-
- void
-
- |
-
-
-
- setMetadata(<Object> metadata)
-
- - - Stores the metadata passed as argument in the ID2 v1 and v2 tags - of the wrapped MP3 file. - |
-
Field Detail | -
Object album-
Object artist-
Object comment-
Object genre-
Object title-
Object trackNumber-
Object year-
<static> <final> Array GENRES-
<static> <final> Array MODES-
<static> <final> Array PICTURE_TYPES-
<static> <final> Array TEXT_ENCODINGS-
- Constructor Detail - | -
jala.Mp3(<String|File> file)- - -
file
- The mp3 file to be parsed, either as path string or as any kind of file object
- - Method Detail - | -
Object createTag(<Object> tagClass, <Object> tagObject)- -
tagClass
-
- tagObject
- optional tag whose standard properties are copied to the new tag.
- jala.Mp3.Id3v1 createV1Tag(<Object> tagObject)- -
tagObject
- optional tag whose standard properties are copied to the new tag.
- jala.Mp3.Id3v2 createV2Tag(<Object> tagObject)- -
tagObject
- optional tag whose standard properties are copied to the new tag.
- Number getBitRate()- -
String getChannelMode()- -
Number getDuration()- -
helma.File getFile()- -
Number getFrequency()- -
org.farng.mp3.MP3File getJavaObject()- -
Object getMetadata()- -
Number getSize()- -
Object getTag(tagClass)- -
jala.Mp3.Id3v1 getV1Tag()- - - - - - - - - - - -
jala.Mp3.Id3v2 getV2Tag()- - - - - - - - - - - -
Object hasTag(tagClass)- -
Boolean hasV1Tag()- -
Boolean hasV2Tag()- -
Boolean isVariableBitRate()- -
Number parseDuration()- -
void removeTag(tagClass)- -
void removeV1Tag()- -
Object removeV2Tag()- -
Boolean save(<String|helma.File> outFile)- -
outFile
- (optional) save the modified file to a different file
- void setMetadata(<Object> metadata)- -
metadata
- An object containing the fields to set and their values.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.XmlWriter - | - +--jala.Rss20Writer - | - +--jala.PodcastWriter -- - -
-
Class to create, modify and render standard-compliant
- RSS 2.0 feeds including support for Apple's Podcast specification.
-
Defined in PodcastWriter.js
-
- Field Summary | -|
- <static> <final> String |
- XMLHEADER
- - A typical XML header as default. |
-
-Constructor Summary | -|
-
-
- jala.PodcastWriter
-
- (<String> header)
-
- - - - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- addItunesCategory(<String> name, <String> subName, <jala.XmlWriter.XmlElement> parent)
-
- - - Add an iTunes Podcast category. - |
-
Methods inherited from class jala.Rss20Writer | -
-
-getRoot, extendChannel, getChannel, setChannel, extendItem, createItem, addItem, addCategory, setImage, setTextInput
- |
-
Methods inherited from class jala.XmlWriter | -
-
-createElement, extend, addNamespace, write, toString, clone
- |
-
Field Detail | -
<static> <final> String XMLHEADER-
-
- Constructor Detail - | -
jala.PodcastWriter(<String> header)- - - - -
header
- Optional XML header.
- - Method Detail - | -
void addItunesCategory(<String> name, <String> subName, <jala.XmlWriter.XmlElement> parent)- -
name
- The category's name.
- subName
- The (optional) sub-category's name.
- parent
- Optional parent element to add the category to.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--helma.Http - | - +--jala.RemoteContent -- - -
-
API to define, fetch and update content
- from a remote site.
-
Defined in RemoteContent.js
-
- Field Summary | -|
- <static> <final> File |
- CACHEDIR
- - The default cache directory. |
-
- <static> <final> int |
- HTTP
- - A constant representing the HTTP retrieval method. |
-
- <static> <final> String |
- SUFFIX
- - The default name of the cache directory. |
-
- <static> <final> int |
- XMLRPC
- - A constant representing the XML-RPC retrieval method. |
-
-Constructor Summary | -|
-
-
- jala.RemoteContent
-
- (<String> url, <Integer> method, <File> storage)
-
- - - Construct a new remote content handler. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- clear()
-
- - - Flushes (empties) the cached remote content. - |
-
-
- Object
-
- |
-
-
-
- get(<String> key)
-
- - - Get an arbitrary property of the remote content. - |
-
-
- Array
-
- |
-
-
-
- getKeys()
-
- - - Get all available property names. - |
-
-
- Boolean
-
- |
-
-
-
- needsUpdate()
-
- - - Tests whether the remote content needs to be updated. - |
-
-
- void
-
- |
-
-
-
- setInterval(<Number> interval)
-
- - - Set the interval the remote content's - cache is bound to be updated. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Get a string representation of the remote content. - |
-
-
- String
-
- |
-
-
-
- update()
-
- - - Get the updated and cached remote content. - |
-
-
- Object
-
- |
-
-
-
- valueOf()
-
- - - Get the value of the remote content. - |
-
-
- <static> void
-
- |
-
-
-
- exec()
-
- - - Apply a custom method on all remote content in a file-based cache. - |
-
-
- <static> void
-
- |
-
-
-
- flush(<File> cache)
-
- - - Remove all remote content from a file-based cache. - |
-
-
- <static> void
-
- |
-
-
-
- forEach(<Function> callback, <File> cache)
-
- - - Apply a custom method on all remote content in a file-based cache. - |
-
Field Detail | -
<static> <final> File CACHEDIR-
<static> <final> int HTTP-
-
<static> <final> String SUFFIX-
-
<static> <final> int XMLRPC-
-
- Constructor Detail - | -
jala.RemoteContent(<String> url, <Integer> method, <File> storage)- - -
url
- The URL string of the remote site.
- method
- The method to retrieve the remote content.
- storage
- The cache directory.
- - Method Detail - | -
void clear()- -
Object get(<String> key)- -
key
- The name of the property.
- Array getKeys()- -
Boolean needsUpdate()- -
void setInterval(<Number> interval)- -
interval
- The interval value in milliseconds.
- String toString()- -
String update()- -
Object valueOf()- -
<static> void exec()- -
callback
- The callback method to be executed for each remote content file.
- cache
- An optional target directory.
- <static> void flush(<File> cache)- -
cache
- An optional target directory.
- <static> void forEach(<Function> callback, <File> cache)- -
callback
- The callback method to be executed for each remote content file.
- cache
- An optional target directory.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.XmlWriter - | - +--jala.Rss20Writer -- -
-
Class to create, modify and render standard-compliant
- RSS 2.0 feeds.
-
Defined in Rss20Writer.js
-
-Constructor Summary | -|
-
-
- jala.Rss20Writer
-
- (<String> header)
-
- - - - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- addCategory(<String> name, <String> domain, <jala.XmlWriter.XmlElement> parent)
-
- - - Add a category element to an arbitrary element. - |
-
-
- void
-
- |
-
-
-
- addItem(<jala.XmlWriter.XmlElement> item)
-
- - - Add an item element to the channel element. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- createItem(<Object> data)
-
- - - Get a new and innocent item element. - |
-
-
- void
-
- |
-
-
-
- extendChannel(<Array> ext)
-
- - - Add child elements to the channel template. - |
-
-
- void
-
- |
-
-
-
- extendItem(<Array> ext)
-
- - - Add child elements to the item template. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- getChannel()
-
- - - Get the writer's channel element. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- getRoot()
-
- - - Get the writer's root element. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- setChannel(<Object> data)
-
- - - Populate the channel element with data. - |
-
-
- void
-
- |
-
-
-
- setImage(<Object> data)
-
- - - Populate the image element with data. - |
-
-
- void
-
- |
-
-
-
- setTextInput(<Object> data)
-
- - - Populate the textInput element with data. - |
-
Methods inherited from class jala.XmlWriter | -
-
-createElement, extend, addNamespace, write, toString, clone
- |
-
- Constructor Detail - | -
jala.Rss20Writer(<String> header)- - - - -
header
- Optional XML header.
- - Method Detail - | -
void addCategory(<String> name, <String> domain, <jala.XmlWriter.XmlElement> parent)- -
name
- The name of the category.
- domain
- The domain of the category.
- parent
- The optional parent element.
- void addItem(<jala.XmlWriter.XmlElement> item)- -
item
- The item element to add.
- jala.XmlWriter.XmlElement createItem(<Object> data)- -
data
- An XmlWriter-compliant object structure.
- void extendChannel(<Array> ext)- -
ext
- List of additional child elements.
- void extendItem(<Array> ext)- -
ext
- List of additional child elements.
- jala.XmlWriter.XmlElement getChannel()- -
jala.XmlWriter.XmlElement getRoot()- -
jala.XmlWriter.XmlElement setChannel(<Object> data)- -
data
- An XmlWriter-compliant object structure.
- void setImage(<Object> data)- -
data
- An XmlWriter-compliant object structure.
- void setTextInput(<Object> data)- -
data
- An XmlWriter-compliant object structure.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.Utilities -- - -
-
This class contains various convenience methods
- which do not fit in any other class.
-
Defined in Utilities.js
-
- Field Summary | -|
- <static> <final> Number |
- VALUE_ADDED
- - Static field indicating ad added object property. |
-
- <static> <final> Number |
- VALUE_MODIFIED
- - Static field indicating a modified object property. |
-
- <static> <final> Number |
- VALUE_REMOVED
- - Static field indicating a removed object property. |
-
-Constructor Summary | -|
-
-
- jala.Utilities
-
- ()
-
- - - Construct a utility object. - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- createPassword(<Number> len, <Number> level)
-
- - - Creates a random password with different levels of security. - |
-
-
- Object
-
- |
-
-
-
- diffObjects(<Object> obj1, <Object> obj2)
-
- - - Returns an array containing the properties that are - added, removed or modified in one object compared to another. - |
-
-
- Object
-
- |
-
-
-
- patchObject(<Object> obj, <Object> diff)
-
- - - Patches an object with a "diff" object created by the - diffObjects() method. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Return a string representation of the utitility object. - |
-
Field Detail | -
<static> <final> Number VALUE_ADDED-
-
<static> <final> Number VALUE_MODIFIED-
-
<static> <final> Number VALUE_REMOVED-
-
- Constructor Detail - | -
jala.Utilities()- - -
- Method Detail - | -
String createPassword(<Number> len, <Number> level)- -
len
- The length of the password (default: 8)
- level
- The security level Object diffObjects(<Object> obj1, <Object> obj2)- -
obj1
- The first of two objects which should be compared
- obj2
- The second of two objects which should be compared
- Object patchObject(<Object> obj, <Object> diff)- -
obj
- The Object the diff should be applied to
- diff
- A "diff" object created by the diffObjects() method
- String toString()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.XmlRpcRequest -- - -
-
Instances of this class provide the necessary functionality
- for issueing XmlRpc requests to a remote service.
-
Defined in XmlRpcRequest.js
-
-Constructor Summary | -|
-
-
- jala.XmlRpcRequest
-
- (<String> url, <String> methodName)
-
- - - A constructor for XmlRpc request objects - |
-
-Method Summary | -|
-
- Boolean
-
- |
-
-
-
- debug()
-
- - - Returns true if debug is enabled for this request, false otherwise - |
-
-
- Object
-
- |
-
-
-
- execute()
-
- - - Calling this method executes the remote method using - the arguments specified. - |
-
-
- String
-
- |
-
-
-
- getCredentials()
-
- - - Returns the credentials of this request - |
-
-
- String
-
- |
-
-
-
- getInputEncoding()
-
- - - Returns the input encoding - |
-
-
- String
-
- |
-
-
-
- getMethodName()
-
- - - Returns the name of the remote function to call - |
-
-
- String
-
- |
-
-
-
- getOutputEncoding()
-
- - - Returns the output encoding - |
-
-
- java.net.Proxy
-
- |
-
-
-
- getProxy()
-
- - - Returns the proxy object. - |
-
-
- Number
-
- |
-
-
-
- getReadTimeout()
-
- - - Returns the socket timeout of this request - |
-
-
- Number
-
- |
-
-
-
- getTimeout()
-
- - - Returns the connection timeout of this request - |
-
-
- java.net.URL
-
- |
-
-
-
- getUrl()
-
- - - Returns the URL of this request - |
-
-
- void
-
- |
-
-
-
- setCredentials(<String> username, <String> password)
-
- - - Sets the credentials for basic http authentication to - use with this request. - |
-
-
- void
-
- |
-
-
-
- setDebug(<Boolean> flag)
-
- - - Enables or disables the debug mode. - |
-
-
- void
-
- |
-
-
-
- setEncoding(<String> enc)
-
- - - Sets both input and output encoding to the - specified encoding string - |
-
-
- void
-
- |
-
-
-
- setInputEncoding(<String> enc)
-
- - - Sets the input encoding to the specified encoding string - |
-
-
- void
-
- |
-
-
-
- setOutputEncoding(<String> enc)
-
- - - Sets the output encoding to the specified encoding string - |
-
-
- void
-
- |
-
-
-
- setProxy(<String> proxyString)
-
- - - Sets the proxy host and port. - |
-
-
- void
-
- |
-
-
-
- setReadTimeout(<Number> millis)
-
- - - Sets the socket timeout to the specified milliseconds. - |
-
-
- void
-
- |
-
-
-
- setTimeout(<Number> millis)
-
- - - Sets the connection timeout to the specified milliseconds. - |
-
-
- <static> String
-
- |
-
-
-
- argumentsToString(<Object> args)
-
- - - Helper method to format an arguments array into - a string useable for debugging output. - |
-
-
- <static> java.lang.Object
-
- |
-
-
-
- convertArgument(<Object> obj)
-
- - - Helper method for converting a Javascript object into - its appropriate Java object. - |
-
-
- <static> Object
-
- |
-
-
-
- convertResult(<java.lang.Object> obj)
-
- - - Converts a Java object into its appropriate Javascript representation. - |
-
- Constructor Detail - | -
jala.XmlRpcRequest(<String> url, <String> methodName)- - -
url
- The url of the XmlRpc entry point
- methodName
- The name of the method to call
- - Method Detail - | -
Boolean debug()- -
Object execute()- -
String getCredentials()- -
String getInputEncoding()- -
String getMethodName()- -
String getOutputEncoding()- -
java.net.Proxy getProxy()- -
Number getReadTimeout()- -
Number getTimeout()- -
java.net.URL getUrl()- -
void setCredentials(<String> username, <String> password)- -
username
- The username
- password
- The password
- void setDebug(<Boolean> flag)- -
flag
- True or false.
- void setEncoding(<String> enc)- -
enc
- The encoding to use for both input and output. This must be a valid java encoding string.
- void setInputEncoding(<String> enc)- -
enc
- The encoding to use for input. This must be a valid java encoding string.
- void setOutputEncoding(<String> enc)- -
enc
- The encoding to use for output. This must be a valid java encoding string.
- void setProxy(<String> proxyString)- -
proxyString
- The proxy string in the form 'fqdn:port' (eg. my.proxy.com:3128)
- void setReadTimeout(<Number> millis)- -
millis
- The timeout to use as socket timeout
- void setTimeout(<Number> millis)- -
millis
- The timeout to use as connection timeout
- <static> String argumentsToString(<Object> args)- -
args
- An arguments array
- <static> java.lang.Object convertArgument(<Object> obj)- -
obj
- The Javascript object to convert
- <static> Object convertResult(<java.lang.Object> obj)- -
obj
- The Java object to convert
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.XmlWriter -- -
-
This class defines a generic interface to write
- arbitrary and validating XML source code. This is done
- by first applying data objects onto template objects,
- both in a specified format. Then, the resulting object
- tree is transformed into XML. Moreover, template objects
- can be extended with other template objects to provide
- full flexibility in inheriting subclasses.
-
Defined in XmlWriter.js
-
-Constructor Summary | -|
-
-
- jala.XmlWriter
-
- (<String> header)
-
- - - Construct a new XML writer. - |
-
-Method Summary | -|
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- addNamespace(<String> name, <String> url)
-
- - - Add a namespace to this writer. - |
-
-
- jala.XmlWriter
-
- |
-
-
-
- clone(obj)
-
- - - Clone this XML writer. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- createElement(<Object> data)
-
- - - Get a newly created XML element. - |
-
-
- jala.XmlWriter
-
- |
-
-
-
- extend(<Object> template, <Object> ext)
-
- - - Extend a template object. - |
-
-
- jala.XmlWriter.XmlElement
-
- |
-
-
-
- getRoot()
-
- - - Get the root XML element of this writer. - |
-
-
- String
-
- |
-
-
-
- toString()
-
- - - Get the XML output as string. - |
-
-
- void
-
- |
-
-
-
- write()
-
- - - Write the XML to the response buffer. - |
-
- Constructor Detail - | -
jala.XmlWriter(<String> header)- - -
header
- An optional XML header.
- - Method Detail - | -
jala.XmlWriter.XmlElement addNamespace(<String> name, <String> url)- -
name
- The name of the namespace.
- url
- The URL string of the namespace.
- jala.XmlWriter clone(obj)- -
The
- clone templare.
- jala.XmlWriter.XmlElement createElement(<Object> data)- -
data
- The XML data as object tree.
- jala.XmlWriter extend(<Object> template, <Object> ext)- -
template
- The template object.
- ext
- The extension object.
- jala.XmlWriter.XmlElement getRoot()- -
String toString()- -
void write()- -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.0 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.db.DataType -- - -
-
Instances of this class represent a data type. Each instance
- contains the code number as defined in java.sql.Types, the name of
- the data type as defined in java.sql.Types and optional creation parameters
- allowed for this data type.
-
Defined in Database.js
-
-Constructor Summary | -|
-
-
- jala.db.DataType
-
- (<Number> type, <String> typeName, <String> params)
-
- - - Returns a newly created DataType instance. - |
-
-Method Summary | -|
-
- String
-
- |
-
-
-
- getParams()
-
- - - Returns the creation parameter string of this data type - |
-
-
- Number
-
- |
-
-
-
- getType()
-
- - - Returns the sql type code number as defined in java.sql.Types - |
-
-
- String
-
- |
-
-
-
- getTypeName()
-
- - - Returns the type name of this data type, which can be - used in sql queries. - |
-
-
- Boolean
-
- |
-
-
-
- needsQuotes()
-
- - - Returns true if values for this data type should be surrounded - by (single) quotes. - |
-
- Constructor Detail - | -
jala.db.DataType(<Number> type, <String> typeName, <String> params)- - -
type
- The sql code number of this data type
- typeName
- The type name of this data type, as used within sql statements
- params
- Optional creation parameters allowed for this data type.
- - Method Detail - | -
String getParams()- -
Number getType()- -
String getTypeName()- -
Boolean needsQuotes()- -
-
-
|
--Jala 1.0 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.db.RamDatabase - | - +--jala.db.FileDatabase -- - -
-
Instances of this class represent a file based in-process database
-
Important: You need the h2.jar in directory "lib/ext"
- of your helma installation for this library to work, which you can get
- at http://www.h2database.com/.
-
Defined in Database.js
-
-Constructor Summary | -|
-
-
- jala.db.FileDatabase
-
- (<String> name, <helma.File> directory, <String> username, <String> password)
-
- - - Returns a newly created instance of FileDatabase. - |
-
-Method Summary | -|
-
- Boolean
-
- |
-
-
-
- backup(<helma.File> file)
-
- - - Creates a backup of this database, using the file passed as argument. - |
-
-
- helma.File
-
- |
-
-
-
- getDirectory()
-
- - - Returns the directory where the database files are stored. - |
-
-
- String
-
- |
-
-
-
- getName()
-
- - - Returns the name of the database. - |
-
-
- String
-
- |
-
-
-
- getPassword()
-
- - - Returns the password of this database - |
-
-
- String
-
- |
-
-
-
- getUsername()
-
- - - Returns the username of this database - |
-
-
- Boolean
-
- |
-
-
-
- remove()
-
- - - Deletes all files of this database on disk. - |
-
-
- Boolean
-
- |
-
-
-
- restore(<helma.File> backupFile)
-
- - - Restores this database using a backup on disk. - |
-
Methods inherited from class jala.db.RamDatabase | -
-
-getUrl, getProperties, getConnection, shutdown, dropTable, tableExists, copyTables, runScript, dump
- |
-
- Constructor Detail - | -
jala.db.FileDatabase(<String> name, <helma.File> directory, <String> username, <String> password)- - -
name
- The name of the database. This name is used as prefix for all database files
- directory
- The directory where the database files should be stored in.
- username
- Optional username (defaults to "sa"). This username is used when creating the database, so the same should be used when creating subsequent instances of jala.db.FileDatabase pointing to the same database
- password
- Optional password (defaults to "").
- - Method Detail - | -
Boolean backup(<helma.File> file)- -
file
- The file to write the backup to
- helma.File getDirectory()- -
String getName()- -
String getPassword()- -
String getUsername()- -
Boolean remove()- -
Boolean restore(<helma.File> backupFile)- -
backupFile
- The backup file to use for restore
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.db.RamDatabase -- -
-
Instances of this class represent an in-memory sql database.
-
Important: You need the h2.jar in directory "lib/ext"
- of your helma installation for this library to work, which you can get
- at http://www.h2database.com/.
-
Defined in Database.js
-
-Constructor Summary | -|
-
-
- jala.db.RamDatabase
-
- (<String> name, <String> username, <String> password)
-
- - - Returns a newly created RamDatabase instance. - |
-
-Method Summary | -|
-
- void
-
- |
-
-
-
- copyTables(<helma.Database> database, <Array> tables)
-
- - - Copies all tables in the database passed as argument into this embedded database. - |
-
-
- Boolean
-
- |
-
-
-
- dropTable(<String> tableName)
-
- - - Drops the table with the given name - |
-
-
- Boolean
-
- |
-
-
-
- dump(<helma.File> file, <Object> props)
-
- - - Dumps the database schema and data into a file - |
-
-
- helma.Database
-
- |
-
-
-
- getConnection(props)
-
- - - Returns a connection to this database - |
-
-
- String
-
- |
-
-
-
- getName()
-
- - - Returns the name of the database - |
-
-
- String
-
- |
-
-
-
- getPassword()
-
- - - Returns the password of this database - |
-
-
- helma.util.ResourceProperties
-
- |
-
-
-
- getProperties(<Object> props)
-
- - - Returns a properties object containing the connection properties - for this database. - |
-
-
- String
-
- |
-
-
-
- getUrl(<Object> props)
-
- - - Returns the JDBC Url to connect to this database - |
-
-
- String
-
- |
-
-
-
- getUsername()
-
- - - Returns the username of this database - |
-
-
- Boolean
-
- |
-
-
-
- runScript(<helma.File> file, <Object> props, <String> charset, <Boolean> continueOnError)
-
- - - Runs the script file passed as argument in the context of this database. - |
-
-
- void
-
- |
-
-
-
- shutdown()
-
- - - Stops this in-process database by issueing a "SHUTDOWN" sql command. - |
-
-
- Boolean
-
- |
-
-
-
- tableExists(<String> name)
-
- - - Returns true if the table exists already in the database - |
-
- Constructor Detail - | -
jala.db.RamDatabase(<String> name, <String> username, <String> password)- - -
name
- The name of the database. If not given a private un-named database is created, that can only be accessed through this instance of jala.db.RamDatabase
- username
- Optional username (defaults to "sa"). This username is used when creating the database, so the same should be used when creating subsequent instances of jala.db.RamDatabase pointing to a named database.
- password
- Optional password (defaults to "").
- - Method Detail - | -
void copyTables(<helma.Database> database, <Array> tables)- -
database
- The database to copy the tables from
- tables
- An optional array containing the names of the tables to copy. If not given all tables are copied
- Boolean dropTable(<String> tableName)- -
tableName
- The name of the table
- Boolean dump(<helma.File> file, <Object> props)- -
file
- The file where the database dump will be
- props
- Optional object containing connection properties
- helma.Database getConnection(props)- -
An
- optional parameter object containing connection properties to add to the connection Url.
- String getName()- -
String getPassword()- -
helma.util.ResourceProperties getProperties(<Object> props)- -
props
- An optional parameter object containing connection properties to add to the connection Url.
- String getUrl(<Object> props)- -
props
- Optional connection properties to add
- String getUsername()- -
Boolean runScript(<helma.File> file, <Object> props, <String> charset, <Boolean> continueOnError)- -
file
- The script file to run
- props
- Optional object containing connection properties
- charset
- Optional character set to use (defaults to "UTF-8")
- continueOnError
- Optional flag indicating whether to continue on error or not (defaults to false)
- void shutdown()- -
Boolean tableExists(<String> name)- -
name
- The name of the table
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.db.Server -- - -
-
Instances of this class represent a H2 database listener that
- allows multiple databases to be accessed via tcp.
-
Important: You need the h2.jar in directory "lib/ext"
- of your helma installation for this library to work, which you can get
- at http://www.h2database.com/.
-
Defined in Database.js
-
-Constructor Summary | -|
-
-
- jala.db.Server
-
- (<helma.File> baseDir, <Number> port)
-
- - - Returns a new Server instance. - |
-
-Method Summary | -|
-
- Boolean
-
- |
-
-
-
- createOnDemand(<Boolean> bool)
-
- - - If called with boolean true as argument, this server creates databases - on-the-fly, otherwise it only accepts connections to already existing - databases. - |
-
-
- helma.Database
-
- |
-
-
-
- getConnection(<String> name, <String> username, <String> password, <Object> props)
-
- - - Returns a connection to a database within this server. - |
-
-
- helma.File
-
- |
-
-
-
- getDirectory()
-
- - - Returns the directory used by this server instance - |
-
-
- Number
-
- |
-
-
-
- getPort()
-
- - - Returns the port this server listens on - |
-
-
- helma.util.ResourceProperties
-
- |
-
-
-
- getProperties(<String> name, <String> username, <String> password, <Object> props)
-
- - - Returns a properties object containing the connection properties - of the database with the given name. - |
-
-
- String
-
- |
-
-
-
- getUrl(<String> name, <Object> props)
-
- - - Returns the JDBC Url to use for connections to a given database. - |
-
-
- Boolean
-
- |
-
-
-
- isPublic(<Boolean> bool)
-
- - - If called with boolean true as argument, this server accepts connections - from outside localhost. - |
-
-
- Boolean
-
- |
-
-
-
- isRunning()
-
- - - Returns true if the database server is running. - |
-
-
- Boolean
-
- |
-
-
-
- start()
-
- - - Starts the database server. - |
-
-
- Boolean
-
- |
-
-
-
- stop()
-
- - - Stops the database server. - |
-
-
- Boolean
-
- |
-
-
-
- useSsl(<Boolean> bool)
-
- - - Toggles the use of Ssl encryption within this server. - |
-
- Constructor Detail - | -
jala.db.Server(<helma.File> baseDir, <Number> port)- - -
baseDir
- The directory where the database files are located or should be stored
- port
- The port to listen on (defaults to 9001)
- createOnDemand
- If true this server will create non-existing databases on-the-fly, if false it only accepts connections to already existing databases in the given base directory
- makePublic
- If true this database is reachable from outside, if false it's only reachable from localhost
- useSsl
- If true SSL will be used to encrypt the connection
- - Method Detail - | -
Boolean createOnDemand(<Boolean> bool)- -
bool
- If true this server creates non-existing databases on demand, if false it only allows connections to existing databases. If no argument is given, this method returns the current setting.
- helma.Database getConnection(<String> name, <String> username, <String> password, <Object> props)- -
name
- The name of the database running within this server
- username
- Optional username to use for this connection
- password
- Optional password to use for this connection
- props
- An optional parameter object containing connection properties to add to the connection Url.
- helma.File getDirectory()- -
Number getPort()- -
helma.util.ResourceProperties getProperties(<String> name, <String> username, <String> password, <Object> props)- -
name
- The name of the database
- username
- Optional username to use for this connection
- password
- Optional password to use for this connection
- props
- An optional parameter object containing connection properties to add to the connection Url.
- String getUrl(<String> name, <Object> props)- -
name
- An optional name of a database running
- props
- Optional connection properties to add
- Boolean isPublic(<Boolean> bool)- -
bool
- If true this server accepts connections from outside localhost. If no argument is given, this method returns the current setting.
- Boolean isRunning()- -
Boolean start()- -
Boolean stop()- -
Boolean useSsl(<Boolean> bool)- -
bool
- If true SSL encryption will be used, false otherwise. If no argument is given, this method returns the current setting.
-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala.db -- - -
-Nested Class Summary | -|
- <static class> |
- jala.db.Server |
-
- <static class> |
- jala.db.DataType |
-
- <static class> |
- jala.db.RamDatabase |
-
- <static class> |
- jala.db.FileDatabase |
-
- - - - - - - - - - - - - - - - - -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
Object - | - +--jala -- - -
-Nested Class Summary | -|
- <static class> |
- jala.AsyncRequest |
-
- <static class> |
- jala.BitTorrent |
-
- <static class> |
- jala.Captcha |
-
- <static class> |
- jala.Date |
-
- <static class> |
- jala.DnsClient |
-
- <static class> |
- jala.Form |
-
- <static class> |
- jala.History |
-
- <static class> |
- jala.HtmlDocument |
-
- <static class> |
- jala.I18n |
-
- <static class> |
- jala.ImageFilter |
-
- <static class> |
- jala.IndexManager |
-
- <static class> |
- jala.ListRenderer |
-
- <static class> |
- jala.Mp3 |
-
- <static class> |
- jala.PodcastWriter |
-
- <static class> |
- jala.RemoteContent |
-
- <static class> |
- jala.Rss20Writer |
-
- <static class> |
- jala.Utilities |
-
- <static class> |
- jala.XmlRpcRequest |
-
- <static class> |
- jala.XmlWriter |
-
- Field Summary | -|
- <static> <final> jala.Date |
- date
- - Default date class instance. |
-
- <static> Object |
- db
- - Namespace declaration |
-
- <static> <final> jala.I18n |
- i18n
- - Default i18n class instance. |
-
- <static> <final> jala.Utilities |
- util
- - Default utility class instance. |
-
Field Detail | -
<static> <final> jala.Date date-
<static> Object db-
<static> <final> jala.I18n i18n-
<static> <final> jala.Utilities util-
-
-
|
--Jala 1.3 - - | - -||||||||
- PREV CLASS - NEXT CLASS | -- FRAMES - NO FRAMES - - - - | -||||||||
- SUMMARY: FIELD | CONSTR | METHOD | --DETAIL: FIELD | CONSTR | METHOD | -
jala.AsyncRequest
- - |
-
jala.BitTorrent
- - |
-
jala.Captcha
- - |
-
jala.db.FileDatabase
- - |
-
jala.db.RamDatabase
- - |
-
jala.db.Server
- - |
-
jala.Date
- - |
-
jala.Date.Calendar
- - |
-
jala.Date.Calendar.Renderer
- - |
-
jala.DnsClient
- - |
-
jala.DnsClient.Record
- - |
-
jala.Form
- - |
-
jala.Form.Component
- - |
-
jala.Form.Component.Button
- - |
-
jala.Form.Component.Checkbox
- - |
-
jala.Form.Component.Date
- - |
-
jala.Form.Component.Fieldset
- - |
-
jala.Form.Component.File
- - |
-
jala.Form.Component.Hidden
- - |
-
jala.Form.Component.Image
- - |
-
jala.Form.Component.Input
- - |
-
jala.Form.Component.Password
- - |
-
jala.Form.Component.Radio
- - |
-
jala.Form.Component.Select
- - |
-
jala.Form.Component.Skin
- - |
-
jala.Form.Component.Submit
- - |
-
jala.Form.Component.Textarea
- - |
-
jala.Form.Tracker
- - |
-
jala.History
- - |
-
jala.HtmlDocument
- - |
-
jala.I18n
- - |
-
jala.ImageFilter
- - |
-
jala.IndexManager
- - |
-
jala.IndexManager.Job
- - |
-
jala.ListRenderer
- - |
-
jala.ListRenderer.ArrayList
- - |
-
jala.Mp3
- - |
-
jala.Mp3.Id3v1
- - |
-
jala.Mp3.Id3v2
- - |
-
jala.PodcastWriter
- - |
-
jala.RemoteContent
- - |
-
jala.Rss20Writer
- - |
-
jala.Utilities
- - |
-
jala.XmlRpcRequest
- - |
-
jala.XmlWriter
- - |
-
All Classes
-
-
-Files
- |
-
- - - diff --git a/modules/jala/docs/overview-summary-AsyncRequest.js.html b/modules/jala/docs/overview-summary-AsyncRequest.js.html deleted file mode 100644 index 2e5de3c2..00000000 --- a/modules/jala/docs/overview-summary-AsyncRequest.js.html +++ /dev/null @@ -1,170 +0,0 @@ - - -
-
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.AsyncRequest class.
-
-
- - Class Summary - - | -|
jala.AsyncRequest | -This class is used to create requests of type "INTERNAL" - (like cron-jobs) that are processed in a separate thread and - therefor asynchronous. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.BitTorrent class.
-
-
- - Class Summary - - | -|
jala.BitTorrent | -This class provides methods to create a BitTorrent - metadata file from any desired file. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.Captcha class.
-
-
- - Class Summary - - | -|
jala.Captcha | -Wrapper class for the - JCaptcha library. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.db package.
-
-
- - Class Summary - - | -|
jala.db.FileDatabase | -Instances of this class represent a file based in-process database
- Important: You need the h2.jar in directory "lib/ext" - of your helma installation for this library to work, which you can get - at http://www.h2database.com/. |
-
jala.db.RamDatabase | -Instances of this class represent an in-memory sql database. | -
jala.db.Server | -Instances of this class represent a H2 database listener that - allows multiple databases to be accessed via tcp. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.Date class.
-
-
- - Class Summary - - | -|
jala.Date | -This class provides various convenience - methods for rendering purposes. | -
jala.Date.Calendar | -This class represents a calendar based based on a grouped - collection of HopObjects. | -
jala.Date.Calendar.Renderer | -A default renderer to use in conjunction with jala.Date.Calendar - | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.DnsClient class.
-
-
- - Class Summary - - | -|
jala.DnsClient | -This is a wrapper around the Dns Client by wonderly.org - providing methods for querying Dns servers. | -
jala.DnsClient.Record | -Instances of this class wrap record data as received - from the nameserver. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- This class can be used to render forms and to validate
- and store user submits. Further types of form components can be added
- by subclassing jala.Form.Component.Input.
-
-
- - Class Summary - - | -|
jala.Form | -A class that renders forms, validates submitted form data and - stores the data in a specified object. | -
jala.Form.Component | -- |
jala.Form.Component.Button | -Subclass of jala.Form.Component.Input which renders a button. | -
jala.Form.Component.Checkbox | -Subclass of jala.Form.Component.Input which renders and validates a - checkbox. | -
jala.Form.Component.Date | -Subclass of jala.Form.Component.Input which renders and validates a - date editor. | -
jala.Form.Component.Fieldset | -Instances of this class represent a form fieldset containing - numerous form components - | -
jala.Form.Component.File | -Subclass of jala.Form.Component.Input which renders and validates a - file upload. | -
jala.Form.Component.Hidden | -Subclass of jala.Form.Component.Input which renders and validates a - hidden input tag. | -
jala.Form.Component.Image | -Subclass of jala.Form.Component.File which renders a file upload - and validates uploaded files as images. | -
jala.Form.Component.Input | -Instances of this class represent a single form input field. | -
jala.Form.Component.Password | -Subclass of jala.Form.Component.Input which renders and validates a - password input tag. | -
jala.Form.Component.Radio | -Subclass of jala.Form.Component.Input which renders and validates a - set of radio buttons. | -
jala.Form.Component.Select | -Subclass of jala.Form.Component.Input which renders and validates a - dropdown element. | -
jala.Form.Component.Skin | -Subclass of jala.Form.Component that allows rendering a skin - within a form. | -
jala.Form.Component.Submit | -Subclass of jala.Form.Component.Button which renders a submit button. | -
jala.Form.Component.Textarea | -Subclass of jala.Form.Component.Input which renders and validates a - textarea input field. | -
jala.Form.Tracker | -Instances of this class can contain error-messages and values - | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the Global prototype.
-
-
- - Method Summary - - | -|
-
- static Boolean
-
- |
-
-
-
- isArray(<Object> val)
-
- - - Returns true if the value passed as argument is an array. - |
-
-
- static Boolean
-
- |
-
-
-
- isBoolean(<Object> val)
-
- - - Returns true if the value passed as argument is either a boolean - literal or an instance of Boolean. - |
-
-
- static Boolean
-
- |
-
-
-
- isDate(<Object> val)
-
- - - Returns true if the value passed as argument is either a Javascript date - or an instance of java.util.Date. - |
-
-
- static Boolean
-
- |
-
-
-
- isFunction(<Object> val)
-
- - - Returns true if the value passed as argument is a function. - |
-
-
- static Boolean
-
- |
-
-
-
- isNull(<Object> val)
-
- - - Returns true if the value passed as argument is null. - |
-
-
- static Boolean
-
- |
-
-
-
- isNumber(<Object> val)
-
- - - Returns true if the value passed as argument is either a number, - an instance of Number or of java.lang.Number. - |
-
-
- static Boolean
-
- |
-
-
-
- isObject(<Object> val)
-
- - - Returns true if the value passed as argument is either a Javascript - object or an instance of java.lang.Object. - |
-
-
- static Boolean
-
- |
-
-
-
- isString(<Object> val)
-
- - - Returns true if the value passed as argument is either a string literal, - an instance of String or of java.lang.String. - |
-
-
- static Boolean
-
- |
-
-
-
- isUndefined(<Object> val)
-
- - - Returns true if the value passed as argument is undefined. - |
-
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.History class.
-
-
- - Class Summary - - | -|
jala.History | -This class is an implementation of a Browser-like history - stack suitable to use in any Helma application. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Additional fields and methods of the HopObject class.
-
-
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.HtmlDocument class.
-
-
- - Class Summary - - | -|
jala.HtmlDocument | -This class provides easy access to the elements of - an arbitrary HTML document. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Methods and macros for internationalization
- of Helma applications.
-
-
- - Class Summary - - | -|
jala.I18n | -This class provides various functions and macros for - internationalization of Helma applications. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.ImageFilter class.
-
-
- - Class Summary - - | -|
jala.ImageFilter | -This class provides several image manipulating - methods. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.IndexManager class.
-
-
- - Class Summary - - | -|
jala.IndexManager | -This class basically sits on top of a helma.Search.Index instance - and provides methods for adding, removing and optimizing the underlying index. | -
jala.IndexManager.Job | -Instances of this class represent a single index - manipulation job to be processed by the index manager. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.ListRenderer class.
-
-
- - Class Summary - - | -|
jala.ListRenderer | -- |
jala.ListRenderer.ArrayList | -A simple wrapper around an array to use in conjunction - with jala.ListRenderer. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.audio package.
-
-
- - Class Summary - - | -|
jala.Mp3 | -This is a class representing an MP3 file - providing methods to access its metadata. | -
jala.Mp3.Id3v1 | -This class represents an Id3v1 tag. | -
jala.Mp3.Id3v2 | -This class represents an Id3v2 tag. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.PodcastWriter class.
-
-
- - Class Summary - - | -|
jala.PodcastWriter | -Class to create, modify and render standard-compliant - RSS 2.0 feeds including support for Apple's Podcast specification. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.RemoteContent class.
-
-
- - Class Summary - - | -|
jala.RemoteContent | -API to define, fetch and update content - from a remote site. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.Rss20Writer class.
-
-
- - Class Summary - - | -|
jala.Rss20Writer | -Class to create, modify and render standard-compliant - RSS 2.0 feeds. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.Utilities class.
-
-
- - Class Summary - - | -|
jala.Utilities | -This class contains various convenience methods - which do not fit in any other class. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.XmlRpcRequest class.
-
-
- - Class Summary - - | -|
jala.XmlRpcRequest | -Instances of this class provide the necessary functionality - for issueing XmlRpc requests to a remote service. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Fields and methods of the jala.XmlWriter class.
-
-
- - Class Summary - - | -|
jala.XmlWriter | -This class defines a generic interface to write - arbitrary and validating XML source code. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
- Wrapper for automatic inclusion of all Jala modules.
-
-
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
-- -Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
- This document is the API Specification for - Jala 1.3. -
- - - -- - Jala is a Helma-based library and utility project initially developed to ease the work at ORF.at's software development department. - - -
- -- - File Summary - - | -|
all.js | -Wrapper for automatic inclusion of all Jala modules. | -
AsyncRequest.js | -Fields and methods of the jala.AsyncRequest class. | -
BitTorrent.js | -Fields and methods of the jala.BitTorrent class. | -
Captcha.js | -Fields and methods of the jala.Captcha class. | -
Database.js | -Fields and methods of the jala.db package. | -
Date.js | -Fields and methods of the jala.Date class. | -
DnsClient.js | -Fields and methods of the jala.DnsClient class. | -
Form.js | -This class can be used to render forms and to validate - and store user submits. | -
Global.js | -Fields and methods of the Global prototype. | -
History.js | -Fields and methods of the jala.History class. | -
HopObject.js | -Additional fields and methods of the HopObject class. | -
HtmlDocument.js | -Fields and methods of the jala.HtmlDocument class. | -
I18n.js | -Methods and macros for internationalization - of Helma applications. | -
ImageFilter.js | -Fields and methods of the jala.ImageFilter class. | -
IndexManager.js | -Fields and methods of the jala.IndexManager class. | -
ListRenderer.js | -Fields and methods of the jala.ListRenderer class. | -
Mp3.js | -Fields and methods of the jala.audio package. | -
PodcastWriter.js | -Fields and methods of the jala.PodcastWriter class. | -
RemoteContent.js | -Fields and methods of the jala.RemoteContent class. | -
Rss20Writer.js | -Fields and methods of the jala.Rss20Writer class. | -
Utilities.js | -Fields and methods of the jala.Utilities class. | -
XmlRpcRequest.js | -Fields and methods of the jala.XmlRpcRequest class. | -
XmlWriter.js | -Fields and methods of the jala.XmlWriter class. | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
--Jala 1.3 - | -||||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
-
-
|
--Jala 1.3 - | -|||||||
- PREV - NEXT | -- FRAMES - NO FRAMES - - - - | -
- Version 2.1, February 1999 - -
- --
Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 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.] -- - -
- 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. -
- -- -
- -- 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: -
- --
- (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: -
- --
- 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: -
- --
- 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. -
- \ No newline at end of file diff --git a/modules/jala/tests/1meg.reference-win.torrent b/modules/jala/tests/1meg.reference-win.torrent deleted file mode 100644 index bfa6890a..00000000 --- a/modules/jala/tests/1meg.reference-win.torrent +++ /dev/null @@ -1 +0,0 @@ -d8:announce30:http://tracker.orf.at/announce13:creation datei1172497604e4:infod6:lengthi1048576e4:name4:1meg12:piece lengthi262144e6:pieces80:. WYT>Y. WYT>Y. WYT>Y. WYT>Yee \ No newline at end of file diff --git a/modules/jala/tests/1meg.reference.torrent b/modules/jala/tests/1meg.reference.torrent deleted file mode 100644 index 16454c90..00000000 Binary files a/modules/jala/tests/1meg.reference.torrent and /dev/null differ diff --git a/modules/jala/tests/AsyncRequest.js b/modules/jala/tests/AsyncRequest.js deleted file mode 100644 index c7033aa2..00000000 --- a/modules/jala/tests/AsyncRequest.js +++ /dev/null @@ -1,65 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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$ -// - - -var result = undefined; - -/** - * A simple test of jala.AsyncRequest. It constructs a new AsyncRequest - * with a test function defined below that sets various properties - * of the global result object above. After evaluating the async request - * the current thread sleeps for a short period of time to wait for - * the other request to finish, and then does the testing of the result. - */ -var testAsyncRequest = function() { - var r = new jala.AsyncRequest(global, "testFunction"); - r.run("jala"); - // wait until the async request started above has finished - // before testing the result, but no longer than 1 second. - var elapsed = 0; - var interval = 5; - while (result === undefined && elapsed < 1000) { - elapsed += interval; - java.lang.Thread.sleep(interval); - } - assertNotUndefined(result); - assertEqual(result.name, "jala"); - assertEqual(result.request, req); - assertEqual(result.response, res); - assertFalse(r.isAlive()); - return; -}; - -/** - * A simple test function that assigns an object to the global - * property "result". - * @param {String} name A string to use as name - */ -var testFunction = function(name) { - result = { - name: name, - request: req, - response: res - }; - return; -}; diff --git a/modules/jala/tests/BitTorrent.js b/modules/jala/tests/BitTorrent.js deleted file mode 100644 index ac1e92bd..00000000 --- a/modules/jala/tests/BitTorrent.js +++ /dev/null @@ -1,59 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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$ -// - -/** - * A simple test of jala.BitTorrent. - * FIXME: Needs resolution of issue #33 - */ -var testBitTorrent = function() { - var size = 1024 * 1024; // 1 meg - var file = new java.io.File(jala.Test.getTestFile("1meg")); - var fos = new java.io.FileOutputStream(file, false); - var channel = fos.getChannel(); - var iterations = 0; - while (channel.size() < size) { - channel.write(java.nio.ByteBuffer.allocate(1024)); - } - channel.close(); - fos.close(); - - var torrent = new jala.BitTorrent(file); - // Testing against file generated with BitTorrent.app (OS X) - torrent.set("announce", "http://tracker.orf.at/announce"); - // S3 defines a multitracker list with a single tracker item - //torrent.set("announce-list", [["http://tracker.amazonaws.com:6969/announce"]]); - torrent.setCreationDate(new Date(2007, 1, 26, 14, 46, 44)); - torrent.save(); - file["delete"](); - - try { - var torrentFile = torrent.getTorrentFile(); - var refFile = new helma.File(jala.Test.getTestFile("1meg.reference.torrent")); - assertEqual(torrentFile.readAll().trim(), refFile.readAll().trim()); - } catch (x) { - throw(x); - } finally { - torrentFile.remove(); - } - return; -}; diff --git a/modules/jala/tests/Database.js b/modules/jala/tests/Database.js deleted file mode 100644 index a2b95509..00000000 --- a/modules/jala/tests/Database.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Contains the system's temporary directory - * @type helma.File - * @private - */ -var tmpDir = new helma.File(java.lang.System.getProperty("java.io.tmpdir")); - -/** - * Contains the server created in testServer method - * @private - */ -var server = null; - -/** - * Basic tests for jala.db.RamDatabase. All of these tests are - * valid for jala.db.FileDatabase too. - */ -var testRamDatabase = function() { - var db = new jala.db.RamDatabase("test"); - assertNotNull(db); - assertEqual(db.getName(), "test"); - assertEqual(db.getDatabasePath(), "mem:test"); - assertEqual(db.getUrl(), "jdbc:h2:mem:test"); - // test connection to database - var conn = db.getConnection(); - assertNotNull(conn); - assertTrue(conn instanceof helma.Database); - - // create a table - db.createTable("test", [ - { - name: "id", - type: java.sql.Types.INTEGER, - nullable: false, - unique: true - }, - { - name: "name", - type: java.sql.Types.VARCHAR, - length: 255 - } - ], "id"); - - // test if the table exists - assertTrue(db.tableExists("test")); - - // dump database - var dumpFile = new helma.File(tmpDir, "backup.test.sql"); - assertTrue(db.dump(dumpFile)); - assertTrue(dumpFile.exists()); - assertTrue(dumpFile.getLength() > 0); - // remove dump file again - dumpFile.remove(); - - // drop table - db.dropTable("test"); - assertFalse(db.tableExists("test")); - - // test db shutdown - db.shutdown(); - assertThrows(function() { - conn.query("select 1 = 1"); - }, Packages.org.h2.jdbc.JdbcSQLException); - return; -}; - -/** - * Basic tests for jala.db.FileDatabase that are different to - * jala.db.RamDatabase - */ -var testFileDatabase = function() { - var db = new jala.db.FileDatabase("test", tmpDir); - assertNotNull(db); - assertEqual(db.getName(), "test"); - assertEqual(db.getDirectory(), tmpDir); - - var dbDir = new helma.File(tmpDir, "test"); - assertEqual(db.getDatabasePath(), "file:" + dbDir.getAbsolutePath()); - assertEqual(db.getUrl(), "jdbc:h2:file:" + dbDir.getAbsolutePath()); - - // execute sql script (need to do that, otherwise the backup won't - // work because the database is empty) - var sqlFile = jala.Test.getTestFile("Database.script.sql"); - assertTrue(db.runScript(sqlFile)); - assertTrue(db.tableExists("test")); - - // test backup - var backupFile = new helma.File(tmpDir, "backup.zip"); - assertTrue(db.backup(backupFile)); - assertTrue(backupFile.exists()); - assertTrue(backupFile.getLength() > 0); - - // remove the database - db.remove(); - assertFalse((new helma.File(db.getDirectory(), db.getName() + ".data.db")).exists()); - assertFalse((new helma.File(db.getDirectory(), db.getName() + ".index.db")).exists()); - assertFalse((new helma.File(db.getDirectory(), db.getName() + ".trace.db")).exists()); - - // test restore - assertTrue(db.restore(backupFile)); - assertTrue(db.tableExists("test")); - - // remove backup file and database - backupFile.remove(); - db.remove(); - - return; -}; - -var testServer = function() { - server = new jala.db.Server(tmpDir); - // test default config - assertEqual(tmpDir, server.getDirectory()); - assertEqual(server.getPort(), 9092); - assertFalse(server.useSsl()); - assertFalse(server.isPublic()); - assertFalse(server.createOnDemand()); - - // test setting config properties - server.useSsl(true); - assertTrue(server.useSsl()); - server.isPublic(true); - assertTrue(server.isPublic()); - server.createOnDemand(true); - assertTrue(server.createOnDemand()); - - // reset back some of them - server.useSsl(false); - assertFalse(server.useSsl()); - server.isPublic(false); - assertFalse(server.isPublic()); - - // start the server - assertTrue(server.start()); - - // test connection properties (this also includes testing - // of server.getUrl()) - var props = server.getProperties("test", "test", "1111"); - assertEqual(props.getProperty("test.url"), "jdbc:h2:tcp://localhost:9092/test"); - assertEqual(props.getProperty("test.driver"), "org.h2.Driver"); - assertEqual(props.getProperty("test.user"), "test"); - assertEqual(props.getProperty("test.password"), "1111"); - - var conn = server.getConnection("test", "test", "1111"); - assertNotNull(conn); - - // stop the server - assertTrue(server.stop()); - // and remove the file database created above - var db = new jala.db.FileDatabase("test", tmpDir, "test", "1111"); - db.remove(); - return; -}; - -/** - * Stuff to do on cleanup - */ -var cleanup = function() { - if (server != null) { - server.stop(); - } - return; -}; diff --git a/modules/jala/tests/Database.script.sql b/modules/jala/tests/Database.script.sql deleted file mode 100644 index 7beab74d..00000000 --- a/modules/jala/tests/Database.script.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE test (id INTEGER NOT NULL, name VARCHAR(255), PRIMARY KEY (id)); -INSERT INTO test (id, name) VALUES (1, 'jala'); -INSERT INTO test (id, name) VALUES (2, 'Database'); -INSERT INTO test (id, name) VALUES (3, 'Test'); diff --git a/modules/jala/tests/DnsClient.js b/modules/jala/tests/DnsClient.js deleted file mode 100644 index 19ceb720..00000000 --- a/modules/jala/tests/DnsClient.js +++ /dev/null @@ -1,66 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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$ -// - - -var dnsClient = new jala.DnsClient("68.12.16.25"); -var result; - -/** - * Testing default mode (A records) - */ -var testAQuery = function() { - result = dnsClient.query("nomatic.org"); - assertEqual(result.length, 1); - assertEqual(result[0].ipAddress, "213.129.249.34"); - return; -}; - -/** - * Testing SOA record queries - */ -var testSoaQuery = function() { - result = dnsClient.query("nomatic.org", jala.DnsClient.TYPE_SOA); - assertEqual(result.length, 1); - assertEqual(result[0].email, "hostmaster.nomatic.org"); - return; -}; - -/** - * Testing MX record queries - */ -var testMxQuery = function() { - result = dnsClient.query("nomatic.org", jala.DnsClient.TYPE_MX); - assertEqual(result.length, 1); - assertEqual(result[0].mx, "grace.nomatic.org"); - return; -}; - -/** - * Testing NS record queries - */ -var testNsQuery = function() { - result = dnsClient.query("nomatic.org", jala.DnsClient.TYPE_NS); - assertEqual(result.length, 3); - // can't test single records as their order changes unpredictably - return; -}; diff --git a/modules/jala/tests/Form.fileupload.doc b/modules/jala/tests/Form.fileupload.doc deleted file mode 100644 index 40b88854..00000000 Binary files a/modules/jala/tests/Form.fileupload.doc and /dev/null differ diff --git a/modules/jala/tests/Form.imageupload.jpg b/modules/jala/tests/Form.imageupload.jpg deleted file mode 100644 index 84a3d709..00000000 Binary files a/modules/jala/tests/Form.imageupload.jpg and /dev/null differ diff --git a/modules/jala/tests/Form.js b/modules/jala/tests/Form.js deleted file mode 100644 index 0fee8358..00000000 --- a/modules/jala/tests/Form.js +++ /dev/null @@ -1,460 +0,0 @@ -// -// Jala Project [http://opensvn.csie.org/traccgi/jala] -// -// 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 -// -// 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$ -// - -/** - * a global variable containing the form instance - * @type jala.Form - */ -var form; - - -/** - * Create and configure the form object - */ -var setup = function() { - form = jala.Form.create(getConfig(), new DataObject()); - // form.render(); // show the test form - return; -}; - - -/** - * Test the form rendering mechanism - */ -var testFormRender = function() { - var html = new jala.HtmlDocument(form.renderAsString()); - var list = html.getAll("*"); - - var idx = 2; - assertEqual(list[idx].name, "form"); - assertAttribute(list[idx].attributes, "id", "test"); - assertAttribute(list[idx].attributes, "class", "form"); - assertAttribute(list[idx].attributes, "name", "test"); - assertAttribute(list[idx].attributes, "enctype", "multipart/form-data"); - assertAttribute(list[idx].attributes, "method", "post"); - - - // alias / input - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testAlias"); - assertAttribute(list[idx].attributes, "class", "component require"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testAliasControl"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testAliasControl"); - assertAttribute(list[idx].attributes, "class", "input"); - assertAttribute(list[idx].attributes, "type", "text"); - assertAttribute(list[idx].attributes, "maxlength", "10"); - assertAttribute(list[idx].attributes, "name", "alias"); - assertAttribute(list[idx].attributes, "size", "20"); - - assertEqual(list[++idx].name, "div"); - assertEqual(list[idx].value, "Enter alias."); - assertAttribute(list[idx].attributes, "class", "helpText"); - - - // desc / textarea - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testDesc"); - assertAttribute(list[idx].attributes, "class", "component require"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testDescControl"); - - assertEqual(list[++idx].name, "textarea"); - assertAttribute(list[idx].attributes, "id", "testDescControl"); - assertAttribute(list[idx].attributes, "class", "textarea"); - assertAttribute(list[idx].attributes, "name", "desc"); - assertAttribute(list[idx].attributes, "cols", "30"); - assertAttribute(list[idx].attributes, "rows", "3"); - - - - // pushdate / date - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testPushdate"); - assertAttribute(list[idx].attributes, "class", "component require"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testPushdateControl"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testPushdateControl"); - assertAttribute(list[idx].attributes, "class", "date"); - assertAttribute(list[idx].attributes, "type", "text"); - assertAttribute(list[idx].attributes, "name", "pushdate"); - - - // isonline / checkbox - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testIsonline"); - assertAttribute(list[idx].attributes, "class", "component optional"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testIsonlineControl"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testIsonlineControl"); - assertAttribute(list[idx].attributes, "type", "checkbox"); - assertAttribute(list[idx].attributes, "class", "checkbox"); - assertAttribute(list[idx].attributes, "name", "isonline"); - assertAttribute(list[idx].attributes, "value", "1"); - - - // category / select - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testCategory"); - assertAttribute(list[idx].attributes, "class", "component optional"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testCategoryControl"); - - assertEqual(list[++idx].name, "select"); - assertAttribute(list[idx].attributes, "id", "testCategoryControl"); - assertAttribute(list[idx].attributes, "class", "select"); - assertAttribute(list[idx].attributes, "name", "category"); - assertAttribute(list[idx].attributes, "size", "1"); - - assertEqual(list[++idx].name, "option"); - assertAttribute(list[idx].attributes, "value", "cat0"); - - assertEqual(list[++idx].name, "option"); - assertAttribute(list[idx].attributes, "value", "cat1"); - - assertEqual(list[++idx].name, "option"); - assertAttribute(list[idx].attributes, "value", "cat2"); - - assertEqual(list[++idx].name, "option"); - assertAttribute(list[idx].attributes, "value", "cat3"); - - - // fieldset - assertEqual(list[++idx].name, "fieldset"); - - assertEqual(list[++idx].name, "legend"); - assertEqual(list[idx].value, "a fieldset"); - - - // fileupload - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testFileupload"); - assertAttribute(list[idx].attributes, "class", "component optional"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testFileuploadControl"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testFileuploadControl"); - assertAttribute(list[idx].attributes, "class", "file"); - assertAttribute(list[idx].attributes, "type", "file"); - assertAttribute(list[idx].attributes, "accept", "application/msword"); - assertAttribute(list[idx].attributes, "name", "fileupload"); - - - // imageupload - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testImageupload"); - assertAttribute(list[idx].attributes, "class", "component optional"); - - assertEqual(list[++idx].name, "label"); - assertAttribute(list[idx].attributes, "for", "testImageuploadControl"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testImageuploadControl"); - assertAttribute(list[idx].attributes, "class", "image"); - assertAttribute(list[idx].attributes, "type", "file"); - assertAttribute(list[idx].attributes, "name", "imageupload"); - - - // submit - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testSubmit"); - assertAttribute(list[idx].attributes, "class", "component"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testSubmitControl"); - assertAttribute(list[idx].attributes, "class", "submit"); - assertAttribute(list[idx].attributes, "name", "submit"); - assertAttribute(list[idx].attributes, "value", "Submit this form"); - assertAttribute(list[idx].attributes, "type", "submit"); - - - // cancel - assertEqual(list[++idx].name, "div"); - assertAttribute(list[idx].attributes, "id", "testCancel"); - assertAttribute(list[idx].attributes, "class", "component"); - - assertEqual(list[++idx].name, "input"); - assertAttribute(list[idx].attributes, "id", "testCancelControl"); - assertAttribute(list[idx].attributes, "class", "button"); - assertAttribute(list[idx].attributes, "name", "cancel"); - assertAttribute(list[idx].attributes, "value", "Cancel edit"); - assertAttribute(list[idx].attributes, "type", "button"); - - return; -} - - -/** - * Test the form validation mechanism - */ -var testFormValidate = function() { - var reqData = getRequestData(); - - // default userinput values that should validate - var tracker = form.validate(reqData); - assertFalse(tracker.hasError()); - - // now try invalid values in userinput: - reqData["alias"] = "a"; - reqData["desc"] = ""; - reqData["pushdate"] = "17.5.2007"; - reqData["category"] = "invalidOption"; - tracker = form.validate(reqData); - assertTrue(tracker.hasError()); - assertEqual(tracker.errors["alias"], "Alias is too short."); - assertEqual(tracker.errors["desc"], "Please enter text into this field."); - assertEqual(tracker.errors["pushdate"], "This date cannot be parsed."); - assertEqual(tracker.errors["category"], "Please select a valid option."); - - // reset to default userinput: - reqData = getRequestData(); - // require a smaller image: - form.components.uploadfieldset.components.imageupload.require("maxwidth", 100, "Maximum width exceeded."); - tracker = form.validate(reqData); - assertTrue(tracker.hasError()); - assertEqual(tracker.errors["imageupload"], "Maximum width exceeded."); - // undo image restriction: - form.components.uploadfieldset.components.imageupload.require("maxwidth", 200, "Maximum width exceeded."); - tracker = form.validate(reqData); - assertFalse(tracker.hasError()); - - return; -}; - - -/** - * Test the form rendering mechanism in the case of an error - */ -var testFormRenderWithError = function() { - var reqData = getRequestData(); - reqData["alias"] = "a"; - var tracker = form.validate(reqData); - - var html = new jala.HtmlDocument(form.renderAsString()); - var list = html.getAll("*"); - assertEqual(list[4].name, "div"); - assertEqual(list[4].value, "Alias is too short."); - assertAttribute(list[4].attributes, "class", "errorText"); -}; - - -/** - * Test the form save mechanism - */ -var testFormSave = function() { - var dataObj = form.getDataObject(); - - var reqData = getRequestData(); - var tracker = form.validate(reqData); - assertFalse(tracker.hasError()); - form.save(); - assertEqual(dataObj.alias, "aliasValue"); - assertEqual(dataObj.getProperty("desc"), "descriptionValue"); - assertEqual(dataObj.pushdate.toString(), new Date(2007, 4, 17, 11, 32, 0).toString()); - assertEqual(dataObj.isonline, 1); - assertEqual(dataObj.getProperty("category"), "cat2"); - - return; -} - - - -/** - * Helper function to dump an html element to the response - * @param {Object} el - */ -var debugElement = function(el) { - res.write("" + el.name + " (" + el.value + ")