Repository: stratos
Updated Branches:
  refs/heads/master 51dff131a -> b5274239a


http://git-wip-us.apache.org/repos/asf/stratos/blob/6aabe7d9/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/vendor/jquery.validate.min.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/vendor/jquery.validate.min.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/vendor/jquery.validate.min.js
deleted file mode 100644
index cbaf510..0000000
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/vendor/jquery.validate.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* 
https://github.com/jzaefferer/jquery-validation
-* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT 
*/(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return 
e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, 
returning nothing."),void 0;var i=t.data(this[0],"validator");return 
i?i:(this.attr("novalidate","novalidate"),i=new 
t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void
 
0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function
 s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input 
type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return
 
i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.for
 
m()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return
 this.validate().form();var e=!0,i=t(this[0].form).validate();return 
this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var 
i={},s=this;return 
t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var
 s=this[0];if(e){var 
r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete
 
a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return
 delete n[s.name],a;var u={};return 
t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var 
o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var
 l=o.required;delete o.required,o=t.extend({requ
 ired:l},o)}return 
o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return
 1===arguments.length?function(){var i=t.makeArray(arguments);return 
i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return
 
i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.setting
 
s.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name
 in 
this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name
 in 
this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name
 in this.submitted?this.element(t):t.parentNode.name in 
this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This
 field is required.",remote:"Please fix this field.",email:"Please enter a 
valid email address.",url:"Please enter a valid URL.",date:"Please enter
  a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please 
enter a valid number.",digits:"Please enter only digits.",creditcard:"Please 
enter a valid credit card number.",equalTo:"Please enter the same value 
again.",maxlength:t.validator.format("Please enter no more than {0} 
characters."),minlength:t.validator.format("Please enter at least {0} 
characters."),rangelength:t.validator.format("Please enter a value between {0} 
and {1} characters long."),range:t.validator.format("Please enter a value 
between {0} and {1}."),max:t.validator.format("Please enter a value less than 
or equal to {0}."),min:t.validator.format("Please enter a value greater than or 
equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function 
e(e){var 
i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer|
 
|t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var
 i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof 
s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var 
s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text,
 [type='password'], [type='file'], select, textarea, [type='number'], 
[type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], 
[type='date'], [type='month'], [type='week'], [type='time'], 
[type='datetime-local'], [type='range'], [type='color'] ","focusin focusout 
keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, 
option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return
 this.checkF
 
orm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var
 t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return 
this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var
 i=this.check(e)!==!1;return i?delete 
this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var
 i in 
e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name
 in 
e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:funct
 
ion(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return
 this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in 
t)e++;return 
e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return
 0===this.size()},size:function(){return 
this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var
 e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return 
t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return 
t(this.currentForm).find("input, select, textarea").not(":submit, :reset, 
:image, [disabled]").not(this.settings.ignore).filter(f
 
unction(){return!this.name&&e.settings.debug&&window.console&&console.error("%o 
has no name assigned",this),this.name in 
i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return
 t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" 
",".");return 
t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var
 
i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof
 
s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var
 i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var 
u={method:a,parameters:s[a]};try{if(i=
 
t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return
 this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return 
this.formatAndAdd(e,u),!1}catch(o){throw 
this.settings.debug&&window.console&&console.log("Exception occurred when 
checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return 
r?void 
0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return
 
t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var
 i=this.settings.messages[t];return 
i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var 
t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return 
void 0},defaultMessage:function(e,i){return 
this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void
 0,t.validator.messages[i],"<strong>Warning: No message de
 fined for "+e.name+"</strong>")},formatAndAdd:function(e,i){var 
s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof 
s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return
 
this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var
 t,e;for(t=0;this.errorList[t];t++){var 
i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass
 
);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return
 
this.currentElements.not(this.invalidElements())},invalidElements:function(){return
 t(this.errorList).map(function(){return 
this.element})},showLabel:function(e,i){var 
s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof
 
this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var
 i=this.idOrName(e);return this.errors().filter(function
 (){return t(this).attr("for")===i})},idOrName:function(t){return 
this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return
 
this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return
 
t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return
 t("option:selected",i).length;case"input":if(this.checkable(i))return 
this.findByName(i.name).filter(":checked").length}return 
e.length},depend:function(t,e){return this.dependTypes[typeof 
t]?this.dependTypes[typeof 
t](t,e):!0},dependTypes:{"boolean":function(t){return 
t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return
 t(e)}},optional:function(e){var 
i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pend
 
ingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete
 
this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return
 
t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var
 i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in 
t.validator.classRuleSettings&&t.extend(i,t.validat
 or.classRuleSettings[this])}),i},attributeRules:function(e){var 
i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var 
a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return
 i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete 
i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in 
t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 
0!==s&&(r[i]=s);return r},staticRules:function(e){var 
i={},s=t.data(e.form,"validator");return 
s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return
 t.each(e,function(s,r){if(r===!1)return delete e[s],void 
0;if(r.param||r.depends){var n=!0;switch(typeof 
r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void
 0!==r.param?r.param:!0:delete e[s]}}),t.ea
 
ch(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var
 
i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof
 
e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete
 e.min,delete 
e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete
 e.minlength,delete 
e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var 
i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return 
e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void
 
0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var
 r=t(i).val();retu
 rn r&&r.length>0}return 
this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return
 
this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\u
 D7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return 
this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-
 
f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return
 this.optional(e)||!/Invalid|NaN/.test(""+new 
Date(t))},dateISO:function(t,e){return 
this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return
 
this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return
 
this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9
 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var 
n=t.length-1;n>=0;n--){var 
a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 
0===i%10},minlength:function(e,i,s){var 
r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return 
this.optional(i)||r>=s
 },maxlength:function(e,i,s){var 
r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return 
this.optional(i)||s>=r},rangelength:function(e,i,s){var 
r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return 
this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return 
this.optional(e)||t>=i},max:function(t,e,i){return 
this.optional(e)||i>=t},range:function(t,e,i){return 
this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return 
this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var
 
r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof
 s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var 
n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{ur
 
l:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var
 a=s===!0||"true"===s;if(a){var 
u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete
 n.invalid[i.name],n.showErrors()}else{var 
o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var
 e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var 
r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var 
i=t.ajax;t.ajax=function(s){var r=("mode"in 
s?s:t.ajaxSettings).mode,n=("port"in 
s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return
 this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arg
 uments):void 0})}})}(jQuery);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/6aabe7d9/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
 
b/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
deleted file mode 100644
index 67fe64d..0000000
--- 
a/components/org.apache.stratos.manager.console/console/themes/theme1/ui/js/wizard.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-$(function () {
-    var isValidForm = function(){
-        if(parseInt($('#items').val()) == 0 || $('#wizard_on').val() == 
"false"){
-            if($('#policy').val() == ""){
-                $('#policy').addClass('error').focus();
-                $('#policyError').html("Required").show();
-                return false;
-            }else{
-                $('#policy').removeClass('error');
-                $('#policyError').hide();
-                return true;
-            }
-        }else{
-            return true;
-        }
-
-    };
-    var isValidPolicy = function(){
-        var policy = $('#policy').val();
-        var error;
-        if(policy != ""){
-            try {
-                var c = $.parseJSON(policy);
-            }
-            catch (err) {
-                error = err;
-            }
-        }
-
-        if(error == undefined){
-            $('#policy').removeClass('error');
-            $('#policyError').hide();
-            return true;
-        }else{
-            $('#policy').addClass('error').focus();
-            $('#policyError').html(error).show();
-            return false;
-        }
-    };
-    $('#wizardNext').click(function () {
-        var newStep = parseInt($(this).attr('data-step')) + 1;
-        $('#nextStep').val(newStep);
-        if(isValidForm() && isValidPolicy()){
-            $('#jsonForm').submit();
-        }
-    });
-
-    $('#wizardSkip').click(function () {
-        var newStep = parseInt($(this).attr('data-step')) + 1;
-        $('#skip').val("true");
-        $('#nextStep').val(newStep);
-        $('#jsonForm').submit();
-    });
-
-    $('#wizardFinish').click(function () {
-        var newStep = parseInt($(this).attr('data-step')) + 1;
-        $('#nextStep').val(newStep);
-        //if(isValidForm()){
-        $('#jsonForm').submit();
-        //}
-    });
-
-
-    $('#wizardBack').click(function () {
-        var newStep = parseInt($(this).attr('data-step')) - 1;
-        $('#nextStep').val(newStep);
-        // if(isValidForm()){
-        $('#jsonForm').submit();
-        // }
-    });
-    var thisStep = $('#thisStep').val();
-
-    $('#policy').keyup(function(){
-        if(parseInt(thisStep)==4){
-            if($(this).val() != ""){
-                
$('#wizardNext').removeClass('btn-default').addClass('btn-primary');
-                
$('#wizardSkip').removeClass('btn-primary').addClass('btn-default');
-            }else{
-                
$('#wizardSkip').removeClass('btn-default').addClass('btn-primary');
-                
$('#wizardNext').removeClass('btn-primary').addClass('btn-default');
-            }
-        }else{
-            isValidForm();
-            isValidPolicy();
-        }
-    });
-    $('pre').each(function () {
-        var jsonStr = $(this).html();
-        jsonStr = jsonStr.replace(/\'/g, '\"');
-        var obj = jQuery.parseJSON(jsonStr);
-        jsonStr = JSON.stringify(obj, undefined, 2);
-        $('textarea', $(this).parent()).val(jsonStr);
-        $(this).html(syntaxHighlight(jsonStr));
-    });
-
-    $('.js_undeploy').click(function(){
-        var $btn = $(this);
-        var type = $(this).attr('data-type');
-        if(type == null || type == "" || type == undefined){
-            return;
-        }
-        $.ajax({
-            data:{type:type,action:"undeploy"},
-            url:"/console/controllers/wizardSubmit.jag",
-            success:function(data){
-                data = jQuery.parseJSON(data);
-                if(data.Error != undefined){
-                    $btn.prev().html('<button aria-hidden="true" 
data-dismiss="alert" class="close" type="button">×</button> ' + 
data.Error.errorMessage).show();
-                }else{
-                    $btn.closest(".panel-default")
-                        .empty()
-                        .removeClass("panel")
-                        .removeClass("panel-default")
-                        .addClass("alert alert-success alert-dismissable")
-                        .html('<button aria-hidden="true" data-dismiss="alert" 
class="close" type="button">×</button> Cartridge undeployed successfully');
-                }
-            }
-        })
-    })
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/6aabe7d9/components/org.apache.stratos.manager.console/console/util/acl.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/util/acl.jag 
b/components/org.apache.stratos.manager.console/console/util/acl.jag
deleted file mode 100644
index 8a57033..0000000
--- a/components/org.apache.stratos.manager.console/console/util/acl.jag
+++ /dev/null
@@ -1,100 +0,0 @@
-<%
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-authenticationUtil = new function(){
-    var log = new Log();
-};
-
-authorizationUtil = new function(){
-    var log = new Log();
-
-    // primitive acl impl.
-    this.isAllowed = function(tenant,roleObj,resource){
-        var aclconfig = require('/config/acl.json');
-        if(tenant == null){ // check for undefine as well
-            return false;
-        }else if(tenant == "carbon.super"){
-            return 
this.checkPermission(roleObj,aclconfig.carbonsuper,resource);
-        }else{
-            return this.checkPermission(roleObj,aclconfig.tenants,resource);
-        }
-
-        return false;
-    };
-    // user roles: {[admin,Internal]}
-    // permission config :
-    //    "admin": ["view", "edit", "add_tenant", "tenant-edit"],
-    //        "everyone": ["view", "tenant-edit"]
-    //}
-    this.checkPermission = function(roleArray, permissionConfig, resource) {
-        for(var i=0; i < roleArray.length; i++){
-            for(var permissionKey in permissionConfig) {
-                if(permissionKey == roleArray[i]){
-                    var permissionArray = permissionConfig[permissionKey];
-                    for(var i=0;i< permissionArray.length;i++){
-                        if(resource != null && resource == permissionArray[i]){
-                            return true;
-                        }
-                    }
-                }
-            }
-        }
-        return false;
-    };
-
-    this.getPermissionObj = function(tenant,roleArray) {
-        var aclconfig = require('/config/acl.json');
-        if(tenant == null){ // check for undefine as well
-            return false;
-        }else if(tenant == "carbon.super"){
-            return this.getUnionOfPermissions(roleArray,aclconfig.carbonsuper);
-        }else{
-            return this.getUnionOfPermissions(roleArray,aclconfig.tenants);
-        }
-    };
-
-    this.getUnionOfPermissions = function(roleArray,permissionConfig) {   // i 
dont like these methods. O(n^4) :((
-        var permObj = {};
-        for(var i=0; i < roleArray.length; i++){
-            for(var permissionKey in permissionConfig) {
-                if(permissionKey == roleArray[i]){
-                    var permissionArray = permissionConfig[permissionKey];
-                    for(var j=0;j< permissionArray.length;j++){
-                        if(!permObj[permissionArray[j]]){
-                            permObj[permissionArray[j]] = true;
-                        }
-                    }
-                }
-            }
-        }
-        return permObj;
-    };
-};
-
-//var testLog = new Log();
-//testLog.info(authorizationUtil.getPermissionObj("carbon.super",["admin"]));
-//testLog.info(authorizationUtil.isAllowed("pradeep.org",["admin","Internal/Everyone"],"edit"));
-//testLog.info(authorizationUtil.isAllowed("pradeep.org",["admin","Internal/Everyone"],"tenant-edit"));
-//testLog.info(authorizationUtil.isAllowed("test.org",["Internal/Everyone"],"view"));
-//testLog.info(authorizationUtil.isAllowed("someorg.com",["admin","Internal/Everyone"],"view"));
-
-%>

http://git-wip-us.apache.org/repos/asf/stratos/blob/6aabe7d9/components/org.apache.stratos.manager.console/console/util/utility.jag
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager.console/console/util/utility.jag 
b/components/org.apache.stratos.manager.console/console/util/utility.jag
deleted file mode 100644
index 916f265..0000000
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ /dev/null
@@ -1,472 +0,0 @@
-<%
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-function E4XtoJSON(xml, ignored) {
-    var r, children = xml.*, attributes = xml.@*, length = children.length();
-    if(length == 0) {
-        r = xml.toString();
-    } else if(length == 1) {
-        var text = xml.text().toString();
-        if(text) {
-            r = text;
-        }
-    }
-    if(r == undefined) {
-        r = {};
-        for each (var child in children) {
-            var name = child.localName();
-            var json = E4XtoJSON(child, ignored);
-            var value = r[name];
-            if(value) {
-                if(value.length) {
-                    value.push(json);
-                } else {
-                    r[name] = [value, json]
-                }
-            } else {
-                r[name] = json;
-            }
-        }
-    }
-    if(attributes.length()) {
-        var a = {}, c = 0;
-        for each (var attribute in attributes) {
-            var name = attribute.localName();
-            if(ignored && ignored.indexOf(name) == -1) {
-                a["_" + name] = attribute.toString();
-                c ++;
-            }
-        }
-        if(c) {
-            if(r) a._ = r;
-            return a;
-        }
-    }
-    return r;
-}
-
-function sortNumber(jsonArray, property, ascending, zeroLast) {
-    jsonArray.sort(function (a, b) {
-        var aProp = parseFloat(a[property]);
-        var bProp = parseFloat(b[property]);
-
-        if(zeroLast){
-            if(aProp == 0){
-                aProp = 500000;
-            }
-            if(bProp == 0 ){
-                bProp = 500000;
-            }
-        }
-
-        return aProp === bProp ? 0 : ( ascending ? (aProp >= bProp ? 1 : -1 ) 
: (aProp >= bProp ? -1 : 1 ));
-    });
-
-    return jsonArray;
-}
-
-
-
-
-function getServerUrl(){
-    var serverUrl = "https://localhost:9453/services";;
-    serverUrl = serverUrl + "/UserProfileMgtService";
-
-    return serverUrl;
-}
-
-consoleAppUtil = new function(){
-    var log = new Log('utility.consoleAppUtil');
-
-    this.getAvailableSingleTenantCartridges = function(){
-        return this.sendReceive("GET","/cartridge/list",{});
-    };
-
-    this.getAvailableMultiTenantCartridges = function(){
-        return this.sendReceive("GET","/cartridge/tenanted/list",{});
-    };
-
-    this.getSubscribedCartridges = function(){
-        return this.sendReceive("GET","/cartridge/list/subscribed",{});
-    }
-
-    this.getTenants = function(){
-        return this.sendReceive("GET","/tenant/list",{});
-    };
-
-    this.getServices = function(){
-        return this.sendReceive("GET","/service",{});
-    };
-
-    this.deployCartridgeDefinition = function(cartridgeDefinition){
-        return this.send("POST","/cartridge/definition",cartridgeDefinition);
-    };
-
-    this.deployServiceDefinition = function(serviceDefinition){
-        return this.send("POST","/service/definition",serviceDefinition);
-    };
-
-    this.deployLbDefinition = function(lbDefinition){
-        return this.send("POST","/cartridge/definition",lbDefinition);
-    };
-
-    this.activateTenant = function(tenantDomain){
-            return this.send("POST","/tenant/activate/" + tenantDomain,{});
-            };
-
-    this.deactivateTenant = function(tenantDomain){
-        return this.send("POST","/tenant/deactivate/" + tenantDomain,{});
-    };
-
-    this.deleteTenant = function(tenantDomain){
-        return this.send("DELETE","/tenant/" + tenantDomain,{});
-    };
-
-    this.checkAvailability = function(tenantDomain){
-        return this.send("POST","/tenant/availability/" + tenantDomain,{});
-    };
-
-    this.deployPartitionDefinition = function(partitionDefinition){
-        return 
this.send("POST","/policy/deployment/partition",partitionDefinition);
-    };
-
-    this.deployDeploymentPolicyDefinition = function(policyDefinition){
-        return this.send("POST","/policy/deployment",policyDefinition);
-    };
-
-    this.deployAutoscalePolicyDefinition = function(policyDefinition){
-        return this.send("POST","/policy/autoscale",policyDefinition);
-    };
-
-
-    this.subscribeToCartridge = function(cartridgeBeanInfo){
-        return this.sendReceive("POST","/cartridge/subscribe", 
cartridgeBeanInfo);
-    };
-
-    this.addTenant = function(tenantInfoBean){
-        return this.sendReceive("POST","/tenant",tenantInfoBean);
-    };
-
-    this.syncRepo = function(alias){
-        return this.send("POST","/cartridge/sync",alias);
-    };
-
-    this.getAutoScalePolicies = function(){
-        return this.sendReceive("GET","/policy/autoscale",{});
-    };
-
-    this.getDeploymentPolicies = function(){
-        return this.sendReceive("GET","/policy/deployment",{});
-    };
-
-    this.getApplicableDeploymentPolicies = function(cartridgeType){
-     return this.sendReceive("GET","/" + cartridgeType + 
"/policy/deployment/",{});
-   };
-
-    this.getPartitions = function(){
-        return this.sendReceive("GET","/partition",{});
-    };
-
-    this.getSingleTenantCartridgeInfo = function(cartridgeType){
-        return this.sendReceive("GET","/cartridge/available/info/" + 
cartridgeType,{});
-    };
-
-    this.getServiceInfo = function(cartridgeType){
-        return this.sendReceive("GET","/service/" + cartridgeType,{});
-    };
-
-    this.getPolicyAutoScale = function(){
-        return this.sendReceive("GET","/policy/autoscale",{});
-    };
-
-    this.getPolicyDeployment = function(){
-        return this.sendReceive("GET","/policy/deployment",{});
-    };
-    this.unsubscribeCartridge = function(alias){
-        return this.send("POST","/cartridge/unsubscribe",alias);
-    };
-    this.getCartridges = function(){
-        return this.sendReceive("GET","/cartridge/available/list",{});
-    };
-
-    this.getLbCartridges = function(){
-        return this.sendReceive("GET","/cartridge/lb",{});
-    };
-
-    this.getClusterInfo = function(clusterId){
-        return this.sendReceive("GET","/cluster/clusterId/" + clusterId,{});
-    };
-
-    this.getLBClusterInfo = function(){
-        return this.sendReceive("GET","/cluster/lb",{});
-    };
-
-    this.getClusterInfoWithAlias = function(cartridgeType, alias){
-        return this.sendReceive("GET","/cluster/" + cartridgeType + "/" + 
alias,{});
-    };
-    this.getCartridgeInfo = function(alias){
-        return this.sendReceive("GET","/cartridge/info/"+alias,{});
-    };
-    this.getCartridgeServiceGroup = function(serviceGroup){
-        return 
this.sendReceive("GET","/cartridge/list/subscribed/group/"+serviceGroup,{});
-    };
-    this.validateCaptcha = function(captchaText){
-        return this.sendReceive("POST","/captcha",captchaText);
-    };
-    this.getCaptcha = function(){
-        return this.sendReceiveImage("Get","/simpleImg",{});
-    };
-    this.undeployCartridge = function(cartridgeType){
-        return 
this.sendReceive("DELETE","/cartridge/definition/"+cartridgeType,{});
-    };
-    this.getConfigStatus = function(){
-        var configStatus = {};
-        var error;
-        var par_res = this.sendReceive("GET","/partition",{});
-        var get_status = session.get("get-status");
-        if(par_res.Error != undefined){
-            error = par_res.Error;
-            configStatus.first_use = true;
-        }else{
-            if(get_status == "succeeded") {
-                if(par_res.partition.length == 0){
-                    configStatus.first_use = true;
-                }else{
-                    var car_res = 
this.sendReceive("GET","/cartridge/available/list",{});
-                    if(car_res.Error != undefined){
-                        error=car_res.Error;
-                        configStatus.first_use = false;
-                        configStatus.not_complete = true;
-                    }else{
-                        get_status = session.get("get-status");
-                        if(get_status == "succeeded") {
-                            if(car_res.cartridge.length == 0){
-                                configStatus.first_use = false;
-                                configStatus.not_complete = true;
-                            }else{
-
-                                configStatus.not_complete = false;
-                                configStatus.first_use = false;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-
-        return configStatus;
-    };
-
-    this.getRequestHeaders = function(ssoEnabled){
-        var requestHeaders;
-        if(ssoEnabled){
-            var accessToken = this.getAccessTokenFromSession();
-            requestHeaders = {
-                "Authorization": "Bearer "+accessToken,
-                "Content-Type": "application/json"
-            };
-        }else{
-            requestHeaders = {
-                "Content-Type": "application/json",
-                "Cookie": "JSESSIONID="+session.get("JSESSIONID")
-            };
-        }
-        return requestHeaders;
-    };
-
-    // refactor sendRecive and send method. duplicate code...
-    this.sendReceive = function(httpMethod,urlPostFix,data){
-        var config = require('/config/console.js').config();
-        var backendServerURL = config.backendServerConfiguration.url;
-        // getting the access token from the session.
-        var endpoint = backendServerURL + urlPostFix;
-        var headers = this.getRequestHeaders(config.ssoConfiguration.enabled);
-        var response;
-        switch (httpMethod){
-            case  "GET":
-                response = get(endpoint,{},headers);
-                break;
-            case   "POST":
-                response = post(endpoint,stringify(data),headers);
-                break;
-            case    "PUT":
-                response = put(endpoint,stringify(data),headers);
-                break;
-            case    "DELETE":
-                response = del(endpoint,stringify(data),headers);
-                break;
-            default :
-                log.error("Error in the programme flow.");
-        }
-        
-        if (response.xhr.status >= 200 && response.xhr.status < 300) { //if 
success
-           session.put("get-status", "succeeded");
-        } else if (response.xhr.status >= 300 && response.xhr.status < 400) { 
//if redirects
-           if(response.data != null && response.data != undefined) {
-               session.put("get-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else if (response.xhr.status >= 400 && response.xhr.status < 500) { 
//if client error
-           if(response.data != null && response.data != undefined) {
-               session.put("get-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else if (response.xhr.status >= 500 && response.xhr.status < 600) { 
//if server error
-           if(response.data != null && response.data != undefined) {
-               session.put("get-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else {
-           session.put("get-status", "Unknown response!");
-        }
-
-        log.debug("sent is: " + stringify(response));
-
-        if (response.data != null && response.data != undefined) {
-            return parse(response.data);
-        } else {
-            return response.data;
-        }
-    };
-
-    // refactor sendRecive and send method. duplicate code...
-    this.sendReceiveImage = function(httpMethod,urlPostFix,data){
-        var config = require('/config/console.js').config();
-        var backendServerURL = config.backendServerConfiguration.url;
-        // getting the access token from the session.
-        var endpoint = backendServerURL + urlPostFix;
-        var headers = this.getRequestHeaders(config.ssoConfiguration.enabled);
-        var type = "   image/png"; // response format
-        var response;
-        switch (httpMethod){
-            case  "GET":
-                response = get(endpoint,{},headers);
-                break;
-            case   "POST":
-                response = post(endpoint,stringify(data),headers,type);
-                break;
-            case    "PUT":
-                response = put(endpoint,stringify(data),headers,type);
-                break;
-            case    "DELETE":
-                response = del(endpoint,stringify(data),headers,type);
-                break;
-            default :
-                log.error("Error in the programme flow.");
-        }
-
-        return response;
-    };
-
-    this.send = function(httpMethod,urlPostFix,data){
-        var config = require('/config/console.js').config();
-        var backendServerURL = config.backendServerConfiguration.url;
-        // getting the access token from the session.
-        var endpoint = backendServerURL + urlPostFix;
-        var headers = this.getRequestHeaders(config.ssoConfiguration.enabled);
-        var response;
-        switch (httpMethod){
-            case  "GET":
-                response = get(endpoint,{},headers);
-                break;
-            case   "POST":
-                response = post(endpoint,data,headers);
-                break;
-            case    "PUT":
-                response = put(endpoint,data,headers);
-                break;
-            case    "DELETE":
-                response = del(endpoint,data,headers);
-                break;
-            default :
-                log.error("Error in the programme flow.");
-        }
-
-        if (response.xhr.status >= 200 && response.xhr.status < 300) { //if 
success
-           session.put("deploy-status", "succeeded");
-        } else if (response.xhr.status >= 300 && response.xhr.status < 400) { 
//if redirects   
-           if(response.data != null && response.data != undefined) {
-               session.put("deploy-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else if (response.xhr.status >= 400 && response.xhr.status < 500) { 
//if client error
-           if(response.data != null && response.data != undefined) {
-               session.put("deploy-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else if (response.xhr.status >= 500 && response.xhr.status < 600) { 
//if server error
-           if(response.data != null && response.data != undefined) {         
-               session.put("deploy-status", 
parse(response.data).Error.errorMessage);
-           }
-        } else {
-           session.put("deploy-status", "Unknown response!");
-        }
-        
-        log.debug("sent is: " + stringify(response));
-
-        if (response.data != null && response.data != undefined) {
-            return parse(response.data);
-        } else {
-            return response.data;
-        }
-    };
-
-
-
-    this.getOauthAccessToken = function(encodedSAMLToken,basicAuthToken){
-        var config = require('/config/console.js').config();
-        var endpoint = config.oauthConfiguration.tokenEndpoint;
-        var headers = {
-            "Authorization": "Basic "+basicAuthToken,
-            "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
-        };
-        var data = {
-            grant_type:"urn:ietf:params:oauth:grant-type:saml2-bearer",
-            assertion:encodedSAMLToken
-        };
-        var response = post(endpoint,data,headers,"json");
-        log.debug(response);
-        return response;
-    };
-
-    this.getSessionCookie = function(userName, password){
-        var config = require('/config/console.js').config();
-        var backendServerURL = config.backendServerConfiguration.url;
-        var endpoint = backendServerURL + "/cookie";
-        var sso = require("sso"); //TODO: get rid of this...
-        var basicAuthToken = sso.client.b64encode(userName + ":" + password);
-        var headers = {
-            "Authorization": "Basic "+basicAuthToken,
-            "Content-Type": "application/json"
-        };
-        var response = get(endpoint,{},headers,"json");
-        log.debug(stringify(response));
-        return response;
-    };
-
-    this.getAccessTokenFromSession = function(){
-        return session.get("access_token");
-    };
-
-
-
-};
-
-
-
-%>

Reply via email to