templateForm_parameter = {};
function templateForm_list_category() {
$('#result').html('');
$('#content').html('');
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/templateform/list/category',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function templateForm_list() {
$('#result').html('');
$('#content').html('');
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/templateform/list',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function templateForm_init() {
$('#result').html('');
$('#content').html('');
var str = '
';
$('#content').html(str);
$('#listWithCategory').click(function() {
templateForm_listWithCategory($('#category').val());
});
$('#get').click(function() {
templateForm_get($('#id').val());
});
$('#concreteFromForm').click(function() {
templateForm_concrete($('#formId').val(), $('#category').val(), $('#name').val());
});
$('#delete').click(function() {
templateForm_delete($('#id').val());
});
}
function templateForm_listWithCategory(category) {
$('#result').html('');
$.ajax({
type : 'put',
dataType : 'json',
url : '../jaxrs/templateform/list/category',
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
data : JSON.stringify({
category : category
}),
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function templateForm_get(id) {
$('#result').html('');
$.ajax({
type : 'get',
dataType : 'json',
url : '../jaxrs/templateform/' + id,
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function templateForm_create_init() {
str = '';
$('#content').html(str);
$('#post').click(function() {
templateForm_post();
});
}
function templateForm_post() {
$.ajax({
type : 'post',
dataType : 'json',
contentType : 'application/json; charset=utf-8',
url : '../jaxrs/templateform',
data : JSON.stringify({
name : $('#name').val(),
category : $('#category').val(),
alias : $('#alias').val(),
description : $('#description').val(),
icon : $('#icon').val(),
data : $('#data').val(),
mobileData : $('#mobileData').val()
}),
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}
function templateForm_delete(id) {
$('#result').html('');
$.ajax({
type : 'delete',
dataType : 'json',
url : '../jaxrs/templateform/' + id,
contentType : 'application/json; charset=utf-8',
xhrFields : {
'withCredentials' : true
},
crossDomain : true
}).always(function(json) {
$('#result').html(JSON.stringify(json, null, 4));
});
}