Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 186C2DFBC for ; Fri, 2 Nov 2012 15:24:29 +0000 (UTC) Received: (qmail 90251 invoked by uid 500); 2 Nov 2012 15:24:29 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 90216 invoked by uid 500); 2 Nov 2012 15:24:29 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 90208 invoked by uid 99); 2 Nov 2012 15:24:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 15:24:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 15:24:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 060C723888CD for ; Fri, 2 Nov 2012 15:24:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1405006 - /airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html Date: Fri, 02 Nov 2012 15:24:05 -0000 To: commits@airavata.apache.org From: heshan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121102152406.060C723888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: heshan Date: Fri Nov 2 15:24:05 2012 New Revision: 1405006 URL: http://svn.apache.org/viewvc?rev=1405006&view=rev Log: Rendering the response for App descriptirons (there is a rendering issue and this needs to be fixed). Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html?rev=1405006&r1=1405005&r2=1405006&view=diff ============================================================================== --- airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html (original) +++ airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_view.html Fri Nov 2 15:24:05 2012 @@ -28,16 +28,31 @@ dataType: "json", contentType: "application/json;charset=utf-8", url: "http://localhost:7080/airavata-registry-rest-services/registry/api/applicationdescriptor/alldescriptors", - success: function(responseData, status, settings) { -// alert(data); -// var data = JSON.stringify(responseData); -// $.each(data, function(key, val) { -// var tr=$(''); -// $.each(val, function(k, v){ -// $(''+v+'').appendTo(tr); -// }); -// tr.appendTo('#display'); -// }); + success: function(data, status, settings) { + var keys=[],result=''; + $.each(data.applicationDescriptors,function(i,row){ + $.each(row,function(key,value){ + if ($.inArray(key,keys)==-1) { + if (key != "serviceDescriptor") { + keys.push(key); + } + } + }) + }); + result+=""; + $.each(keys,function(i,key){ + result+=""+key+"<\/th>"; + }); + result+="<\/tr><\/thead>"; + $.each(data.hostDescriptions,function(i,row){ + result+=""; + $.each(keys,function(i,key){ + result+=""+ (row[key]||'') + "<\/td>"; + }); + result+="<\/tr>"; + }); + result+="<\/tbody>"; + $('#display').html(result); }, error: function(ajaxrequest, ajaxOptions, thrownError){ alert(thrownError);