added explanations regarding the usage of these optional repositories and added docs for helma.Image
This commit is contained in:
parent
c17e1df282
commit
e4d04f1db0
25 changed files with 146 additions and 6 deletions
|
@ -16,6 +16,10 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Adds useful methods to the JavaScript Array type.
|
* @fileoverview Adds useful methods to the JavaScript Array type.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/core/Array.js')
|
||||||
|
*
|
||||||
* @addon
|
* @addon
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Adds useful methods to the JavaScript Date type.
|
* @fileoverview Adds useful methods to the JavaScript Date type.
|
||||||
|
* <br /><br />
|
||||||
|
* 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.ONESECOND = 1000;
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Implements some useful macro filters.
|
* @fileoverview Implements some useful macro filters.
|
||||||
|
* <br /><br />
|
||||||
|
* 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');
|
app.addRepository('modules/core/String.js');
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
* $Date$
|
* $Date$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileoverview Adds useful global macros.
|
||||||
|
* <br /><br />
|
||||||
|
* 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");
|
app.addRepository("modules/core/String.js");
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
* $Date$
|
* $Date$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileoverview Adds useful methods to Helma's built-in HopObject prototype.
|
||||||
|
* <br /><br />
|
||||||
|
* 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/Number.js");
|
||||||
app.addRepository("modules/core/String.js");
|
app.addRepository("modules/core/String.js");
|
||||||
|
|
21
core/JSON.js
21
core/JSON.js
|
@ -14,6 +14,12 @@
|
||||||
* $Date$
|
* $Date$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileoverview Adds JSON methods to the Object, Array and String prototypes.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/core/JSON.js')
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
json.js
|
json.js
|
||||||
|
@ -49,6 +55,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
s = {
|
s = {
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
array: function (x) {
|
array: function (x) {
|
||||||
var a = ['['], b, f, i, l = x.length, v;
|
var a = ['['], b, f, i, l = x.length, v;
|
||||||
for (i = 0; i < l; i += 1) {
|
for (i = 0; i < l; i += 1) {
|
||||||
|
@ -77,10 +86,16 @@
|
||||||
return "null";
|
return "null";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
number: function (x) {
|
number: function (x) {
|
||||||
return isFinite(x) ? String(x) : 'null';
|
return isFinite(x) ? String(x) : 'null';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
object: function (x) {
|
object: function (x) {
|
||||||
if (x) {
|
if (x) {
|
||||||
if (x instanceof Array) {
|
if (x instanceof Array) {
|
||||||
|
@ -107,6 +122,9 @@
|
||||||
return 'null';
|
return 'null';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
string: function (x) {
|
string: function (x) {
|
||||||
if (/["\\\x00-\x1f]/.test(x)) {
|
if (/["\\\x00-\x1f]/.test(x)) {
|
||||||
x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
|
x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
|
||||||
|
@ -127,6 +145,7 @@
|
||||||
/**
|
/**
|
||||||
* This method produces a JSON text from an object.
|
* This method produces a JSON text from an object.
|
||||||
* The object must not contain any cyclical references.
|
* The object must not contain any cyclical references.
|
||||||
|
* @ignore
|
||||||
*/
|
*/
|
||||||
Object.prototype.toJSON = function () {
|
Object.prototype.toJSON = function () {
|
||||||
return s.object(this);
|
return s.object(this);
|
||||||
|
@ -135,6 +154,7 @@
|
||||||
/**
|
/**
|
||||||
* This method produces a JSON text from an array.
|
* This method produces a JSON text from an array.
|
||||||
* The array must not contain any cyclical references.
|
* The array must not contain any cyclical references.
|
||||||
|
* @ignore
|
||||||
*/
|
*/
|
||||||
Array.prototype.toJSON = function () {
|
Array.prototype.toJSON = function () {
|
||||||
return s.array(this);
|
return s.array(this);
|
||||||
|
@ -149,6 +169,7 @@
|
||||||
/**
|
/**
|
||||||
* This method parses a JSON text to produce an object or
|
* This method parses a JSON text to produce an object or
|
||||||
* array. It will return false if there is an error.
|
* array. It will return false if there is an error.
|
||||||
|
* @ignore
|
||||||
*/
|
*/
|
||||||
String.prototype.parseJSON = function () {
|
String.prototype.parseJSON = function () {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Adds useful methods to the JavaScript Number type.
|
* @fileoverview Adds useful methods to the JavaScript Number type.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/core/Number.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Adds useful methods to the JavaScript Object type.
|
* @fileoverview Adds useful methods to the JavaScript Object type.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/core/Object.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,6 +32,9 @@ String.NULL = String.EMPTY; // to be deprecated?
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Adds useful methods to the JavaScript String type.
|
* @fileoverview Adds useful methods to the JavaScript String type.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/core/String.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
* $Date$
|
* $Date$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileoverview Methods of the helma.Aspects module.
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
* Define the global namespace if not existing
|
||||||
|
|
3
helma/Chart.js
vendored
3
helma/Chart.js
vendored
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Chart prototype
|
* @fileoverview Fields and methods of the helma.Chart prototype
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// take care of any dependencies
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Chart prototype
|
* @fileoverview Fields and methods of the helma.Chart prototype
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// take care of any dependencies
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Properties and methods of the helma.Database prototype.
|
* @fileoverview Properties and methods of the helma.Database prototype.
|
||||||
|
* <br /><br />
|
||||||
|
* 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) {
|
if (!global.helma) {
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Default properties and methods of
|
* @fileoverview Default properties and methods of the File prototype.
|
||||||
* the File prototype.
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/File.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Default properties and methods of
|
* @fileoverview Default properties and methods of the FtpClient prototype.
|
||||||
* the FtpClient prototype.
|
* <br /><br />
|
||||||
|
* 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
|
// requires helma.File
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview A JavaScript library wrapping
|
* @fileoverview A JavaScript library wrapping
|
||||||
* Packages.helma.extensions.helmagroups
|
* Packages.helma.extensions.helmagroups
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// Define the global namespace if not existing
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Html
|
* @fileoverview Fields and methods of the helma.Html
|
||||||
* and helma.Html.Tablewriter classes.
|
* and helma.Html.Tablewriter classes.
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// take care of any dependencies
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Http class.
|
* @fileoverview Fields and methods of the helma.Http class.
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// take care of any dependencies
|
||||||
|
|
|
@ -14,11 +14,37 @@
|
||||||
* $Date$
|
* $Date$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileoverview Methods of the helma.Image module.
|
||||||
|
* <br /><br />
|
||||||
|
* 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) {
|
if (!global.helma) {
|
||||||
global.helma = {};
|
global.helma = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an Image object, generated from the specified source.
|
||||||
|
* <br /><br />
|
||||||
|
* 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 <code>imageGenerator</code>
|
||||||
|
* 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) {
|
helma.Image = function(arg) {
|
||||||
// according to
|
// according to
|
||||||
// http://grazia.helma.org/pipermail/helma-dev/2004-June/001253.html
|
// http://grazia.helma.org/pipermail/helma-dev/2004-June/001253.html
|
||||||
|
@ -26,12 +52,20 @@ helma.Image = function(arg) {
|
||||||
return generator.createImage(arg);
|
return generator.createImage(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @ignore */
|
||||||
helma.Image.toString = function() {
|
helma.Image.toString = function() {
|
||||||
return "[helma.Image]";
|
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) {
|
helma.Image.getInfo = function(arg) {
|
||||||
if (arguments.length != 1) {
|
if (arguments.length != 1) {
|
||||||
throw new java.lang.IllegalArgumentException(
|
throw new java.lang.IllegalArgumentException(
|
||||||
|
@ -92,13 +126,18 @@ helma.Image.getInfo = function(arg) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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() {
|
helma.Image.spacer = function() {
|
||||||
res.contentType = "image/gif";
|
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]);
|
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;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
helma.lib = "Image";
|
helma.lib = "Image";
|
||||||
helma.dontEnum(helma.lib);
|
helma.dontEnum(helma.lib);
|
||||||
for (var i in helma[helma.lib])
|
for (var i in helma[helma.lib])
|
||||||
|
@ -106,3 +145,6 @@ for (var i in helma[helma.lib])
|
||||||
for (var i in helma[helma.lib].prototype)
|
for (var i in helma[helma.lib].prototype)
|
||||||
helma[helma.lib].prototype.dontEnum(i);
|
helma[helma.lib].prototype.dontEnum(i);
|
||||||
delete helma.lib;
|
delete helma.lib;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Mail class.
|
* @fileoverview Fields and methods of the helma.Mail class.
|
||||||
|
* <br /><br />
|
||||||
|
* 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
|
// take care of any dependencies
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Search class
|
* @fileoverview Fields and methods of the helma.Search class
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/Search.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// take care of any dependencies
|
// take care of any dependencies
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Skin class.
|
* @fileoverview Fields and methods of the helma.Skin class.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/Skin.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Ssh class.
|
* @fileoverview Fields and methods of the helma.Ssh class.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/Ssh.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// take care of any dependencies
|
// take care of any dependencies
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Url class.
|
* @fileoverview Fields and methods of the helma.Url class.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/Url.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!global.helma) {
|
if (!global.helma) {
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview Fields and methods of the helma.Zip class.
|
* @fileoverview Fields and methods of the helma.Zip class.
|
||||||
|
* <br /><br />
|
||||||
|
* To use this optional module, its repository needs to be added to the
|
||||||
|
* application, for example by calling app.addRepository('modules/helma/Zip.js')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// take care of any dependencies
|
// take care of any dependencies
|
||||||
|
|
Loading…
Add table
Reference in a new issue