function connection_list_init() { $('#result').html(''); $.ajax({ type : 'get', dataType : 'json', contentType : 'application/json; charset=utf-8', url : '../jaxrs/connection/list/connectiontype', xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { var str = ''; str += '
type list
 
'; $('#content').html(str); $('#list', '#content').click(function() { connection_list($('#type', '#content').val()); }); $('#result').html(JSON.stringify(data.data, null, 4)); } else { failure(data); } }); } function connection_list(connectionType) { $('#grid').html(''); $.ajax({ type : 'get', dataType : 'json', contentType : 'application/json; charset=utf-8', url : '../jaxrs/connection/list/connectiontype/' + connectionType, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { var str = ''; str += ''; if (data.data) { $.each(data.data, function(typeIndex, item) { str += ''; str += ''; str += ''; str += ''; str += ''; }); } str += '
urlusernameoperate
' + item.url + '' + item.username + ''; str += 'edit '; str += 'delete '; str += '
'; $('#grid').html(str); $('#result').html(JSON.stringify(data.data, null, 4)); } else { failure(data); } }); } function connection_edit(connectionType, order) { $('#result').html(''); $('#content').html(''); var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
put
type' + connectionType + '
url:
username:
password:
enable:
order:
'; $('#content').html(str); $.ajax({ type : 'get', dataType : 'json', contentType : 'application/json; charset=utf-8', url : '../jaxrs/connection/connectiontype/' + connectionType + '/order/' + order, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { $('#url', '#content').val(data.data.url); $('#username', '#content').val(data.data.username); $('#password', '#content').val(data.data.password); $('#enable', '#content').val(data.data.enable + ''); $('#order', '#content').val(data.data.order); } else { failure(data); } $('#result').html(JSON.stringify(data.data, null, 4)); }); $('#put', '#content').click(function() { connection_put(connectionType, order); }); } function connection_put(connectionType, order) { $('#result').html(''); $.ajax({ type : 'put', dataType : 'json', url : '../jaxrs/connection/connectiontype/' + connectionType + '/order/' + order, contentType : 'application/json; charset=utf-8', data : JSON.stringify({ url : $('#url', '#content').val(), username : $('#username', '#content').val(), password : $('#password', '#content').val(), order : $('#order', '#content').val(), enable : $('#enable', '#content').val(), }), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { } else { failure(data); } $('#result').html(JSON.stringify(data.data, null, 4)); }); } function connection_create_init() { $('#result').html(''); var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
post
type:
url:
username:
password:
enable:
'; $('#content').html(str); $.ajax({ type : 'get', dataType : 'json', contentType : 'application/json; charset=utf-8', url : '../jaxrs/connection/list/connectiontype', xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { if (data.data) { var str = ''; $.each(data.data, function(typeIndex, type) { str += ''; }); } $('#type').html(str); $('#result').html(JSON.stringify(data.data, null, 4)); } else { failure(data); } }); $('#post', '#content').click(function() { connection_post($('#type', '#content').val()); }); } function connection_post(connectionType) { $.ajax({ type : 'post', dataType : 'json', url : '../jaxrs/connection/connectiontype/' + connectionType, contentType : 'application/json; charset=utf-8', data : JSON.stringify({ url : $('#url', '#content').val(), username : $('#username', '#content').val(), password : $('#password', '#content').val(), enable : $('#enable', '#content').val() }), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { } else { failure(data); } $('#result').html(JSON.stringify(data.data, null, 4)); }); } function connection_update() { var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
put
type:
url:
username:
password:
order:
enable:
toolLevel:
runtimeLevel:
dataCacheLevel:
metaDataLevel:
enhanceLevel:
queryLevel:
sqlLevel:
jdbcLevel:
'; $('#content').html(str); $('#put', '#content').click(function() { connection_put(); }); } function connection_delete(connectionType, order) { $.ajax({ type : 'delete', dataType : 'json', url : '../jaxrs/connection/connectiontype/' + connectionType + '/order/' + order, contentType : 'application/json; charset=utf-8', xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { } else { failure(data); } $('#result').html(JSON.stringify(data.data, null, 4)); }); } function connection_createForEach_init() { $('#result').html(''); var str = ''; str += ''; str += ''; str += ''; str += ''; str += ''; str += '
post
url:
username:
password:
enable:
'; $('#content').html(str); $('#post', '#content').click(function() { connection_postForEach(); }); } function connection_postForEach() { $.ajax({ type : 'post', dataType : 'json', url : '../jaxrs/connection/connectiontype/all/type', contentType : 'application/json; charset=utf-8', data : JSON.stringify({ url : $('#url', '#content').val(), username : $('#username', '#content').val(), password : $('#password', '#content').val(), enable : $('#enable', '#content').val() }), xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { } else { failure(data); } $('#result').html(JSON.stringify(data.data, null, 4)); }); }