=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-03-24 02:56:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-05-24 16:30:12 +0000
@@ -20,7 +20,7 @@
class="org.hisp.dhis.dataset.action.dataentryform.SelectDataElementAction">
Implements a sortable hashtable which accepts non-null
String
- * keys and non-null
values.
This object is primarily intended to address the shortcomings of using an - * Object as a hashtable, by managing the names of the properties which are - * stored in an Object.
- * - *HashTable does not define a hashing function, as Object's built-in - * hashing is used for storing and retrieving items.
- * - *Initial values are taken from any Objects passed into the constructor: - * if another HashTable is given as an argument, its contents will be taken.
- * - * @constructor - */ -var HashTable = function() -{ - /** - * Storage object - values are stored as properties whose names are hashtable - * keys. - * - * @type Object - * @private - */ - this._store = {}; - - /** - * A list of hashtable keys. - * - * @type Array - * @private - */ - this._keys = []; - - for (var i = 0; i < arguments.length; i++) - { - this._putFromObject(arguments[i]); - } -}; - -/** - * Puts all properties from a given HashTable or Object into the hashtable. - * - * @param {Object} source an object whose values will be put into the hashtable. - * @private - */ -HashTable.prototype._putFromObject = function(source) -{ - if (source.constructor == HashTable) - { - source.forEach(function(k, v) - { - this.put(k, v); - }, this); - } - else - { - for (property in source) - { - if (source.hasOwnProperty(property)) - { - this.put(property, source[property]); - } - } - } -}; - -/** - * Clears the hashtable. - */ -HashTable.prototype.clear = function() -{ - this._store = {}; - this._keys = []; -}; - -/** - * An iterator which calls the given function, passing key, value, item index and a - * reference to this Hashtable for each item in the hashtable. - * - * @param {Function} callback the function to be called for each item. - * @param {Object} context an optional context object for the calls to block. - * - * @see "Enumerating Javascript Objects", http://dean.edwards.name/weblog/2006/07/enum/ - */ -HashTable.prototype.forEach = function(callback, context) -{ - for (var i = 0, l = this._keys.length; i < l; i++) - { - callback.call(context, this._keys[i], this._store[this._keys[i]], i, this); - } -}; - -/** - * Retrieves the item with the given key. - * - * @param {String} key the key for the item to be retrieved. - * @return the item stored in this HashTable with the given key if one exists, - *null
otherwise.
- */
-HashTable.prototype.get = function(key)
-{
- var result = null;
- if (typeof(this._store[key]) != "undefined")
- {
- result = this._store[key];
- }
- return result;
-};
-
-/**
- * Determines if the hashtable contains the given key.
- *
- * @param {String} key the key to be searched for.
- * @return true
if this HashTable contains the given key,
- * false
otherwise.
- * @type Boolean
- */
-HashTable.prototype.hasKey = function(key)
-{
- var result = false;
- this.forEach(function(k)
- {
- if (key == k)
- {
- result = true;
- return true;
- }
- });
- return result;
-};
-
-/**
- * Determines if the hashtable contains the given value.
- *
- * @param {Object} value the value to be searched for.
- * @return true
if this HashTable contains the given value,
- * false
otherwise.
- * @type Boolean
- */
-HashTable.prototype.hasValue = function(value)
-{
- var result = false;
- this.forEach(function(k, v)
- {
- if (value == v)
- {
- result = true;
- return true;
- }
- });
- return result;
-};
-
-/**
- * Creates Object representations of the items in the hashtable.
- *
- * @return the items in the hashtable, represented as Objects with "key"
- * and "value" properties.
- * @type Array
- */
-HashTable.prototype.items = function()
-{
- var items = [];
- this.forEach(function(k, v)
- {
- items.push({"key": k, "value": v});
- });
- return items;
-};
-
-/**
- * Retrieves the hashtable's keys.
- *
- * @return the hashtable's keys.
- * @type Array
- */
-HashTable.prototype.keys = function()
-{
- var keys = [];
- this.forEach(function(key)
- {
- keys.push(key);
- });
- return keys;
-};
-
-/**
- * Puts an item into the hashtable.
- *
- * @param {String} key the key under which the item should be stored.
- * @param {Object} value the item to be stored.
- */
-HashTable.prototype.put = function(key, value)
-{
- if (key == undefined || key == null || typeof(key) != "string"
- || value == undefined || value == null)
- {
- return;
- }
-
- if (typeof(this._store[key]) == "undefined")
- {
- this._keys.push(key);
- }
-
- this._store[key] = value;
-};
-
-/**
- * Removes an item from the hashtable and returns it.
- *
- * @param {String} key the key for the item to be removed.
- * @return the item which was removed, or null
if the item did not
- * exist.
- */
-HashTable.prototype.remove = function(key)
-{
- var result = null;
- for (var i = 0, l = this._keys.length; i < l; i++)
- {
- if (key == this._keys[i])
- {
- result = this._store[key];
- delete(this._store[key]);
- this._keys.splice(i, 1);
- break;
- }
- }
- return result;
-};
-
-/**
- * Determines the number of entries in the hashtable.
- *
- * @return the number of entries in this HashTable.
- * @type Number
- */
-HashTable.prototype.size = function()
-{
- return this._keys.length;
-};
-
-/**
- * Sorts the keys of the hashtable.
- *
- * @param {Function} comparator an optional function which will be used to sort
- * the keys - if not provided, they will be sorted
- * lexographically (in dictionary order).
- */
-HashTable.prototype.sort = function(comparator)
-{
- if (typeof(comparator) == "function")
- {
- this._keys.sort(comparator);
- }
- else
- {
- this._keys.sort();
- }
-};
-
-/**
- * Creates a String representation of the hashtable.
- *
- * @return a String representation of this {@link HashTable}.
- * @type String
- */
-HashTable.prototype.toString = function()
-{
- var result = "{";
- this.forEach(function(key, value, index)
- {
- if (index != 0)
- {
- result += ", ";
- }
- result += key + ": " + value;
- });
- result += "}";
- return result;
-};
-
-/**
- * Updates the hashtable with the values contained in a given {@link HashTable}
- * or Object.
- *
- * @param {Object} source an object whose values will be put into the hashtable.
- */
-HashTable.prototype.update = function(source)
-{
- this._putFromObject(source);
-};
-
-/**
- * Retrieves the hashtable's values.
- *
- * @return the hashtable's values.
- * @type Array
- */
-HashTable.prototype.values = function()
-{
- var values = [];
- this.forEach(function(key, value)
- {
- values.push(value);
- });
- return values;
-};
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/request.js 1970-01-01 00:00:00 +0000
@@ -1,199 +0,0 @@
-
-// -----------------------------------------------------------------------------
-// Author: Torgeir Lorange Ostby, torgeilo@gmail.com
-// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
-// -----------------------------------------------------------------------------
-
-/*
- * Usage:
- *
- * function processResponse( response ) { ... } // Text or XML
- * function requestFailed( httpStatusCode ) { ... }
- *
- * var request = new Request();
- * request.setResponseTypeXML( 'rootElement' ); // Optional
- * request.sendAsPost( 'value=1&value=2' ); // Optional
- * request.setCallbackSuccess( processResponse ); // Optional
- * request.setCallbackError( requestFailed ); // Optional
- * request.send( 'url.action?value=1' );
- */
-
-function Request()
-{
- var request;
- var responseType = 'TEXT';
- var requestMethod = 'GET';
- var requestParameters = null;
- var rootElementName;
- var callbackSuccess;
- var callbackError;
-
- this.setResponseTypeXML = function( rootElementName_ )
- {
- responseType = 'XML';
- rootElementName = rootElementName_;
- };
-
- this.sendAsPost = function( requestParameters_ )
- {
- requestMethod = 'POST';
- requestParameters = requestParameters_;
- };
-
- this.setCallbackSuccess = function( callbackSuccess_ )
- {
- callbackSuccess = callbackSuccess_;
- };
-
- this.setCallbackError = function( callbackError_ )
- {
- callbackError = callbackError_;
- };
-
- this.send = function( url )
- {
- request = newXMLHttpRequest();
-
- if ( !request )
- {
- window.alert( "Your browser doesn't support XMLHttpRequest" );
- return;
- }
-
- request.onreadystatechange = responseReceived;
- request.open( requestMethod, url, true );
- request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
- request.send( requestParameters );
- };
-
- function newXMLHttpRequest()
- {
- if ( window.XMLHttpRequest )
- {
- try
- {
- return new XMLHttpRequest();
- }
- catch ( e )
- {
- return false;
- }
- }
- else if ( window.ActiveXObject )
- {
- try
- {
- return new ActiveXObject( 'Msxml2.XMLHTTP' );
- }
- catch ( e )
- {
- try
- {
- return new ActiveXObject( 'Microsoft.XMLHTTP' );
- }
- catch ( ee )
- {
- return false;
- }
- }
- }
-
- return false;
- }
-
- function responseReceived()
- {
- if ( request.readyState == 4 )
- {
- switch( request.status )
- {
- case 200:
- if ( callbackSuccess )
- {
- if ( responseType == 'TEXT' )
- {
- callbackSuccess( request.responseText );
- }
- else
- {
- var xml = textToXML( request.responseText, rootElementName );
-
- callbackSuccess( xml );
- }
- }
- break;
- case 204:
- if ( callbackSuccess )
- {
- callbackSuccess( null );
- }
- break;
- case 500:
- var message = 'Operation failed - internal server error';
-
- var serverMessage = request.responseText;
-
- if ( serverMessage )
- {
- var maxLength = 512;
-
- if ( serverMessage.length > maxLength )
- {
- serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
- }
-
- if ( serverMessage.length > 0 )
- {
- message += '\n\n' + serverMessage;
- }
- }
-
- message += '\n\nThe error details are logged';
-
- window.alert( message );
-
- break;
- default:
- if ( callbackError )
- {
- callbackError( request.status );
- }
- }
- }
- }
-
- function textToXML( text, rootElementName )
- {
- var docImpl = document.implementation;
- var parser, dom;
-
- // For standards compliant browsers
- if ( docImpl && docImpl.createLSParser )
- {
- parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
- var input = docImpl.createLSInput();
- input.stringData = text;
- return parser.parse( input ).documentElement;
- }
-
- // For IE
- else if ( window.ActiveXObject )
- {
- dom = new ActiveXObject( 'Microsoft.XMLDOM' );
- dom.async = "false";
- dom.loadXML( text );
- return dom.getElementsByTagName( rootElementName )[0];
- }
-
- // For Mozilla
- else if ( window.DOMParser )
- {
- parser = new DOMParser();
- dom = parser.parseFromString( text, 'application\/xml' );
- return dom.documentElement;
- }
-
- // No parsing abilities
- return null;
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2009-11-03 09:05:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/sortOrderSection.vm 2010-05-21 16:16:11 +0000
@@ -1,7 +1,7 @@