var query_ext = manifold.query_store.find_query_ext(query.query_uuid);
query_ext.query_state = QUERY_STATE_INPROGRESS;
- var query_json = JSON.stringify(query);
+ /*
+ If the Query object concerns SFA AM objects, iterate on each AM platform
+ This allows a progressive loading per AM platform
+ */
+ if(query.object == 'resource' || query.object == 'lease' || query.object == 'slice'){
+ var obj = query.object;
+ $.post("/rest/platform/", function( data ) {
+ $.each(data, function(index, p) {
+ query.object = p.platform+":"+obj;
+ var query_json = JSON.stringify(query);
+
+ // Inform plugins about the progress
+ query.iter_subqueries(function (sq) {
+ var sq_query_ext = manifold.query_store.find_analyzed_query_ext(sq.query_uuid);
+ sq_query_ext.query_state = QUERY_STATE_INPROGRESS;
+ manifold.raise_record_event(sq.query_uuid, IN_PROGRESS);
+ });
- // Inform plugins about the progress
- query.iter_subqueries(function (sq) {
- var sq_query_ext = manifold.query_store.find_analyzed_query_ext(sq.query_uuid);
- sq_query_ext.query_state = QUERY_STATE_INPROGRESS;
+ $.post(manifold.proxy_url, {'json': query_json} , manifold.success_closure(query, null, callback));
- manifold.raise_record_event(sq.query_uuid, IN_PROGRESS);
- });
+ });
+ });
+ }else{
+ var query_json = JSON.stringify(query);
- $.post(manifold.proxy_url, {'json': query_json} , manifold.success_closure(query, null, callback));
+ // Inform plugins about the progress
+ query.iter_subqueries(function (sq) {
+ var sq_query_ext = manifold.query_store.find_analyzed_query_ext(sq.query_uuid);
+ sq_query_ext.query_state = QUERY_STATE_INPROGRESS;
+ manifold.raise_record_event(sq.query_uuid, IN_PROGRESS);
+ });
+
+ $.post(manifold.proxy_url, {'json': query_json} , manifold.success_closure(query, null, callback));
+
+ }
},
// XXX DEPRECATED
// myslice.user is in LocalStorage
if(typeof(slices) != "undefined"){
/*
+ This allows progressive loading per AM platform
Launch queries to get the resources and leases in Manifold Cache
+ XXX platform:object
+ TODO support cache for prefixed objects
+ XXX Disabled until it's supported on Manifold side
*/
- $.post("/rest/resource/", function( data ) {
- });
- $.post("/rest/lease/", function( data ) {
- });
+ /*
+ $.post("/rest/platform/", function( data ) {
+ $.each(data, function(index, p) {
+ $.post("/rest/"+p.platform+":resource/", function( data ) {
+ });
+ $.post("/rest/"+p.platform+":lease/", function( data ) {
+ });
+ $.each( slices, function(i, val) {
+ // Launch a Query for each slice to get it in Manifold Cache
+ $.post("/rest/"+p.platform+":slice/", { 'filters': { 'slice_hrn' : val } }, function(data) {
+ });
+ });
- $.each( slices, function(i, val) {
- /*
- Launch a Query for each slice to get resources and leases in Manifold Cache
- */
- $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) {
});
});
+ */
}
},