airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [54/57] airavata-php-gateway git commit: AIRAVATA-1695 Queues are now selected dynamically
Date Fri, 01 May 2015 21:33:41 GMT
AIRAVATA-1695 Queues are now selected dynamically


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/a88b5d69
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/a88b5d69
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/a88b5d69

Branch: refs/heads/master
Commit: a88b5d69ee31460be4607fd38ee285d44a482acc
Parents: 01413d6
Author: nipunhere <nipunhere@gmail.com>
Authored: Fri May 1 17:14:48 2015 -0400
Committer: nipunhere <nipunhere@gmail.com>
Committed: Fri May 1 17:14:48 2015 -0400

----------------------------------------------------------------------
 app/controllers/ComputeResource.php             |  238 --
 app/controllers/ExperimentController.php        |   43 +-
 app/controllers/ResourceController.php          |  238 ++
 app/libraries/Utilities.php                     | 2098 +++++++++++++++++
 app/libraries/utilities.php                     | 2111 ------------------
 app/routes.php                                  |   22 +-
 app/views/experiment/create-complete.blade.php  |   17 +-
 app/views/layout/basic.blade.php                |   14 +
 app/views/partials/experiment-inputs.blade.php  |   52 +-
 .../partials/experiment-queue-block.blade.php   |  107 +
 10 files changed, 2538 insertions(+), 2402 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a88b5d69/app/controllers/ComputeResource.php
