Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
web.inbound.inboundcommon.js Maven / Gradle / Ivy
var intervalRequired = false;
var ENABLE = "enable";
var DISABLE = "disable";
function isNameValid(namestring) {
if (namestring != null && namestring != "") {
for (var j = 0; j < namestring.length; j++)
{
var ch = namestring.charAt(j);
var code = ch.charCodeAt(0);
if ((code > 47 && code < 59) // number
|| (code > 64 && code < 91)// capital
|| (code > 96 && code < 123)// simple
|| (code == 46) //dot
|| (code == 95) // underscore
|| (code == 2013) // en dash
|| (code == 2014) // em dash
|| (code == 45)) // minus sign - hyphen
{
}
else {
return false;
}
}
return true;
} else {
return false;
}
}
function isNumber(numberstring) {
if (numberstring != null && numberstring != "") {
for (var j = 0; j < numberstring.length; j++) {
var ch = numberstring.charAt(j);
var code = ch.charCodeAt(0);
if (code > 47 && code < 59) {
} else {
return false;
}
}
return true;
} else {
return false;
}
}
function forward(destinationJSP) {
location.href = destinationJSP;
}
function addParam(form){
form.action='newInbound1.jsp?action=addParam';
form.submit();
return false;
}
function inboundsave1(namemsg, typemsg, form , existingList){
var name;
if (!isNameValid(document.getElementById('inboundName').value)) {
CARBON.showWarningDialog(namemsg);
return false;
}
name = document.getElementById('inboundName').value;
if(existingInbounds != null ){
for(var i=0; i< existingInbounds.length;i++){
if(name == existingInbounds[i]){
CARBON.showErrorDialog("Inbound endpoint already exists please use separate name");
return false;
}
}
}
if (document.getElementById('inboundType').value == '') {
CARBON.showWarningDialog(typemsg);
return false;
}
form.submit();
return false;
}
function inboundsave2(msg1,msg2,msg3,msg4,msg5,msg6,form){
if (sequenceRequired && document.getElementById('inboundSequence').value == '') {
CARBON.showWarningDialog(msg1);
return false;
}
if (onErrorRequired && document.getElementById('inboundErrorSequence').value == '') {
CARBON.showWarningDialog(msg2);
return false;
}
if (classRequired && document.getElementById('inboundClass').value == '') {
CARBON.showWarningDialog(msg4);
return false;
}
if (intervalRequired == true && document.getElementById('interval').value == "") {
CARBON.showWarningDialog(msg3);
return false;
}
if (document.getElementById('interval') != null && isNaN(document.getElementById('interval').value)) {
CARBON.showWarningDialog(msg3);
return false;
}
var subscriptionDurable = document.getElementById('transport.jms.SubscriptionDurable');
if (subscriptionDurable != null && subscriptionDurable.options[subscriptionDurable.selectedIndex].value == "true" &&
document.getElementById('transport.jms.DurableSubscriberName').value == "") {
CARBON.showWarningDialog(msg6);
return false;
}
if(requiredParams != null){
for(var i = 0;i= 0 && str.charAt(j) <= " "; j--) ;
return str.substring(0, j + 1);
}
//This function accepts a String and trims the string in both sides of the string ignoring space characters
function trim(stringValue) {
// var trimedString = stringValue.replace( /^\s+/g, "" );
// return trimedString.replace( /\s+$/g, "" );
return ltrim(rtrim(stringValue));
}
function goBackOnePage() {
history.go(-1);
}
function goBackTwoPages() {
history.go(-2);
}
function autoredioselect() {
settrigger(document.getElementById("taskTrigger_hidden").value);
}
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow((rowCount-1));
iParamCount++;
var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "text";
element1.name="paramkey" + iParamCount;
element1.id="paramkey" + iParamCount;
cell1.appendChild(element1);
var cell2 = row.insertCell(1);
var element2 = document.createElement("input");
element2.name="paramval" + iParamCount;
element2.id="paramval" + iParamCount;
cell2.appendChild(element2);
}
function deleteRow(tableID) {
if(iParamCount > 0){
try {
if(iParamMax < 0 || iParamMax < iParamCount){
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
table.deleteRow((rowCount-2));
iParamCount--;
}
}catch(e) {
//alert(e);
}
}
}
function showAdvancedOptions(id) {
var formElem = document.getElementById(id + '_advancedForm');
if (formElem.style.display == 'none') {
formElem.style.display = '';
document.getElementById(id + '_adv').innerHTML = '' + taskjsi18n['hide.advanced.options'] + ' ';
} else {
formElem.style.display = 'none';
document.getElementById(id + '_adv').innerHTML = '' + taskjsi18n['show.advanced.options'] + ' ';
}
}
function showSpecialFields(specialParams, inboundDescriptionOfParams, topicListParams) {
var strSplitter = "~:~";
var consumerType = document.getElementById('consumer.type').value.trim();
var specialFieldsArea = '';
document.getElementById('specialFieldsForm').innerHTML = specialFieldsArea;
}
function showTopicsOrTopicFilterFields(inboundDescriptionOfParams, topicListParams) {
var strSplitter = "~:~";
var tField = document.getElementById('topicsOrTopicFilter').value.trim();
var tFieldsArea = '';
document.getElementById('tDiv').innerHTML = tFieldsArea;
}
function disableStat(inboundEndpointName) {
$.ajax({
type: 'POST',
url: 'stat-ajaxprocessor.jsp',
data: 'inboundEndpointName=' + inboundEndpointName + '&action=disableStat',
success: function (msg) {
handleCallback(inboundEndpointName, DISABLE);
},
error: function (msg) {
CARBON.showErrorDialog('Error occurred when disabling statistics for the inbound Endpoint :' + inboundEndpointName);
}
});
}
function enableStat(inboundEndpointName) {
$.ajax({
type: 'POST',
url: 'stat-ajaxprocessor.jsp',
data: 'inboundEndpointName=' + inboundEndpointName + '&action=enableStat',
success: function (msg) {
handleCallback(inboundEndpointName, ENABLE);
},
error: function (msg) {
CARBON.showErrorDialog('Error occurred when enabling statistics for the inbound Endpoint :' + inboundEndpointName);
}
});
}
function handleCallback(apiName, action) {
var element;
if (action == "enable") {
element = document.getElementById("disableStat" + apiName);
element.style.display = "";
element = document.getElementById("enableStat" + apiName);
element.style.display = "none";
} else {
element = document.getElementById("disableStat" + apiName);
element.style.display = "none";
element = document.getElementById("enableStat" + apiName);
element.style.display = "";
}
}
function disableTrace(inboundEndpointName) {
$.ajax({
type: 'POST',
url: 'trace-ajaxprocessor.jsp',
data: 'inboundEndpointName=' + inboundEndpointName + '&action=disableTrace',
success: function (msg) {
document.getElementById("disableTrace" + inboundEndpointName).style.display = "none";
document.getElementById("enableTrace" + inboundEndpointName).style.display = "";
},
error: function (msg) {
CARBON.showErrorDialog('Error occurred when disabling tracing for the inbound Endpoint :' + inboundEndpointName);
}
});
}
function enableTrace(inboundEndpointName) {
$.ajax({
type: 'POST',
url: 'trace-ajaxprocessor.jsp',
data: 'inboundEndpointName=' + inboundEndpointName + '&action=enableTrace',
success: function (msg) {
document.getElementById("disableTrace" + inboundEndpointName).style.display = "";
document.getElementById("enableTrace" + inboundEndpointName).style.display = "none";
document.getElementById("disableStat" + inboundEndpointName).style.display = "";
document.getElementById("enableStat" + inboundEndpointName).style.display = "none";
},
error: function (msg) {
CARBON.showErrorDialog('Error occurred when enabling tracing for the inbound Endpoint :' + inboundEndpointName);
}
});
}