{"core/event/ErrorEvent.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,1,9,9,9,null,null,null,null,null,null,null,1,2,2,22,12,null,null,2,2,null,null,null,null,1,1],"source":["var Event = require('./Event.js').Event;","var Class = require(\"../../mootools/mootools-node.js\").Class;","","/**"," * @class ErrorEvent"," * @extends Event"," * @requires Class"," * @requires Event"," *"," * @param {String} type"," * @param {Object} data"," * @param {Number} code"," * @param {String} message"," */","var ErrorEvent = function() {","    ","    /** @ignore */","\tthis.Extends = Event;","","    /**","     * Error code.","     * @public","     * @type {Number}","     */","\tthis.code = 0;","","    /**","     * Error message.","     * @public","     * @type {String} ","     */","\tthis.message = null;","","","    /** @ignore */","\tthis.initialize = function(type, data, code, message) {","\t\tthis.parent(type, data);","\t\tthis.code = code;","\t\tthis.message = message;","\t};","","","    /**","     * Displays error as html content","     * @return {String}","     */","    this.toHtmlString = function(){","        var retVal = \"&lt;pre&gt;\";","        for(el in this){","            if(this.hasOwnProperty(el) &amp;&amp; typeof this[el]!='function' ){","                retVal+=\"\\t\" + el+': '+this[el]+\"\\n\";","            }","        }","        retVal += \"&lt;/pre&gt;\";","        return retVal;","    };","    ","};","","ErrorEvent = new Class(new ErrorEvent());","exports.ErrorEvent = ErrorEvent;",null]},"core/event/Event.js":{"coverage":[null,1,null,null,null,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,1,108,108,108,null,null,null,1,1],"source":["var Class = require('../../../lib/mootools/mootools-node.js').Class;","","/**"," * @class Event"," * @requires Class"," * "," * @param {String} type"," * @param {Object} data"," * @param {EventDispatcher} target","  */","var Event = function(){","","    /**","     * @property {String} type","     */","    this.type = undefined;","","    /**","     * @property {EventDispatcher} target","     */","    this.target = null;","","    /**","     * @property {Object} data","     */","    this.data = null;","","    /** @ignore */","    this.initialize = function(type, data, target){","        this.type = type;","        this.data = data;","        this.target = target;","    };","};","","Event = new Class(new Event());","exports.Event = Event;",null]},"core/event/EventDispatcher.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,null,1,283,114,null,169,null,null,null,null,null,null,null,1,null,178,178,178,null,178,156,null,null,null,178,25,1,null,null,null,null,177,null,177,null,null,null,null,null,null,1,92,null,85,85,null,null,null,null,99,null,null,85,100,100,100,99,null,null,1,null,null,null,null,null,null,null,null,null,null,1,4,4,1,null,3,2,null,3,2,1,null,null,1,null,2,null,1,null,null,null,null,null,null,1,3,2,1,1,null,null,1,null,null,null,1,1,1,null,null,null,null,1,1],"source":["var Event = require('./Event.js').Event;","var Class = require(\"../../mootools/mootools-node.js\").Class;","","/**"," * EventDispatcher"," * @class EventDispatcher provides listening and dispatching events functionality"," * @requires Class"," * @requires Event"," */","var EventDispatcher = function() {","","    /**","     * @property {Object} _eventsArray","     * @private","     */","    this._eventsArray = new Object();","","    /**","     * Checks if given event type listener is registered","     * @param {String} type Event type","     * @returns {Boolean} True if listener of given type is registered ","     */","    this.hasEventListener = function(type) {","        if (this._eventsArray.hasOwnProperty(type) &amp;&amp; this._eventsArray[type].length &gt; 0){","            return true;","        }","        return false;","    };","","    /**","     * Adding listener","     * @param {String} type Event type","     * @param {Function} callbackFunction Function that will be called if event of givent type will ocurr. ","     */","    this.addEventListener = function(type, callbackFunction, context){","        //creating new listener object","        var listener = new Object();","        listener.callbackFunction = callbackFunction;","        listener.context = (context) ? context : this;","        //creating space for listeners of given type","        if (!this.hasEventListener(type)){","            this._eventsArray[type] = new Array();","        }","        ","        //check if given listener is arledy added.","        for(var i = 0, l = this._eventsArray[type].length; i &lt; l; i++){","            if(this._eventsArray[type][i].callbackFunction == callbackFunction &amp;&amp; this._eventsArray[type][i].context == context){","                return false;","            }","        }","        ","        //adding listener","        this._eventsArray[type].push(listener);","","        return this;","    };","","    /**","     * Dispatches event","     * @param {Event} e Event object to be dispatched","     */","    this.dispatchEvent = function(e) {","        if (this.hasEventListener(e.type)) {","            //creating private function to pass listener by value otherwise nextTick oparates on last loop iteration variables states ","            var that = this;","            var callLater = function(listener) {                ","                //passing script execution to end of script execution queue","                //different in client \"window.setTimeout\"","                //process.nextTick( function(){","                //setTimeout( function(){ ","                    listener.callbackFunction.call(listener.context, e);","                //}, 0);","            };","            for (var i = 0; i &lt; this._eventsArray[e.type].length; i++) {","                e.target = this;","                var listener = this._eventsArray[e.type][i];","                if ( listener.callbackFunction != undefined ){","                    callLater(listener);","                }","                else{","                    throw \"Callback function for Event type: [ \" + e.type + \" ] is undefined. Please check your addEventListener statement.\";","                }","            }","        }","    };","","    /**","     * Remove listener","     * @param {String} type Event type","     * @param {Function} callbackFunction Function that was given on adding event listener. ","     */","    this.removeEventListener = function(type, callbackFunction) {","        var i = 0;","        if (!this.hasEventListener(type)){","            throw 'Listeners of given type: \"' + type + '\" do not exists.';","        }             ","        while(i &lt; this._eventsArray[type].length &amp;&amp; this._eventsArray[type][i].callbackFunction != callbackFunction) {","            i++;","        }","        if(i &lt; this._eventsArray[type].length){","            if(this._eventsArray[type].length &gt; 1){","                this._eventsArray[type].splice(i, 1);","            }","            else{","                delete this._eventsArray[type];","            }","            return true;","        }","        return false;","    };","","    /**","     * Remove group of listeners or all listeners","     * @param {String} type Event type if given removes all listeners of given type, otherwise removes all listeners. ","     */","    this.removeAllEventListeners = function(type) { ","        if(type != undefined){","            if(this.hasEventListener(type)){","                delete this._eventsArray[type];","                return true;","            }","            else{","                throw 'Listeners of given type: \"' + type + '\" do not exists.';","            }","        }","        else{","            delete this._eventsArray;","            this._eventsArray = new Object();","            return true;","        }","    };","};","","EventDispatcher = new Class(new EventDispatcher());","exports.EventDispatcher = EventDispatcher;",null]},"core/opal/OpalLoader.js":{"coverage":[null,1,1,1,1,1,1,null,null,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,1,12,null,null,null,null,null,null,null,1,4,null,4,1,1,1,1,null,null,3,3,3,null,3,null,null,null,null,null,null,null,null,1,6,6,1,1,null,null,null,null,null,null,null,1,5,null,null,null,null,null,null,1,3,null,3,3,null,1,1,null,null,2,1,1,null,null,1,null,null,null,null,null,null,null,1,9,9,null,null,null,null,null,null,1,7,null,null,null,null,null,null,1,26,1,25,6,null,null,null,null,null,null,null,1,7,null,7,1,null,null,6,null,6,null,null,null,null,null,null,4,null,1,1,null,null,6,6,null,6,null,null,null,1,1,1,1],"source":["var http = require('http');","var OpalRequest = require('./OpalRequest.js').OpalRequest;","var Event = require('../../../lib/core/event/Event.js').Event;","var ErrorEvent = require('../../../lib/core/event/ErrorEvent.js').ErrorEvent;","var EventDispatcher = require('../../../lib/core/event/EventDispatcher.js').EventDispatcher; ","var Class = require('../../../lib/mootools/mootools-node.js').Class;","","/**"," * @class OpalLoader"," * @extends EventDispatcher"," * @requires Class"," * @requires OpalRequest"," * @requires Event"," * @requires ErrorEvent"," * @requires EventDispatcher"," * @requires http"," *"," * @param {OpalRequest} request"," */","var OpalLoader = function(){","","    /** @ignore */","    this.Extends = EventDispatcher;","","","    /**","     * @property {Object} data","     */","    this.data = {};","    ","    /**","     * @private","     * @property {Object} _chunks","     */","    this._chunks = [];","","     /**","     * @private","     * @property {Object} _request","     */","    this._request = null;","","     /**","     * @private","     * @property {Number} _timeout","     */","    this._timeout = 15000;","","     /**","     * @private","     * @property {Object} _timer","     */","    this._timer = null;","    ","","    /** @ignore */","    this.initialize = function(request){","        this.setRequest(request);","    };","","    /**","     * callback responsible for gathering response chunks","     * @private","     * @param {Server.HttpResponse} response","     */","    this._response = function(response){","        var self = this;","","        if(response.statusCode !== 200){","            this._clearTimer();","            var event = new ErrorEvent(OpalLoader.ERROR, response.statusCode, -2, 'Wrong HTTP status code');","            this.dispatchEvent(event);","            return;","        }","","        response.setEncoding('utf8');","        response.addListener('data', function(chunk){","            self._chunks.push(chunk);","        }).addListener('end', function(){","            self._onEnd();","        });","    };","","    /**","     * sets timer who is responsible for timeout detection","     * @private","     * @param {Server.HttpRequest} request","     */","    this._setTimer = function(request){","        var self = this;","        this._timer = setTimeout(function(){","            request.removeAllListeners('response');","            self.dispatchEvent(new ErrorEvent(OpalLoader.ERROR, null, -4, 'Http response timeout'));","        }, this.getTimeout());","    };","","    /**","     * clears timer handle that is responsible for timeout detection","     * @private","     */","    this._clearTimer = function(){","        clearTimeout(this._timer);","    };","","    /**","     * called on request end, when whole data is retreived from server","     * @private","     */","    this._onEnd = function(){","        this._clearTimer();","","        try {","            this._data = JSON.parse(this._chunks.join(''));","        } catch(err) {","            this.dispatchEvent(new ErrorEvent(OpalLoader.ERROR, {json: this._chunks.join(''), error: err.message}, -3, 'JSON parse error'));","            return;","        }","","        if(this._data.hasOwnProperty('error')) {","            this.dispatchEvent(new ErrorEvent(OpalLoader.ERROR, null, this._data.error.code, this._data.error.message));","            return;","        }","","        this.dispatchEvent(new Event(OpalLoader.LOADED, this._data.result));","    };","","","    /**","     * sets timeout in miliseconds","     * @param {Number} ms","     */","    this.setTimeout = function(ms){","        this._timeout = ms;","        return this;","    };","","    /**","     * gets timeout in miliseconds","     * @returns {Number}","     */","    this.getTimeout = function(){","        return this._timeout;","    };","","    /**","     * sets request object to process","     * @param {OpalRequest} request","     */","    this.setRequest = function(request){","        if(request &amp;&amp; !(request instanceof OpalRequest)){","            throw 'Given request is not a instance of OpalRequest';","        } else if(request) {","            this._request = request;","        }        ","    };","","    /**","     * makes request to the backend system based on the request object","     * @param {OpalRequest} request","     */","    this.load = function(request){","        this.setRequest(request);","        ","        if(this._request == null){","            throw new Error('Request has not been set');","        }","","        var self = this;","        ","        var request = http.request({","            host: this._request.getGatewayHost(),","            port: this._request.getGatewayPort(),","            path: this._request.getUrl(),","            method: this._request.getMethod(),","            headers: this._request.getHeaders()","        }, function(response){","            self._response(response);","        }).addListener('error', function(e){","            self._clearTimer();","            self.dispatchEvent(new ErrorEvent(OpalLoader.ERROR, e, -1, 'Http request error'));","        });","","        request.write(this._request.getData());","        request.end();","","        this._setTimer(request);","    };","};","","OpalLoader = new Class(new OpalLoader());","OpalLoader.LOADED = \"OpalLoader_LOADED\";","OpalLoader.ERROR = \"OpalLoaded_ERROR\";","exports.OpalLoader = OpalLoader;",null]},"core/opal/OpalRequest.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,1,19,1,null,null,18,null,null,18,null,18,1,1,null,17,17,null,null,18,18,null,18,10,null,8,null,null,18,null,null,null,null,null,null,18,null,18,null,null,null,null,null,null,null,null,1,19,null,19,null,null,null,null,null,null,1,3,null,null,null,null,null,null,null,1,19,null,19,null,null,null,null,null,null,1,2,null,null,null,null,null,null,null,null,1,19,null,19,null,null,null,null,null,null,null,1,40,null,null,null,null,null,null,null,1,27,null,27,null,null,null,null,null,null,1,10,null,null,null,null,null,null,null,null,1,19,null,19,null,null,null,null,null,null,null,1,10,null,null,null,1],"source":["var Class = require('../../mootools/mootools-node.js').Class;","var UrlRequest = require('./UrlRequest.js').UrlRequest;","","/**"," * @class OpalRequest"," * @extends UrlRequest"," * @requires Class"," * @requires UrlRequest"," *"," */","var OpalRequest = function(){","    ","    /** @ignore */","    this.Extends = UrlRequest;","","    /**","     * @private","     * @property {String} _remoteMethod","     */","    this._remoteMethod = null;","","    /**","     * @private","     * @property {Object} _gateway","     */","    this._gateway = {host: null, port: 80};","","    /** @ignore */","    this.initialize = function(data){","        if(!data.hasOwnProperty('url') || !data.hasOwnProperty('params') || !data.hasOwnProperty('method')){","            throw new Error('Given request is incomplete');","        }","","        this.setHeaders({","            'Content-Type': 'application/json-rpc'","        });","        this.setGatewayHost(data.url);","","        if(data.url.substring(0, 8) == 'https://'){","            this.setGatewayPort(443);","            this.setHost(data.url.replace('https://', ''));","        }else{","            this.setGatewayPort(80);","            this.setHost(data.url.replace('http://', ''));","        }","","        this.setRemoteMethod(data.method);","        this.setMethod(UrlRequest.POST);","","        if(data.hasOwnProperty('application')){","            this.setApplication(data.application);","        }else{","            this.setApplication('localhost.front.onetapi.pl');","        }","","        var data = JSON.stringify({","            'jsonrpc': '2.0',","            'id': this.getRemoteMethod() + '-' + +new Date(),","            'method': this.getRemoteMethod(),","            'params': data.params","        });","        ","        this.setData(data);","","        this.setHeaders('Content-Length', data.length);","        //this.setHeaders('X-Onet-Cache', 'refresh');","    };","","    /**","     * sets hostname of a service endpoint","     * @param {String} host","     * @returns {OpalRequest}","     */","    this.setHost = function(host){","        this.setHeaders('Host', host);","","        return this;","    };","","    /**","     * returns hostname of a service endpoint","     * @returns {OpalRequest}","     */","    this.getHost = function(){","        return this.getHeaders()['Host'];","    };","","    /**","     * sets the application ident string","     * @param {String} app","     * @returns {OpalRequest}","     */","    this.setApplication = function(app){","        this.setHeaders('X-Onet-App', app);","","        return this;","    };","","    /**","     * returns application ident string","     * @returns {OpalRequest}","     */","    this.getApplication = function(){","        return this.getHeaders()['X-Onet-App'];","    };","","","    /**","     * sets method of communicating with a service","     * @param {String} method","     * @returns {OpalRequest}","     */","    this.setRemoteMethod = function(method){","        this._remoteMethod = method;","","        return this;","    };","","    /**","     * returns method of communicating with a service","     * ","     * @returns {OpalRequest}","     */","    this.getRemoteMethod = function(){","        return this._remoteMethod;","    };","","    /**","     * sets host that will handle request transmission","     * @param {String} host","     * @returns {OpalRequest}","     */","    this.setGatewayHost = function(host){","        this._gateway.host = host;","","        return this;","    };","","    /**","     * returns host that will handle request transmission","     * @returns {OpalRequest}","     */","    this.getGatewayHost = function(){","        return this._gateway.host;","    };","","    /**","     * sets the port of a gateway host","     *","     * @param {Number} port","     * @returns {OpalRequest}","     */","    this.setGatewayPort = function(port){","        this._gateway.port = port;","","        return this;","    };","","    /**","     * gets the port of a gateway host","     * ","     * @returns {Number}","     */","    this.getGatewayPort = function(){","        return this._gateway.port;","    };","};","","exports.OpalRequest = new Class(new OpalRequest());",null]},"core/opal/UrlRequest.js":{"coverage":[null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,1,7,7,null,null,null,null,null,null,null,null,null,1,1,null,1,null,null,null,null,null,null,null,1,8,null,null,null,null,null,null,null,null,1,20,null,20,null,null,null,null,null,null,null,1,9,null,null,null,null,null,null,null,null,null,null,null,null,1,76,57,19,19,null,null,76,null,null,null,null,null,null,1,13,null,null,null,null,null,null,null,1,19,null,19,null,null,null,null,null,null,1,8,null,null,null,1,1,1,null,1],"source":["var Class = require('../../mootools/mootools-node.js').Class;","","/**"," * @class UrlRequest"," * @requires Class"," *"," * @param {String} url"," */","var UrlRequest = function(){","","    /**","     * @private","     * @property {String} _url","     */","    this._url = '/';","","    /**","     * @private","     * @property {String} _method","     */","    this._method = 'GET';","","    /**","     * @private","     * @property {Object} _headers","     */","    this._headers = {};","","    /**","     * @private","     * @property {Object} _data","     */","    this._data = {};","    ","    /** @ignore */","    this.initialize = function(url){","        if(url){","            this._url = url;","        }","    };","","    /**","     * sets url of a service endpoint","     *","     * @param {String} url","     * @returns {UrlRequest}","     */","    this.setUrl = function(url){","        this._url = url;","","        return this;","    };","","    /**","     * returns url of a service endpoint","     *","     * @returns {String}","     */","    this.getUrl = function(){","        return this._url;","    };","","    /**","     * sets method of communicating with a service","     *","     * @param {String} method","     * @returns {UrlRequest}","     */","    this.setMethod = function(method){","        this._method = method;","","        return this;","    };","","    /**","     * returns method of communicating with a service","     *","     * @returns {String}","     */","    this.getMethod = function(){","        return this._method;","    };","","    /**","     * sets request headers","     * could be Object with key/value pais or","     * two String Objects first with a header name, second with the header value","     *","     * @param {String} headerName","     * @param {String} headerValue","     * @param {Object} headers","     * @returns {UrlRequest}","     */","    this.setHeaders = function(){","        if(arguments.length == 2){","            this._headers[arguments[0]] = arguments[1];                ","        } else if (typeof arguments[0] == 'object'){","            this._headers = arguments[0];","        }","","        return this;","    };","","    /**","     * returns headers value pair object","     * @returns {Object}","     */","    this.getHeaders = function(){","        return this._headers;","    };","","    /**","     * sets the data or parameters that will be sent to service","     * @param {Object} data","     * @returns {Object}","     */","    this.setData = function(data){","        this._data = data;","","        return this;            ","    };","","    /**","     * returns data or parameters that will be sent to service","     * @returns {Object}","     */","    this.getData = function(){","        return this._data;","    };","};","","UrlRequest = new Class(new UrlRequest());","UrlRequest.POST = \"POST\";","UrlRequest.GET = \"GET\";","","exports.UrlRequest = UrlRequest;",null]},"RenderingController.js":{"coverage":[null,1,1,1,1,1,1,1,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,1,22,8,null,14,14,14,14,null,null,null,null,null,null,null,null,1,8,8,8,8,8,8,null,8,null,null,null,null,null,null,null,null,null,1,0,null,null,null,null,null,null,null,null,null,1,23,null,23,3,3,null,2,null,null,1,null,null,20,null,null,20,null,null,null,null,null,null,1,null,13,null,null,13,1,1,null,null,12,null,null,12,null,12,12,null,null,12,24,null,null,24,24,null,1,null,null,23,null,23,null,20,20,null,20,null,null,null,9,null,null,null,null,null,null,1,12,12,12,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","var Event = require('../lib/core/event/Event.js').Event;","var ErrorEvent = require('../lib/core/event/ErrorEvent.js').ErrorEvent;","var EventDispatcher = require('../lib/core/event/EventDispatcher.js').EventDispatcher;","var DriverManager = require('../lib/DriverManager.js').DriverManager;","var DriverLocal = require('../lib/DriverManager.js').DriverLocal;","var DriverAbstract = require('../lib/DriverAbstract.js').DriverAbstract;","var TemplateManager = require('../lib/TemplateManager.js').TemplateManager;","","","/**"," * @class RenderingController Responsible for holding and parsing configuration."," * @extends EventDispatcher"," * @requires Class "," * @requires Event "," * @requires ErrorEvent "," * @requires EventDispatcher "," * @requires DriverManager "," * @requires DriverAbstract "," * @requires TemplateManager"," * @param {Object} configuration Rendering configuration"," * @throws {RenderingController.Exception.WRONG_CONFIGURATION} if given configuration isn't valid - is null or is'nt {@link Object} or {@link Array}."," */","","var RenderingController = function(){","    /** @ignore */","    this.Extends = EventDispatcher;","    /**","     * @property {DriverManager} _driverManager holds reference to driverManager","     * @private","     */","    this._driverManager = null;","    /**","     * @property {TemplateManager} _templateManagers holds references to templateManagers","     * @private","     */","    this._templateManagers = [];","    /**","     * @property {Object} _configuration holds the configuration","     * @private","     */","    this._configuration = null;","    /**","     * @property {Number} _counter holds number of rendered templateManager","     * @private","     */","    this._counter = 0;","","    /** @ignore */","    this.initialize = function(configuration){","        if(!configuration || typeof configuration != \"object\" || configuration.constructor != Array){","            throw RenderingController.Exception.WRONG_CONFIGURATION;","        }","        this._driverManager = new DriverManager();","        this._templateManagers = [];","        this._configuration = configuration;","        this._counter = 0;","    };","","    /**","     * callback dispatched when templateManager renders all of its templates","     * ","     * @param {Event} e","     * @private","     */","    this._onTemplateManagerRendered = function(e){","        this._counter++;","        if(this._counter == this._templateManagers.length){","            console.log('   -- RenderingController::onTemplateManagerRendered');","            var data = [];","            for( var i = 0; i &lt; this._templateManagers.length; i++){","                data.push(this._templateManagers[i].getTemplatesContent());","            }","            this.dispatchEvent(new Event(RenderingController.RENDERED, data));","        }","    };","","    /**","     * callback dispatched when an error occurs in templateManager rendering process","     * ","     * @param {ErrorEvent} e","     * @private","     */","    this._onTemplateManagerError = function(e){","        this.dispatchEvent(new ErrorEvent(RenderingController.ERROR, e));","    };","","    /**","     * wraps DriverManager.createDriver factory method,","     * creates proper instance of driver based on the given configuration","     * ","     * @param {Object} configItem Configuration of transformation rule ","     * @private","     */","    this._createDriver = function(configItem){","        var driver;","","        if(configItem.hasOwnProperty('#data')){","            var data = configItem['#data'];","            if(data.hasOwnProperty('driver')){","                //TODO make a call;","                driver = DriverManager.createDriver(data.driver, data);","            }","            else{","                throw RenderingController.Exception.NO_REMOTE_DRIVER;","            }","        }else{","            driver = DriverManager.createDriver('DriverLocal', configItem.data || {});","        }","","        return driver;","    };","    /**","     * Executing rendering flow. Creates {@link TemplateManager} instances, adds templates, creates drivers and fetches them","     * @public","     * @throws {RenderingController.Exception.NO_REMOTE_DRIVER} if given transformation rule has declared remote driver use &lt;i&gt;#data&lt;/i&gt; but no &lt;i&gt;driver&lt;/i&gt; field is declared.","     */","    this.render = function(){","","        var config = this._configuration;","","        // jezeli nie ma zadnych danych do renderingu zwroc blad","        if(!config.length){","            this.dispatchEvent(new ErrorEvent(RenderingController.ERROR, {}, -123, 'Empty template arguments'));","            return;","        }","","        console.log('   -- RenderingController::render');","","        // lece po wszystkich galeziach drzewa","        for( var i = 0, max = config.length; i &lt; max; i++ ){","            // tworze TemplateManagery dla kazdej z glownych galezi drzewa","            var manager = new TemplateManager();","            this.addTemplateManager(manager);","            ","            // lece po wszystkich itemach w danej galezi","            for(var name in config[i]){","                if(config[i].hasOwnProperty(name)){","","                    //sprawdzam czy obslugujemy podany templejt","                    try{","                        var template = TemplateManager.createTemplate(name, config[i][name]);","                    }catch(e){","                        continue;","                    }","","                    manager.addTemplate(template);","","                    var driver = this._createDriver(config[i][name]);","","                    driver.addEventListener(DriverAbstract.LOADED, template.onData, template);","                    driver.addEventListener(DriverAbstract.ERROR, template.onDataError, template);   ","","                    this._driverManager.addDriver(driver);","                }","            }","        }","        this._driverManager.fetch();","    };","    /**","     * Adds event listeners to the given templateManager and holds it","     * @public","     * @param {TemplateManager} manager ","     */","    this.addTemplateManager = function(manager){","        this._templateManagers.push(manager);","        manager.addEventListener(TemplateManager.RENDERED, this._onTemplateManagerRendered, this);","        manager.addEventListener(TemplateManager.ERROR, this._onTemplateManagerError, this);","        //TODO error event  ","    };","};","","RenderingController = new Class(new RenderingController());","/**"," * @static"," * @constant"," */","RenderingController.RENDERED = \"RenderingController_RENDERED\";","/**"," * @static"," * @constant"," */","RenderingController.ERROR = \"RenderingController_ERROR\";","/**"," * Namespace for exeptions messages."," * @static"," * @constant"," * @namespace"," */","RenderingController.Exception = {};","/**"," * @static"," * @constant"," */","RenderingController.Exception.WRONG_CONFIGURATION = 'Given configuration is not proper';","/**"," * @static"," * @constant"," */","RenderingController.Exception.NO_REMOTE_DRIVER = \"Remote data marker given but no driver specified!\";","","exports.RenderingController = RenderingController;",null]},"DriverManager.js":{"coverage":[null,1,null,1,null,null,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,1,26,25,27,1,null,null,null,24,24,null,null,1,null,null,null,null,null,null,null,1,10,22,null,null,null,null,1,null,null,null,null,null,null,null,null,null,null,1,null,26,26,23,23,23,null,3,null,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","","var DriverAbstract = require('../lib/DriverAbstract.js').DriverAbstract;","","/**"," * @class Driver Manager Responsible for managing drivers (creating, adding, fetching). "," * @requires Class"," * @requires DriverAbstract"," */","var DriverManager = function(){","","    /**","     * array of drivers to handle","     *","     * @type Array[DriverAbstract]","     * @private","     */","    this._drivers = [];","","    /**","     * Adds a driver to collection","     * @public","     * @param {DriverAbstract} driver Driver instance.","     * @throws {DriverManager.Exception.WRONG_INSTANCE} if given driver is not an instance of DriverAbstract class.","     * @returns {boolean} Returns {false} if given driver is arledy in collection otherwise returns {true}","     */","    this.addDriver = function(driver){","        if(driver instanceof DriverAbstract) {","            for(var i = 0, l = this._drivers.length; i &lt; l; i++){","                if(this._drivers[i] == driver){","                    return false;","                }","            }","","            this._drivers.push(driver);","            return true;","        }","        else {","            throw DriverManager.Exception.WRONG_INSTANCE;","        }","    };","","    /**","     * Loads model from each added driver. See: {@link DriverAbstract#load}","     * @public","     */","    this.fetch = function(){","        for(var i=0,max=this._drivers.length;i&lt;max;i++){","            this._drivers[i].load();","        }","    };","};","","DriverManager = new Class(new DriverManager());","","/**"," * Factory method - createing new drivers of given &lt;i&gt;driverClassName&lt;/i&gt;."," *"," * @static"," * @param {String} driverClassName Name of a driver class."," * @param mixed data Data passed to the driver's constructor"," * @return {DriverAbstract}"," * @throws {DriverManager.Exception.DRIVER_DOES_NOT_EXIST} if given driver class name cannot be resolved."," */","DriverManager.createDriver = function(driverClassName, data){","    //TODO przerbic domysln&#196;&#133; sciezke","    try{","        var driverLib = require('../lib/' + driverClassName);","        var DriverClass = driverLib[driverClassName];","        var driver = new DriverClass(data);","        return driver;","    }catch(e){","        throw DriverManager.Exception.DRIVER_DOES_NOT_EXIST;","    }","};","","/**"," * @constant"," * @static"," */","DriverManager.LOADED = \"DriverManager_LOADED\";","/**"," * @constant"," * @static"," */","DriverManager.ERROR = \"DriverManager_ERROR\";","","/**"," * Namespace for exeptions messages."," * @constant"," * @static"," * @namespace"," */","DriverManager.Exception = {};","/**"," * @constant"," * @static"," */","DriverManager.Exception.WRONG_INSTANCE = 'Driver must be instance of DriverAbstract class.';","/**"," * @constant"," * @static"," */","DriverManager.Exception.DRIVER_DOES_NOT_EXIST = 'Given driver does not exist';","","exports.DriverManager = DriverManager;",null]},"DriverAbstract.js":{"coverage":[null,1,null,1,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,1,1,null,null,null,null,null,1,1,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","","var EventDispatcher = require('../lib/core/event/EventDispatcher').EventDispatcher;","","/**"," * Abstract class - direct instance cannot be created."," * @class Providing simple interface of Driver's"," * @extends EventDispatcher"," * @throws {DriverAbstract.Exception.INITIALIZE_NOT_IMPLEMENTED}"," * @requires Class "," * @requires EventDispatcher"," */","var DriverAbstract = function(){","","    /** @ignore */","    this.Extends = EventDispatcher;","    ","    /** @ignore */","    this.initialize = function(){","        throw DriverAbstract.Exception.INITIALIZE_NOT_IMPLEMENTED;  ","    };","    /**","     * Iterface method. Should execute model loading.","     * @throws {DriverAbstract.Exception.LOAD_NOT_IMPLEMENTED}","     */","    this.load = function(){","        throw DriverAbstract.Exception.LOAD_NOT_IMPLEMENTED;","    };","};","","DriverAbstract = new Class(new DriverAbstract());","/**"," * @constant"," * @static"," */","DriverAbstract.LOADED = \"DriverAbstract_LOADED\";","/**"," * @constant"," * @static"," */","DriverAbstract.ERROR = \"DriverAbstract_ERROR\";","","/**"," * Namespace for exeptions messages."," * @constant"," * @static"," * @namespace"," */","DriverAbstract.Exception = {};","/**"," * "," * @constant"," * @static"," */","DriverAbstract.Exception.INITIALIZE_NOT_IMPLEMENTED = \"Method::initialize() - not implemented!\";","/**"," * @constant"," * @static"," */","DriverAbstract.Exception.LOAD_NOT_IMPLEMENTED = \"Method::load() - not implemented!\";","","exports.DriverAbstract = DriverAbstract;",null]},"TemplateManager.js":{"coverage":[null,1,1,null,1,null,1,1,null,null,null,null,null,null,null,null,null,1,null,1,null,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,1,18,18,null,null,null,null,null,null,null,1,33,null,null,null,null,null,null,null,1,null,9,9,25,null,25,13,1,1,null,12,null,null,null,9,null,null,null,null,null,null,null,null,1,41,8,null,null,33,33,33,null,33,null,null,null,null,null,null,null,null,null,1,10,8,null,null,2,1,1,1,null,null,null,1,null,null,null,null,null,null,null,null,1,40,7,null,33,null,33,58,null,null,33,31,null,null,33,null,null,null,null,null,null,1,null,1,1,null,null,1,1,1,null,null,null,null,null,null,null,null,1,24,24,12,null,null,null,null,null,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,null,null,null,1,26,null,null,26,null,24,24,24,24,null,2,null,null,24,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","var JsonRpcError = require(\"../lib/core/jsonrpc/JsonRpcError.js\").JsonRpcError;","","var EventDispatcher = require('../lib/core/event/EventDispatcher.js').EventDispatcher;","","var Event = require('../lib/core/event/Event.js').Event;","var Template = require('./template/Template.js').Template;","/**"," * @class Responsible for managing templates. "," * @extends EventDispatcher"," * @requires Class"," * @requires Event"," * @requires EventDispatcher"," * @requires JsonRpcError"," * @requires Template"," */","var TemplateManager = function(){","    /** @ignore */","    this.Extends = EventDispatcher;","    ","    /**","     * keeps references to attached templates","     * ","     * @private","     * ","     * @type {Template[]} ","     */","    this._templates = [];","    ","    /**","     * helper property, keeps count of currently rendered elements","     * ","     * @private","     * ","     * @type {integer}","     */","    this._counter = 0;","    /**","     * ","     * @private","     * ","     * @type {boolean}","     */","    this._isAborted = false;","    /**","     * keeps the error which caused the abort","     * ","     * @private","     * ","     * @type {JsonRpcError}","     */","    this._abortError = undefined;","    ","    /** @ignore */","    this.initialize = function(){","        this._templates = [];","        this._counter = 0;","    };","    ","    /**","     * Indicates if rendering process was aborded.","     * @public","     * @returns {boolean}","     */","    this.isAborted = function(){","        return this._isAborted;","    };","","    /**","     * Return templates content object.","     * @public","     * @returns {Object} ","     */","    this.getTemplatesContent = function(){","        //TODO wywalanie niepotrzebnych element&#195;&#179;w","        var renderedTemplates = {};","        for( var i = 0; i &lt; this._templates.length; i++){","            var template = this._templates[i];","","            if(!template.hasParent){","                if(this.isAborted()){","                    var error = JsonRpcError.factory(TemplateManager.Error.ABORTING).setData(this._abortError).toJson();","                    renderedTemplates[template.getName()] = error;","                }else{","                    renderedTemplates[template.getName()] = template.getContent();","                }","            }","        }","        return renderedTemplates;","    };","    /**","     * Adds a template to collection","     * @public","     * @param {Template} template","     * @throws {TemplateManager.Exception.TEMPLATE_HAS_TO_INHERIT}","     * @returns {boolean}","     */","    this.addTemplate = function(template){","        if(!template || !(template instanceof Template)){","            throw TemplateManager.Exception.TEMPLATE_HAS_TO_INHERIT;","        }","","        this._templates.push(template);","        template.setTemplateManager(this);","        template.addEventListener(Template.RENDERED, this._onTemplateRendered, this);","","        return true;","    };","","    /**","     * Removes template from collecion","     * @public","     * @param {Template} template","     * @throws {TemplateManager.Exception.TEMPLATE_HAS_TO_INHERIT}","     * @returns {boolean}","     */","    this.removeTemplate = function(template){","        if(!template || !(template instanceof Template)){","            throw TemplateManager.Exception.TEMPLATE_HAS_TO_INHERIT;","        }","","        for(var i = 0, l = this._templates.length; i &lt; l; i++){","            if(this._templates[i] == template){","                this._templates.splice(i, 1);","                return true;","            }","        }","        ","        return false;","    };","    /**","     * Returns template instance by given name","     * @public","     * @param {string} name templates name","     * @throws {TemplateManager.Exception.NAME_MUST_BE_A_STRING}","     * @returns {Template|null}","     */","    this.getTemplateByName = function(name){","        if(typeof name != \"string\"){","            throw TemplateManager.Exception.NAME_MUST_BE_A_STRING;","        }","        var result = null, i = 0, count = this._templates.length;","","        while(i &lt; count &amp;&amp; name != this._templates[i].getName()){","            i++;","        }","","        if(i &lt; count){","            result =  this._templates[i];   ","        }","","        return result;","    };","    ","    /**","     * Aborts rendering current tree. Dispatchig {@link TemplateManager.RENDERED}","     * @public","     */","    this.abort = function(error){","        //TODO zastanowic sie nad przeniesieniem logiki Abortowania flow renderingu z klasy TemplateManagera do klasy odpowiedzialnej za rendering - RenderingController. Jest to niepotrzebne mieszanie logiki renderowania i zarzadzania templateami.","        for(var i = 0, l = this._templates.length; i &lt; l; i++){","            this._templates[i].removeEventListener(Template.RENDERED, this._onTemplateRendered);","        }","","        this._isAborted = true;","        this._abortError = error;","        this.dispatchEvent(new Event(TemplateManager.RENDERED));","    };","","    /**","     * Event handler called on template rendered","     *","     * @param {Event} e","     * @private","     */","    this._onTemplateRendered = function(e){","        this._counter++;","        if(this._counter == this._templates.length){","            this.dispatchEvent(new Event(TemplateManager.RENDERED));","        }","    };","","    /**","     * Event handler called on template error","     * ","     * @param {ErrorEvent} e","     * @private","     */","    this._onTemplateError = function(e){","        //this._counter++;","        //this.dispatchEvent(new ErrorEvent(TemplateManager.ERROR, e));","    };","};","","","TemplateManager = new Class(new TemplateManager());","","/**"," * Makes new template of specific type."," * Factory method"," *"," * @static"," * @public"," * @param {string} name Template's name/file path"," * @param {object} configuration Configuration of transformation rule"," * @returns {Template}"," */","TemplateManager.createTemplate = function(name, configuration){","    var template,","        type = configuration.template.substring(configuration.template.lastIndexOf('.'), configuration.template.length);","","    switch(type){","        case TemplateManager.JQTEMPLATE:","            console.log('   -- creating new JqTemplate: '+ name);","            var JqTemplate = require('./template/JqTemplate.js').JqTemplate;","            template = new JqTemplate(name, configuration);","        break;","        default:","            throw TemplateManager.Exception.UNRESOLVED_TYPE;","    }","    ","    return template;","};","","/**"," * @static"," * @constant"," */","TemplateManager.RENDERED = \"TemplateManager_RENDERED\";","/**"," * @static"," * @constant"," */","TemplateManager.ERROR = \"TemplateManager_ERROR\";","/**"," * @static"," * @constant"," */","TemplateManager.JQTEMPLATE = \".jqtpl\";","/**"," * Namespace for exeptions messages."," * @static"," * @constant"," * @namespace"," */","TemplateManager.Exception = {};","/**"," * @static"," * @constant"," */","TemplateManager.Exception.TEMPLATE_HAS_TO_INHERIT = 'Given template has to iherit from Template';","/**"," * @static"," * @constant"," */","TemplateManager.Exception.NAME_MUST_BE_A_STRING = 'Template name has to be a string';","/**"," * @static"," * @constant"," */","TemplateManager.Exception.UNRESOLVED_TYPE = \"Error - unresolved template type.\";","/**"," * Namespace for error objects."," * @static"," * @constant"," * @namespace"," */","TemplateManager.Error = {};","/**"," * @static"," * @constant"," */","TemplateManager.Error.ABORTING = new JsonRpcError(-2101, \"Aborted\");","","exports.TemplateManager = TemplateManager;",null]},"core/jsonrpc/JsonRpcError.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,1,14,14,14,null,null,null,null,null,null,null,1,14,14,null,null,null,null,null,null,null,1,11,null,null,null,null,null,null,null,null,1,14,14,null,null,null,null,null,null,null,1,11,null,null,null,null,null,null,null,1,25,1,null,24,null,25,null,null,null,null,null,null,null,1,2,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,null,null,null,null,1,2,null,null,null,null,2,2,null,null,2,null,null,null,1,null,null,null,null,null,null,null,null,null,null,1,11,0,null,null,11,null,11,null,null,null,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require('../../mootools/mootools-node.js').Class;","var JsonRpcAbstract = require('./JsonRpcAbstract.js').JsonRpcAbstract;","","/**"," * @class JsonRpcError"," * @extends JsonRpcAbstract"," * @requires Class"," * @requires JsonRpcAbstract"," *"," * @param {Number} code Number error code"," * @param {String} message error message"," * @param {Object} data additional error data"," */","var JsonRpcError = function(){","","    /** @ignore */","    this.Extends = JsonRpcAbstract;","","    /**","     * error code","     * ","     * @private","     * @property {Number} _code","     */","    this._code;","","    /**","     * error message","     * ","     * @private","     * @property {String} _message","     */","    this._message;","","    /**","     * optional additional error data","     * ","     * @private","     * @property {Object} _data","     */","    this._data;","","","    /** @ignore */","    this.initialize = function(code, message, data){","        this.setCode(code);","        this.setMessage(message);","        this.setData(data);","    };","    ","    /**","     * sets error code","     * ","     * @param {Number} code error code","     */","    this.setCode = function(code){","        this._code = code;","        return this;","    };","    ","    /**","     * gets error code","     * ","     * @returns {Number}","     */","    this.getCode = function(){","        return this._code;","    };","    ","    /**","     * sets error message","     * ","     * @param {String} message error message","     * @returns {JsonRpcError}","     */","    this.setMessage = function(message){","        this._message = message;","        return this;","    };","    ","    /**","     * gets error message","     * ","     * @returns {String}","     */","    this.getMessage = function(){","        return this._message;","    };","    ","    /**","     * sets error data","     * ","     * @param {Object} data error data","     */","    this.setData = function(data){","        if(data instanceof JsonRpcError){","            this._data = data._toJson();","        }else{","            this._data = data;            ","        }","        return this;","    };","    ","    /**","     * gets error data","     * ","     * @returns {Object}","     */","    this.getData = function(){","        return this._data;","    };","    ","    /**","     * returns properties as json","     * ","     * @returns {Object}","     */","    this.toJson = function(){","        return {","            error: this._toJson()","        };","    };","","    /**","     * returns base json representation of class properties","     * only for internal use","     * ","     * @private","     * @returns {Object}","     */","    this._toJson = function(){","        var data = {","            code: this._code,","            message: this._message","        };","        ","        if(this._data){","            data.data = this._data;","        }","        ","        return data;","    };","};","","JsonRpcError = new Class(new JsonRpcError());","","/**"," * creates new instance based on the given instance"," * factory method"," * "," * @static"," * "," * @param {JsonRpcError} jsonRpcError"," * @returns {JsonRpcError}"," */","JsonRpcError.factory = function(jsonRpcError){","    if(!(jsonRpcError instanceof JsonRpcError)){","        throw JsonRpcError.Exceptions.WRONG_CLASS;","    }","    ","    var factory = new JsonRpcError(jsonRpcError.getCode(), jsonRpcError.getMessage());","","    return factory;","};","","/**"," * @static"," * @constant"," * @namespace"," */","JsonRpcError.Exceptions = {};","/**"," * @static"," * @constant"," */","JsonRpcError.Exceptions.WRONG_CLASS = 'Given something is not a instance of JsonRpcError class';","","exports.JsonRpcError = JsonRpcError;",null],"noTest":true},"core/jsonrpc/JsonRpcAbstract.js":{"coverage":[null,1,null,null,null,null,null,1,null,1,null,1],"source":["var Class = require(\"../../mootools/mootools-node.js\").Class;","","/**"," * @class JsonRpcAbstract"," * @requires Class"," */","var JsonRpcAbstract = function(){};","","JsonRpcAbstract = new Class(new JsonRpcAbstract());","","exports.JsonRpcAbstract = JsonRpcAbstract;",null],"noTest":true},"template/Template.js":{"coverage":[null,1,1,1,1,null,1,null,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,null,1,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,1,null,56,4,null,null,52,52,null,52,52,null,null,52,52,52,null,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,null,1,26,26,26,null,null,16,16,null,0,null,16,null,null,null,null,null,null,null,null,1,20,0,null,null,20,null,20,null,20,11,11,null,11,null,11,14,14,14,14,14,null,null,1,null,null,null,0,null,null,null,9,9,null,null,null,null,null,null,null,null,1,0,null,null,null,null,null,null,null,null,null,1,16,2,null,14,14,14,2,null,null,null,null,null,null,null,null,1,35,null,35,3,null,32,11,null,21,18,null,null,3,null,null,null,null,29,29,29,null,null,null,null,null,null,null,1,34,null,null,null,null,null,null,null,1,18,null,null,null,null,null,null,null,1,29,0,null,29,null,null,null,null,null,null,null,1,null,37,null,37,2,null,35,1,0,null,34,null,null,null,null,null,null,null,1,115,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,1,13,null,13,null,13,null,10,null,10,10,10,null,10,13,null,10,null,null,10,null,3,null,null,null,null,null,null,null,1,17,null,9,9,null,7,7,null,1,1,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,19,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../../lib/mootools/mootools-node.js\").Class;","var JsonRpcResult = require(\"../../lib/core/jsonrpc/JsonRpcResult.js\").JsonRpcResult;","var JsonRpcError = require(\"../../lib/core/jsonrpc/JsonRpcError.js\").JsonRpcError;","var JsonRpcAbstract = require(\"../../lib/core/jsonrpc/JsonRpcAbstract.js\").JsonRpcAbstract;","","var EventDispatcher = require('../../lib/core/event/EventDispatcher.js').EventDispatcher;","","var Event = require('../../lib/core/event/Event.js').Event;","","/**"," * Representing template."," * @class Template Base template class. "," * @extends EventDispatcher"," * @requires Class"," * @requires Event "," * @requires EventDispatcher"," * @requires JsonRpcAbstract"," * @requires JsonRpcError  "," * @requires JsonRpcResult"," * @requires TemplateManager"," * @param {String} name"," * @param {Object} configuration"," * @throws {Template.Exception.CONFIG_INVALID} if given &lt;i&gt;name&lt;/i&gt; or &lt;i&gt;configuration&lt;/i&gt; are invalid."," */","var Template = function(){","    /** @ignore */","    this.Extends = EventDispatcher;","   ","    /**","     * Indicates if template is a child of parent.","     * @public","     * @type {Boolean}","     */","    this.hasParent = false;","    /**","     * Indicates if template was rendered.","     * @public","     * @type {Boolean}","     */","    this.isRendered = false;","    ","    /**","     * configuration object","     * @private","     * @type {Object}","     */","    this._configuration = null;","    /**","     * generated content","     * @private","     * @type {Object}","     */","    this._content = null;","    /**","     * rendered children counter","     * @private","     * @type {Number}","     */ ","    this._counter = 0; ","    /**","     * template model","     * @private","     * @type {Object}","     */","    this._data = null;","    /**","     * template name within configuration","     * @private","     * @type {Boolean}","     */        ","    this._name = \"\";","","","    /** @ignore */","    this.initialize = function(name, configuration){","","        if(!name || !configuration || !configuration.hasOwnProperty(\"template\")){","            throw Template.Exception.CONFIG_INVALID;","        }","        //public","        this.hasParent = false;","        this.isRendered = false;","        //private","        this._configuration = configuration;","        this._content = {","            result: null","        }; ","        this._counter = 0; ","        this._data = null;","        this._name = name;","    };","    ","    /**","     * Abstract method. Needed to be overriden - otherwise Template.Exception.NOT_IMPLEMENTED will be throwed.","     * @public","     * @param {Object} data","     * @throw {Template.Exception.NOT_IMPLEMENTED}","     */","    this.render = function(data){","        throw Template.Exception.NOT_IMPLEMENTED;","    };","    ","    /**","     * Dispatchig render action and handles its errors and exceptions.","     * @public","     * @param {Object} data","     * @throws {Template.Exception.NOT_IMPLEMENTED} if method render wasn't overriden ","     */","    this.dispatchRender = function(data){","        try{","            console.log('   -- Template '+this._name+': rendering...');","            this.render(data);","        }","        catch(e){","            console.log('   -- Template '+this._name+': error while rendering...', e);","            if(e == Template.Exception.NOT_IMPLEMENTED){","                 //fallback in case of not implementing","                throw Template.Exception.NOT_IMPLEMENTED;","            }","            this._handleError(e);","        }","    };","    ","    /**","     * Handling model load. Called on DriverAbstract.LOADED","     * @public","     * @param {Event} e","     */","    this.onData = function(e){","        if(this._templateManager.isAborted()){","            return;","        }","        ","        console.log('   -- Template '+this._name+': received data');","","        this._data = e.data;","","        if(this._data &amp;&amp; this._data.hasOwnProperty('#body')){","            var children = this._data['#body'];","            this._counter = children.length;","        ","            console.log('   -- Template '+this._name+': have '+children.length +' children');","        ","            for( var i = 0, max = children.length; i &lt; max; i++ ){","                console.log('   -- Template '+this._name+': waiting for children: '+children[i]);","                var child = this.getTemplateManager().getTemplateByName(children[i]);","                if(child) {","                    try {","                        this.addChild(child);    ","                    }","                    catch(err) {","                        this._handleError(err);","                    }","                }","                else {","                    this._counter--;","                }","            }            ","        }else{","            console.log('   -- Template '+this._name+': does\\'nt have children');","            this.dispatchRender(this._data);","        }","    };","        ","    /**","     * Handling model error. Called on DriverAbstract.ERROR","     * @public","     * @param {ErrorEvent} e","     */","    this.onDataError = function(e){","        console.log('   -- Template '+this._name+': data error');","        //TODO handle error","    };","    ","    /**","     * Adding child template","     * @public","     * @param {Template} child","     * @throws {Template.Exception.RECURSIVE_TEMPLATES} if given child is a self instance.","     */","    this.addChild = function(child){","        if(child === this){","            throw Template.Exception.RECURSIVE_TEMPLATES;","        }","        child.addEventListener(Template.RENDERED, this._onTemplateRendered, this);","        child.hasParent = true;","        if(child.isRendered){","            this._onTemplateRendered(new Event(Template.RENDERED, child));","        }","    };","    ","    /**","     * Setting rendering result","     * @public","     * @param {Object} data ","     */","    this.setRenderedData = function(data){","        console.log('   -- Template '+this._name+': rendered.');","","        if(!data){","            throw Template.Exception.WRONG_RENDER_DATA;","        }","        else if(typeof data == 'string'){","            this._content = new JsonRpcResult(data).toJson();","        }","        else if(data instanceof JsonRpcAbstract){","            this._content = data;","        }","        else {","            throw Template.Exception.WRONG_RENDER_DATA;","        }","","       ","","        console.log('   -- Template '+this._name+': dispaching...');","        this.isRendered = true;","        this.dispatchEvent(new Event(Template.RENDERED, this));","    };","    ","    /**","     * Returns content generated by specific render engine","     * @public","     * @return {String}","     */","    this.getContent = function(){","        return this._content;","    };","    ","    /**","     * Returns error handler","     * @public","     * @return {CONST}","     */","    this.getErrorAction = function(){","        return this._configuration.onerror ? this._configuration.onerror : Template.ACTION_ERROR_DEFAULT;","    };","","    /**","     * Returns template manager who holds every template in the subtree","     * @public","     * @return {TemplateManager}","     */","    this.getTemplateManager = function(){","        if(!this._templateManager){","            throw Template.Exception.TEMPLATEMANAGER_NULL;","        }","        return this._templateManager;","    };","","    /**","     * Sets template manager object which holds every template in the subtree","     * @public","     * @param {TemplateManager} templateManager","     */","    this.setTemplateManager = function(templateManager){","        ","        var TemplateManager = require('../../lib/TemplateManager.js').TemplateManager;","","        if(!templateManager){","            throw Template.Exception.TEMPLATEMANAGER_NULL;","        }","        else if(!(templateManager instanceof TemplateManager)){","           throw Template.Exception.TEMPLATEMANAGER_NOT_CLASS_INSTANCE;","           return;","        }","        this._templateManager = templateManager;","    };","","    /**","     * Returns template name","     * @public","     * @return {String}","     */","    this.getName = function(){","        return this._name;","    };","","    /**","     * Returns template location path","     * @public","     * @return {String} template path","     */","    this.getPath = function(){","        return this._configuration.template;","    };","    ","    /**","     * Callback function called on rendered child template","     * @private","     * @param {Event} e","     */","    this._onTemplateRendered = function(e){","        this._counter--;","","        console.log('   -- Template '+this._name+': received children: '+e.data.getName());","","        if(this._counter === 0){","","            console.log('   -- Template '+this._name+': have all children');","        ","            if(this._data.hasOwnProperty('#body')){","                var children = this._data['#body'];","                this._data.body = [];","","                for(var i=0,max=children.length;i&lt;max;i++){","                    this._data.body.push(this.getTemplateManager().getTemplateByName(children[i]).getContent());","                }","                delete this._data['#body'];","            }","","            this.dispatchRender(this._data);","        } else {","            console.log('   -- Template '+this._name+': children left: '+this._counter);","        }","    };","    ","    /**","     * Handling error","     * @private","     */","     this._handleError = function(e){","            switch(this.getErrorAction()){","                case Template.ACTION_ERROR_PROPAGATE:","                    this.setRenderedData(JsonRpcError.factory(Template.Error.PROPAGATED).setData(e));","                    break;","                case Template.ACTION_ERROR_DISCARD:","                    this.setRenderedData(new JsonRpcResult(\"\"));","                    break;","                case Template.ACTION_ERROR_ABORT:","                    this._templateManager.abort(JsonRpcError.factory(Template.Error.ABORTED).setData(e));","                    break;    ","            }","     };","};","","Template = new Class( new Template() );","","/**"," * @static"," * @constant"," */","Template.RENDERED = \"Template_RENDERED\";","/**"," * @static"," * @constant"," */","Template.ERROR = \"Template_ERROR\";","/**"," * @static"," * @constant"," */","Template.ACTION_ERROR_PROPAGATE = \"propagate\";","/**"," * @static"," * @constant"," */","Template.ACTION_ERROR_DISCARD = \"discard\";","/**"," * @static"," * @constant"," */","Template.ACTION_ERROR_ABORT = \"abort\";","/**"," * @static"," * @constant"," */","Template.ACTION_ERROR_DEFAULT = Template.ACTION_ERROR_DISCARD;","/**"," * Namespace for exeptions messages."," * @static"," * @constant"," * @namespace"," */","Template.Exception = {};","/**"," * @static"," * @constant"," */","Template.Exception.CONFIG_INVALID = \"Error - Template name and configuration are invalid.\";","/**"," * @static"," * @constant"," */","Template.Exception.NOT_IMPLEMENTED = \"Method:render() - Not implemented!\";","/**"," * @static"," * @constant"," */","Template.Exception.TEMPLATEMANAGER_NULL = \"TemplateManager is null\";","/**"," * @static"," * @constant"," */","Template.Exception.TEMPLATEMANAGER_NOT_CLASS_INSTANCE = \"templateManager must be instance of TemplateManager class\";","/**"," * @static"," * @constant"," */","Template.Exception.FILE_DOES_NOT_EXIST = function(fileName){","    return \"Template: \" + fileName + \" doesn't exist\";","};","/**"," * @static"," * @constant"," */","Template.Exception.WRONG_RENDER_DATA = \"Given data has to be String\";","/**"," * @static"," * @constant"," */","Template.Exception.RECURSIVE_TEMPLATES = \"Template cannot be his own child!!!\";","/**"," * Namespace for error objects;"," * @static"," * @constant"," * @namespace"," */","Template.Error = {};","/**"," * @static"," * @constant"," */","Template.Error.ABORTED = new JsonRpcError(-2201, \"Aborting because of template error\");","/**"," * @static"," * @constant"," */","Template.Error.PROPAGATED = new JsonRpcError(-2202, \"Error occured, propagating error.\");","","exports.Template = Template;",null]},"core/jsonrpc/JsonRpcResult.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,null,null,1,null,null,1,18,null,null,null,null,null,null,null,null,1,18,18,null,null,null,null,null,null,null,1,0,null,null,null,null,null,null,null,1,11,null,null,null,null,null,1,null,1],"source":["var Class = require(\"../../mootools/mootools-node.js\").Class;","var JsonRpcAbstract = require(\"./JsonRpcAbstract.js\").JsonRpcAbstract;","","/**"," * @class JsonRpcResult"," * @extends JsonRpcAbstract"," * @requires Class"," * @requires JsonRpcAbstract"," *"," * @param {Object} result"," */","var JsonRpcResult = function(){","","    /** @ignore */","    this.Extends = JsonRpcAbstract;","    ","    /**","     * result","     * ","     * @private","     * @property {Object} _result","     */","    this._result;","    ","    /** @ignore */","    this.initialize = function(result){","        this.setResult(result);","    };","    ","    /**","     * sets result","     * ","     * @param {Object} result","     * @returns {JsonRpcResult}","     */","    this.setResult = function(result){","        this._result = result;","        return this;","    };","    ","    /**","     * gets result","     * ","     * @returns {Object}","     */","    this.getResult = function(){","        return this._result;","    };","    ","    /**","     * returns properties as json","     * ","     * @returns {Object}","     */","    this.toJson = function(){","        return {","            result: this._result","        };","    };","};","","JsonRpcResult = new Class(new JsonRpcResult());","","exports.JsonRpcResult = JsonRpcResult;",null],"noTest":true},"TemplateEngine.js":{"coverage":[null,1,null,1,1,1,null,null,null,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,1,null,null,1,5,null,null,null,null,null,null,null,1,5,null,null,null,null,null,null,null,1,3,null,null,null,null,null,null,null,1,0,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,1,null,1,1,0,null,null,1,null,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,1,null,null,null,null,null,null,null,null,null,null,1,0,0,0,0,0,0,null,0,0,0,0,null,null,null,null,null,null,null,1,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","","var RequestProcessor = require(\"../lib/RequestProcessor.js\").RequestProcessor;","var Cache = require(\"./cache/Cache.js\").Cache;","var http = require('http');","","/**"," * Create Server on given port."," * @class TemplateEngine Main TemplateEngine Server class."," * @requires Class "," * @requires RequestProcessor "," * @requires Cache "," * @requires http"," * @param {Number} [port] port on which should server start. Default is 8080."," */","var TemplateEngine = function(){","","    /**","     * Server port number","     * ","     * @private","     * @type {Number}","     */","    this._port = 8080;","    ","    ","    /**","     * Server template path","     * ","     * @private","     * @type {String}","     */","    this._templatePath = \"examples/templates/\"; ","   ","    /**@ignore*/","    this.initialize = function(port){","        port ? this.setPort(port) : false;","    };","    ","    /**","     * Returns a server port number","     * ","     * @returns {Number}","     */","    this.getPort = function(){","        return this._port;","    };","","    /**","     * Sets server port number","     * ","     * @param {Number} port TCP/IP Port number","     */","    this.setPort = function(port){","        this._port = port;","    };","    ","    /**","     * Returns a server template path","     * ","     * @returns {String}","     */","    this.getTemplatePath = function(){","        return this._templatePath;","    };","","    /**","     * Sets server template path","     * ","     * @param {string} templatePath Path to templates folder.","     */","    this.setTemplatePath = function(templatePath){","        this._templatePath = templatePath;","    };","    ","   ","    /**","     * Creates template engine server, caching defined resources","     * @public","     */","    this.create = function(){","        //create http server and setting up request handler","        var that = this;","        var server = http.createServer(function(request, response){","            that._onRequestHandler(request, response);","        });","","        var cache = new Cache([","            {","                className: \"JqTplCache\",","                resourcePath: this._templatePath,","                excludePattern: \".svn\"","            }/*,","            {","                className: \"StylusCache\",","                resourcePath: \"examples/stylus/\",","                excludePattern: \".svn\"","            }*/","        ]);","","        cache.cache();","","        ","        server.listen(this.getPort());","        console.log('Server runing @' + this.getPort() + '...');","    };","    ","    /**","     * Handling incoming request","     * ","     * @private","     * ","     * @param {http.ServerRequest} request","     * @param {http.ServerResponse} response","     */","    this._onRequestHandler = function(request, response){","        console.log('-- request start');","        var that = this;","        if (request.method == 'POST') {","            var postData = [];","            request.on('data', function(data) {","                postData.push(data);","            });","            request.on('end', function(){","                request.data = postData.join(\"\");","                var requestProcessor = new RequestProcessor(request, response);","                requestProcessor.process();","            });","        }","    };","","   ","};","","TemplateEngine = new Class(new TemplateEngine());","exports.TemplateEngine = TemplateEngine;",null]},"RequestProcessor.js":{"coverage":[null,1,null,1,null,null,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,1,null,null,11,null,11,1,null,10,2,null,8,1,null,null,7,7,7,null,null,null,null,null,1,null,null,7,7,null,1,null,null,null,null,null,null,1,null,null,6,null,null,null,1,null,null,null,null,null,1,null,5,null,null,null,5,1,null,null,null,null,null,1,null,null,null,4,4,null,1,null,null,null,null,null,null,1,null,null,null,3,3,3,3,null,1,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,null,null,null,null,1,7,7,null,null,null,null,7,null,null,null,7,null,null,null,null,null,null,null,null,null,null,1,7,null,7,14,21,21,null,null,null,null,7,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","","var RenderingController = require(\"../lib/RenderingController.js\").RenderingController;","","/**"," * @class RequestProcessor"," * @requires Class"," * @requires RenderingController"," * @param {http.ServerRequest} request"," * @param {http.ServerResponse} response"," * @throws {RequestProcessor.Exception.INVALID_REQUEST_RESPONSE} if constructor parameters are invalid or null."," */","var RequestProcessor = function(){","    /**","     * Request object","     * @public ","     * @type {http.ServerRequest}","     */","    this.request = null;","    /**","     * Response object","     * @public","     * @type {http.ServerResponse}","     */","    this.response = null;","    /**","     * holds the request id","     * @private ","     * @type {mixed}","     */","    this._id;","    ","    /** @ignore */","    this.initialize = function(request, response){","","","        var http = require('http');","","        if(!request || !response){","            throw RequestProcessor.Exception.INVALID_REQUEST_RESPONSE;","        }","        else if(!(request instanceof http.IncomingMessage)){","            throw RequestProcessor.Exception.INVALID_REQUEST_RESPONSE;","        }","        else if(!(response instanceof http.ServerResponse)){","            throw RequestProcessor.Exception.INVALID_REQUEST_RESPONSE;","        }","","        console.time('   -- REQUEST TIME');","        this.request = request;","        this.response = response;","    };","    /**","     * Starts processing the request. Creates and dispatches rendering flow.","     * @public","     */","    this.process = function(){","        //FIXME: dodac sprawdzanie czy format zapytania jest zgodny z jsonrpc - dla zapewnienia kompatybilnosci ze standardem","        //sprawdzam czy podanego json da sie sparsowac","        try{","            var request = JSON.parse(this.request.data);","        } catch(error){","            this.sendResponse({","                error: {","                    code: -32700,","                    message: \"Invalid JSON. An error occurred on the server while parsing the JSON text.\",","                    data: error","                }","            });","            return;","        }","        //weryfikuje poprawnosc zapytania","        if(!request.hasOwnProperty(\"method\") ||","           !request.hasOwnProperty(\"jsonrpc\") || request.jsonrpc != \"2.0\" ||","           !request.hasOwnProperty(\"params\") ||","           !request.hasOwnProperty(\"id\") || request.id == \"\"){","            this.sendResponse({","                error: {","                    code: -32600,","                    message: \"The received JSON is not a valid JSON-RPC Request.\"","                }","            });","            return;","        }else{","            this._id = request.id;","        }","        ","        //weryfikuje metode","        if(request.method != \"render\"){","            this.sendResponse({","                error: {","                    code: -32601,","                    message: \"The requested remote-procedure does not exist / is not available.\"","                }","            });","            return;","        }","        ","        //weryfikuje poprawnosc konfiguracji","        try{","            var controller = new RenderingController(request.params);            ","        }catch(e){","            this.sendResponse({","                error: {","                    code: -32602,","                    message: \"Invalid method parameters.\",","                    data: e","                }","            });","            return;            ","        }","","        //wywalam ogolny blad jesli nie zostal przez nic glebiej przechwycony","        try{","            controller.addEventListener(RenderingController.RENDERED, this._onRenderingSuccess, this);","            controller.addEventListener(RenderingController.ERROR, this._onRenderingError, this);","            controller.render();","        }catch(e){","            this.sendResponse({","                error: {","                    code: -32603,","                    message: \"Internal JSON-RPC error.\",","                    data: e","                }","            });","            return;  ","        }","    };","    /**","     * Called on rendering success","     * ","     * @param {Event} e","     * @private","     */","    this._onRenderingSuccess = function(e){","        this.sendResponse({","            result: e.data","        });","    };","    /**","     * Called on rendering error","     * ","     * @param {ErrorEvent} e","     * @private","     */","    this._onRenderingError = function(e){","        this.sendResponse({","            error: {","                code: -123,","                message: e.toHtmlString()","            }","        });","    };","    /**","     * Sends response","     *","     * @param {Object} data Response data.","     */","    this.sendResponse = function(data){","        console.timeEnd('   -- REQUEST TIME');","        this.response.writeHead(200, {","            'Content-Type': 'application/json; charset=utf-8',","            'Access-Control-Allow-Origin': '*'","        });","","        this.response.end(new Buffer(JSON.stringify(this._merge({","            id: this._id,","            jsonrpc: \"2.0\"","        }, data))));","        console.log('-- request ended');","    };","    ","    /**","     * helper method, merges two or more object into one","     * ","     * @param {object}","     * @private","     * ","     * @returns {object} merged object","     */","    this._merge = function(){","        var tmp = {};","        ","        for(var i = 0, l = arguments.length; i &lt; l; i++){","            for(var key in arguments[i]){","                if(arguments[i].hasOwnProperty(key)){","                    tmp[key] = arguments[i][key];","                }","            }","        }","        ","        return tmp;","    };","};","","RequestProcessor = new Class( new RequestProcessor() );","","/**"," * Namespace for exeptions messages."," * @static"," * @constant"," * @namespace"," */","RequestProcessor.Exception = {};","/**"," * @static"," * @constant"," */","RequestProcessor.Exception.INVALID_REQUEST_RESPONSE = \"Invalid Request and/or Response objects\";","","exports.RequestProcessor = RequestProcessor;",null]},"cache/Cache.js":{"coverage":[null,1,1,null,null,null,null,null,null,null,null,1,null,null,null,null,null,1,null,null,null,1,1,null,null,null,null,null,null,1,null,1,1,null,1,1,1,null,1,null,null,null,null,null,null,null,null,null,null,1,2,2,2,null,2,12,10,10,10,1,null,9,9,null,null,null,null,null,null,null,null,1,1],"source":["var Class = require(\"../mootools/mootools-node.js\").Class;","var fs = require('fs');","","/**"," * @class Main resource cache controller"," * @requires Class"," * @requires fs"," *"," * @param {Object} configuration"," */","var Cache = function(){","","    /**","     * @property {Object} _configuration","     * @private","     */","    this._configuration = null;","    ","","    /** @ignore */","    this.initialize = function(configuration){","        this._configuration = configuration;","    };","","    /**","     * cache everything mensioned in configuraion using","     * special classes for given resource types","     */","    this.cache = function(){","","        for(var i=0, max=this._configuration.length;i&lt;max;i++){","            var configItem = this._configuration[i];","","            var resourceLib = require('./resource/' + configItem.className);","            var ResourceClass = resourceLib[configItem.className];","            var resourceInstance = new ResourceClass(configItem);","            ","            this._cacheRecursive(resourceInstance.getResourcePath(), resourceInstance);","        }","    };","","    /**","     * cache recursive used by main Cache() method","     *","     * @private","     * @param {String} templatePath","     * @param {IResourceCache} resourceInstance","     */","    this._cacheRecursive = function(templatePath, resourceInstance){","        var templateFiles = fs.readdirSync(templatePath);","        var fileContents = '';","        var statInfo = null;","","        for(var i = 0, l = templateFiles.length; i &lt; l; i++){","           if(templateFiles[i]!==resourceInstance.getExcludePattern()){","               path = templatePath + templateFiles[i];","               statInfo = fs.statSync(path);","               if(statInfo.isDirectory()){","                   this._cacheRecursive(path+'/', resourceInstance);","               } else {","                   fileContents = fs.readFileSync(templatePath + templateFiles[i], 'utf8');","                   resourceInstance.cache(templatePath+templateFiles[i], fileContents);","               }","           }","        }","    };","","","};","","Cache = new Class(new Cache());","exports.Cache = Cache;",null],"noTest":true},"DriverLocal.js":{"coverage":[null,1,1,1,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,1,null,null,1,32,3,null,null,29,null,null,null,null,null,1,21,null,null,null,1,null,null,null,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","var Event = require('../lib/core/event/Event.js').Event;","var DriverAbstract = require('../lib/DriverAbstract').DriverAbstract;","","/**"," * Special implementation of driver which not making any remote or I/O calls. Given 'data' will be threated as retrived data after calling load method."," * @class DriverLocal Special implementation of driver which not making any remote or I/O calls."," * @extends DriverAbstract"," * @requires Class "," * @requires DriverAbstract "," * @requires Event"," * @param {Object} data Model data."," * @throws {DriverLocal.Exception.NO_DATA_GIVEN} if given data is null."," */","var DriverLocal = function(){","","    /** @ignore */","    this.Extends = DriverAbstract;","    ","    /**","     * @property {Object} _data","     * @private","     */","    this._data = null;","","    /** @ignore */","    this.initialize = function(data){","        if(!data){","            throw DriverLocal.Exception.NO_DATA_GIVEN;","        }","","        this._data = data;","    };","","    /**","     * Implements DriverAbstract interface. Dispatches DriverAbstract.LOADED event with given model data.","     */","    this.load = function(){","        this.dispatchEvent(new Event(DriverAbstract.LOADED, this._data));","    };","};","","DriverLocal = new Class(new DriverLocal());","","/**"," * Namespace for exeptions messages."," * @constant"," * @static"," * @namespace"," */","DriverLocal.Exception = {};","/**"," * @constant"," * @static"," */","DriverLocal.Exception.NO_DATA_GIVEN = \"No data given!\";","","exports.DriverLocal = DriverLocal;",null]},"DriverRemote.js":{"coverage":[null,1,null,1,null,1,1,1,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,1,11,7,null,4,4,null,null,null,null,null,null,null,1,3,3,null,1,null,null,2,null,2,2,null,2,null,null,null,null,null,1,1,null,null,null,null,null,1,null,null,1,null,null,null,1,null,null,null,null,null,null,1,null,null,null,null,1,null,null,null,null,1,null,1],"source":["var Class = require(\"../lib/mootools/mootools-node.js\").Class;","","var DriverAbstract = require('../lib/DriverAbstract.js').DriverAbstract;","","var Event = require('../lib/core/event/Event.js').Event;","var ErrorEvent = require('../lib/core/event/ErrorEvent.js').ErrorEvent;","var OpalLoader = require('../lib/core/opal/OpalLoader.js').OpalLoader;","var OpalRequest = require('../lib/core/opal/OpalRequest.js').OpalRequest;","","/**"," * Implementation of driver which making remote calls through OPAL intraface."," * Dispatches event: DriverAbstract.LOADED on successfull data retrieving otherwise dispatches DriverAbstract.ERROR"," * @class DriverRemote class"," * @extends DriverAbstract"," * @requires Class "," * @requires DriverAbstract "," * @requires OpalLoader "," * @requires OpalRequest "," * @requires Event "," * @requires ErrorEvent"," * @param {Object} params Parameters which will be passed to OPAL call."," */","var DriverRemote = function(){","","    /** @ignore */","    this.Extends = DriverAbstract;","    ","    /**","     * @property","     * @private","     */","    this._params = null;","    ","    /**","     * @property","     * @private","     */","    this._loader = null;","    ","    /** @ignore */","    this.initialize = function(params){","        if(!params || typeof params != \"object\" || params.constructor != Object){","            throw DriverRemote.Exception.WRONG_PARAMS;","        }","        this._params = params;","        this._loader = new OpalLoader();","    };","","    /**","     * Makes remote call through OPAL interface. Implements DriverAbstract interface.","     * @public","     * @throws {DriverRemote.Exception.OPAL_WRONG_PARAMS} if given params are invalid for OPAL (see:{@link OpalRequest})","     */","    this.load = function(){","        try{","            var opalRequest = new OpalRequest(this._params);            ","        }catch(e){","            throw DriverRemote.Exception.OPAL_WRONG_PARAMS;","        }","        //FIXME: do wywalenia","        opalRequest.setGatewayHost('rtx.m4r2.onet');","","        this._loader.addEventListener(OpalLoader.LOADED, this._onLoad, this);","        this._loader.addEventListener(OpalLoader.ERROR, this._onError, this);","","        this._loader.load(opalRequest);","    };","","    /**","     * @private","     */","    this._onLoad = function(e){","        this.dispatchEvent(new Event(DriverAbstract.LOADED, e.data));","    };","","    /**","     * @private","     */","    this._onError = function(e){","        //TODO dodac sprawdzanie typu bledu i nadawanie kodu i msg dla emitowanego ErrorEvent","        //FIXME to wogole jest \"popsute\" bo nie przekazuje bledu z opala dalej","        this.dispatchEvent(new ErrorEvent(DriverAbstract.ERROR, e.data));","    };","};","","DriverRemote = new Class(new DriverRemote());","/**"," * Namespace for exeptions messages."," * @constant"," * @static"," * @namespace"," */","DriverRemote.Exception = {};","/**"," * @constant"," * @static"," */","DriverRemote.Exception.WRONG_PARAMS = 'Given param has to be an object';","/**"," * @static"," * @constant"," */","DriverRemote.Exception.OPAL_WRONG_PARAMS = 'Given configuration is not valid';","","exports.DriverRemote = DriverRemote;",null]},"template/JqTemplate.js":{"coverage":[null,1,1,1,1,null,null,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,null,1,null,25,17,null,null,8,null,null,null,1,1],"source":["var Class = require(\"../../lib/mootools/mootools-node.js\").Class;","var Template = require('./Template.js').Template;","var jqtpl = require('jqtpl');","var JsonRpcResult = require(\"../../lib/core/jsonrpc/JsonRpcResult.js\").JsonRpcResult;","","/**"," * @class JqTemplate Implementation of Template class - using &lt;a href=\"https://github.com/kof/node-jqtpl\"&gt;jQuery Templates engine&lt;/a&gt;.  "," * @extends Template"," * @requires Class "," * @requires Template "," * @requires jqtpl "," * @requires JsonRpcResult"," */","var JqTemplate = function(){","","    /** @ignore */","    this.Extends = Template;","","    /**","     * Executing template rendering.","     * @param {Object} data Template data.","     * @throws {Template.Error.FILE_DOES_NOT_EXIST} if given template path is invalid.","     */","    this.render = function(data){","        //FIXME: template nie powinien uwzgledniac pakowania calosci w zwrotke RPC","        if(!jqtpl.template.hasOwnProperty(this._configuration.template)){","            throw Template.Exception.FILE_DOES_NOT_EXIST(this._configuration.template);","        }","","        this.setRenderedData(jqtpl.tmpl(this._configuration.template, {'data': data}, {cache: true}));","    };","};","","JqTemplate = new Class(new JqTemplate());","exports.JqTemplate = JqTemplate;",null]},"cache/resource/JqTplCache.js":{"coverage":[null,1,1,1,null,null,null,null,null,null,null,1,null,null,1,null,null,null,null,null,null,null,1,9,null,null,9,null,null,null,1,1],"source":["var Class = require(\"../../mootools/mootools-node.js\").Class;","var IResourceCache = require('./IResourceCache.js').IResourceCache;","var jqtpl = require('jqtpl');","","/**"," * @class In-memory resource Cache for jQuery Templates"," * @requires Class"," * @requires IResourceCache"," * @requires jqtpl"," */","var JqTplCache = function(){","","    /** @ignore */","    this.Implements = IResourceCache;","","    /**","     * cache resource in memory","     * ","     * @param {String} path","     * @param {String} contents","     */","    this.cache = function(path, contents){","        console.log('Caching JqTpl  template: ' + path);","        ","        // caching","        jqtpl.template(path, contents);","    };","};","","JqTplCache = new Class(new JqTplCache());","exports.JqTplCache = JqTplCache;",null],"noTest":true},"cache/resource/IResourceCache.js":{"coverage":[null,1,null,null,null,null,null,1,null,null,null,null,null,1,null,null,1,1,null,null,null,null,null,null,1,1,null,null,null,null,null,null,1,12,null,null,null,null,null,null,1,0,null,null,null,1,1],"source":["var Class = require(\"../../mootools/mootools-node.js\").Class;","","/**"," * @class Interface for classes that implements resource caching of any kind"," * @requires Class"," */","var IResourceCache = function(){","","    /**","     * @property {Object} _configuration","     * @private","     */","    this._configuration = null;","","    /** @ignore */","    this.initialize = function(configuration){","        this._configuration = configuration;","    };","","    /**","     * returns path to resources","     * @returns {String}","     */","    this.getResourcePath = function(){","        return this._configuration.resourcePath;","    };","","    /**","     * returns exclude resource regexp pattern","     * @returns {String}","     */","    this.getExcludePattern = function(){","        return this._configuration.excludePattern;","    };","","    /**","     * abstract method. you need to override this method in your subclass","     * @throws {Exception} Not implemented","     */","    this.cache = function(){","        throw \"Not Implemented. You must override this method\";","    };","};","","IResourceCache = new Class(new IResourceCache());","exports.IResourceCache = IResourceCache;",null],"noTest":true},"cache/resource/StylusCache.js":{"coverage":[0],"source":[null],"noTest":true}}