----------------------------------------------------------------------
diff --git a/app/controllers/ComputeResource.php b/app/controllers/ComputeResource.php
deleted file mode 100755
index 6644c73..0000000
--- a/app/controllers/ComputeResource.php
+++ /dev/null
@@ -1,238 +0,0 @@
-<?php
-
-class ComputeResource extends BaseController{
-	
-	/**
-	*    Instantiate a new Compute Resource Controller Instance
-	**/
-
-	public function __construct()
-	{
-		$this->beforeFilter('verifyadmin');
-		Session::put("nav-active", "compute-resource");
-
-	}
-
-	public function createView(){
-			return View::make("resource/create");
-	}
-
-	public function createSubmit(){
-
-		$hostAliases = Input::get("hostaliases");
-		$ips = Input::get("ips");
-		$computeDescription = array( 
-									"hostName"=> trim( Input::get("hostname") ),
-									"hostAliases"=> array_unique( array_filter( $hostAliases) ),
-									"ipAddresses"=> array_unique( array_filter( $ips) ),
-									"resourceDescription"=>Input::get("description") 
-									);
-		$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription);
-		
-		return Redirect::to( "cr/edit?crId=" . $computeResource->computeResourceId);
-	}
-
-	public function editView(){
-		
-		$data = CRUtilities::getEditCRData();
-		$computeResourceId = "";
-		if( Input::has("crId"))
-			$computeResourceId = Input::get("crId");
-		else if( Session::has("computeResource"))
-		{
-			$computeResource = Session::get("computeResource");
-			$computeResourceId = $computeResource->computeResourceId;
-		}
-
-		if( $computeResourceId != "")
-		{
-			$computeResource = Utilities::get_compute_resource(  $computeResourceId);
-			$jobSubmissionInterfaces = array();
-			$dataMovementInterfaces = array();
-			$addedJSP = array();
-			$addedDMI = array();
-			//var_dump( $computeResource->jobSubmissionInterfaces); exit;
-			if( count( $computeResource->jobSubmissionInterfaces) )
-			{
-				foreach( $computeResource->jobSubmissionInterfaces as $JSI )
-				{
-					$jobSubmissionInterfaces[] = CRUtilities::getJobSubmissionDetails( $JSI->jobSubmissionInterfaceId,
$JSI->jobSubmissionProtocol);
-					$addedJSP[] = $JSI->jobSubmissionProtocol;
-				}
-			}
-			//var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId,
1) ); exit;
-			if( count( $computeResource->dataMovementInterfaces) )
-			{
-				foreach( $computeResource->dataMovementInterfaces as $DMI )
-				{
-					$dataMovementInterfaces[] = CRUtilities::getDataMovementDetails( $DMI->dataMovementInterfaceId,
$DMI->dataMovementProtocol);
-					$addedDMI[] = $DMI->dataMovementProtocol;
-				}
-			}
-
-			$data["computeResource"] = $computeResource;
-			$data["jobSubmissionInterfaces"] = $jobSubmissionInterfaces;
-			$data["dataMovementInterfaces"] = $dataMovementInterfaces;
-			$data["addedJSP"] = $addedJSP;
-			$data["addedDMI"] = $addedDMI;
-			//var_dump($data["jobSubmissionInterfaces"]); exit;
-			return View::make("resource/edit", $data);
-		}
-		else
-			return View::make("resource/browse")->with("login-alert", "Unable to retrieve this
Compute Resource. Please report this error to devs.");
-
-	}
-		
-	public function editSubmit(){
-
-		$tabName = "";
-		if( Input::get("cr-edit") == "resDesc") /* Modify compute Resource description */
-		{
-			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
-			$computeDescription->hostName = trim( Input::get("hostname") );
-			$computeDescription->hostAliases = array_unique( array_filter( Input::get("hostaliases")
) );
-			$computeDescription->ipAddresses = array_unique( array_filter( Input::get("ips") )
);
-			$computeDescription->resourceDescription = Input::get("description");
-			$computeDescription->maxMemoryPerNode = Input::get("maxMemoryPerNode");
-			//var_dump( $computeDescription); exit;
-
-			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
-
-			$tabName =  "#tab-desc";
-		}
-		if( Input::get("cr-edit") == "queue") /* Add / Modify a Queue */
-		{
-			$queue = array( "queueName"			=>Input::get("qname"),
-							"queueDescription"	=>Input::get("qdesc"),
-							"maxRunTime"		=>Input::get( "qmaxruntime"),
-							"maxNodes"			=>Input::get("qmaxnodes"),
-							"maxProcessors"		=>Input::get("qmaxprocessors"),
-							"maxJobsInQueue"	=>Input::get("qmaxjobsinqueue"),
-							"maxMemory"			=>Input::get("qmaxmemoryinqueue")
-						);
-
-			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
-			$computeDescription->batchQueues[] = CRUtilities::createQueueObject( $queue);
-			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
-			//var_dump( $computeResource); exit;
-			$tabName = "#tab-queues";
-		}
-		else if( Input::get("cr-edit") == "delete-queue" )
-		{
-			CRUtilities::deleteQueue( Input::get("crId"), Input::get("queueName") );
-			$tabName = "#tab-queues";
-		} 
-		else if( Input::get("cr-edit") == "fileSystems")
-		{
-			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
-			$computeDescription->fileSystems = array_filter( Input::get("fileSystems"), "trim");
-			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
-
-			$tabName = "#tab-filesystem";
-		}
-		else if( Input::get("cr-edit") == "jsp" ||  Input::get("cr-edit") == "edit-jsp" ) /* Add
/ Modify a Job Submission Interface */
-		{		
-			$update = false;	
-			if( Input::get("cr-edit") == "edit-jsp")
-				$update = true;
-
-			$jobSubmissionInterface = CRUtilities::create_or_update_JSIObject( Input::all(), $update
);
-
-			$tabName = "#tab-jobSubmission";
-		}
-		else if( Input::get("cr-edit") == "jsi-priority") 
-		{
-			$inputs = Input::all();
-			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
-			foreach( $computeDescription->jobSubmissionInterfaces as $index => $jsi)
-			{
-				foreach( $inputs["jsi-id"] as $idIndex => $jsiId)
-				{
-					if( $jsiId == $jsi->jobSubmissionInterfaceId )
-					{
-						$computeDescription->jobSubmissionInterfaces[$index]->priorityOrder = $inputs["jsi-priority"][$idIndex];
-						break;
-					}
-				}
-			}
-			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
-
-			return 1; //currently done by ajax.
-		}
-		else if( Input::get("cr-edit") == "dmp" ||  Input::get("cr-edit") == "edit-dmi" ) /* Add
/ Modify a Data Movement Interface */
-		{
-			$update = false;	
-			if( Input::get("cr-edit") == "edit-dmi")
-				$update = true;
-			$dataMovementInterface = CRUtilities::create_or_update_DMIObject( Input::all(), $update
);
-
-			$tabName = "#tab-dataMovement";
-		}
-		else if( Input::get("cr-edit") == "dmi-priority") 
-		{
-			$inputs = Input::all();
-			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
-			foreach( $computeDescription->dataMovementInterfaces as $index => $dmi)
-			{
-				foreach( $inputs["dmi-id"] as $idIndex => $dmiId)
-				{
-					if( $dmiId == $dmi->dataMovementInterfaceId )
-					{
-						$computeDescription->dataMovementInterfaces[$index]->priorityOrder = $inputs["dmi-priority"][$idIndex];
-						break;
-					}
-				}
-			}
-			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
-
-			return 1; //currently done by ajax.
-		}
-
-		return Redirect::to("cr/edit?crId=" . Input::get("crId") . $tabName );
-	}
-
-	public function deleteActions(){
-
-		$result = CRUtilities::deleteActions( Input::all() );
-		if( Input::has("jsiId"))
-		{
-			return Redirect::to("cr/edit?crId=" . Input::get("crId"). "#tab-jobSubmission")
-							->with("message", "Job Submission Interface was deleted successfully");
-		}
-		if( Input::has("dmiId"))
-		{
-			return Redirect::to("cr/edit?crId=" . Input::get("crId"). "#tab-dataMovement")
-							->with( "message", "Data Movement Protocol was deleted successfully");
-		}
-		elseif( Input::has("del-crId") )
-		{
-			return Redirect::to("cr/browse")->with("message", "The Compute Resource has been successfully
deleted.");
-		}
-		else
-			return $result;
-	}
-
-	public function browseView(){
-		$data = CRUtilities::getBrowseCRData();
-		$allCRs = $data["crObjects"];
-		$appDeployments = $data["appDeployments"];
-
-		$connectedDeployments = array();
-		foreach( (array)$allCRs as $crId => $crName)
-		{
-			$connectedDeployments[ $crId] = 0;
-			foreach( (array)$appDeployments as $deploymentObject)
-			{
-				if( $crId == $deploymentObject->computeHostId)
-					$connectedDeployments[$crId]++;
-			}
-		}
-		return View::make("resource/browse", array(
-												"allCRs" => $allCRs,
-												"connectedDeployments" => $connectedDeployments
-												));
-
-	}
-}
-
-?>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a88b5d69/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 69abd00..0968d81 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -26,7 +26,16 @@ class ExperimentController extends BaseController {
 		{
 			Session::put( 'exp_create_continue', true);
 			
+			$computeResources = Utilities::create_compute_resources_select($_POST['application'],
null);
+
 			$app_config = Utilities::read_config();
+
+			$queueDefaults = array( "queueName" => $app_config["queue-name"],
+						        	"nodeCount" => $app_config["node-count"],
+						        	"cpuCount" => $app_config["total-cpu-count"],
+						        	"wallTimeLimit" => $app_config["wall-time-limit"]
+							);
+
 			$experimentInputs = array( 
 								"disabled" => ' disabled',
 						        "experimentName" => $_POST['experiment-name'],
@@ -36,11 +45,10 @@ class ExperimentController extends BaseController {
 						        "allowedFileSize" => $app_config["server-allowed-file-size"],
 						        "echo" => ($_POST['application'] == 'Echo')? ' selected' : '',
 						        "wrf" => ($_POST['application'] == 'WRF')? ' selected' : '',
-						        "queueName" => $app_config["queue-name"],
-						        "nodeCount" => $app_config["node-count"],
-						        "cpuCount" => $app_config["total-cpu-count"],
-						        "wallTimeLimit" => $app_config["wall-time-limit"],
-						        "advancedOptions" => $app_config["advanced-experiment-options"]
+						        "queueDefaults" => $queueDefaults,
+						        "advancedOptions" => $app_config["advanced-experiment-options"],
+						        "computeResources" => $computeResources,
+						        "resourceHostId" => null
 					        );
 			return View::make( "experiment/create-complete", array( "expInputs" => $experimentInputs)
);
 		}
@@ -166,11 +174,17 @@ class ExperimentController extends BaseController {
 	public function editView()
 	{
 		$app_config = Utilities::read_config();
+		$queueDefaults = array( "queueName" => $app_config["queue-name"],
+						        "nodeCount" => $app_config["node-count"],
+						        "cpuCount" => $app_config["total-cpu-count"],
+						        "wallTimeLimit" => $app_config["wall-time-limit"]
+							);
+
 		$experiment = Utilities::get_experiment($_GET['expId']);
 		$project = Utilities::get_project($experiment->projectID);
 
 		$expVal = Utilities::get_experiment_values( $experiment, $project);
-
+		$computeResources = Utilities::create_compute_resources_select($experiment->applicationId,
$expVal['scheduling']->resourceHostId);
 		$experimentInputs = array(	
 								"disabled" => ' ',
 						        "experimentName" => $experiment->name,
@@ -178,10 +192,13 @@ class ExperimentController extends BaseController {
 						        "application" => $experiment->applicationId,
 						      	"allowedFileSize" => $app_config["server-allowed-file-size"],
 								'experiment' => $experiment,
+								"queueDefaults" => $queueDefaults,
 								'project' => $project,
 								'expVal' => $expVal,
 								'cloning' => true,
-						        'advancedOptions' => $app_config["advanced-experiment-options"]
+						        'advancedOptions' => $app_config["advanced-experiment-options"],
+						        'computeResources' => $computeResources,
+						        "resourceHostId" => $expVal['scheduling']->resourceHostId
 								);
 		return View::make("experiment/edit", array("expInputs" => $experimentInputs) );
 	}
@@ -227,6 +244,18 @@ class ExperimentController extends BaseController {
 												));
 	}
 
+	public function getQueueView()
+	{
+		$queues = Utilities::getQueueDatafromResourceId( Input::get("crId"));
+		$app_config = Utilities::read_config();
+		$queueDefaults = array( "queueName" => $app_config["queue-name"],
+						        "nodeCount" => $app_config["node-count"],
+						        "cpuCount" => $app_config["total-cpu-count"],
+						        "wallTimeLimit" => $app_config["wall-time-limit"]
+							);
+		return View::make("partials/experiment-queue-block", array( "queues" => $queues, "queueDefaults"
=> $queueDefaults) );
+	}
+
 }
 
 ?>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a88b5d69/app/controllers/ResourceController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ResourceController.php b/app/controllers/ResourceController.php
new file mode 100755
index 0000000..d11d918
--- /dev/null
+++ b/app/controllers/ResourceController.php
@@ -0,0 +1,238 @@
+<?php
+
+class ResourceController extends BaseController{
+	
+	/**
+	*    Instantiate a new Compute Resource Controller Instance
+	**/
+
+	public function __construct()
+	{
+		$this->beforeFilter('verifyadmin');
+		Session::put("nav-active", "compute-resource");
+
+	}
+
+	public function createView(){
+			return View::make("resource/create");
+	}
+
+	public function createSubmit(){
+
+		$hostAliases = Input::get("hostaliases");
+		$ips = Input::get("ips");
+		$computeDescription = array( 
+									"hostName"=> trim( Input::get("hostname") ),
+									"hostAliases"=> array_unique( array_filter( $hostAliases) ),
+									"ipAddresses"=> array_unique( array_filter( $ips) ),
+									"resourceDescription"=>Input::get("description") 
+									);
+		$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription);
+		
+		return Redirect::to( "cr/edit?crId=" . $computeResource->computeResourceId);
+	}
+
+	public function editView(){
+		
+		$data = CRUtilities::getEditCRData();
+		$computeResourceId = "";
+		if( Input::has("crId"))
+			$computeResourceId = Input::get("crId");
+		else if( Session::has("computeResource"))
+		{
+			$computeResource = Session::get("computeResource");
+			$computeResourceId = $computeResource->computeResourceId;
+		}
+
+		if( $computeResourceId != "")
+		{
+			$computeResource = Utilities::get_compute_resource(  $computeResourceId);
+			$jobSubmissionInterfaces = array();
+			$dataMovementInterfaces = array();
+			$addedJSP = array();
+			$addedDMI = array();
+			//var_dump( $computeResource->jobSubmissionInterfaces); exit;
+			if( count( $computeResource->jobSubmissionInterfaces) )
+			{
+				foreach( $computeResource->jobSubmissionInterfaces as $JSI )
+				{
+					$jobSubmissionInterfaces[] = CRUtilities::getJobSubmissionDetails( $JSI->jobSubmissionInterfaceId,
$JSI->jobSubmissionProtocol);
+					$addedJSP[] = $JSI->jobSubmissionProtocol;
+				}
+			}
+			//var_dump( CRUtilities::getJobSubmissionDetails( $data["computeResource"]->jobSubmissionInterfaces[0]->jobSubmissionInterfaceId,
1) ); exit;
+			if( count( $computeResource->dataMovementInterfaces) )
+			{
+				foreach( $computeResource->dataMovementInterfaces as $DMI )
+				{
+					$dataMovementInterfaces[] = CRUtilities::getDataMovementDetails( $DMI->dataMovementInterfaceId,
$DMI->dataMovementProtocol);
+					$addedDMI[] = $DMI->dataMovementProtocol;
+				}
+			}
+
+			$data["computeResource"] = $computeResource;
+			$data["jobSubmissionInterfaces"] = $jobSubmissionInterfaces;
+			$data["dataMovementInterfaces"] = $dataMovementInterfaces;
+			$data["addedJSP"] = $addedJSP;
+			$data["addedDMI"] = $addedDMI;
+			//var_dump($data["jobSubmissionInterfaces"]); exit;
+			return View::make("resource/edit", $data);
+		}
+		else
+			return View::make("resource/browse")->with("login-alert", "Unable to retrieve this
Compute Resource. Please report this error to devs.");
+
+	}
+		
+	public function editSubmit(){
+
+		$tabName = "";
+		if( Input::get("cr-edit") == "resDesc") /* Modify compute Resource description */
+		{
+			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
+			$computeDescription->hostName = trim( Input::get("hostname") );
+			$computeDescription->hostAliases = array_unique( array_filter( Input::get("hostaliases")
) );
+			$computeDescription->ipAddresses = array_unique( array_filter( Input::get("ips") )
);
+			$computeDescription->resourceDescription = Input::get("description");
+			$computeDescription->maxMemoryPerNode = Input::get("maxMemoryPerNode");
+			//var_dump( $computeDescription); exit;
+
+			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
+
+			$tabName =  "#tab-desc";
+		}
+		if( Input::get("cr-edit") == "queue") /* Add / Modify a Queue */
+		{
+			$queue = array( "queueName"			=>Input::get("qname"),
+							"queueDescription"	=>Input::get("qdesc"),
+							"maxRunTime"		=>Input::get( "qmaxruntime"),
+							"maxNodes"			=>Input::get("qmaxnodes"),
+							"maxProcessors"		=>Input::get("qmaxprocessors"),
+							"maxJobsInQueue"	=>Input::get("qmaxjobsinqueue"),
+							"maxMemory"			=>Input::get("qmaxmemoryinqueue")
+						);
+
+			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
+			$computeDescription->batchQueues[] = CRUtilities::createQueueObject( $queue);
+			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
+			//var_dump( $computeResource); exit;
+			$tabName = "#tab-queues";
+		}
+		else if( Input::get("cr-edit") == "delete-queue" )
+		{
+			CRUtilities::deleteQueue( Input::get("crId"), Input::get("queueName") );
+			$tabName = "#tab-queues";
+		} 
+		else if( Input::get("cr-edit") == "fileSystems")
+		{
+			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
+			$computeDescription->fileSystems = array_filter( Input::get("fileSystems"), "trim");
+			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
+
+			$tabName = "#tab-filesystem";
+		}
+		else if( Input::get("cr-edit") == "jsp" ||  Input::get("cr-edit") == "edit-jsp" ) /* Add
/ Modify a Job Submission Interface */
+		{		
+			$update = false;	
+			if( Input::get("cr-edit") == "edit-jsp")
+				$update = true;
+
+			$jobSubmissionInterface = CRUtilities::create_or_update_JSIObject( Input::all(), $update
);
+
+			$tabName = "#tab-jobSubmission";
+		}
+		else if( Input::get("cr-edit") == "jsi-priority") 
+		{
+			$inputs = Input::all();
+			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
+			foreach( $computeDescription->jobSubmissionInterfaces as $index => $jsi)
+			{
+				foreach( $inputs["jsi-id"] as $idIndex => $jsiId)
+				{
+					if( $jsiId == $jsi->jobSubmissionInterfaceId )
+					{
+						$computeDescription->jobSubmissionInterfaces[$index]->priorityOrder = $inputs["jsi-priority"][$idIndex];
+						break;
+					}
+				}
+			}
+			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
+
+			return 1; //currently done by ajax.
+		}
+		else if( Input::get("cr-edit") == "dmp" ||  Input::get("cr-edit") == "edit-dmi" ) /* Add
/ Modify a Data Movement Interface */
+		{
+			$update = false;	
+			if( Input::get("cr-edit") == "edit-dmi")
+				$update = true;
+			$dataMovementInterface = CRUtilities::create_or_update_DMIObject( Input::all(), $update
);
+
+			$tabName = "#tab-dataMovement";
+		}
+		else if( Input::get("cr-edit") == "dmi-priority") 
+		{
+			$inputs = Input::all();
+			$computeDescription = Utilities::get_compute_resource(  Input::get("crId"));
+			foreach( $computeDescription->dataMovementInterfaces as $index => $dmi)
+			{
+				foreach( $inputs["dmi-id"] as $idIndex => $dmiId)
+				{
+					if( $dmiId == $dmi->dataMovementInterfaceId )
+					{
+						$computeDescription->dataMovementInterfaces[$index]->priorityOrder = $inputs["dmi-priority"][$idIndex];
+						break;
+					}
+				}
+			}
+			$computeResource = CRUtilities::register_or_update_compute_resource( $computeDescription,
true);
+
+			return 1; //currently done by ajax.
+		}
+
+		return Redirect::to("cr/edit?crId=" . Input::get("crId") . $tabName );
+	}
+
+	public function deleteActions(){
+
+		$result = CRUtilities::deleteActions( Input::all() );
+		if( Input::has("jsiId"))
+		{
+			return Redirect::to("cr/edit?crId=" . Input::get("crId"). "#tab-jobSubmission")
+							->with("message", "Job Submission Interface was deleted successfully");
+		}
+		if( Input::has("dmiId"))
+		{
+			return Redirect::to("cr/edit?crId=" . Input::get("crId"). "#tab-dataMovement")
+							->with( "message", "Data Movement Protocol was deleted successfully");
+		}
+		elseif( Input::has("del-crId") )
+		{
+			return Redirect::to("cr/browse")->with("message", "The Compute Resource has been successfully
deleted.");
+		}
+		else
+			return $result;
+	}
+
+	public function browseView(){
+		$data = CRUtilities::getBrowseCRData();
+		$allCRs = $data["crObjects"];
+		$appDeployments = $data["appDeployments"];
+
+		$connectedDeployments = array();
+		foreach( (array)$allCRs as $crId => $crName)
+		{
+			$connectedDeployments[ $crId] = 0;
+			foreach( (array)$appDeployments as $deploymentObject)
+			{
+				if( $crId == $deploymentObject->computeHostId)
+					$connectedDeployments[$crId]++;
+			}
+		}
+		return View::make("resource/browse", array(
+												"allCRs" => $allCRs,
+												"connectedDeployments" => $connectedDeployments
+												));
+
+	}
+}
+
+?>
\ No newline at end of file


Mime
View raw message