fix: missing jsdoc files

This commit is contained in:
Tobi Schäfer 2020-03-18 10:35:18 +01:00
parent bd552751f5
commit d985d1be0c
13 changed files with 246 additions and 102 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'application'
version = new Date().format("yyyyMMdd") version = new Date().format("yyyyMMdd")
tasks.build.dependsOn javadoc tasks.build.dependsOn javadoc, 'jsdoc'
tasks.compileJava.dependsOn 'processSource' tasks.compileJava.dependsOn 'processSource'
sourceSets { sourceSets {
@ -85,7 +85,12 @@ applicationDistribution.from(projectDir) {
applicationDistribution.from(javadoc.destinationDir) { applicationDistribution.from(javadoc.destinationDir) {
include '**' include '**'
into 'docs' into 'docs/javadoc'
}
applicationDistribution.from("${project.buildDir}/docs/jsdoc") {
include '**'
into 'docs/jsdoc'
} }
distTar { distTar {
@ -93,7 +98,7 @@ distTar {
} }
installDist { installDist {
dependsOn javadoc dependsOn javadoc, 'jsdoc'
finalizedBy 'update' finalizedBy 'update'
} }
@ -161,6 +166,22 @@ task update {
} }
} }
task jsdoc(type: Exec) {
def sources = ['modules/core', 'modules/helma', 'modules/jala/code']
def destination = "${project.buildDir}/docs/jsdoc"
sources.each { dir -> inputs.dir dir }
outputs.dir destination
executable 'npx'
args = ['jsdoc', '-d', "$destination"].plus(sources)
// As of writing jsdoc throws the following error:
// Unable to parse /home/tobi/Projects/helma/current/modules/jala/code/Database.js: Unexpected token, expected "(" (844:10)
// Seems to be related to the `for each` syntax but did not find any further references.
ignoreExitValue true
}
task shell(type: JavaExec) { task shell(type: JavaExec) {
def rhinoJar = configurations.library.files.find { f -> def rhinoJar = configurations.library.files.find { f ->
f.name.startsWith('rhino') f.name.startsWith('rhino')

View file

@ -19,12 +19,12 @@
* <br /><br /> * <br /><br />
* To use this optional module, its repository needs to be added to the * To use this optional module, its repository needs to be added to the
* application, for example by calling app.addRepository('modules/core/Array.js') * application, for example by calling app.addRepository('modules/core/Array.js')
*
* @addon
*/ */
/** /**
* Check if this array contains a specific value. * Check if this array contains a specific value.
* @external
* @memberof {Array}
* @param {Object} val the value to check * @param {Object} val the value to check
* @return {boolean} true if the value is contained * @return {boolean} true if the value is contained
*/ */
@ -34,6 +34,8 @@ Array.prototype.contains = function(val) {
/** /**
* Retrieve the union set of a bunch of arrays * Retrieve the union set of a bunch of arrays
* @external
* @memberof {Array}
* @param {Array} array1,... the arrays to unify * @param {Array} array1,... the arrays to unify
* @return {Array} the union set * @return {Array} the union set
*/ */
@ -54,6 +56,8 @@ Array.union = function() {
/** /**
* Retrieve the intersection set of a bunch of arrays * Retrieve the intersection set of a bunch of arrays
* @external
* @memberof {Array}
* @param {Array} array1,... the arrays to intersect * @param {Array} array1,... the arrays to intersect
* @return {Array} the intersection set * @return {Array} the intersection set
*/ */

View file

@ -34,7 +34,9 @@ Date.ISOFORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
/** /**
* Format a Date to a string. * Format a Date to a string.
* For details on the format pattern, see * For details on the format pattern, see
* http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html * http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html *
* @external
* @memberof {Date}
* *
* @param String Format pattern * @param String Format pattern
* @param Object Java Locale Object (optional) * @param Object Java Locale Object (optional)
@ -56,6 +58,8 @@ Date.prototype.format = function (format, locale, timezone) {
/** /**
* set the date/time to UTC by subtracting * set the date/time to UTC by subtracting
* the timezone offset * the timezone offset
* @external
* @memberof {Date}
*/ */
Date.prototype.toUtc = function() { Date.prototype.toUtc = function() {
this.setMinutes(this.getMinutes() + this.getTimezoneOffset()); this.setMinutes(this.getMinutes() + this.getTimezoneOffset());
@ -65,6 +69,8 @@ Date.prototype.toUtc = function() {
/** /**
* set the date/time to local time by adding * set the date/time to local time by adding
* the timezone offset * the timezone offset
* @external
* @memberof {Date}
*/ */
Date.prototype.toLocalTime = function() { Date.prototype.toLocalTime = function() {
this.setMinutes(this.getMinutes() - this.getTimezoneOffset()); this.setMinutes(this.getMinutes() - this.getTimezoneOffset());
@ -74,6 +80,8 @@ Date.prototype.toLocalTime = function() {
/** /**
* returns the difference between this and another * returns the difference between this and another
* date object in milliseconds * date object in milliseconds
* @external
* @memberof {Date}
*/ */
Date.prototype.diff = function(dateObj) { Date.prototype.diff = function(dateObj) {
return this.getTime() - dateObj.getTime(); return this.getTime() - dateObj.getTime();
@ -82,6 +90,8 @@ Date.prototype.diff = function(dateObj) {
/** /**
* return the timespan to current date/time or a different Date object * return the timespan to current date/time or a different Date object
* @external
* @memberof {Date}
* @param Object parameter object containing optional properties: * @param Object parameter object containing optional properties:
* .now = String to use if difference is < 1 minute * .now = String to use if difference is < 1 minute
* .day|days = String to use for single|multiple day(s) * .day|days = String to use for single|multiple day(s)
@ -134,6 +144,8 @@ Date.prototype.getTimespan = function(param) {
* return the past timespan between this Date object and * return the past timespan between this Date object and
* the current Date or a different Date object * the current Date or a different Date object
* @see Date.prototype.getTimespan * @see Date.prototype.getTimespan
* @external
* @memberof {Date}
*/ */
Date.prototype.getAge = function(param) { Date.prototype.getAge = function(param) {
var age = this.getTimespan(param); var age = this.getTimespan(param);
@ -147,6 +159,8 @@ Date.prototype.getAge = function(param) {
* return the future timespan between this Date object and * return the future timespan between this Date object and
* the current Date or a different Date object * the current Date or a different Date object
* @see Date.prototype.getTimespan * @see Date.prototype.getTimespan
* @external
* @memberof {Date}
*/ */
Date.prototype.getExpiry = function(param) { Date.prototype.getExpiry = function(param) {
var age = this.getTimespan(param); var age = this.getTimespan(param);
@ -158,6 +172,8 @@ Date.prototype.getExpiry = function(param) {
/** /**
* checks if a date object equals another date object * checks if a date object equals another date object
* @external
* @memberof {Date}
* @param Object Date object to compare * @param Object Date object to compare
* @param Int indicating how far the comparison should go * @param Int indicating how far the comparison should go
* @return Boolean * @return Boolean

View file

@ -27,6 +27,8 @@ app.addRepository("modules/core/String.js");
/** /**
* Iterates over each child node of the HopObject. * Iterates over each child node of the HopObject.
* @external
* @memberof {HopObject}
* @param {Function} callback The callback function to be * @param {Function} callback The callback function to be
* called for each child node. On every call the first * called for each child node. On every call the first
* argument of this function is set to the current value * argument of this function is set to the current value
@ -45,6 +47,8 @@ HopObject.prototype.forEach = function(callback) {
/** /**
* macro returns the id of a HopObject * macro returns the id of a HopObject
* @external
* @memberof {HopObject}
*/ */
HopObject.prototype.id_macro = function() { HopObject.prototype.id_macro = function() {
res.write(this._id); res.write(this._id);
@ -54,6 +58,8 @@ HopObject.prototype.id_macro = function() {
/** /**
* macro returns the url for any hopobject * macro returns the url for any hopobject
* @external
* @memberof {HopObject}
*/ */
HopObject.prototype.href_macro = function(param, action) { HopObject.prototype.href_macro = function(param, action) {
res.write(this.href(action || param.action || String.NULLSTR)); res.write(this.href(action || param.action || String.NULLSTR));
@ -64,6 +70,8 @@ HopObject.prototype.href_macro = function(param, action) {
/** /**
* macro rendering a skin or displaying * macro rendering a skin or displaying
* its source (param.as == "source") * its source (param.as == "source")
* @external
* @memberof {HopObject}
*/ */
HopObject.prototype.skin_macro = function(param, name) { HopObject.prototype.skin_macro = function(param, name) {
var skinName = name || param.name; var skinName = name || param.name;
@ -85,6 +93,8 @@ HopObject.prototype.skin_macro = function(param, name) {
/** /**
* this macro renders a text depending on * this macro renders a text depending on
* the value of a given property * the value of a given property
* @external
* @memberof {HopObject}
*/ */
HopObject.prototype.switch_macro = function(param) { HopObject.prototype.switch_macro = function(param) {
if (param.name) { if (param.name) {
@ -97,6 +107,8 @@ HopObject.prototype.switch_macro = function(param) {
/** /**
* generic macro that loops over the childobjects * generic macro that loops over the childobjects
* and renders a specified skin for each of them * and renders a specified skin for each of them
* @external
* @memberof {HopObject}
* @param Object providing the following properties: * @param Object providing the following properties:
* skin: the skin to render for each item (required) * skin: the skin to render for each item (required)
* collection: the collection containing the items * collection: the collection containing the items
@ -170,6 +182,8 @@ HopObject.prototype.loop_macro = function(param, collection) {
* <li>param.one - exactly one child node</li> * <li>param.one - exactly one child node</li>
* <li>param.many - more than one child node</li> * <li>param.many - more than one child node</li>
* </ol> * </ol>
* @external
* @memberof {HopObject}
* @param {Object} param The default macro parameter * @param {Object} param The default macro parameter
* @param {String} name The default name for a child node * @param {String} name The default name for a child node
*/ */

View file

@ -23,6 +23,8 @@
/** /**
* format a Number to a String * format a Number to a String
* @external
* @memberof {Number}
* @param String Format pattern * @param String Format pattern
* @param java.util.Locale An optional Locale instance * @param java.util.Locale An optional Locale instance
* @return String Number formatted to a String * @return String Number formatted to a String
@ -42,6 +44,8 @@ Number.prototype.format = function(fmt, locale) {
/** /**
* return the percentage of a Number * return the percentage of a Number
* according to a given total Number * according to a given total Number
* @external
* @memberof {Number}
* @param Int Total * @param Int Total
* @param String Format Pattern * @param String Format Pattern
* @param java.util.Locale An optional Locale instance * @param java.util.Locale An optional Locale instance
@ -57,6 +61,8 @@ Number.prototype.toPercent = function(total, fmt, locale) {
/** /**
* factory to create functions for sorting objects in an array * 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 String name of the field each object is compared with
* @param Number order (ascending or descending) * @param Number order (ascending or descending)
* @return Function ready for use in Array.prototype.sort * @return Function ready for use in Array.prototype.sort

View file

@ -23,6 +23,8 @@
/** /**
* Copies the properties of this object into a clone. * Copies the properties of this object into a clone.
* @external
* @memberof {Object}
* @param {Object} clone The optional target object * @param {Object} clone The optional target object
* @param {Boolean} recursive If true child objects are cloned as well, otherwise * @param {Boolean} recursive If true child objects are cloned as well, otherwise
* the clone contains references to the child objects * the clone contains references to the child objects
@ -73,6 +75,8 @@ Object.prototype.clone = function(clone, recursive) {
/** /**
* reduce an extended object (ie. a HopObject) * reduce an extended object (ie. a HopObject)
* to a generic javascript object * to a generic javascript object
* @external
* @memberof {Object}
* @param HopObject the HopObject to be reduced * @param HopObject the HopObject to be reduced
* @return Object the resulting generic object * @return Object the resulting generic object
*/ */
@ -90,6 +94,8 @@ Object.prototype.reduce = function(recursive) {
/** /**
* print the contents of an object for debugging * print the contents of an object for debugging
* @external
* @memberof {Object}
* @param Object the object to dump * @param Object the object to dump
* @param Boolean recursive flag (if true, dump child objects, too) * @param Boolean recursive flag (if true, dump child objects, too)
*/ */

View file

@ -20,10 +20,6 @@ String.APATTERN = /[^a-zA-Z]/;
String.NUMPATTERN = /[^0-9]/; String.NUMPATTERN = /[^0-9]/;
String.FILEPATTERN = /[^a-zA-Z0-9-_\. ]/; String.FILEPATTERN = /[^a-zA-Z0-9-_\. ]/;
String.HEXPATTERN = /[^a-fA-F0-9]/; String.HEXPATTERN = /[^a-fA-F0-9]/;
// Email and URL RegExps contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
// licensed unter MIT license - http://www.opensource.org/licenses/mit-license.php
String.EMAILPATTERN = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
String.URLPATTERN = /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
String.LEFT = -1 String.LEFT = -1
String.BALANCE = 0 String.BALANCE = 0
String.RIGHT = 1 String.RIGHT = 1
@ -32,6 +28,13 @@ String.SPACE = " ";
String.EMPTY = ""; String.EMPTY = "";
String.NULL = String.EMPTY; // to be deprecated? String.NULL = String.EMPTY; // to be deprecated?
// Email and URL RegExps contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
// licensed unter MIT license - http://www.opensource.org/licenses/mit-license.php
String.EMAILPATTERN = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
String.URLPATTERN = /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;
/** /**
* @fileoverview Adds useful methods to the JavaScript String type. * @fileoverview Adds useful methods to the JavaScript String type.
* <br /><br /> * <br /><br />
@ -41,6 +44,8 @@ String.NULL = String.EMPTY; // to be deprecated?
/** /**
* checks if a date format pattern is correct * checks if a date format pattern is correct
* @external
* @memberof {String}
* @return Boolean true if the pattern is correct * @return Boolean true if the pattern is correct
*/ */
String.prototype.isDateFormat = function() { String.prototype.isDateFormat = function() {
@ -56,6 +61,8 @@ String.prototype.isDateFormat = function() {
/** /**
* parse a timestamp into a date object. This is used when users * parse a timestamp into a date object. This is used when users
* want to set createtime explicitly when creating/editing stories. * want to set createtime explicitly when creating/editing stories.
* @external
* @memberof {String}
* @param String date format to be applied * @param String date format to be applied
* @param Object Java TimeZone Object (optional) * @param Object Java TimeZone Object (optional)
* @return Object contains the resulting date * @return Object contains the resulting date
@ -81,6 +88,8 @@ String.prototype.toDate = function(format, timezone) {
* function checks if the string passed contains any characters that * function checks if the string passed contains any characters that
* are forbidden in URLs and tries to create a java.net.URL from it * are forbidden in URLs and tries to create a java.net.URL from it
* FIXME: probably deprecated -> helma.Url * FIXME: probably deprecated -> helma.Url
* @external
* @memberof {String}
* @return Boolean * @return Boolean
* @see helma.Url.PATTERN * @see helma.Url.PATTERN
*/ */
@ -92,6 +101,8 @@ String.prototype.isUrl = function() {
/** /**
* function checks if the string passed contains any characters * function checks if the string passed contains any characters
* that are forbidden in image- or filenames * that are forbidden in image- or filenames
* @external
* @memberof {String}
* @return Boolean * @return Boolean
*/ */
String.prototype.isFileName = function() { String.prototype.isFileName = function() {
@ -102,6 +113,8 @@ String.prototype.isFileName = function() {
/** /**
* function cleans the string passed as argument from any characters * function cleans the string passed as argument from any characters
* that are forbidden or shouldn't be used in filenames * that are forbidden or shouldn't be used in filenames
* @external
* @memberof {String}
* @return Boolean * @return Boolean
*/ */
String.prototype.toFileName = function() { String.prototype.toFileName = function() {
@ -112,6 +125,8 @@ String.prototype.toFileName = function() {
/** /**
* function checks a string for a valid color value in hexadecimal format. * function checks a string for a valid color value in hexadecimal format.
* it may also contain # as first character * it may also contain # as first character
* @external
* @memberof {String}
* @returns Boolean false, if string length (without #) > 6 or < 6 or * @returns Boolean false, if string length (without #) > 6 or < 6 or
* contains any character which is not a valid hex value * contains any character which is not a valid hex value
*/ */
@ -129,6 +144,8 @@ String.prototype.isHexColor = function() {
* converts a string into a hexadecimal color * converts a string into a hexadecimal color
* representation (e.g. "ffcc33"). also knows how to * representation (e.g. "ffcc33"). also knows how to
* convert a color string like "rgb (255, 204, 51)". * convert a color string like "rgb (255, 204, 51)".
* @external
* @memberof {String}
* @return String the resulting hex color (w/o "#") * @return String the resulting hex color (w/o "#")
*/ */
String.prototype.toHexColor = function() { String.prototype.toHexColor = function() {
@ -151,6 +168,8 @@ String.prototype.toHexColor = function() {
/** /**
* function returns true if the string contains * function returns true if the string contains
* only a-z and 0-9 (case insensitive!) * only a-z and 0-9 (case insensitive!)
* @external
* @memberof {String}
* @return Boolean true in case string is alpha, false otherwise * @return Boolean true in case string is alpha, false otherwise
*/ */
String.prototype.isAlphanumeric = function() { String.prototype.isAlphanumeric = function() {
@ -163,6 +182,8 @@ String.prototype.isAlphanumeric = function() {
/** /**
* function cleans a string by throwing away all * function cleans a string by throwing away all
* non-alphanumeric characters * non-alphanumeric characters
* @external
* @memberof {String}
* @return cleaned string * @return cleaned string
*/ */
String.prototype.toAlphanumeric = function() { String.prototype.toAlphanumeric = function() {
@ -173,6 +194,8 @@ String.prototype.toAlphanumeric = function() {
/** /**
* function returns true if the string contains * function returns true if the string contains
* only characters a-z * only characters a-z
* @external
* @memberof {String}
* @return Boolean true in case string is alpha, false otherwise * @return Boolean true in case string is alpha, false otherwise
*/ */
String.prototype.isAlpha = function() { String.prototype.isAlpha = function() {
@ -185,6 +208,8 @@ String.prototype.isAlpha = function() {
/** /**
* function returns true if the string contains * function returns true if the string contains
* only 0-9 * only 0-9
* @external
* @memberof {String}
* @return Boolean true in case string is numeric, false otherwise * @return Boolean true in case string is numeric, false otherwise
*/ */
String.prototype.isNumeric = function() { String.prototype.isNumeric = function() {
@ -196,6 +221,8 @@ String.prototype.isNumeric = function() {
/** /**
* transforms the first n characters of a string to uppercase * transforms the first n characters of a string to uppercase
* @external
* @memberof {String}
* @param Number amount of characters to transform * @param Number amount of characters to transform
* @return String the resulting string * @return String the resulting string
*/ */
@ -211,6 +238,8 @@ String.prototype.capitalize = function(limit) {
/** /**
* transforms the first n characters of each * transforms the first n characters of each
* word in a string to uppercase * word in a string to uppercase
* @external
* @memberof {String}
* @return String the resulting string * @return String the resulting string
*/ */
String.prototype.titleize = function() { String.prototype.titleize = function() {
@ -227,6 +256,8 @@ String.prototype.titleize = function() {
/** /**
* translates all characters of a string into HTML entities * translates all characters of a string into HTML entities
* @external
* @memberof {String}
* @return String translated result * @return String translated result
*/ */
String.prototype.entitize = function() { String.prototype.entitize = function() {
@ -244,6 +275,8 @@ String.prototype.entitize = function() {
* breaks up a string into two parts called * breaks up a string into two parts called
* head and tail at the given position * head and tail at the given position
* don't apply this to HTML, i.e. use stripTags() in advance * don't apply this to HTML, i.e. use stripTags() in advance
* @external
* @memberof {String}
* @param Number number of charactrers or of segments separated by the delimiter * @param Number number of charactrers or of segments separated by the delimiter
* @param String pre-/suffix to be pre-/appended to shortened string * @param String pre-/suffix to be pre-/appended to shortened string
* @param String delimiter * @param String delimiter
@ -276,6 +309,8 @@ String.prototype.embody = function(limit, clipping, delimiter) {
/** /**
* get the head of a string * get the head of a string
* @external
* @memberof {String}
* @see String.prototype.embody() * @see String.prototype.embody()
*/ */
String.prototype.head = function(limit, clipping, delimiter) { String.prototype.head = function(limit, clipping, delimiter) {
@ -285,6 +320,8 @@ String.prototype.head = function(limit, clipping, delimiter) {
/** /**
* get the tail of a string * get the tail of a string
* @external
* @memberof {String}
* @see String.prototype.embody() * @see String.prototype.embody()
*/ */
String.prototype.tail = function(limit, clipping, delimiter) { String.prototype.tail = function(limit, clipping, delimiter) {
@ -292,9 +329,12 @@ String.prototype.tail = function(limit, clipping, delimiter) {
}; };
/* /**
* set clip method out of compatibility/convenience reason
* FIXME: we eventually have to get rid of this one... * FIXME: we eventually have to get rid of this one...
* set clip method out of compatibility/convenience reason
* @external
* @memberof {String}
* @deprecated
* @see String.prototype.head() * @see String.prototype.head()
*/ */
String.prototype.clip = String.prototype.head; String.prototype.clip = String.prototype.head;
@ -302,6 +342,8 @@ String.prototype.clip = String.prototype.head;
/** /**
* function inserts a string every number of characters * function inserts a string every number of characters
* @external
* @memberof {String}
* @param Int number of characters after which insertion should take place * @param Int number of characters after which insertion should take place
* @param String string to be inserted * @param String string to be inserted
* @param Boolean definitely insert at each interval position * @param Boolean definitely insert at each interval position
@ -327,6 +369,8 @@ String.prototype.group = function(interval, str, ignoreWhiteSpace) {
/** /**
* replace all linebreaks and optionally all w/br tags * replace all linebreaks and optionally all w/br tags
* @external
* @memberof {String}
* @param Boolean flag indicating if html tags should be replaced * @param Boolean flag indicating if html tags should be replaced
* @param String replacement for the linebreaks / html tags * @param String replacement for the linebreaks / html tags
* @return String the unwrapped string * @return String the unwrapped string
@ -343,6 +387,8 @@ String.prototype.unwrap = function(removeTags, replacement) {
/** /**
* function calculates the md5 hash of a string * function calculates the md5 hash of a string
* @external
* @memberof {String}
* @return String md5 hash of the string * @return String md5 hash of the string
*/ */
String.prototype.md5 = function() { String.prototype.md5 = function() {
@ -352,6 +398,8 @@ String.prototype.md5 = function() {
/** /**
* function repeats a string the specified amount of times * function repeats a string the specified amount of times
* @external
* @memberof {String}
* @param Int amount of repetitions * @param Int amount of repetitions
* @return String resulting string * @return String resulting string
*/ */
@ -366,6 +414,8 @@ String.prototype.repeat = function(multiplier) {
/** /**
* function returns true if the string starts with * function returns true if the string starts with
* the string passed as argument * the string passed as argument
* @external
* @memberof {String}
* @param String string pattern to search for * @param String string pattern to search for
* @return Boolean true in case it matches the beginning * @return Boolean true in case it matches the beginning
* of the string, false otherwise * of the string, false otherwise
@ -381,6 +431,8 @@ String.prototype.startsWith = function(str, offset) {
/** /**
* function returns true if the string ends with * function returns true if the string ends with
* the string passed as argument * the string passed as argument
* @external
* @memberof {String}
* @param String string pattern to search for * @param String string pattern to search for
* @return Boolean true in case it matches the end of * @return Boolean true in case it matches the end of
* the string, false otherwise * the string, false otherwise
@ -393,6 +445,8 @@ String.prototype.endsWith = function(str) {
/** /**
* fills a string with another string up to a desired length * fills a string with another string up to a desired length
* @external
* @memberof {String}
* @param String the filling string * @param String the filling string
* @param Number the desired length of the resulting string * @param Number the desired length of the resulting string
* @param Number the direction which the string will be padded in: * @param Number the direction which the string will be padded in:
@ -429,6 +483,8 @@ String.prototype.pad = function(str, len, mode) {
/** /**
* function returns true if a string contains the string * function returns true if a string contains the string
* passed as argument * passed as argument
* @external
* @memberof {String}
* @param String string to search for * @param String string to search for
* @param Int Position to start search * @param Int Position to start search
* @param Boolean * @param Boolean
@ -443,6 +499,8 @@ String.prototype.contains = function(str, fromIndex) {
/** /**
* function compares a string with the one passed as argument * function compares a string with the one passed as argument
* using diff * using diff
* @external
* @memberof {String}
* @param String String to compare against String object value * @param String String to compare against String object value
* @param String Optional regular expression string to use for * @param String Optional regular expression string to use for
* splitting. If not defined, newlines will be used. * splitting. If not defined, newlines will be used.
@ -502,6 +560,8 @@ String.prototype.diff = function(mod, separator) {
/** /**
* remove leading and trailing whitespace * remove leading and trailing whitespace
* @external
* @memberof {String}
*/ */
String.prototype.trim = function () { String.prototype.trim = function () {
var s = new java.lang.String(this); var s = new java.lang.String(this);
@ -511,6 +571,8 @@ String.prototype.trim = function () {
/** /**
* returns true if the string looks like an e-mail * returns true if the string looks like an e-mail
* @external
* @memberof {String}
*/ */
String.prototype.isEmail = function() { String.prototype.isEmail = function() {
return String.EMAILPATTERN.test(this); return String.EMAILPATTERN.test(this);
@ -519,6 +581,8 @@ String.prototype.isEmail = function() {
/** /**
* returns the amount of occurences of one string in another * returns the amount of occurences of one string in another
* @external
* @memberof {String}
*/ */
String.prototype.count = function(str) { String.prototype.count = function(str) {
var count = 0; var count = 0;
@ -533,6 +597,8 @@ String.prototype.count = function(str) {
/** /**
* returns the string encoded using the base64 algorithm * returns the string encoded using the base64 algorithm
* @external
* @memberof {String}
*/ */
String.prototype.enbase64 = function() { String.prototype.enbase64 = function() {
var bytes = new java.lang.String(this) . getBytes(); var bytes = new java.lang.String(this) . getBytes();
@ -542,6 +608,8 @@ String.prototype.enbase64 = function() {
/** /**
* returns the decoded string using the base64 algorithm * returns the decoded string using the base64 algorithm
* @external
* @memberof {String}
*/ */
String.prototype.debase64 = function() { String.prototype.debase64 = function() {
var bytes = new Packages.sun.misc.BASE64Decoder().decodeBuffer(this); var bytes = new Packages.sun.misc.BASE64Decoder().decodeBuffer(this);
@ -574,6 +642,8 @@ String.prototype.stripTags = function() {
/** /**
* factory to create functions for sorting objects in an array * factory to create functions for sorting objects in an array
* @external
* @memberof {String}
* @param String name of the field each object is compared with * @param String name of the field each object is compared with
* @param Number order (ascending or descending) * @param Number order (ascending or descending)
* @return Function ready for use in Array.prototype.sort * @return Function ready for use in Array.prototype.sort
@ -603,6 +673,8 @@ String.Sorter.cache = {};
/** /**
* create a string from a bunch of substrings * create a string from a bunch of substrings
* @external
* @memberof {String}
* @param String one or more strings as arguments * @param String one or more strings as arguments
* @return String the resulting string * @return String the resulting string
*/ */
@ -616,6 +688,8 @@ String.compose = function() {
/** /**
* creates a random string (numbers and chars) * creates a random string (numbers and chars)
* @external
* @memberof {String}
* @param len length of key * @param len length of key
* @param mode determines which letters to use. null or 0 = all letters; * @param mode determines which letters to use. null or 0 = all letters;
* 1 = skip 0, 1, l and o which can easily be mixed with numbers; * 1 = skip 0, 1, l and o which can easily be mixed with numbers;
@ -650,6 +724,8 @@ String.random = function(len, mode) {
/** /**
* append one string onto another and add some "glue" * append one string onto another and add some "glue"
* if none of the strings is empty or null. * if none of the strings is empty or null.
* @external
* @memberof {String}
* @param String the first string * @param String the first string
* @param String the string to be appended onto the first one * @param String the string to be appended onto the first one
* @param String the "glue" to be inserted between both strings * @param String the "glue" to be inserted between both strings

View file

@ -17,6 +17,8 @@
// convenience SingleFileRepository to load all the // convenience SingleFileRepository to load all the
// Javascript library files in ./modules/helma // Javascript library files in ./modules/helma
/** @namespace helma */
app.addRepository('modules/helma/Aspects.js'); app.addRepository('modules/helma/Aspects.js');
app.addRepository('modules/helma/Chart.js'); app.addRepository('modules/helma/Chart.js');
app.addRepository('modules/helma/Color.js'); app.addRepository('modules/helma/Color.js');

View file

@ -1930,7 +1930,7 @@ jala.Form.Component.Select = function Select(name) {
* <li>Array of objects <code>[ {value:val, display:display}, .. ]</code></li> * <li>Array of objects <code>[ {value:val, display:display}, .. ]</code></li>
* <li>Array of strings <code>[ display, display, .. ]</code> In this case, * <li>Array of strings <code>[ display, display, .. ]</code> In this case,
* the index position of the string will be the value.</li> * the index position of the string will be the value.</li>
* @param {Array Function} newOptions Array or function defining option list. * @param {Array|Function} newOptions Array or function defining option list.
*/ */
this.setOptions = function(newOptions) { this.setOptions = function(newOptions) {
options = newOptions; options = newOptions;
@ -2251,7 +2251,6 @@ jala.Form.Component.File.prototype.checkRequirements = function(reqData) {
jala.Form.Component.Image = function() {}; jala.Form.Component.Image = function() {};
/** /**
* @ignore
* FIXME: JSDoc has some sever problems with this class. * FIXME: JSDoc has some sever problems with this class.
* It's somehow due to the named method ("Image") that it * It's somehow due to the named method ("Image") that it
* always appears as global static object. * always appears as global static object.

View file

@ -125,5 +125,6 @@ jala.PodcastWriter = function(header) {
/** A typical XML header as default. /** A typical XML header as default.
@type String @final */ @type {String}
@final */
jala.PodcastWriter.XMLHEADER = '<?xml version="1.0" encoding="UTF-8"?>'; jala.PodcastWriter.XMLHEADER = '<?xml version="1.0" encoding="UTF-8"?>';

View file

@ -50,7 +50,6 @@ jala.Utilities = function() {
* Return a string representation of the utitility class. * Return a string representation of the utitility class.
* @returns [jala.Utilities] * @returns [jala.Utilities]
* @type String * @type String
* @ignore FIXME: JSDoc bug
*/ */
jala.Utilities.toString = function() { jala.Utilities.toString = function() {
return "[jala.Utilities]"; return "[jala.Utilities]";

View file

@ -52,7 +52,6 @@ jala.XmlWriter = function(header) {
'<?xml version="1.0" encoding="iso-8859-15"?>'; '<?xml version="1.0" encoding="iso-8859-15"?>';
var LOCALE = java.util.Locale.ENGLISH; var LOCALE = java.util.Locale.ENGLISH;
/** @ignore FIXME: JSDoc bug */
var write = function(str) { var write = function(str) {
return res.write(str); return res.write(str);
}; };

View file

@ -29,6 +29,7 @@
// Define the global namespace for Jala modules // Define the global namespace for Jala modules
if (!global.jala) { if (!global.jala) {
/** @namespace jala */
global.jala = {}; global.jala = {};
} }